diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b09edd73bbcbc..63e335067199d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -422,6 +422,9 @@ x-pack/test/security_solution_cypress @elastic/security-engineering-productivity # Security Asset Management /x-pack/plugins/osquery @elastic/security-asset-management +# Cloud Posture Security +/x-pack/plugins/cloud_security_posture/ @elastic/cloud-posture-security + # Design (at the bottom for specificity of SASS files) **/*.scss @elastic/kibana-design #CC# /packages/kbn-ui-framework/ @elastic/kibana-design diff --git a/.github/workflows/add-to-apm-project.yml b/.github/workflows/add-to-apm-project.yml index dee908e9fb762..5df47b56792cd 100644 --- a/.github/workflows/add-to-apm-project.yml +++ b/.github/workflows/add-to-apm-project.yml @@ -14,7 +14,7 @@ jobs: with: headers: '{"GraphQL-Features": "projects_next_graphql"}' query: | - mutation add_to_project($projectid:String!,$contentid:String!) { + mutation add_to_project($projectid:ID!,$contentid:ID!) { addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { projectNextItem { id @@ -31,7 +31,7 @@ jobs: with: headers: '{"GraphQL-Features": "projects_next_graphql"}' query: | - mutation label_team($projectid:String!,$itemid:String!,$fieldid:String!,$value:String!) { + mutation label_team($projectid:ID!,$itemid:ID!,$fieldid:ID!,$value:String!) { updateProjectNextItemField(input: { projectId:$projectid itemId:$itemid fieldId:$fieldid value:$value }) { projectNextItem { id diff --git a/.github/workflows/add-to-fleet-project.yml b/.github/workflows/add-to-fleet-project.yml index 59b3513c85284..e828a3a5b637e 100644 --- a/.github/workflows/add-to-fleet-project.yml +++ b/.github/workflows/add-to-fleet-project.yml @@ -20,7 +20,7 @@ jobs: with: headers: '{"GraphQL-Features": "projects_next_graphql"}' query: | - mutation add_to_project($projectid:String!,$contentid:String!) { + mutation add_to_project($projectid: ID!, $contentid: ID!) { addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { projectNextItem { id diff --git a/.github/workflows/backport-next.yml b/.github/workflows/backport-next.yml new file mode 100644 index 0000000000000..6779bb4247241 --- /dev/null +++ b/.github/workflows/backport-next.yml @@ -0,0 +1,27 @@ +on: + pull_request_target: + branches: + - main + types: + - labeled + - closed + +jobs: + backport: + name: Backport PR + runs-on: ubuntu-latest + if: | + github.event.pull_request.merged == true + && contains(github.event.pull_request.labels.*.name, 'auto-backport-next') + && ( + (github.event.action == 'labeled' && github.event.label.name == 'auto-backport-next') + || (github.event.action == 'closed') + ) + steps: + - name: Backport Action + uses: sqren/backport-github-action@v7.3.1 + with: + github_token: ${{secrets.KIBANAMACHINE_TOKEN}} + + - name: Backport log + run: cat /home/runner/.backport/backport.log diff --git a/.github/workflows/label-qa-fixed-in.yml b/.github/workflows/label-qa-fixed-in.yml new file mode 100644 index 0000000000000..836aa308e92c7 --- /dev/null +++ b/.github/workflows/label-qa-fixed-in.yml @@ -0,0 +1,87 @@ +name: Add QA labels to Fleet issues +on: + # pull_request_target allows running actions on PRs from forks with a read/write GITHUB_TOKEN, but it will not allow + # running workflows defined in the PRs itself, only workflows already merged into the target branch. This avoids + # potential vulnerabilities that could allow someone to open a PR and retrieve secrets. + # It's important that this workflow never runs any checkout actions which could be used to circumvent this protection. + # See these links for more information: + # - https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/ + # - https://nathandavison.com/blog/github-actions-and-the-threat-of-malicious-pull-requests + pull_request_target: + types: + - closed + +jobs: + fetch_issues_to_label: + runs-on: ubuntu-latest + # Only run on PRs that were merged for the Fleet team + if: | + github.event.pull_request.merged_at && + contains(github.event.pull_request.labels.*.name, 'Team:Fleet') + outputs: + matrix: ${{ steps.issues_to_label.outputs.value }} + label_ids: ${{ steps.label_ids.outputs.value }} + steps: + - uses: octokit/graphql-action@v2.x + id: closing_issues + with: + query: | + query closingIssueNumbersQuery($prnumber: Int!) { + repository(owner: "elastic", name: "kibana") { + pullRequest(number: $prnumber) { + closingIssuesReferences(first: 10) { + nodes { + id + labels(first: 20) { + nodes { + id + name + } + } + } + } + } + } + } + prnumber: ${{ github.event.number }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: sergeysova/jq-action@v2 + id: issues_to_label + with: + # Map to the issues' node id + cmd: echo $CLOSING_ISSUES | jq -c '.repository.pullRequest.closingIssuesReferences.nodes | map(.id)' + multiline: true + env: + CLOSING_ISSUES: ${{ steps.closing_issues.outputs.data }} + - uses: sergeysova/jq-action@v2 + id: label_ids + with: + # Get list of version labels on pull request and map to label's node id, append 'QA:Ready For Testing' id ("MDU6TGFiZWwyNTQ1NjcwOTI4") + cmd: echo $PR_LABELS | jq -c 'map(select(.name | test("v[0-9]+\\.[0-9]+\\.[0-9]+")) | .node_id) + ["MDU6TGFiZWwyNTQ1NjcwOTI4"]' + multiline: true + env: + PR_LABELS: ${{ toJSON(github.event.pull_request.labels) }} + + label_issues: + needs: fetch_issues_to_label + runs-on: ubuntu-latest + # For each issue closed by the PR run this job + strategy: + matrix: + issueNodeId: ${{ fromJSON(needs.fetch_issues_to_label.outputs.matrix) }} + name: Label issue ${{ matrix.issueNodeId }} + steps: + - uses: octokit/graphql-action@v2.x + id: add_labels_to_closed_issue + with: + query: | + mutation add_label($issueid: ID!, $labelids:[ID!]!) { + addLabelsToLabelable(input: {labelableId: $issueid, labelIds: $labelids}) { + clientMutationId + } + } + issueid: ${{ matrix.issueNodeId }} + labelids: ${{ fromJSON(needs.fetch_issues_to_label.outputs.label_ids) }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/project-assigner.yml b/.github/workflows/project-assigner.yml index fd745f8a8c1fe..65808dffd801f 100644 --- a/.github/workflows/project-assigner.yml +++ b/.github/workflows/project-assigner.yml @@ -20,7 +20,6 @@ jobs: {"label": "Feature:Drilldowns", "projectNumber": 68, "columnName": "Inbox"}, {"label": "Feature:Input Controls", "projectNumber": 72, "columnName": "Inbox"}, {"label": "Team:Security", "projectNumber": 320, "columnName": "Awaiting triage", "projectScope": "org"}, - {"label": "Team:Operations", "projectNumber": 314, "columnName": "Triage", "projectScope": "org"}, - {"label": "Team:Fleet", "projectNumber": 490, "columnName": "Inbox", "projectScope": "org"} + {"label": "Team:Operations", "projectNumber": 314, "columnName": "Triage", "projectScope": "org"} ] ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }} diff --git a/api_docs/actions.devdocs.json b/api_docs/actions.devdocs.json index 29a799f020c22..703029e49ca4b 100644 --- a/api_docs/actions.devdocs.json +++ b/api_docs/actions.devdocs.json @@ -695,7 +695,7 @@ "label": "ActionParamsType", "description": [], "signature": [ - "{ readonly source?: string | undefined; readonly group?: string | undefined; readonly summary?: string | undefined; readonly timestamp?: string | undefined; readonly eventAction?: \"resolve\" | \"trigger\" | \"acknowledge\" | undefined; readonly dedupKey?: string | undefined; readonly severity?: \"error\" | \"info\" | \"warning\" | \"critical\" | undefined; readonly component?: string | undefined; readonly class?: string | undefined; }" + "{ readonly source?: string | undefined; readonly summary?: string | undefined; readonly group?: string | undefined; readonly timestamp?: string | undefined; readonly eventAction?: \"resolve\" | \"trigger\" | \"acknowledge\" | undefined; readonly dedupKey?: string | undefined; readonly severity?: \"error\" | \"info\" | \"warning\" | \"critical\" | undefined; readonly component?: string | undefined; readonly class?: string | undefined; }" ], "path": "x-pack/plugins/actions/server/builtin_action_types/pagerduty.ts", "deprecated": false, diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index f60c99d62ced6..8c424176af296 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github summary: API docs for the actions plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,7 +12,7 @@ import actionsObj from './actions.devdocs.json'; -Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) for questions regarding this plugin. +Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 2b6d59e46e5b0..8ef8640df80ad 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github summary: API docs for the advancedSettings plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index 389461e4a833d..6c5b1a4dc02f8 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -1311,12 +1311,367 @@ "section": "def-server.AlertServices", "text": "AlertServices" }, - " extends ", - "Services" + "" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, "children": [ + { + "parentPluginId": "alerting", + "id": "def-server.AlertServices.savedObjectsClient", + "type": "Object", + "tags": [], + "label": "savedObjectsClient", + "description": [], + "signature": [ + "{ create: (type: string, attributes: T, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + " | undefined) => Promise<", + "SavedObject", + ">; bulkCreate: (objects: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkCreateObject", + "text": "SavedObjectsBulkCreateObject" + }, + "[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCreateOptions", + "text": "SavedObjectsCreateOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, + ">; checkConflicts: (objects?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCheckConflictsObject", + "text": "SavedObjectsCheckConflictsObject" + }, + "[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCheckConflictsResponse", + "text": "SavedObjectsCheckConflictsResponse" + }, + ">; delete: (type: string, id: string, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsDeleteOptions", + "text": "SavedObjectsDeleteOptions" + }, + ") => Promise<{}>; find: (options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsFindOptions", + "text": "SavedObjectsFindOptions" + }, + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsFindResponse", + "text": "SavedObjectsFindResponse" + }, + ">; bulkGet: (objects?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkGetObject", + "text": "SavedObjectsBulkGetObject" + }, + "[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkResponse", + "text": "SavedObjectsBulkResponse" + }, + ">; bulkResolve: (objects: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkResolveObject", + "text": "SavedObjectsBulkResolveObject" + }, + "[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkResolveResponse", + "text": "SavedObjectsBulkResolveResponse" + }, + ">; get: (type: string, id: string, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + "SavedObject", + ">; resolve: (type: string, id: string, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsResolveResponse", + "text": "SavedObjectsResolveResponse" + }, + ">; update: (type: string, id: string, attributes: Partial, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsUpdateOptions", + "text": "SavedObjectsUpdateOptions" + }, + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsUpdateResponse", + "text": "SavedObjectsUpdateResponse" + }, + ">; collectMultiNamespaceReferences: (objects: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesObject", + "text": "SavedObjectsCollectMultiNamespaceReferencesObject" + }, + "[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesOptions", + "text": "SavedObjectsCollectMultiNamespaceReferencesOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCollectMultiNamespaceReferencesResponse", + "text": "SavedObjectsCollectMultiNamespaceReferencesResponse" + }, + ">; updateObjectsSpaces: (objects: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesObject", + "text": "SavedObjectsUpdateObjectsSpacesObject" + }, + "[], spacesToAdd: string[], spacesToRemove: string[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesOptions", + "text": "SavedObjectsUpdateObjectsSpacesOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsUpdateObjectsSpacesResponse", + "text": "SavedObjectsUpdateObjectsSpacesResponse" + }, + ">; bulkUpdate: (objects: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkUpdateObject", + "text": "SavedObjectsBulkUpdateObject" + }, + "[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkUpdateOptions", + "text": "SavedObjectsBulkUpdateOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBulkUpdateResponse", + "text": "SavedObjectsBulkUpdateResponse" + }, + ">; removeReferencesTo: (type: string, id: string, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToOptions", + "text": "SavedObjectsRemoveReferencesToOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsRemoveReferencesToResponse", + "text": "SavedObjectsRemoveReferencesToResponse" + }, + ">; openPointInTimeForType: (type: string | string[], options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeOptions", + "text": "SavedObjectsOpenPointInTimeOptions" + }, + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, + ">; closePointInTime: (id: string, options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsBaseOptions", + "text": "SavedObjectsBaseOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, + ">; createPointInTimeFinder: (findOptions: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderOptions", + "text": "SavedObjectsCreatePointInTimeFinderOptions" + }, + ", dependencies?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsCreatePointInTimeFinderDependencies", + "text": "SavedObjectsCreatePointInTimeFinderDependencies" + }, + " | undefined) => ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.ISavedObjectsPointInTimeFinder", + "text": "ISavedObjectsPointInTimeFinder" + }, + "; errors: typeof ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsErrorHelpers", + "text": "SavedObjectsErrorHelpers" + }, + "; }" + ], + "path": "x-pack/plugins/alerting/server/types.ts", + "deprecated": false + }, + { + "parentPluginId": "alerting", + "id": "def-server.AlertServices.scopedClusterClient", + "type": "Object", + "tags": [], + "label": "scopedClusterClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } + ], + "path": "x-pack/plugins/alerting/server/types.ts", + "deprecated": false + }, { "parentPluginId": "alerting", "id": "def-server.AlertServices.alertFactory", @@ -1333,6 +1688,8 @@ "section": "def-server.PublicAlert", "text": "PublicAlert" }, + "; done: () => ", + "AlertFactoryDoneUtils", "; }" ], "path": "x-pack/plugins/alerting/server/types.ts", @@ -2226,6 +2583,19 @@ ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false + }, + { + "parentPluginId": "alerting", + "id": "def-server.RuleType.doesSetRecoveryContext", + "type": "CompoundType", + "tags": [], + "label": "doesSetRecoveryContext", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/alerting/server/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -2436,7 +2806,9 @@ "Alert", "; scheduleActionsWithSubGroup: (actionGroup: ActionGroupIds, subgroup: string, context?: Context) => ", "Alert", - "; }" + "; setContext: (context: Context) => ", + "Alert", + "; getContext: () => Context; hasContext: () => boolean; }" ], "path": "x-pack/plugins/alerting/server/alert/alert.ts", "deprecated": false, @@ -3431,6 +3803,19 @@ "path": "x-pack/plugins/alerting/common/alert.ts", "deprecated": false }, + { + "parentPluginId": "alerting", + "id": "def-common.AlertExecutionStatus.metrics", + "type": "Object", + "tags": [], + "label": "metrics", + "description": [], + "signature": [ + "{ numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; } | undefined" + ], + "path": "x-pack/plugins/alerting/common/alert.ts", + "deprecated": false + }, { "parentPluginId": "alerting", "id": "def-common.AlertExecutionStatus.lastExecutionDate", @@ -4001,6 +4386,72 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleExecutionRunResult", + "type": "Interface", + "tags": [], + "label": "RuleExecutionRunResult", + "description": [], + "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "alerting", + "id": "def-common.RuleExecutionRunResult.state", + "type": "CompoundType", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { metrics: { numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }; triggeredActions: { group?: string | undefined; id?: string | undefined; actionTypeId?: string | undefined; params?: { [x: string]: unknown; } | undefined; }[]; }" + ], + "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", + "deprecated": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleExecutionRunResult.monitoring", + "type": "Object", + "tags": [], + "label": "monitoring", + "description": [], + "signature": [ + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.RuleMonitoring", + "text": "RuleMonitoring" + }, + " | undefined" + ], + "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", + "deprecated": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleExecutionRunResult.schedule", + "type": "Object", + "tags": [], + "label": "schedule", + "description": [], + "signature": [ + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.IntervalSchedule", + "text": "IntervalSchedule" + }, + " | undefined" + ], + "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "alerting", "id": "def-common.RuleMonitoring", @@ -4281,6 +4732,19 @@ "path": "x-pack/plugins/alerting/common/rule_type.ts", "deprecated": false }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleType.doesSetRecoveryContext", + "type": "CompoundType", + "tags": [], + "label": "doesSetRecoveryContext", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/alerting/common/rule_type.ts", + "deprecated": false + }, { "parentPluginId": "alerting", "id": "def-common.RuleType.enabledInLicense", @@ -4691,27 +5155,27 @@ }, { "parentPluginId": "alerting", - "id": "def-common.RuleStatusValues", + "id": "def-common.RuleExecutionMetrics", "type": "Type", "tags": [], - "label": "RuleStatusValues", + "label": "RuleExecutionMetrics", "description": [], "signature": [ - "\"OK\" | \"Active\" | \"Error\"" + "{ numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }" ], - "path": "x-pack/plugins/alerting/common/alert_summary.ts", + "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "alerting", - "id": "def-common.RuleTaskParams", + "id": "def-common.RuleExecutionState", "type": "Type", "tags": [], - "label": "RuleTaskParams", + "label": "RuleExecutionState", "description": [], "signature": [ - "{ alertId: string; } & { spaceId?: string | undefined; }" + "{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { metrics: { numSearches?: number | undefined; totalSearchDurationMs?: number | undefined; esSearchDurationMs?: number | undefined; }; triggeredActions: { group?: string | undefined; id?: string | undefined; actionTypeId?: string | undefined; params?: { [x: string]: unknown; } | undefined; }[]; }" ], "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", "deprecated": false, @@ -4719,13 +5183,27 @@ }, { "parentPluginId": "alerting", - "id": "def-common.RuleTaskState", + "id": "def-common.RuleStatusValues", "type": "Type", "tags": [], - "label": "RuleTaskState", + "label": "RuleStatusValues", "description": [], "signature": [ - "{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; }" + "\"OK\" | \"Active\" | \"Error\"" + ], + "path": "x-pack/plugins/alerting/common/alert_summary.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.RuleTaskParams", + "type": "Type", + "tags": [], + "label": "RuleTaskParams", + "description": [], + "signature": [ + "{ alertId: string; } & { spaceId?: string | undefined; }" ], "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", "deprecated": false, @@ -4733,13 +5211,13 @@ }, { "parentPluginId": "alerting", - "id": "def-common.RuleTaskStateWithActions", + "id": "def-common.RuleTaskState", "type": "Type", "tags": [], - "label": "RuleTaskStateWithActions", + "label": "RuleTaskState", "description": [], "signature": [ - "{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; } & { triggeredActions: { group?: string | undefined; id?: string | undefined; actionTypeId?: string | undefined; params?: { [x: string]: unknown; } | undefined; }[]; }" + "{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; }" ], "path": "x-pack/plugins/alerting/common/rule_task_instance.ts", "deprecated": false, diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 9e42d8dbfabbf..f9c8afc629784 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github summary: API docs for the alerting plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,13 +12,13 @@ import alertingObj from './alerting.devdocs.json'; -Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) for questions regarding this plugin. +Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 289 | 0 | 281 | 19 | +| 299 | 0 | 291 | 19 | ## Client diff --git a/api_docs/apm.devdocs.json b/api_docs/apm.devdocs.json index 04ad9a4d92bad..f0df027d6acad 100644 --- a/api_docs/apm.devdocs.json +++ b/api_docs/apm.devdocs.json @@ -731,7 +731,7 @@ "label": "APIEndpoint", "description": [], "signature": [ - "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/dynamic\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"POST /internal/apm/latency/overall_distribution\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/ux/client-metrics\" | \"GET /internal/apm/ux/page-load-distribution\" | \"GET /internal/apm/ux/page-load-distribution/breakdown\" | \"GET /internal/apm/ux/page-view-trends\" | \"GET /internal/apm/ux/services\" | \"GET /internal/apm/ux/visitor-breakdown\" | \"GET /internal/apm/ux/web-core-vitals\" | \"GET /internal/apm/ux/long-task-metrics\" | \"GET /internal/apm/ux/url-search\" | \"GET /internal/apm/ux/js-errors\" | \"GET /api/apm/observability_overview/has_rum_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/backend\" | \"GET /internal/apm/services/{serviceName}/serviceNodes\" | \"GET /internal/apm/services\" | \"GET /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/profiling/timeline\" | \"GET /internal/apm/services/{serviceName}/profiling/statistics\" | \"GET /internal/apm/services/{serviceName}/alerts\" | \"GET /internal/apm/services/{serviceName}/infrastructure\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_rate\" | \"GET /internal/apm/alerts/chart_preview/transaction_duration\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_count\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/services\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_data\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/backends/top_backends\" | \"GET /internal/apm/backends/upstream_services\" | \"GET /internal/apm/backends/metadata\" | \"GET /internal/apm/backends/charts/latency\" | \"GET /internal/apm/backends/charts/throughput\" | \"GET /internal/apm/backends/charts/error_rate\" | \"POST /internal/apm/correlations/p_values\" | \"GET /internal/apm/correlations/field_candidates\" | \"POST /internal/apm/correlations/field_stats\" | \"GET /internal/apm/correlations/field_value_stats\" | \"POST /internal/apm/correlations/field_value_pairs\" | \"POST /internal/apm/correlations/significant_correlations\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys\"" + "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/dynamic\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"POST /internal/apm/latency/overall_distribution\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/ux/client-metrics\" | \"GET /internal/apm/ux/page-load-distribution\" | \"GET /internal/apm/ux/page-load-distribution/breakdown\" | \"GET /internal/apm/ux/page-view-trends\" | \"GET /internal/apm/ux/services\" | \"GET /internal/apm/ux/visitor-breakdown\" | \"GET /internal/apm/ux/web-core-vitals\" | \"GET /internal/apm/ux/long-task-metrics\" | \"GET /internal/apm/ux/url-search\" | \"GET /internal/apm/ux/js-errors\" | \"GET /api/apm/observability_overview/has_rum_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/backend\" | \"GET /internal/apm/services/{serviceName}/serviceNodes\" | \"GET /internal/apm/services\" | \"GET /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search\" | \"POST /api/apm/services/{serviceName}/annotation\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/profiling/timeline\" | \"GET /internal/apm/services/{serviceName}/profiling/statistics\" | \"GET /internal/apm/services/{serviceName}/alerts\" | \"GET /internal/apm/services/{serviceName}/infrastructure\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_rate\" | \"GET /internal/apm/alerts/chart_preview/transaction_duration\" | \"GET /internal/apm/alerts/chart_preview/transaction_error_count\" | \"GET /api/apm/settings/agent-configuration\" | \"GET /api/apm/settings/agent-configuration/view\" | \"DELETE /api/apm/settings/agent-configuration\" | \"PUT /api/apm/settings/agent-configuration\" | \"POST /api/apm/settings/agent-configuration/search\" | \"GET /api/apm/settings/agent-configuration/services\" | \"GET /api/apm/settings/agent-configuration/environments\" | \"GET /api/apm/settings/agent-configuration/agent_name\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps\" | \"POST /api/apm/sourcemaps\" | \"DELETE /api/apm/sourcemaps/{id}\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/backends/top_backends\" | \"GET /internal/apm/backends/upstream_services\" | \"GET /internal/apm/backends/metadata\" | \"GET /internal/apm/backends/charts/latency\" | \"GET /internal/apm/backends/charts/throughput\" | \"GET /internal/apm/backends/charts/error_rate\" | \"POST /internal/apm/correlations/p_values\" | \"GET /internal/apm/correlations/field_candidates\" | \"POST /internal/apm/correlations/field_stats\" | \"GET /internal/apm/correlations/field_value_stats\" | \"POST /internal/apm/correlations/field_value_pairs\" | \"POST /internal/apm/correlations/significant_correlations\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys\"" ], "path": "x-pack/plugins/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts", "deprecated": false, @@ -1695,9 +1695,9 @@ }, ", { cloudStandaloneSetup: { apmServerUrl: string | undefined; secretToken: string | undefined; } | undefined; fleetAgents: never[]; isFleetEnabled: false; } | { cloudStandaloneSetup: { apmServerUrl: string | undefined; secretToken: string | undefined; } | undefined; isFleetEnabled: true; fleetAgents: { id: string; name: string; apmServerUrl: any; secretToken: any; }[]; }, ", "APMRouteCreateOptions", - ">; \"GET /internal/apm/fleet/has_data\": ", + ">; \"GET /internal/apm/fleet/has_apm_policies\": ", "ServerRoute", - "<\"GET /internal/apm/fleet/has_data\", undefined, ", + "<\"GET /internal/apm/fleet/has_apm_policies\", undefined, ", { "pluginId": "apm", "scope": "server", @@ -1705,7 +1705,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { hasData: boolean; }, ", + ", { hasApmPolicies: boolean; }, ", "APMRouteCreateOptions", ">; \"DELETE /api/apm/sourcemaps/{id}\": ", "ServerRoute", @@ -4001,7 +4001,7 @@ "AgentName", "; } & { serviceName: string; healthStatus: ", "ServiceHealthStatus", - "; }>; hasLegacyData: boolean; }, ", + "; }>; }, ", "APMRouteCreateOptions", ">; \"GET /internal/apm/services/{serviceName}/serviceNodes\": ", "ServerRoute", diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index 4c215e864b0a8..8364b357d677b 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github summary: API docs for the apm plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 08f3a09434e5a..570db3e540d9f 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github summary: API docs for the banners plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 9fcae4a691d20..bd5a3577bb43a 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github summary: API docs for the bfetch plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 47217436fe639..e7c2d60908ea4 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github summary: API docs for the canvas plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/cases.devdocs.json b/api_docs/cases.devdocs.json index a9887264af299..bd34b6f2b0334 100644 --- a/api_docs/cases.devdocs.json +++ b/api_docs/cases.devdocs.json @@ -444,6 +444,35 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "cases", + "id": "def-public.CaseAttachments", + "type": "Type", + "tags": [], + "label": "CaseAttachments", + "description": [], + "signature": [ + "SupportedCaseAttachment", + "[]" + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.DRAFT_COMMENT_STORAGE_ID", + "type": "string", + "tags": [], + "label": "DRAFT_COMMENT_STORAGE_ID", + "description": [], + "signature": [ + "\"xpack.cases.commentDraft\"" + ], + "path": "x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "cases", "id": "def-public.GetAllCasesSelectorModalProps", @@ -646,6 +675,25 @@ ], "returnComment": [] }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getCasesContext", + "type": "Function", + "tags": [], + "label": "getCasesContext", + "description": [], + "signature": [ + "() => (props: ", + "CasesContextProps", + " & { children: React.ReactNode; }) => React.ReactElement<", + "CasesContextProps", + ", string | React.JSXElementConstructor>" + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "cases", "id": "def-public.CasesUiStart.getAllCasesSelectorModal", @@ -704,6 +752,58 @@ "A react component that is a modal for selecting a case" ] }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getAllCasesSelectorModalNoProvider", + "type": "Function", + "tags": [], + "label": "getAllCasesSelectorModalNoProvider", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.GetAllCasesSelectorModalProps", + "text": "GetAllCasesSelectorModalProps" + }, + ") => React.ReactElement<", + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.GetAllCasesSelectorModalProps", + "text": "GetAllCasesSelectorModalProps" + }, + ", string | React.JSXElementConstructor>" + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getAllCasesSelectorModalNoProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + { + "pluginId": "cases", + "scope": "public", + "docId": "kibCasesPluginApi", + "section": "def-public.GetAllCasesSelectorModalProps", + "text": "GetAllCasesSelectorModalProps" + } + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "cases", "id": "def-public.CasesUiStart.getCreateCaseFlyout", @@ -762,6 +862,40 @@ "A react component that is a flyout for creating a case" ] }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getCreateCaseFlyoutNoProvider", + "type": "Function", + "tags": [], + "label": "getCreateCaseFlyoutNoProvider", + "description": [], + "signature": [ + "(props: ", + "CreateCaseFlyoutProps", + ") => React.ReactElement<", + "CreateCaseFlyoutProps", + ", string | React.JSXElementConstructor>" + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.getCreateCaseFlyoutNoProvider.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "CreateCaseFlyoutProps" + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "cases", "id": "def-public.CasesUiStart.getRecentCases", @@ -819,6 +953,23 @@ "returnComment": [ "A react component for showing recent cases" ] + }, + { + "parentPluginId": "cases", + "id": "def-public.CasesUiStart.hooks", + "type": "Object", + "tags": [], + "label": "hooks", + "description": [], + "signature": [ + "{ getUseCasesAddToNewCaseFlyout: (props: ", + "CreateCaseFlyoutProps", + ") => { open: () => void; close: () => void; }; getUseCasesAddToExistingCaseModal: (props: ", + "AllCasesSelectorModalProps", + ") => { open: () => void; close: () => void; }; }" + ], + "path": "x-pack/plugins/cases/public/types.ts", + "deprecated": false } ], "lifecycle": "start", diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 1e07e40d42adb..fd7fb30d09bab 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github summary: API docs for the cases plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) for qu | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 74 | 0 | 51 | 19 | +| 82 | 0 | 59 | 20 | ## Client diff --git a/api_docs/charts.devdocs.json b/api_docs/charts.devdocs.json index eac5adfc1c61a..6acc863cb7a24 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -108,9 +108,9 @@ "label": "EmptyPlaceholder", "description": [], "signature": [ - "({ icon, message, }: { icon: ", + "({ icon, iconColor, message, dataTestSubj, }: { icon: ", "IconType", - "; message?: JSX.Element | undefined; }) => JSX.Element" + "; iconColor?: string | undefined; message?: JSX.Element | undefined; dataTestSubj?: string | undefined; }) => JSX.Element" ], "path": "src/plugins/charts/public/static/components/empty_placeholder.tsx", "deprecated": false, @@ -120,7 +120,7 @@ "id": "def-public.EmptyPlaceholder.$1", "type": "Object", "tags": [], - "label": "{\n icon,\n message = ,\n}", + "label": "{\n icon,\n iconColor = 'subdued',\n message = ,\n dataTestSubj = 'emptyPlaceholder',\n}", "description": [], "path": "src/plugins/charts/public/static/components/empty_placeholder.tsx", "deprecated": false, @@ -138,6 +138,19 @@ "path": "src/plugins/charts/public/static/components/empty_placeholder.tsx", "deprecated": false }, + { + "parentPluginId": "charts", + "id": "def-public.EmptyPlaceholder.$1.iconColor", + "type": "string", + "tags": [], + "label": "iconColor", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/charts/public/static/components/empty_placeholder.tsx", + "deprecated": false + }, { "parentPluginId": "charts", "id": "def-public.EmptyPlaceholder.$1.message", @@ -150,6 +163,19 @@ ], "path": "src/plugins/charts/public/static/components/empty_placeholder.tsx", "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.EmptyPlaceholder.$1.dataTestSubj", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/charts/public/static/components/empty_placeholder.tsx", + "deprecated": false } ] } diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 3cbb943b1bba0..5eda2bcb2295a 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github summary: API docs for the charts plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 319 | 2 | 286 | 4 | +| 321 | 2 | 288 | 4 | ## Client diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index 3924d4cbe40e8..12472f322c464 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github summary: API docs for the cloud plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/console.mdx b/api_docs/console.mdx index cddd0dac25d1e..e19e9db1fabbc 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github summary: API docs for the console plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 1807e789987fd..d031009861ead 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github summary: API docs for the controls plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/core.devdocs.json b/api_docs/core.devdocs.json index 8903cc844a4c3..9e4d8681b8ef7 100644 --- a/api_docs/core.devdocs.json +++ b/api_docs/core.devdocs.json @@ -1686,9 +1686,6 @@ "tags": [], "label": "EnvironmentMode", "description": [], - "signature": [ - "EnvironmentMode" - ], "path": "node_modules/@types/kbn__config/index.d.ts", "deprecated": false, "children": [ @@ -3989,9 +3986,6 @@ "tags": [], "label": "PackageInfo", "description": [], - "signature": [ - "PackageInfo" - ], "path": "node_modules/@types/kbn__config/index.d.ts", "deprecated": false, "children": [ @@ -6332,9 +6326,7 @@ "\nMetric to track once this property changes" ], "signature": [ - "{ type: ", - "UiCounterMetricType", - "; name: string; } | undefined" + "{ type: string; name: string; } | undefined" ], "path": "src/core/types/ui_settings.ts", "deprecated": true, @@ -6646,7 +6638,7 @@ "label": "KibanaExecutionContext", "description": [], "signature": [ - "{ readonly type: string; readonly name: string; readonly id: string; readonly description: string; readonly url?: string | undefined; parent?: ", + "{ readonly type: string; readonly name: string; readonly id: string; readonly description?: string | undefined; readonly url?: string | undefined; child?: ", "KibanaExecutionContext", " | undefined; }" ], @@ -6788,9 +6780,7 @@ "UiSettingsType", " | undefined; description?: string | undefined; name?: string | undefined; options?: string[] | undefined; order?: number | undefined; value?: unknown; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", "DeprecationSettings", - " | undefined; metric?: { type: ", - "UiCounterMetricType", - "; name: string; } | undefined; }" + " | undefined; metric?: { type: string; name: string; } | undefined; }" ], "path": "src/core/types/ui_settings.ts", "deprecated": false, @@ -8031,14 +8021,6 @@ "path": "src/core/server/plugins/types.ts", "deprecated": true, "references": [ - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/plugin.ts" - }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/plugin.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/target/types/server/plugin.d.ts" @@ -8582,9 +8564,6 @@ "description": [ "\r\nDeprecation context provided to {@link ConfigDeprecation | config deprecations}\r\n" ], - "signature": [ - "ConfigDeprecationContext" - ], "path": "node_modules/@types/kbn__config/index.d.ts", "deprecated": false, "children": [ @@ -8677,9 +8656,6 @@ "description": [ "\r\nProvides helpers to generates the most commonly used {@link ConfigDeprecation}\r\nwhen invoking a {@link ConfigDeprecationProvider}.\r\n\r\nSee methods documentation for more detailed examples.\r\n" ], - "signature": [ - "ConfigDeprecationFactory" - ], "path": "node_modules/@types/kbn__config/index.d.ts", "deprecated": false, "children": [ @@ -10599,9 +10575,6 @@ "tags": [], "label": "EnvironmentMode", "description": [], - "signature": [ - "EnvironmentMode" - ], "path": "node_modules/@types/kbn__config/index.d.ts", "deprecated": false, "children": [ @@ -11703,731 +11676,1907 @@ { "parentPluginId": "core", "id": "def-server.IClusterClient.asInternalUser", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "asInternalUser", "description": [ "\nA {@link ElasticsearchClient | client} to be used to query the ES cluster on behalf of the Kibana internal user" ], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" - ], - "path": "src/core/server/elasticsearch/client/cluster_client.ts", - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.IClusterClient.asScoped", - "type": "Function", - "tags": [], - "label": "asScoped", - "description": [ - "\nCreates a {@link IScopedClusterClient | scoped cluster client} bound to given {@link ScopeableRequest | request}" - ], - "signature": [ - "(request: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.ScopeableRequest", - "text": "ScopeableRequest" - }, - ") => ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.IScopedClusterClient", - "text": "IScopedClusterClient" - } - ], - "path": "src/core/server/elasticsearch/client/cluster_client.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.IClusterClient.asScoped.$1", - "type": "CompoundType", - "tags": [], - "label": "request", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.ScopeableRequest", - "text": "ScopeableRequest" - } - ], - "path": "src/core/server/elasticsearch/client/cluster_client.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.IContextContainer", - "type": "Interface", - "tags": [], - "label": "IContextContainer", - "description": [ - "\nAn object that handles registration of context providers and configuring handlers with context.\n" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.registerContext", - "type": "Function", - "tags": [], - "label": "registerContext", - "description": [ - "\nRegister a new context provider.\n" - ], - "signature": [ - "(pluginOpaqueId: symbol, contextName: ContextName, provider: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.IContextProvider", - "text": "IContextProvider" - }, - ") => this" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.registerContext.$1", - "type": "Uncategorized", - "tags": [], - "label": "pluginOpaqueId", - "description": [ - "- The plugin opaque ID for the plugin that registers this context." - ], - "signature": [ - "symbol" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.registerContext.$2", - "type": "Uncategorized", - "tags": [], - "label": "contextName", - "description": [ - "- The key of the `TContext` object this provider supplies the value for." - ], - "signature": [ - "ContextName" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.registerContext.$3", - "type": "Function", - "tags": [], - "label": "provider", - "description": [ - "- A {@link IContextProvider } to be called each time a new context is created." - ], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.IContextProvider", - "text": "IContextProvider" - }, - "" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "The {@link IContextContainer } for method chaining." - ] - }, - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.createHandler", - "type": "Function", - "tags": [], - "label": "createHandler", - "description": [ - "\nCreate a new handler function pre-wired to context for the plugin.\n" - ], - "signature": [ - "(pluginOpaqueId: symbol, handler: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.RequestHandler", - "text": "RequestHandler" - }, - " | Error | { message: string | Error; attributes?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ResponseErrorAttributes", - "text": "ResponseErrorAttributes" - }, - " | undefined; } | Buffer | ", - "Stream", - " | undefined>(options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.CustomHttpResponseOptions", - "text": "CustomHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; badRequest: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; unauthorized: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; forbidden: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; notFound: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; conflict: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; customError: (options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.CustomHttpResponseOptions", - "text": "CustomHttpResponseOptions" - }, "<", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ResponseError", - "text": "ResponseError" - }, - ">) => ", - "KibanaResponse", - "; redirected: (options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.RedirectResponseOptions", - "text": "RedirectResponseOptions" - }, - ") => ", - "KibanaResponse", - " | Buffer | ", - "Stream", - ">; ok: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.HttpResponseOptions", - "text": "HttpResponseOptions" - }, - ") => ", - "KibanaResponse", - " | Buffer | ", - "Stream", - ">; accepted: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.HttpResponseOptions", - "text": "HttpResponseOptions" - }, - ") => ", - "KibanaResponse", - " | Buffer | ", - "Stream", - ">; noContent: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.HttpResponseOptions", - "text": "HttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; }>) => (request: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.KibanaRequest", - "text": "KibanaRequest" - }, - ", response: { custom: | Error | { message: string | Error; attributes?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ResponseErrorAttributes", - "text": "ResponseErrorAttributes" - }, - " | undefined; } | Buffer | ", - "Stream", - " | undefined>(options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.CustomHttpResponseOptions", - "text": "CustomHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; badRequest: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; unauthorized: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; forbidden: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; notFound: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; conflict: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; customError: (options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.CustomHttpResponseOptions", - "text": "CustomHttpResponseOptions" - }, + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", "<", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ResponseError", - "text": "ResponseError" - }, - ">) => ", - "KibanaResponse", - "; redirected: (options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.RedirectResponseOptions", - "text": "RedirectResponseOptions" - }, - ") => ", - "KibanaResponse", - " | Buffer | ", - "Stream", - ">; ok: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.HttpResponseOptions", - "text": "HttpResponseOptions" - }, - ") => ", - "KibanaResponse", - " | Buffer | ", - "Stream", - ">; accepted: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.HttpResponseOptions", - "text": "HttpResponseOptions" - }, - ") => ", - "KibanaResponse", - " | Buffer | ", - "Stream", - ">; noContent: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.HttpResponseOptions", - "text": "HttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; }) => Promise<", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.IKibanaResponse", - "text": "IKibanaResponse" - }, - ">" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.createHandler.$1", - "type": "Uncategorized", - "tags": [], - "label": "pluginOpaqueId", - "description": [ - "- The plugin opaque ID for the plugin that registers this handler." - ], - "signature": [ - "symbol" - ], - "path": "src/core/server/context/container/context.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "core", - "id": "def-server.IContextContainer.createHandler.$2", - "type": "Function", - "tags": [], - "label": "handler", - "description": [ - "- Handler function to pass context object to." - ], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.RequestHandler", - "text": "RequestHandler" - }, - " | Error | { message: string | Error; attributes?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ResponseErrorAttributes", - "text": "ResponseErrorAttributes" - }, - " | undefined; } | Buffer | ", - "Stream", - " | undefined>(options: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.CustomHttpResponseOptions", - "text": "CustomHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; badRequest: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; unauthorized: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; forbidden: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; notFound: (options?: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.ErrorHttpResponseOptions", - "text": "ErrorHttpResponseOptions" - }, - ") => ", - "KibanaResponse", - "; conflict: (options?: ", - { + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" + ], + "path": "src/core/server/elasticsearch/client/cluster_client.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.IClusterClient.asScoped", + "type": "Function", + "tags": [], + "label": "asScoped", + "description": [ + "\nCreates a {@link IScopedClusterClient | scoped cluster client} bound to given {@link ScopeableRequest | request}" + ], + "signature": [ + "(request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ScopeableRequest", + "text": "ScopeableRequest" + }, + ") => ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.IScopedClusterClient", + "text": "IScopedClusterClient" + } + ], + "path": "src/core/server/elasticsearch/client/cluster_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IClusterClient.asScoped.$1", + "type": "CompoundType", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ScopeableRequest", + "text": "ScopeableRequest" + } + ], + "path": "src/core/server/elasticsearch/client/cluster_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.IContextContainer", + "type": "Interface", + "tags": [], + "label": "IContextContainer", + "description": [ + "\nAn object that handles registration of context providers and configuring handlers with context.\n" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.registerContext", + "type": "Function", + "tags": [], + "label": "registerContext", + "description": [ + "\nRegister a new context provider.\n" + ], + "signature": [ + "(pluginOpaqueId: symbol, contextName: ContextName, provider: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, + ") => this" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.registerContext.$1", + "type": "Uncategorized", + "tags": [], + "label": "pluginOpaqueId", + "description": [ + "- The plugin opaque ID for the plugin that registers this context." + ], + "signature": [ + "symbol" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.registerContext.$2", + "type": "Uncategorized", + "tags": [], + "label": "contextName", + "description": [ + "- The key of the `TContext` object this provider supplies the value for." + ], + "signature": [ + "ContextName" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.registerContext.$3", + "type": "Function", + "tags": [], + "label": "provider", + "description": [ + "- A {@link IContextProvider } to be called each time a new context is created." + ], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.IContextProvider", + "text": "IContextProvider" + }, + "" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [ + "The {@link IContextContainer } for method chaining." + ] + }, + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.createHandler", + "type": "Function", + "tags": [], + "label": "createHandler", + "description": [ + "\nCreate a new handler function pre-wired to context for the plugin.\n" + ], + "signature": [ + "(pluginOpaqueId: symbol, handler: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, + " | Error | { message: string | Error; attributes?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, + " | undefined; } | Buffer | ", + "Stream", + " | undefined>(options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; badRequest: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; unauthorized: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; forbidden: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; notFound: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; conflict: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; customError: (options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + "<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ResponseError", + "text": "ResponseError" + }, + ">) => ", + "KibanaResponse", + "; redirected: (options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.RedirectResponseOptions", + "text": "RedirectResponseOptions" + }, + ") => ", + "KibanaResponse", + " | Buffer | ", + "Stream", + ">; ok: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, + ") => ", + "KibanaResponse", + " | Buffer | ", + "Stream", + ">; accepted: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, + ") => ", + "KibanaResponse", + " | Buffer | ", + "Stream", + ">; noContent: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; }>) => (request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ", response: { custom: | Error | { message: string | Error; attributes?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, + " | undefined; } | Buffer | ", + "Stream", + " | undefined>(options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; badRequest: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; unauthorized: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; forbidden: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; notFound: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; conflict: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; customError: (options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + "<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ResponseError", + "text": "ResponseError" + }, + ">) => ", + "KibanaResponse", + "; redirected: (options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.RedirectResponseOptions", + "text": "RedirectResponseOptions" + }, + ") => ", + "KibanaResponse", + " | Buffer | ", + "Stream", + ">; ok: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, + ") => ", + "KibanaResponse", + " | Buffer | ", + "Stream", + ">; accepted: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, + ") => ", + "KibanaResponse", + " | Buffer | ", + "Stream", + ">; noContent: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.HttpResponseOptions", + "text": "HttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; }) => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, + ">" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.createHandler.$1", + "type": "Uncategorized", + "tags": [], + "label": "pluginOpaqueId", + "description": [ + "- The plugin opaque ID for the plugin that registers this handler." + ], + "signature": [ + "symbol" + ], + "path": "src/core/server/context/container/context.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "core", + "id": "def-server.IContextContainer.createHandler.$2", + "type": "Function", + "tags": [], + "label": "handler", + "description": [ + "- Handler function to pass context object to." + ], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.RequestHandler", + "text": "RequestHandler" + }, + " | Error | { message: string | Error; attributes?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ResponseErrorAttributes", + "text": "ResponseErrorAttributes" + }, + " | undefined; } | Buffer | ", + "Stream", + " | undefined>(options: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.CustomHttpResponseOptions", + "text": "CustomHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; badRequest: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; unauthorized: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; forbidden: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; notFound: (options?: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.ErrorHttpResponseOptions", + "text": "ErrorHttpResponseOptions" + }, + ") => ", + "KibanaResponse", + "; conflict: (options?: ", + { "pluginId": "core", "scope": "server", "docId": "kibCoreHttpPluginApi", @@ -12921,46 +14070,2398 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.IScopedClusterClient.asInternalUser", - "type": "CompoundType", + "id": "def-server.IScopedClusterClient.asInternalUser", + "type": "Object", + "tags": [], + "label": "asInternalUser", + "description": [ + "\nA {@link ElasticsearchClient | client} to be used to query the elasticsearch cluster\non behalf of the internal Kibana user." + ], + "signature": [ + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" + ], + "path": "src/core/server/elasticsearch/client/scoped_cluster_client.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.IScopedClusterClient.asCurrentUser", + "type": "Object", "tags": [], - "label": "asInternalUser", + "label": "asCurrentUser", "description": [ - "\nA {@link ElasticsearchClient | client} to be used to query the elasticsearch cluster\non behalf of the internal Kibana user." + "\nA {@link ElasticsearchClient | client} to be used to query the elasticsearch cluster\non behalf of the user that initiated the request to the Kibana server." ], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" - ], - "path": "src/core/server/elasticsearch/client/scoped_cluster_client.ts", - "deprecated": false - }, - { - "parentPluginId": "core", - "id": "def-server.IScopedClusterClient.asCurrentUser", - "type": "CompoundType", - "tags": [], - "label": "asCurrentUser", - "description": [ - "\nA {@link ElasticsearchClient | client} to be used to query the elasticsearch cluster\non behalf of the user that initiated the request to the Kibana server." - ], - "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "src/core/server/elasticsearch/client/scoped_cluster_client.ts", "deprecated": false @@ -13285,9 +16786,6 @@ "description": [ "\r\nLogger exposes all the necessary methods to log any type of information and\r\nthis is the interface used by the logging consumers including plugins.\r\n" ], - "signature": [ - "Logger" - ], "path": "node_modules/@types/kbn__logging/index.d.ts", "deprecated": false, "children": [ @@ -13715,9 +17213,6 @@ "description": [ "\r\nThe single purpose of `LoggerFactory` interface is to define a way to\r\nretrieve a context-based logger instance.\r\n" ], - "signature": [ - "LoggerFactory" - ], "path": "node_modules/@types/kbn__logging/index.d.ts", "deprecated": false, "children": [ @@ -14407,9 +17902,6 @@ "tags": [], "label": "PackageInfo", "description": [], - "signature": [ - "PackageInfo" - ], "path": "node_modules/@types/kbn__config/index.d.ts", "deprecated": false, "children": [ @@ -15048,20 +18540,1196 @@ { "parentPluginId": "core", "id": "def-server.PollEsNodesVersionOptions.internalClient", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "internalClient", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", "deprecated": false @@ -16505,9 +21173,7 @@ "\nMetric to track once this property changes" ], "signature": [ - "{ type: ", - "UiCounterMetricType", - "; name: string; } | undefined" + "{ type: string; name: string; } | undefined" ], "path": "src/core/types/ui_settings.ts", "deprecated": true, @@ -17263,129 +21929,1305 @@ "text": "ConfigDeprecationDetails" }, " | ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.FeatureDeprecationDetails", - "text": "FeatureDeprecationDetails" - } - ], - "path": "src/core/server/deprecations/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.DocLinksServiceStart", - "type": "Type", - "tags": [], - "label": "DocLinksServiceStart", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.DocLinksServiceSetup", - "text": "DocLinksServiceSetup" - } - ], - "path": "src/core/server/doc_links/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.Ecs", - "type": "Type", - "tags": [], - "label": "Ecs", - "description": [ - "\r\nRepresents the full ECS schema.\r\n" - ], - "signature": [ - "EcsBase & EcsTracing & { ecs: EcsField; agent?: EcsAgent | undefined; as?: EcsAutonomousSystem | undefined; client?: EcsClient | undefined; cloud?: EcsCloud | undefined; container?: EcsContainer | undefined; data_stream?: EcsDataStream | undefined; destination?: EcsDestination | undefined; dns?: EcsDns | undefined; email?: EcsEmail | undefined; error?: EcsError | undefined; event?: EcsEvent | undefined; file?: EcsFile | undefined; group?: EcsGroup | undefined; host?: EcsHost | undefined; http?: EcsHttp | undefined; log?: EcsLog | undefined; network?: EcsNetwork | undefined; observer?: EcsObserver | undefined; orchestrator?: EcsOrchestrator | undefined; organization?: EcsOrganization | undefined; package?: EcsPackage | undefined; process?: EcsProcess | undefined; registry?: EcsRegistry | undefined; related?: EcsRelated | undefined; rule?: EcsRule | undefined; server?: EcsServer | undefined; service?: EcsService | undefined; source?: EcsSource | undefined; threat?: EcsThreat | undefined; tls?: EcsTls | undefined; url?: EcsUrl | undefined; user?: EcsUser | undefined; user_agent?: EcsUserAgent | undefined; vulnerability?: EcsVulnerability | undefined; }" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.EcsEventCategory", - "type": "Type", - "tags": [], - "label": "EcsEventCategory", - "description": [], - "signature": [ - "\"database\" | \"package\" | \"network\" | \"web\" | \"host\" | \"session\" | \"file\" | \"registry\" | \"process\" | \"authentication\" | \"configuration\" | \"driver\" | \"iam\" | \"intrusion_detection\" | \"malware\"" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.EcsEventKind", - "type": "Type", - "tags": [], - "label": "EcsEventKind", - "description": [], - "signature": [ - "\"alert\" | \"metric\" | \"event\" | \"state\" | \"signal\" | \"pipeline_error\"" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.EcsEventOutcome", - "type": "Type", - "tags": [], - "label": "EcsEventOutcome", - "description": [], - "signature": [ - "\"unknown\" | \"success\" | \"failure\"" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.EcsEventType", - "type": "Type", - "tags": [], - "label": "EcsEventType", - "description": [], - "signature": [ - "\"start\" | \"user\" | \"error\" | \"end\" | \"info\" | \"group\" | \"protocol\" | \"connection\" | \"access\" | \"admin\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" - ], - "path": "node_modules/@types/kbn__logging/index.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "core", - "id": "def-server.ElasticsearchClient", - "type": "Type", - "tags": [], - "label": "ElasticsearchClient", - "description": [ - "\nClient used to query the elasticsearch cluster.\n" - ], - "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.FeatureDeprecationDetails", + "text": "FeatureDeprecationDetails" + } + ], + "path": "src/core/server/deprecations/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.DocLinksServiceStart", + "type": "Type", + "tags": [], + "label": "DocLinksServiceStart", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.DocLinksServiceSetup", + "text": "DocLinksServiceSetup" + } + ], + "path": "src/core/server/doc_links/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.Ecs", + "type": "Type", + "tags": [], + "label": "Ecs", + "description": [ + "\r\nRepresents the full ECS schema.\r\n" + ], + "signature": [ + "EcsBase & EcsTracing & { ecs: EcsField; agent?: EcsAgent | undefined; as?: EcsAutonomousSystem | undefined; client?: EcsClient | undefined; cloud?: EcsCloud | undefined; container?: EcsContainer | undefined; data_stream?: EcsDataStream | undefined; destination?: EcsDestination | undefined; dns?: EcsDns | undefined; email?: EcsEmail | undefined; error?: EcsError | undefined; event?: EcsEvent | undefined; file?: EcsFile | undefined; group?: EcsGroup | undefined; host?: EcsHost | undefined; http?: EcsHttp | undefined; log?: EcsLog | undefined; network?: EcsNetwork | undefined; observer?: EcsObserver | undefined; orchestrator?: EcsOrchestrator | undefined; organization?: EcsOrganization | undefined; package?: EcsPackage | undefined; process?: EcsProcess | undefined; registry?: EcsRegistry | undefined; related?: EcsRelated | undefined; rule?: EcsRule | undefined; server?: EcsServer | undefined; service?: EcsService | undefined; source?: EcsSource | undefined; threat?: EcsThreat | undefined; tls?: EcsTls | undefined; url?: EcsUrl | undefined; user?: EcsUser | undefined; user_agent?: EcsUserAgent | undefined; vulnerability?: EcsVulnerability | undefined; }" + ], + "path": "node_modules/@types/kbn__logging/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.EcsEventCategory", + "type": "Type", + "tags": [], + "label": "EcsEventCategory", + "description": [], + "signature": [ + "\"database\" | \"package\" | \"network\" | \"web\" | \"host\" | \"session\" | \"file\" | \"registry\" | \"process\" | \"authentication\" | \"configuration\" | \"driver\" | \"iam\" | \"intrusion_detection\" | \"malware\"" + ], + "path": "node_modules/@types/kbn__logging/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.EcsEventKind", + "type": "Type", + "tags": [], + "label": "EcsEventKind", + "description": [], + "signature": [ + "\"alert\" | \"metric\" | \"event\" | \"state\" | \"signal\" | \"pipeline_error\"" + ], + "path": "node_modules/@types/kbn__logging/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.EcsEventOutcome", + "type": "Type", + "tags": [], + "label": "EcsEventOutcome", + "description": [], + "signature": [ + "\"unknown\" | \"success\" | \"failure\"" + ], + "path": "node_modules/@types/kbn__logging/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.EcsEventType", + "type": "Type", + "tags": [], + "label": "EcsEventType", + "description": [], + "signature": [ + "\"start\" | \"user\" | \"error\" | \"end\" | \"info\" | \"group\" | \"protocol\" | \"connection\" | \"access\" | \"admin\" | \"allowed\" | \"change\" | \"creation\" | \"deletion\" | \"denied\" | \"installation\"" + ], + "path": "node_modules/@types/kbn__logging/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "core", + "id": "def-server.ElasticsearchClient", + "type": "Type", + "tags": [], + "label": "ElasticsearchClient", + "description": [ + "\nClient used to query the elasticsearch cluster.\n" + ], + "signature": [ + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "src/core/server/elasticsearch/client/types.ts", "deprecated": false, @@ -18266,7 +24108,7 @@ "label": "KibanaExecutionContext", "description": [], "signature": [ - "{ readonly type: string; readonly name: string; readonly id: string; readonly description: string; readonly url?: string | undefined; parent?: ", + "{ readonly type: string; readonly name: string; readonly id: string; readonly description?: string | undefined; readonly url?: string | undefined; child?: ", "KibanaExecutionContext", " | undefined; }" ], @@ -18482,9 +24324,7 @@ "UiSettingsType", " | undefined; description?: string | undefined; name?: string | undefined; options?: string[] | undefined; order?: number | undefined; value?: unknown; category?: string[] | undefined; optionLabels?: Record | undefined; requiresPageReload?: boolean | undefined; readonly?: boolean | undefined; sensitive?: boolean | undefined; deprecation?: ", "DeprecationSettings", - " | undefined; metric?: { type: ", - "UiCounterMetricType", - "; name: string; } | undefined; }" + " | undefined; metric?: { type: string; name: string; } | undefined; }" ], "path": "src/core/types/ui_settings.ts", "deprecated": false, diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 4cead3ed131ee..18f8da72e47e4 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github summary: API docs for the core plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2366 | 15 | 973 | 32 | +| 2368 | 15 | 975 | 32 | ## Client diff --git a/api_docs/core_application.devdocs.json b/api_docs/core_application.devdocs.json index 193b728e1c088..2b85de6e9f5fe 100644 --- a/api_docs/core_application.devdocs.json +++ b/api_docs/core_application.devdocs.json @@ -860,6 +860,33 @@ "path": "src/core/public/application/types.ts", "deprecated": false }, + { + "parentPluginId": "core", + "id": "def-public.AppLeaveConfirmAction.confirmButtonText", + "type": "string", + "tags": [], + "label": "confirmButtonText", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/core/public/application/types.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-public.AppLeaveConfirmAction.buttonColor", + "type": "CompoundType", + "tags": [], + "label": "buttonColor", + "description": [], + "signature": [ + "ButtonColor", + " | undefined" + ], + "path": "src/core/public/application/types.ts", + "deprecated": false + }, { "parentPluginId": "core", "id": "def-public.AppLeaveConfirmAction.callback", @@ -1353,10 +1380,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/integrations/index.tsx" }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/index.tsx" - }, { "plugin": "security", "path": "x-pack/plugins/security/public/authentication/logout/logout_app.test.ts" diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index 72545603645f0..1966be80f8ba5 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-application title: "core.application" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.application plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.application'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2366 | 15 | 973 | 32 | +| 2368 | 15 | 975 | 32 | ## Client diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index 8e50bda60dce5..7048c43fd84a0 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-chrome title: "core.chrome" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.chrome plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.chrome'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2366 | 15 | 973 | 32 | +| 2368 | 15 | 975 | 32 | ## Client diff --git a/api_docs/core_http.mdx b/api_docs/core_http.mdx index 2ea23af5a885e..89dee2ccba96c 100644 --- a/api_docs/core_http.mdx +++ b/api_docs/core_http.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-http title: "core.http" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.http plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.http'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2366 | 15 | 973 | 32 | +| 2368 | 15 | 975 | 32 | ## Client diff --git a/api_docs/core_saved_objects.devdocs.json b/api_docs/core_saved_objects.devdocs.json index 525b950ddf80e..6b8adb5a2e621 100644 --- a/api_docs/core_saved_objects.devdocs.json +++ b/api_docs/core_saved_objects.devdocs.json @@ -13484,6 +13484,10 @@ { "plugin": "dashboard", "path": "src/plugins/dashboard/server/saved_objects/migrations_730.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts" } ], "children": [ diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index d472479fa4e30..6888a16005366 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/core-savedObjects title: "core.savedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the core.savedObjects plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.savedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2366 | 15 | 973 | 32 | +| 2368 | 15 | 975 | 32 | ## Client diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 443110cb658e8..00e483f3bc202 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github summary: API docs for the customIntegrations plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/dashboard.devdocs.json b/api_docs/dashboard.devdocs.json index b1ffd09f9fab2..22489858b5d62 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -1091,6 +1091,37 @@ } ], "functions": [ + { + "parentPluginId": "dashboard", + "id": "def-public.cleanEmptyKeys", + "type": "Function", + "tags": [], + "label": "cleanEmptyKeys", + "description": [], + "signature": [ + "(stateObj: Record) => Record" + ], + "path": "src/plugins/dashboard/public/locator.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dashboard", + "id": "def-public.cleanEmptyKeys.$1", + "type": "Object", + "tags": [], + "label": "stateObj", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/dashboard/public/locator.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "dashboard", "id": "def-public.createDashboardEditUrl", @@ -1263,6 +1294,16 @@ "path": "src/plugins/dashboard/public/types.ts", "deprecated": false }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardContainerInput.timeRestore", + "type": "boolean", + "tags": [], + "label": "timeRestore", + "description": [], + "path": "src/plugins/dashboard/public/types.ts", + "deprecated": false + }, { "parentPluginId": "dashboard", "id": "def-public.DashboardContainerInput.description", diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 9440593e200d9..bbd449c960d58 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github summary: API docs for the dashboard plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 138 | 0 | 136 | 14 | +| 141 | 0 | 139 | 14 | ## Client diff --git a/api_docs/dashboard_enhanced.devdocs.json b/api_docs/dashboard_enhanced.devdocs.json index 7bfbf4fb30ef7..33137ff371963 100644 --- a/api_docs/dashboard_enhanced.devdocs.json +++ b/api_docs/dashboard_enhanced.devdocs.json @@ -123,7 +123,7 @@ "section": "def-common.DrilldownConfig", "text": "DrilldownConfig" }, - ", context: Context) => Promise<", + ", context: Context, useUrlForState: boolean) => Promise<", "KibanaLocation", ">" ], @@ -163,6 +163,20 @@ "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/abstract_dashboard_drilldown.tsx", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "dashboardEnhanced", + "id": "def-public.AbstractDashboardDrilldown.getLocation.$3", + "type": "boolean", + "tags": [], + "label": "useUrlForState", + "description": [], + "signature": [ + "boolean" + ], + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/abstract_dashboard_drilldown.tsx", + "deprecated": false, + "isRequired": true } ], "returnComment": [] @@ -263,7 +277,7 @@ "label": "createConfig", "description": [], "signature": [ - "() => { dashboardId: string; useCurrentFilters: boolean; useCurrentDateRange: boolean; }" + "() => { dashboardId: string; useCurrentFilters: boolean; useCurrentDateRange: boolean; openInNewTab: boolean; }" ], "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/abstract_dashboard_drilldown.tsx", "deprecated": false, @@ -595,9 +609,7 @@ "section": "def-public.ShareMenuProvider", "text": "ShareMenuProvider" }, - ") => void; } & { urlGenerators: ", - "UrlGeneratorsSetup", - "; url: ", + ") => void; } & { url: ", { "pluginId": "share", "scope": "public", @@ -708,9 +720,7 @@ "section": "def-public.ShowShareMenuOptions", "text": "ShowShareMenuOptions" }, - ") => void; } & { urlGenerators: ", - "UrlGeneratorsStart", - "; url: ", + ") => void; } & { url: ", { "pluginId": "share", "scope": "public", @@ -760,7 +770,7 @@ "label": "Config", "description": [], "signature": [ - "{ dashboardId?: string | undefined; useCurrentFilters: boolean; useCurrentDateRange: boolean; }" + "{ dashboardId?: string | undefined; useCurrentFilters: boolean; useCurrentDateRange: boolean; openInNewTab: boolean; }" ], "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/abstract_dashboard_drilldown/types.ts", "deprecated": false, @@ -1016,7 +1026,7 @@ "label": "DrilldownConfig", "description": [], "signature": [ - "{ dashboardId?: string | undefined; useCurrentFilters: boolean; useCurrentDateRange: boolean; }" + "{ dashboardId?: string | undefined; useCurrentFilters: boolean; useCurrentDateRange: boolean; openInNewTab: boolean; }" ], "path": "x-pack/plugins/dashboard_enhanced/common/drilldowns/dashboard_drilldown/types.ts", "deprecated": false, diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 95cc9f0affbb2..fc677c3267ed5 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the dashboardEnhanced plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 51 | 0 | 50 | 0 | +| 52 | 0 | 51 | 0 | ## Client diff --git a/api_docs/data.devdocs.json b/api_docs/data.devdocs.json index df156d4840ea5..1d33a00a53fcf 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -2679,6 +2679,10 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/target/types/public/vis_types/base_vis_type.d.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts" + }, { "plugin": "discover", "path": "src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts" @@ -2883,6 +2887,14 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" @@ -2907,6 +2919,22 @@ "plugin": "ux", "path": "x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts" @@ -2983,14 +3011,6 @@ "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, { "plugin": "dataViewEditor", "path": "src/plugins/data_view_editor/public/shared_imports.ts" @@ -3359,6 +3379,38 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" @@ -3367,6 +3419,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" @@ -3379,6 +3439,98 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" @@ -3663,26 +3815,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" @@ -3695,14 +3827,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" @@ -3852,6 +3976,18 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "lens", "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" @@ -4060,6 +4196,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" @@ -4080,6 +4224,66 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" @@ -4136,6 +4340,46 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" @@ -4148,6 +4392,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" @@ -5757,26 +6009,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-public.getKbnTypeNames", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getKbnTypeNames", - "description": [], - "signature": [ - "() => string[]" - ], - "path": "src/plugins/data/common/kbn_field_types/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "returnComment": [], - "children": [], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-public.getSearchParamsFromRequest", @@ -6210,16 +6442,7 @@ "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", - "references": [ - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - } - ], + "references": [], "returnComment": [], "children": [ { @@ -8380,6 +8603,19 @@ "path": "src/plugins/data_views/common/data_views/data_views.ts", "deprecated": false }, + { + "parentPluginId": "data", + "id": "def-public.DataViewListItem.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_views.ts", + "deprecated": false + }, { "parentPluginId": "data", "id": "def-public.DataViewListItem.title", @@ -10546,9 +10782,6 @@ "tags": [], "label": "ES_FIELD_TYPES", "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -10560,9 +10793,6 @@ "tags": [], "label": "KBN_FIELD_TYPES", "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -11386,74 +11616,6 @@ "deprecated": true, "removeBy": "8.1", "references": [ - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, { "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" @@ -11514,14 +11676,6 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, { "plugin": "discoverEnhanced", "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" @@ -11634,14 +11788,6 @@ "plugin": "discover", "path": "src/plugins/discover/public/application/context/services/context_state.test.ts" }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/types.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/types.ts" - }, { "plugin": "discover", "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" @@ -11651,44 +11797,40 @@ "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/get_sharing_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/get_sharing_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "discover", @@ -11822,24 +11964,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-public.IFieldSubType", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "IFieldSubType", - "description": [], - "signature": [ - "IFieldSubTypeMultiOptional | IFieldSubTypeNestedOptional" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-public.IMetricAggType", @@ -12758,9 +12882,6 @@ ], "label": "KueryNode", "description": [], - "signature": [ - "KueryNode" - ], "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", @@ -12985,9 +13106,6 @@ ], "label": "RangeFilterParams", "description": [], - "signature": [ - "RangeFilterParams" - ], "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", @@ -13154,82 +13272,6 @@ "deprecated": true, "removeBy": "8.1", "references": [ - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/use_navigation_props.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/use_navigation_props.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" @@ -13238,42 +13280,6 @@ "plugin": "discover", "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/context_app.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/context_app.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/components/layout/discover_layout.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/components/layout/discover_layout.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/plugin.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/plugin.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, { "plugin": "discoverEnhanced", "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts" @@ -17564,26 +17570,6 @@ "path": "src/plugins/data/public/types.ts", "deprecated": true, "references": [ - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/application/main/components/chart/histogram.tsx" @@ -18369,6 +18355,19 @@ "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false }, + { + "parentPluginId": "data", + "id": "def-server.DataView.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false + }, { "parentPluginId": "data", "id": "def-server.DataView.allowNoIndex", @@ -18478,15 +18477,9 @@ "signature": [ "() => { storedFields: string[]; scriptFields: Record; docvalueFields: { field: string; format: string; }[]; runtimeFields: Record; }" + ">; docvalueFields: { field: string; format: string; }[]; runtimeFields: ", + "MappingRuntimeFields", + "; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -18968,7 +18961,7 @@ "tags": [], "label": "addRuntimeField", "description": [ - "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate" + "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate." ], "signature": [ "(name: string, runtimeField: ", @@ -18979,7 +18972,15 @@ "section": "def-common.RuntimeField", "text": "RuntimeField" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -19097,6 +19098,67 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-server.DataView.getAllRuntimeFields", + "type": "Function", + "tags": [], + "label": "getAllRuntimeFields", + "description": [], + "signature": [ + "() => Record" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-server.DataView.getFieldsByRuntimeFieldName", + "type": "Function", + "tags": [], + "label": "getFieldsByRuntimeFieldName", + "description": [], + "signature": [ + "(name: string) => Record | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-server.DataView.getFieldsByRuntimeFieldName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-server.DataView.replaceAllRuntimeFields", @@ -19179,6 +19241,24 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-server.DataView.getRuntimeMappings", + "type": "Function", + "tags": [], + "label": "getRuntimeMappings", + "description": [ + "\nReturn the \"runtime_mappings\" section of the ES search query" + ], + "signature": [ + "() => ", + "MappingRuntimeFields" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-server.DataView.getFormatterForFieldNoDefault", @@ -19545,6 +19625,10 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/target/types/public/vis_types/base_vis_type.d.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts" + }, { "plugin": "discover", "path": "src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts" @@ -19749,6 +19833,14 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" @@ -19773,6 +19865,22 @@ "plugin": "ux", "path": "x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts" @@ -19849,14 +19957,6 @@ "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, { "plugin": "dataViewEditor", "path": "src/plugins/data_view_editor/public/shared_imports.ts" @@ -20225,6 +20325,38 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" @@ -20233,6 +20365,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" @@ -20245,6 +20385,98 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" @@ -20529,26 +20761,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" @@ -20561,14 +20773,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" @@ -20718,6 +20922,18 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "lens", "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" @@ -20926,6 +21142,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" @@ -20946,6 +21170,66 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" @@ -21002,6 +21286,46 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" @@ -21014,6 +21338,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" @@ -21304,7 +21636,7 @@ { "parentPluginId": "data", "id": "def-server.IndexPatternsFetcher.Unnamed.$1", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "elasticsearchClient", "description": [], @@ -22964,9 +23296,6 @@ "tags": [], "label": "ES_FIELD_TYPES", "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -22978,9 +23307,6 @@ "tags": [], "label": "KBN_FIELD_TYPES", "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -23067,74 +23393,6 @@ "deprecated": true, "removeBy": "8.1", "references": [ - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, { "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" @@ -23195,14 +23453,6 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, { "plugin": "discoverEnhanced", "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" @@ -23315,14 +23565,6 @@ "plugin": "discover", "path": "src/plugins/discover/public/application/context/services/context_state.test.ts" }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/types.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/types.ts" - }, { "plugin": "discover", "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" @@ -23332,44 +23574,40 @@ "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/get_sharing_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/get_sharing_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "discover", @@ -23415,24 +23653,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-server.IFieldSubType", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "IFieldSubType", - "description": [], - "signature": [ - "IFieldSubTypeMultiOptional | IFieldSubTypeNestedOptional" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-server.IndexPatternAttributes", @@ -23538,9 +23758,6 @@ ], "label": "KueryNode", "description": [], - "signature": [ - "KueryNode" - ], "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", @@ -25294,6 +25511,19 @@ "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false }, + { + "parentPluginId": "data", + "id": "def-common.DataView.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false + }, { "parentPluginId": "data", "id": "def-common.DataView.allowNoIndex", @@ -25403,15 +25633,9 @@ "signature": [ "() => { storedFields: string[]; scriptFields: Record; docvalueFields: { field: string; format: string; }[]; runtimeFields: Record; }" + ">; docvalueFields: { field: string; format: string; }[]; runtimeFields: ", + "MappingRuntimeFields", + "; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -25893,7 +26117,7 @@ "tags": [], "label": "addRuntimeField", "description": [ - "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate" + "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate." ], "signature": [ "(name: string, runtimeField: ", @@ -25904,7 +26128,15 @@ "section": "def-common.RuntimeField", "text": "RuntimeField" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -26022,6 +26254,67 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.DataView.getAllRuntimeFields", + "type": "Function", + "tags": [], + "label": "getAllRuntimeFields", + "description": [], + "signature": [ + "() => Record" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.DataView.getFieldsByRuntimeFieldName", + "type": "Function", + "tags": [], + "label": "getFieldsByRuntimeFieldName", + "description": [], + "signature": [ + "(name: string) => Record | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.DataView.getFieldsByRuntimeFieldName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.DataView.replaceAllRuntimeFields", @@ -26104,6 +26397,24 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.DataView.getRuntimeMappings", + "type": "Function", + "tags": [], + "label": "getRuntimeMappings", + "description": [ + "\nReturn the \"runtime_mappings\" section of the ES search query" + ], + "signature": [ + "() => ", + "MappingRuntimeFields" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.DataView.getFormatterForFieldNoDefault", @@ -26537,8 +26848,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -26557,8 +26868,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -26787,6 +27098,16 @@ "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false }, + { + "parentPluginId": "data", + "id": "def-common.DataViewField.isRuntimeField", + "type": "boolean", + "tags": [], + "label": "isRuntimeField", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, { "parentPluginId": "data", "id": "def-common.DataViewField.sortable", @@ -27024,6 +27345,21 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewField.isRuntimeCompositeSubField", + "type": "Function", + "tags": [], + "label": "isRuntimeCompositeSubField", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false @@ -28353,6 +28689,10 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/target/types/public/vis_types/base_vis_type.d.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts" + }, { "plugin": "discover", "path": "src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts" @@ -28557,6 +28897,14 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" @@ -28581,6 +28929,22 @@ "plugin": "ux", "path": "x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts" @@ -28657,14 +29021,6 @@ "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, { "plugin": "dataViewEditor", "path": "src/plugins/data_view_editor/public/shared_imports.ts" @@ -29033,6 +29389,38 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" @@ -29041,6 +29429,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" @@ -29053,6 +29449,98 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" @@ -29337,26 +29825,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" @@ -29369,14 +29837,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" @@ -29526,6 +29986,18 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "lens", "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" @@ -29734,6 +30206,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" @@ -29754,6 +30234,66 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" @@ -29810,6 +30350,46 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" @@ -29822,6 +30402,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" @@ -30250,9 +30838,6 @@ "tags": [], "label": "KbnFieldType", "description": [], - "signature": [ - "KbnFieldType" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "children": [ @@ -31768,26 +32353,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-common.getFilterableKbnTypeNames", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getFilterableKbnTypeNames", - "description": [], - "signature": [ - "() => string[]" - ], - "path": "src/plugins/data/common/kbn_field_types/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "returnComment": [], - "children": [], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-common.getIndexPatternLoadMeta", @@ -31812,58 +32377,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-common.getKbnFieldType", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getKbnFieldType", - "description": [], - "signature": [ - "(typeName: string) => ", - "KbnFieldType" - ], - "path": "src/plugins/data/common/kbn_field_types/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-common.getKbnFieldType.$1", - "type": "string", - "tags": [], - "label": "typeName", - "description": [], - "path": "node_modules/@types/kbn__field-types/index.d.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.getKbnTypeNames", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getKbnTypeNames", - "description": [], - "signature": [ - "() => string[]" - ], - "path": "src/plugins/data/common/kbn_field_types/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "returnComment": [], - "children": [], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-common.getPhraseFilterField", @@ -32163,16 +32676,7 @@ "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", - "references": [ - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - } - ], + "references": [], "returnComment": [], "children": [ { @@ -33048,6 +33552,19 @@ "path": "src/plugins/data_views/common/data_views/data_views.ts", "deprecated": false }, + { + "parentPluginId": "data", + "id": "def-common.DataViewListItem.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_views.ts", + "deprecated": false + }, { "parentPluginId": "data", "id": "def-common.DataViewListItem.title", @@ -33277,8 +33794,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, "> | undefined" ], @@ -33317,6 +33834,19 @@ ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -33556,8 +34086,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -35006,7 +35536,14 @@ "section": "def-common.FieldSpec", "text": "FieldSpec" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } ], "path": "src/plugins/data_views/common/fields/field_list.ts", "deprecated": false, @@ -35448,9 +35985,6 @@ "tags": [], "label": "KbnFieldTypeOptions", "description": [], - "signature": [ - "KbnFieldTypeOptions" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "children": [ @@ -35505,34 +36039,46 @@ "parentPluginId": "data", "id": "def-common.RuntimeField", "type": "Interface", - "tags": [], + "tags": [ + "see" + ], "label": "RuntimeField", - "description": [], + "description": [ + "\nThis is the RuntimeField interface enhanced with Data view field\nconfiguration: field format definition, customLabel or popularity.\n" + ], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.RuntimeField", + "text": "RuntimeField" + }, + " extends ", + "RuntimeFieldBase", + ",", + "FieldConfiguration" + ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, "children": [ { "parentPluginId": "data", - "id": "def-common.RuntimeField.type", - "type": "CompoundType", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\"" - ], - "path": "src/plugins/data_views/common/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-common.RuntimeField.script", + "id": "def-common.RuntimeField.fields", "type": "Object", "tags": [], - "label": "script", + "label": "fields", "description": [], "signature": [ - "{ source: string; } | undefined" + "Record | undefined" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false @@ -36300,9 +36846,6 @@ "tags": [], "label": "ES_FIELD_TYPES", "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -36316,9 +36859,6 @@ "description": [ "\r\n Filter,\r\nAn enum to denote whether a filter is specific to an application's context or whether it should be applied globally." ], - "signature": [ - "FilterStateStore" - ], "path": "node_modules/@types/kbn__es-query/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -36330,9 +36870,6 @@ "tags": [], "label": "KBN_FIELD_TYPES", "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], "path": "node_modules/@types/kbn__field-types/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -36773,74 +37310,6 @@ "deprecated": true, "removeBy": "8.1", "references": [ - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/main/services/discover_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context_state.ts" - }, { "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" @@ -36901,14 +37370,6 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, - { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - }, { "plugin": "discoverEnhanced", "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" @@ -37021,14 +37482,6 @@ "plugin": "discover", "path": "src/plugins/discover/public/application/context/services/context_state.test.ts" }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/types.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/embeddable/types.ts" - }, { "plugin": "discover", "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" @@ -37038,44 +37491,40 @@ "path": "src/plugins/discover/public/embeddable/saved_search_embeddable.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/get_sharing_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/utils/get_sharing_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts" + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" }, { "plugin": "discover", @@ -37156,24 +37605,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-common.IFieldSubType", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "IFieldSubType", - "description": [], - "signature": [ - "IFieldSubTypeMultiOptional | IFieldSubTypeNestedOptional" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-common.INDEX_PATTERN_SAVED_OBJECT_TYPE", @@ -37792,9 +38223,6 @@ ], "label": "KueryNode", "description": [], - "signature": [ - "KueryNode" - ], "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", @@ -38130,9 +38558,6 @@ ], "label": "RangeFilterParams", "description": [], - "signature": [ - "RangeFilterParams" - ], "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", @@ -38147,7 +38572,7 @@ "label": "RuntimeType", "description": [], "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\"" + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\" | \"composite\"" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -38408,7 +38833,7 @@ "label": "RUNTIME_FIELD_TYPES", "description": [], "signature": [ - "readonly [\"keyword\", \"long\", \"double\", \"date\", \"ip\", \"boolean\", \"geo_point\"]" + "readonly [\"keyword\", \"long\", \"double\", \"date\", \"ip\", \"boolean\", \"geo_point\", \"composite\"]" ], "path": "src/plugins/data_views/common/constants.ts", "deprecated": false, diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 83578e4206fba..75501fbd0013b 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github summary: API docs for the data plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3386 | 40 | 2791 | 26 | +| 3392 | 40 | 2795 | 26 | ## Client diff --git a/api_docs/data_autocomplete.mdx b/api_docs/data_autocomplete.mdx index 03d9948ab4606..00c930c343325 100644 --- a/api_docs/data_autocomplete.mdx +++ b/api_docs/data_autocomplete.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-autocomplete title: "data.autocomplete" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.autocomplete plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.autocomplete'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3386 | 40 | 2791 | 26 | +| 3392 | 40 | 2795 | 26 | ## Client diff --git a/api_docs/data_enhanced.mdx b/api_docs/data_enhanced.mdx index 23567d436cb56..511af26bb9015 100644 --- a/api_docs/data_enhanced.mdx +++ b/api_docs/data_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataEnhanced title: "dataEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataEnhanced plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 5b27cb9570bf5..c4d4875f1393e 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.query plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3386 | 40 | 2791 | 26 | +| 3392 | 40 | 2795 | 26 | ## Client diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index e31eeecd66eba..c37265a550a31 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -23898,7 +23898,7 @@ "label": "type", "description": [], "signature": [ - "\"date\" | \"long\" | \"double\" | \"date_nanos\" | undefined" + "\"date\" | \"date_nanos\" | \"long\" | \"double\" | undefined" ], "path": "src/plugins/data/common/search/search_source/types.ts", "deprecated": false @@ -27660,7 +27660,7 @@ "section": "def-common.SortDirection", "text": "SortDirection" }, - "; numeric_type?: \"date\" | \"long\" | \"double\" | \"date_nanos\" | undefined; }" + "; numeric_type?: \"date\" | \"date_nanos\" | \"long\" | \"double\" | undefined; }" ], "path": "src/plugins/data/common/search/search_source/types.ts", "deprecated": false, diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 12468c8bc7a4e..0e8930269f2de 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.search plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3386 | 40 | 2791 | 26 | +| 3392 | 40 | 2795 | 26 | ## Client diff --git a/api_docs/data_ui.mdx b/api_docs/data_ui.mdx index aa6a8118f3215..bdab96a480712 100644 --- a/api_docs/data_ui.mdx +++ b/api_docs/data_ui.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/data-ui title: "data.ui" image: https://source.unsplash.com/400x175/?github summary: API docs for the data.ui plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.ui'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3386 | 40 | 2791 | 26 | +| 3392 | 40 | 2795 | 26 | ## Client diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index f94b095a4fb6b..b44cf2309f9a4 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewEditor plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 2e3ffc6ef478d..5cebff6aee871 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewFieldEditor plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index 37f551b5cfdc7..55a219292069f 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViewManagement plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/data_views.devdocs.json b/api_docs/data_views.devdocs.json index 677b535526246..ccc8a5573bbdf 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -245,6 +245,19 @@ "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false + }, { "parentPluginId": "dataViews", "id": "def-public.DataView.allowNoIndex", @@ -354,15 +367,9 @@ "signature": [ "() => { storedFields: string[]; scriptFields: Record; docvalueFields: { field: string; format: string; }[]; runtimeFields: Record; }" + ">; docvalueFields: { field: string; format: string; }[]; runtimeFields: ", + "MappingRuntimeFields", + "; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -800,7 +807,7 @@ "tags": [], "label": "addRuntimeField", "description": [ - "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate" + "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate." ], "signature": [ "(name: string, runtimeField: ", @@ -811,7 +818,15 @@ "section": "def-common.RuntimeField", "text": "RuntimeField" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -929,6 +944,67 @@ ], "returnComment": [] }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.getAllRuntimeFields", + "type": "Function", + "tags": [], + "label": "getAllRuntimeFields", + "description": [], + "signature": [ + "() => Record" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.getFieldsByRuntimeFieldName", + "type": "Function", + "tags": [], + "label": "getFieldsByRuntimeFieldName", + "description": [], + "signature": [ + "(name: string) => Record | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.getFieldsByRuntimeFieldName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "dataViews", "id": "def-public.DataView.replaceAllRuntimeFields", @@ -1011,6 +1087,24 @@ ], "returnComment": [] }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.getRuntimeMappings", + "type": "Function", + "tags": [], + "label": "getRuntimeMappings", + "description": [ + "\nReturn the \"runtime_mappings\" section of the ES search query" + ], + "signature": [ + "() => ", + "MappingRuntimeFields" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "dataViews", "id": "def-public.DataView.getFormatterForFieldNoDefault", @@ -1444,8 +1538,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -1464,8 +1558,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -1694,6 +1788,16 @@ "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.isRuntimeField", + "type": "boolean", + "tags": [], + "label": "isRuntimeField", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, { "parentPluginId": "dataViews", "id": "def-public.DataViewField.sortable", @@ -1931,6 +2035,21 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.isRuntimeCompositeSubField", + "type": "Function", + "tags": [], + "label": "isRuntimeCompositeSubField", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false @@ -3536,6 +3655,10 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/target/types/public/vis_types/base_vis_type.d.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts" + }, { "plugin": "discover", "path": "src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts" @@ -3880,6 +4003,14 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" @@ -3904,6 +4035,22 @@ "plugin": "ux", "path": "x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts" @@ -4244,14 +4391,6 @@ "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, { "plugin": "dataViewEditor", "path": "src/plugins/data_view_editor/public/shared_imports.ts" @@ -4620,6 +4759,38 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" @@ -4628,6 +4799,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" @@ -4640,6 +4819,98 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" @@ -4926,51 +5197,23 @@ }, { "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" + "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, { "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" + "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, { "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" + "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, { "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" + "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" }, { "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" + "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" }, { "plugin": "visTypeTimeseries", @@ -5137,6 +5380,18 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "lens", "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" @@ -5401,6 +5656,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" @@ -5421,6 +5684,66 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" @@ -5477,6 +5800,46 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" @@ -5489,6 +5852,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" @@ -6573,6 +6944,19 @@ "path": "src/plugins/data_views/common/data_views/data_views.ts", "deprecated": false }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewListItem.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_views.ts", + "deprecated": false + }, { "parentPluginId": "dataViews", "id": "def-public.DataViewListItem.title", @@ -6802,8 +7186,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, "> | undefined" ], @@ -6842,6 +7226,19 @@ ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewSpec.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -6890,7 +7287,14 @@ "section": "def-common.FieldSpec", "text": "FieldSpec" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } ], "path": "src/plugins/data_views/common/fields/field_list.ts", "deprecated": false, @@ -7356,6 +7760,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "dataViews", + "id": "def-public.DATA_VIEW_SAVED_OBJECT_TYPE", + "type": "string", + "tags": [], + "label": "DATA_VIEW_SAVED_OBJECT_TYPE", + "description": [], + "signature": [ + "\"index-pattern\"" + ], + "path": "src/plugins/data_views/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "dataViews", "id": "def-public.DataViewsContract", @@ -8195,6 +8613,20 @@ "path": "src/plugins/data_views/common/constants.ts", "deprecated": false, "initialIsOpen": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.RuntimeType", + "type": "Type", + "tags": [], + "label": "RuntimeType", + "description": [], + "signature": [ + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\" | \"composite\"" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false, + "initialIsOpen": false } ], "objects": [], @@ -8767,7 +9199,7 @@ { "parentPluginId": "dataViews", "id": "def-server.IndexPatternsFetcher.Unnamed.$1", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "elasticsearchClient", "description": [], @@ -10241,66 +10673,1242 @@ { "parentPluginId": "dataViews", "id": "def-server.DataViewsServerPluginStart.dataViewsServiceFactory.$2", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "elasticsearchClient", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" - ], - "path": "src/plugins/data_views/server/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dataViews", - "id": "def-server.DataViewsServerPluginStart.dataViewsServiceFactory.$3", - "type": "Object", - "tags": [], - "label": "request", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.KibanaRequest", - "text": "KibanaRequest" - }, - " | undefined" - ], - "path": "src/plugins/data_views/server/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dataViews", - "id": "def-server.DataViewsServerPluginStart.dataViewsServiceFactory.$4", - "type": "CompoundType", - "tags": [], - "label": "byPassCapabilities", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data_views/server/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "dataViews", - "id": "def-server.DataViewsServerPluginStart.indexPatternsServiceFactory", - "type": "Function", - "tags": [ - "deprecated" - ], + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" + ], + "path": "src/plugins/data_views/server/types.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-server.DataViewsServerPluginStart.dataViewsServiceFactory.$3", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + " | undefined" + ], + "path": "src/plugins/data_views/server/types.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-server.DataViewsServerPluginStart.dataViewsServiceFactory.$4", + "type": "CompoundType", + "tags": [], + "label": "byPassCapabilities", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data_views/server/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "dataViews", + "id": "def-server.DataViewsServerPluginStart.indexPatternsServiceFactory", + "type": "Function", + "tags": [ + "deprecated" + ], "label": "indexPatternsServiceFactory", "description": [], "signature": [ @@ -10728,20 +12336,1196 @@ { "parentPluginId": "dataViews", "id": "def-server.DataViewsServerPluginStart.indexPatternsServiceFactory.$2", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "elasticsearchClient", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "src/plugins/data_views/server/types.ts", "deprecated": false @@ -11044,6 +13828,19 @@ "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataView.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false + }, { "parentPluginId": "dataViews", "id": "def-common.DataView.allowNoIndex", @@ -11153,15 +13950,9 @@ "signature": [ "() => { storedFields: string[]; scriptFields: Record; docvalueFields: { field: string; format: string; }[]; runtimeFields: Record; }" + ">; docvalueFields: { field: string; format: string; }[]; runtimeFields: ", + "MappingRuntimeFields", + "; }" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -11599,7 +14390,7 @@ "tags": [], "label": "addRuntimeField", "description": [ - "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate" + "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate." ], "signature": [ "(name: string, runtimeField: ", @@ -11610,7 +14401,15 @@ "section": "def-common.RuntimeField", "text": "RuntimeField" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -11728,6 +14527,67 @@ ], "returnComment": [] }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataView.getAllRuntimeFields", + "type": "Function", + "tags": [], + "label": "getAllRuntimeFields", + "description": [], + "signature": [ + "() => Record" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataView.getFieldsByRuntimeFieldName", + "type": "Function", + "tags": [], + "label": "getFieldsByRuntimeFieldName", + "description": [], + "signature": [ + "(name: string) => Record | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-common.DataView.getFieldsByRuntimeFieldName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "dataViews", "id": "def-common.DataView.replaceAllRuntimeFields", @@ -11810,6 +14670,24 @@ ], "returnComment": [] }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataView.getRuntimeMappings", + "type": "Function", + "tags": [], + "label": "getRuntimeMappings", + "description": [ + "\nReturn the \"runtime_mappings\" section of the ES search query" + ], + "signature": [ + "() => ", + "MappingRuntimeFields" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "dataViews", "id": "def-common.DataView.getFormatterForFieldNoDefault", @@ -12243,8 +15121,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -12263,8 +15141,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -12493,6 +15371,16 @@ "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataViewField.isRuntimeField", + "type": "boolean", + "tags": [], + "label": "isRuntimeField", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, { "parentPluginId": "dataViews", "id": "def-common.DataViewField.sortable", @@ -12730,6 +15618,21 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataViewField.isRuntimeCompositeSubField", + "type": "Function", + "tags": [], + "label": "isRuntimeCompositeSubField", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false @@ -14104,6 +17007,10 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/target/types/public/vis_types/base_vis_type.d.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts" + }, { "plugin": "discover", "path": "src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts" @@ -14448,6 +17355,14 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" @@ -14472,6 +17387,22 @@ "plugin": "ux", "path": "x-pack/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts" + }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts" @@ -14812,14 +17743,6 @@ "plugin": "savedObjects", "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "dataViewFieldEditor", - "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, { "plugin": "dataViewEditor", "path": "src/plugins/data_view_editor/public/shared_imports.ts" @@ -15161,52 +18084,184 @@ "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" }, { "plugin": "stackAlerts", @@ -15492,26 +18547,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/annotations_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/vis_editor.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" @@ -15524,14 +18559,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/target/types/public/application/components/panel_config/types.d.ts" - }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/metrics_type.ts" @@ -15705,6 +18732,18 @@ "plugin": "lens", "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { "plugin": "lens", "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" @@ -15969,6 +19008,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" @@ -15989,6 +19036,66 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" @@ -16045,6 +19152,46 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" @@ -16057,6 +19204,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" @@ -16883,6 +20038,19 @@ "path": "src/plugins/data_views/common/data_views/data_views.ts", "deprecated": false }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataViewListItem.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/data_views/data_views.ts", + "deprecated": false + }, { "parentPluginId": "dataViews", "id": "def-common.DataViewListItem.title", @@ -17112,8 +20280,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, "> | undefined" ], @@ -17152,6 +20320,19 @@ ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-common.DataViewSpec.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -17391,8 +20572,8 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, " | undefined" ], @@ -19173,7 +22354,14 @@ "section": "def-common.FieldSpec", "text": "FieldSpec" }, - ") => void" + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } ], "path": "src/plugins/data_views/common/fields/field_list.ts", "deprecated": false, @@ -19612,34 +22800,124 @@ "parentPluginId": "dataViews", "id": "def-common.RuntimeField", "type": "Interface", - "tags": [], + "tags": [ + "see" + ], "label": "RuntimeField", - "description": [], + "description": [ + "\nThis is the RuntimeField interface enhanced with Data view field\nconfiguration: field format definition, customLabel or popularity.\n" + ], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.RuntimeField", + "text": "RuntimeField" + }, + " extends ", + "RuntimeFieldBase", + ",", + "FieldConfiguration" + ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, "children": [ { "parentPluginId": "dataViews", - "id": "def-common.RuntimeField.type", - "type": "CompoundType", + "id": "def-common.RuntimeField.fields", + "type": "Object", "tags": [], - "label": "type", + "label": "fields", "description": [], "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\"" + "Record | undefined" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataViews", + "id": "def-common.RuntimeFieldSpec", + "type": "Interface", + "tags": [], + "label": "RuntimeFieldSpec", + "description": [ + "\nThe RuntimeField that will be sent in the ES Query \"runtime_mappings\" object" + ], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.RuntimeFieldSpec", + "text": "RuntimeFieldSpec" }, + " extends ", + "RuntimeFieldBase" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false, + "children": [ { "parentPluginId": "dataViews", - "id": "def-common.RuntimeField.script", + "id": "def-common.RuntimeFieldSpec.fields", "type": "Object", "tags": [], - "label": "script", + "label": "fields", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataViews", + "id": "def-common.RuntimeFieldSubField", + "type": "Interface", + "tags": [], + "label": "RuntimeFieldSubField", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.RuntimeFieldSubField", + "text": "RuntimeFieldSubField" + }, + " extends ", + "FieldConfiguration" + ], + "path": "src/plugins/data_views/common/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-common.RuntimeFieldSubField.type", + "type": "CompoundType", + "tags": [], + "label": "type", "description": [], "signature": [ - "{ source: string; } | undefined" + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\"" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false @@ -21660,7 +24938,7 @@ "label": "RuntimeType", "description": [], "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\"" + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"long\" | \"double\" | \"composite\"" ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false, @@ -21741,7 +25019,7 @@ "label": "RUNTIME_FIELD_TYPES", "description": [], "signature": [ - "readonly [\"keyword\", \"long\", \"double\", \"date\", \"ip\", \"boolean\", \"geo_point\"]" + "readonly [\"keyword\", \"long\", \"double\", \"date\", \"ip\", \"boolean\", \"geo_point\", \"composite\"]" ], "path": "src/plugins/data_views/common/constants.ts", "deprecated": false, diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index b08a61c35ba1c..65eb1beeb6be7 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataViews plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 742 | 3 | 597 | 7 | +| 765 | 3 | 616 | 10 | ## Client diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index b2caa1e7b51b0..9dd9eabccc6e4 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the dataVisualizer plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 786e201a382fb..918b5e74758dd 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- @@ -15,52 +15,50 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | ---------------|-----------|-----------| | | dataViews, visTypeTimeseries, maps, data | - | | | dataViews, observability, lens, maps, graph, stackAlerts, transform, inputControlVis, visTypeTimelion, data | - | -| | dataViews, upgradeAssistant, dashboard, visualizations, discover, visTypeTimeseries, observability, dataVisualizer, transform, lens, ux, savedObjects, dataViewFieldEditor, dataViewEditor, graph, stackAlerts, uptime, maps, inputControlVis, visDefaultEditor, visTypeVega, data | - | -| | dataViews, dataVisualizer, lens, dataViewEditor, maps, inputControlVis, visDefaultEditor, visTypeTimeseries, discover, data | - | +| | dataViews, upgradeAssistant, dashboard, visualizations, discover, visTypeTimeseries, observability, dataVisualizer, transform, lens, maps, ux, savedObjects, dataViewEditor, graph, stackAlerts, uptime, inputControlVis, visDefaultEditor, visTypeVega, dataViewFieldEditor, data | - | +| | dataViews, dataVisualizer, lens, maps, dataViewEditor, inputControlVis, visDefaultEditor, visTypeTimeseries, discover, data | - | | | dataViews, monitoring, stackAlerts, transform | - | | | dataViews, transform, canvas, discover | - | | | dataViews, monitoring, stackAlerts, transform, data | - | | | dataViews, transform, canvas, discover, data | - | | | dataViews, observability, lens, maps, graph, stackAlerts, transform, inputControlVis, visTypeTimelion, data | - | | | dataViews, visualizations, data | - | -| | dataViews, dataVisualizer, lens, dataViewEditor, maps, inputControlVis, visDefaultEditor, visTypeTimeseries, discover, data | - | +| | dataViews, dataVisualizer, lens, maps, dataViewEditor, inputControlVis, visDefaultEditor, visTypeTimeseries, discover, data | - | | | dataViews, visTypeTimeseries, maps, data | - | | | dataViews, visualizations, dashboard, lens | - | -| | dataViews, upgradeAssistant, dashboard, visualizations, discover, visTypeTimeseries, observability, dataVisualizer, transform, lens, ux, savedObjects, dataViewFieldEditor, dataViewEditor, graph, stackAlerts, uptime, maps, inputControlVis, visDefaultEditor, visTypeVega, data | - | +| | dataViews, upgradeAssistant, dashboard, visualizations, discover, visTypeTimeseries, observability, dataVisualizer, transform, lens, maps, ux, savedObjects, dataViewEditor, graph, stackAlerts, uptime, inputControlVis, visDefaultEditor, visTypeVega, dataViewFieldEditor, data | - | | | dataViews, maps | - | | | dataViewManagement, dataViews | - | | | visTypeTimeseries, graph, dataViewManagement, dataViews | - | | | dataViews, dataViewManagement | - | | | dataViews, transform, canvas, discover | - | -| | dataViews, dataVisualizer, lens, dataViewEditor, maps, inputControlVis, visDefaultEditor, visTypeTimeseries, discover | - | -| | dataViews, upgradeAssistant, dashboard, visualizations, discover, visTypeTimeseries, observability, dataVisualizer, transform, lens, ux, savedObjects, dataViewFieldEditor, dataViewEditor, graph, stackAlerts, uptime, maps, inputControlVis, visDefaultEditor, visTypeVega | - | +| | dataViews, dataVisualizer, lens, maps, dataViewEditor, inputControlVis, visDefaultEditor, visTypeTimeseries, discover | - | +| | dataViews, upgradeAssistant, dashboard, visualizations, discover, visTypeTimeseries, observability, dataVisualizer, transform, lens, maps, ux, savedObjects, dataViewEditor, graph, stackAlerts, uptime, inputControlVis, visDefaultEditor, visTypeVega, dataViewFieldEditor | - | | | dataViews, visTypeTimeseries, maps | - | | | dataViews, maps | - | | | dataViewManagement, dataViews | - | | | visTypeTimeseries, graph, dataViewManagement, dataViews | - | | | dataViews, dataViewManagement | - | | | discover, visualizations, lens, maps, fileUpload, dataVisualizer, infra, graph, monitoring, securitySolution, stackAlerts, transform, uptime, inputControlVis, visTypeTimelion, visTypeTimeseries, visTypeVega, savedObjects | - | -| | fleet, dataViewFieldEditor, discover, dashboard, lens, stackAlerts, visTypeTable, visTypeTimeseries, visTypeXy, visTypeVislib, expressionPartitionVis | - | +| | discover, dashboard, lens, stackAlerts, visTypeTable, visTypeTimeseries, visTypeXy, visTypeVislib, dataViewFieldEditor, expressionPartitionVis | - | | | visTypeTimeseries | - | | | visTypeTimeseries, graph, dataViewManagement | - | | | data, lens, visTypeTimeseries, infra, maps, visTypeTimelion | - | | | maps | - | +| | dashboard, maps | - | | | visualizations, dashboard, maps, graph | - | | | visualizations, dashboard, lens, maps, ml, securitySolution, security | - | -| | observability, osquery | - | +| | lens, dashboard, maps | - | | | visualizations, dashboard, lens | - | | | savedObjectsTaggingOss, visualizations, dashboard, lens | - | -| | lens, dashboard | - | | | embeddable, presentationUtil, discover, dashboard, graph | - | -| | spaces, security, actions, alerting, ml, fleet, remoteClusters, graph, indexLifecycleManagement, mapsEms, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | - | +| | spaces, security, actions, alerting, ml, remoteClusters, graph, indexLifecycleManagement, mapsEms, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | - | | | dashboard | - | | | discover | - | | | discover | - | | | data, discover, embeddable | - | | | advancedSettings, discover | - | | | advancedSettings, discover | - | -| | dataVisualizer | - | -| | dataVisualizer | - | | | visTypeVega | - | | | monitoring, visTypeVega | - | | | monitoring, kibanaUsageCollection | - | @@ -78,36 +76,34 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | apm, security, securitySolution | - | | | encryptedSavedObjects, actions, cloud, ml, dataEnhanced, logstash, securitySolution | - | | | securitySolution | - | -| | security, fleet | - | -| | security, fleet | - | -| | security, fleet | - | -| | security, licenseManagement, ml, fleet, apm, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | - | -| | management, fleet, security, kibanaOverview | - | -| | fleet | - | | | actions, alerting | - | | | cloud, apm | - | +| | security, licenseManagement, ml, apm, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | - | | | dataViewManagement | - | | | dataViewManagement | - | | | actions, ml, enterpriseSearch, savedObjectsTagging | - | | | visTypePie | - | | | visTypePie | - | +| | security, fleet | - | | | security | - | +| | security, fleet | - | +| | security, fleet | - | | | security | - | +| | management, fleet, security, kibanaOverview | - | +| | fleet | - | | | ml | - | | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | | | mapsEms | - | | | console | - | | | discover, maps, inputControlVis | 8.1 | -| | discover, dashboardEnhanced, discoverEnhanced, maps | 8.1 | -| | discover, dashboard, dashboardEnhanced, discoverEnhanced, urlDrilldown, inputControlVis, maps | 8.1 | -| | discover, dashboard, dashboardEnhanced, discoverEnhanced, urlDrilldown, inputControlVis, maps | 8.1 | +| | discover, discoverEnhanced, maps | 8.1 | +| | dashboard, discoverEnhanced, urlDrilldown, inputControlVis, discover, maps | 8.1 | +| | dashboard, discoverEnhanced, urlDrilldown, inputControlVis, discover, maps | 8.1 | | | discover, maps, inputControlVis | 8.1 | -| | discover, dashboard, dashboardEnhanced, discoverEnhanced, urlDrilldown, inputControlVis, maps | 8.1 | +| | dashboard, discoverEnhanced, urlDrilldown, inputControlVis, discover, maps | 8.1 | | | apm, graph, stackAlerts | 8.1 | | | stackAlerts | 8.1 | -| | dashboardEnhanced | 8.1 | -| | dashboardEnhanced | 8.1 | | | discoverEnhanced | 8.1 | | | discoverEnhanced | 8.1 | | | alerting, dataEnhanced | 8.1 | @@ -127,7 +123,6 @@ Safe to remove. | ---------------|------------| | | data | | | data | -| | data | | | data | | | data | | | data | @@ -135,9 +130,9 @@ Safe to remove. | | data | | | data | | | data | -| | data | | | data | | | data | +| | data | | | data | | | data | | | data | @@ -146,7 +141,6 @@ Safe to remove. | | data | | | data | | | data | -| | data | | | data | | | data | | | data | @@ -164,6 +158,7 @@ Safe to remove. | | data | | | data | | | data | +| | data | | | data | | | data | | | data | @@ -185,14 +180,10 @@ Safe to remove. | | data | | | data | | | data | -| | data | -| | data | -| | data | | | data | | | data | | | data | | | data | -| | data | | | expressions | | | expressions | | | expressions | @@ -206,6 +197,10 @@ Safe to remove. | | licensing | | | licensing | | | licensing | +| | reporting | +| | reporting | +| | reporting | +| | reporting | | | taskManager | | | core | | | core | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 9aac5a24121eb..b71f930504c21 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin summary: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- @@ -104,15 +104,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern) | - | +| | [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [use_dashboard_app_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts#:~:text=IndexPattern), [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [use_dashboard_app_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts#:~:text=IndexPattern) | - | | | [export_csv_action.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/export_csv_action.tsx#:~:text=fieldFormats) | - | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 5 more | 8.1 | | | [load_saved_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts#:~:text=ensureDefaultDataView), [load_saved_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts#:~:text=ensureDefaultDataView) | - | -| | [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern) | - | +| | [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [use_dashboard_app_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts#:~:text=IndexPattern), [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [use_dashboard_app_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts#:~:text=IndexPattern) | - | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 5 more | 8.1 | -| | [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern) | - | +| | [load_saved_dashboard_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/lib/load_saved_dashboard_state.d.ts#:~:text=IndexPattern), [use_dashboard_app_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/target/types/public/application/hooks/use_dashboard_app_state.d.ts#:~:text=IndexPattern) | - | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 5 more | 8.1 | | | [load_saved_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts#:~:text=ensureDefaultDataView) | - | +| | [kibana_react.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/kibana_react.ts#:~:text=ExitFullScreenButton), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=ExitFullScreenButton), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=ExitFullScreenButton), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=ExitFullScreenButton) | - | | | [saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/top_nav/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/top_nav/save_modal.tsx#:~:text=SavedObjectSaveModal) | - | | | [saved_object_loader.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_object_loader.ts#:~:text=SavedObject), [saved_object_loader.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_object_loader.ts#:~:text=SavedObject), [saved_object_loader.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_object_loader.ts#:~:text=SavedObject), [saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#:~:text=SavedObject), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=SavedObject), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=SavedObject), [dashboard_tagging.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts#:~:text=SavedObject), [dashboard_tagging.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts#:~:text=SavedObject), [clone_panel_action.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#:~:text=SavedObject), [clone_panel_action.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#:~:text=SavedObject)+ 1 more | - | | | [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=SavedObjectClass) | - | @@ -122,19 +123,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex -## dashboardEnhanced - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=esFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=esFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=esFilters) | 8.1 | -| | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters) | 8.1 | -| | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter) | 8.1 | -| | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter) | 8.1 | -| | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters) | 8.1 | -| | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter) | 8.1 | - - - ## data | Deprecated API | Reference location(s) | Remove By | @@ -185,10 +173,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | -| | [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_editor_context.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=fieldFormats), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=fieldFormats) | - | -| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | -| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | +| | [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | +| | [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=fieldFormats) | - | +| | [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | +| | [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | @@ -255,8 +243,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [saved_search_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts#:~:text=IndexPattern), [saved_search_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts#:~:text=IndexPattern), [saved_search_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts#:~:text=IndexPattern), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPattern), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPattern), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern)+ 44 more | - | | | [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_data_row.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/types/field_data_row.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPatternField), [grid_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx#:~:text=IndexPatternField), [grid_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx#:~:text=IndexPatternField)+ 5 more | - | | | [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [geo_point_content_with_map.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [index_based_expanded_row.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx#:~:text=IndexPattern), [saved_search_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts#:~:text=IndexPattern), [saved_search_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts#:~:text=IndexPattern), [saved_search_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts#:~:text=IndexPattern), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPattern), [search_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx#:~:text=IndexPattern), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern)+ 17 more | - | -| | [results_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx#:~:text=DiscoverUrlGeneratorState), [results_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx#:~:text=DiscoverUrlGeneratorState), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=DiscoverUrlGeneratorState), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=DiscoverUrlGeneratorState) | - | -| | [results_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx#:~:text=DISCOVER_APP_URL_GENERATOR), [results_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx#:~:text=DISCOVER_APP_URL_GENERATOR), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=DISCOVER_APP_URL_GENERATOR), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=DISCOVER_APP_URL_GENERATOR) | - | @@ -271,18 +257,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | | | [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=indexPatterns) | - | | | [histogram.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/chart/histogram.tsx#:~:text=fieldFormats) | - | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [use_navigation_props.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_navigation_props.tsx#:~:text=esFilters), [use_navigation_props.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_navigation_props.tsx#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=esFilters)+ 17 more | 8.1 | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 24 more | 8.1 | +| | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=esFilters), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=esFilters) | 8.1 | +| | [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter) | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=IndexPatternAttributes), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=IndexPatternAttributes), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 4 more | - | | | [discover_field_visualize_inner.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize_inner.tsx#:~:text=IndexPatternField), [discover_field_visualize_inner.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize_inner.tsx#:~:text=IndexPatternField), [fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/__stories__/fields.ts#:~:text=IndexPatternField), [fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/__stories__/fields.ts#:~:text=IndexPatternField), [discover_field_visualize_inner.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize_inner.tsx#:~:text=IndexPatternField), [discover_field_visualize_inner.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize_inner.tsx#:~:text=IndexPatternField), [fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/__stories__/fields.ts#:~:text=IndexPatternField), [fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/__stories__/fields.ts#:~:text=IndexPatternField) | - | | | [use_discover_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts#:~:text=IndexPattern), [use_discover_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts#:~:text=IndexPattern) | - | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 24 more | 8.1 | +| | [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter) | 8.1 | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=IndexPatternAttributes), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=IndexPatternAttributes), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=IndexPatternAttributes) | - | | | [discover_field_visualize_inner.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize_inner.tsx#:~:text=IndexPatternField), [discover_field_visualize_inner.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize_inner.tsx#:~:text=IndexPatternField), [fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/__stories__/fields.ts#:~:text=IndexPatternField), [fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/__stories__/fields.ts#:~:text=IndexPatternField) | - | | | [use_discover_state.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/use_discover_state.d.ts#:~:text=IndexPattern) | - | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 24 more | 8.1 | +| | [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter) | 8.1 | | | [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal), [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal) | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/search_embeddable_factory.ts#:~:text=executeTriggerActions), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/embeddable/search_embeddable_factory.d.ts#:~:text=executeTriggerActions) | - | | | [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | @@ -348,14 +334,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx#:~:text=fieldFormats) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#:~:text=disabled) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#:~:text=disabled) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#:~:text=disabled) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/plugin.ts#:~:text=license%24) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#:~:text=license%24) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/integrations/index.tsx#:~:text=appBasePath), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/index.tsx#:~:text=appBasePath), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/public/applications/fleet/index.d.ts#:~:text=appBasePath), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/public/applications/integrations/index.d.ts#:~:text=appBasePath) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#:~:text=AsyncPlugin) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/integrations/index.tsx#:~:text=appBasePath), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/public/applications/fleet/index.d.ts#:~:text=appBasePath), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/public/applications/integrations/index.d.ts#:~:text=appBasePath) | - | +| | [plugin.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#:~:text=AsyncPlugin) | - | @@ -487,28 +470,30 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | ---------------|-----------|-----------| | | [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | -| | [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern)+ 4 more | - | -| | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 130 more | - | +| | [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [percentile_agg_field.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts#:~:text=IndexPattern), [percentile_agg_field.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts#:~:text=IndexPattern), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=IndexPattern), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_source.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts#:~:text=IndexPattern), [es_source.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts#:~:text=IndexPattern)+ 82 more | - | +| | [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 194 more | - | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | | | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/kibana_services.ts#:~:text=indexPatterns) | - | | | [locators.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/locators.test.ts#:~:text=esFilters), [locators.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/locators.test.ts#:~:text=esFilters) | 8.1 | -| | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter) | 8.1 | +| | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter) | 8.1 | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | -| | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 130 more | - | +| | [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 194 more | - | | | [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | -| | [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern)+ 4 more | - | +| | [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [percentile_agg_field.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts#:~:text=IndexPattern), [percentile_agg_field.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts#:~:text=IndexPattern), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=IndexPattern), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_source.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts#:~:text=IndexPattern), [es_source.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts#:~:text=IndexPattern)+ 82 more | - | | | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | -| | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter) | 8.1 | +| | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter) | 8.1 | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | -| | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 60 more | - | -| | [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [percentile_agg_field.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern), [get_docvalue_source_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts#:~:text=IndexPattern) | - | +| | [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 92 more | - | +| | [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [percentile_agg_field.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts#:~:text=IndexPattern), [percentile_agg_field.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts#:~:text=IndexPattern), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=IndexPattern), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_tooltip_property.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts#:~:text=IndexPattern), [es_source.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts#:~:text=IndexPattern), [es_source.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts#:~:text=IndexPattern)+ 36 more | - | | | [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | -| | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter) | 8.1 | +| | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter) | 8.1 | | | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=indexPatternsServiceFactory), [indexing_routes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/indexing_routes.ts#:~:text=indexPatternsServiceFactory) | - | +| | [map_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx#:~:text=ExitFullScreenButton), [map_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx#:~:text=ExitFullScreenButton) | - | | | [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings), [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings), [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings) | - | | | [render_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/render_app.tsx#:~:text=onAppLeave), [map_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx#:~:text=onAppLeave), [map_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/map_page.tsx#:~:text=onAppLeave), [render_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/render_app.d.ts#:~:text=onAppLeave), [map_page.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_page.d.ts#:~:text=onAppLeave), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=onAppLeave) | - | +| | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts#:~:text=warning) | - | @@ -555,15 +540,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract), [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract), [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract), [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract) | - | | | [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern)+ 34 more | - | | | [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern)+ 12 more | - | -| | [use_discover_link.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_discover_link.tsx#:~:text=urlGenerator) | - | - - - -## osquery - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [pack_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx#:~:text=urlGenerator), [use_discover_link.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx#:~:text=urlGenerator) | - | @@ -822,16 +798,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService)+ 44 more | - | -| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 76 more | - | +| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 62 more | - | | | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField)+ 2 more | - | | | [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=indexPatterns), [combo_box_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx#:~:text=indexPatterns), [query_bar_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/query_bar_wrapper.tsx#:~:text=indexPatterns), [annotation_row.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/annotation_row.tsx#:~:text=indexPatterns), [metrics_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/metrics_type.ts#:~:text=indexPatterns), [metrics_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/metrics_type.ts#:~:text=indexPatterns), [convert_series_to_datatable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.ts#:~:text=indexPatterns), [timeseries_visualization.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/timeseries_visualization.tsx#:~:text=indexPatterns), [metrics_type.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/metrics_type.test.ts#:~:text=indexPatterns) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/plugin.ts#:~:text=fieldFormats) | - | | | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField)+ 2 more | - | | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService)+ 44 more | - | -| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 76 more | - | +| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 62 more | - | | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | - | | | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField) | - | -| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 33 more | - | +| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 26 more | - | | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService)+ 44 more | - | | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/plugin.ts#:~:text=fieldFormats) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index ca9516ce85df8..14a6f5f1707d7 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -3,7 +3,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team summary: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. --- @@ -24,16 +24,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 13 more | 8.2 | | dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 66 more | 8.2 | | dataViews | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 13 more | 8.2 | -| dashboardEnhanced | | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=esFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=esFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=esFilters) | 8.1 | -| dashboardEnhanced | | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters) | 8.1 | -| dashboardEnhanced | | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | -| dashboardEnhanced | | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | -| dashboardEnhanced | | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=isFilters) | 8.1 | -| dashboardEnhanced | | [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [embeddable_to_dashboard_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | | dataEnhanced | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode)+ 2 more | 8.1 | | dataEnhanced | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode)+ 2 more | 8.1 | | dataEnhanced | | [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=nodeBuilder), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=nodeBuilder), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=nodeBuilder)+ 2 more | 8.1 | | dataEnhanced | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/types.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [get_search_session_page.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [check_non_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode), [expire_persisted_sessions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts#:~:text=KueryNode)+ 2 more | 8.1 | +| urlDrilldown | | [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | +| urlDrilldown | | [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | +| urlDrilldown | | [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [context_variables.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [url_drilldown.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter), [data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts#:~:text=Filter) | 8.1 | @@ -43,11 +40,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | --------|-------|-----------|-----------| | graph | | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery) | 8.1 | | discover | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | -| discover | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [use_navigation_props.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_navigation_props.tsx#:~:text=esFilters), [use_navigation_props.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_navigation_props.tsx#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=esFilters)+ 19 more | 8.1 | -| discover | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 29 more | 8.1 | -| discover | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 29 more | 8.1 | +| discover | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=esFilters), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=esFilters), [explore_data_chart_action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts#:~:text=esFilters), [explore_data_chart_action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts#:~:text=esFilters) | 8.1 | +| discover | | [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [explore_data_context_menu_action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts#:~:text=Filter)+ 4 more | 8.1 | +| discover | | [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [explore_data_context_menu_action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts#:~:text=Filter)+ 4 more | 8.1 | | discover | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | -| discover | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 29 more | 8.1 | +| discover | | [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [context_state.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/context_state.test.ts#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [context.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/context/services/context.d.ts#:~:text=Filter), [explore_data_context_menu_action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts#:~:text=Filter)+ 4 more | 8.1 | | discoverEnhanced | | [explore_data_chart_action.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts#:~:text=RangeFilter), [explore_data_chart_action.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts#:~:text=RangeFilter) | 8.1 | | discoverEnhanced | | [explore_data_chart_action.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts#:~:text=RangeFilter), [explore_data_chart_action.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts#:~:text=RangeFilter) | 8.1 | @@ -59,10 +56,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | --------|-------|-----------|-----------| | maps | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | | maps | | [locators.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/locators.test.ts#:~:text=esFilters), [locators.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/locators.test.ts#:~:text=esFilters) | 8.1 | -| maps | | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter) | 8.1 | -| maps | | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter) | 8.1 | +| maps | | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter) | 8.1 | +| maps | | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter) | 8.1 | | maps | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | -| maps | | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter) | 8.1 | +| maps | | [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [can_skip_fetch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter), [map_app.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts#:~:text=Filter) | 8.1 | diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 1e6820b976fc6..895d0b0f655fd 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github summary: API docs for the devTools plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/discover.devdocs.json b/api_docs/discover.devdocs.json index a842dc1e03fcc..37bf36e243699 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -482,262 +482,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "DiscoverUrlGeneratorState", - "description": [], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": true, - "references": [ - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" - } - ], - "children": [ - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.savedSearchId", - "type": "string", - "tags": [], - "label": "savedSearchId", - "description": [ - "\nOptionally set saved search ID." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.indexPatternId", - "type": "string", - "tags": [], - "label": "indexPatternId", - "description": [ - "\nOptionally set index pattern ID." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.timeRange", - "type": "Object", - "tags": [], - "label": "timeRange", - "description": [ - "\nOptionally set the time range in the time picker." - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - " | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.refreshInterval", - "type": "Object", - "tags": [], - "label": "refreshInterval", - "description": [ - "\nOptionally set the refresh interval." - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - " | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [ - "\nOptionally apply filters." - ], - "signature": [ - "Filter", - "[] | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.query", - "type": "Object", - "tags": [], - "label": "query", - "description": [ - "\nOptionally set a query. NOTE: if given and used in conjunction with `dashboardId`, and the\nsaved dashboard has a query saved with it, this will _replace_ that query." - ], - "signature": [ - "Query", - " | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.useHash", - "type": "CompoundType", - "tags": [], - "label": "useHash", - "description": [ - "\nIf not given, will use the uiSettings configuration for `storeInSessionStorage`. useHash determines\nwhether to hash the data in the url to avoid url length issues." - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.searchSessionId", - "type": "string", - "tags": [], - "label": "searchSessionId", - "description": [ - "\nBackground search session id" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.columns", - "type": "Array", - "tags": [], - "label": "columns", - "description": [ - "\nColumns displayed in the table" - ], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.interval", - "type": "string", - "tags": [], - "label": "interval", - "description": [ - "\nUsed interval of the histogram" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.sort", - "type": "Array", - "tags": [], - "label": "sort", - "description": [ - "\nArray of the used sorting [[field,direction],...]" - ], - "signature": [ - "string[][] | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.savedQuery", - "type": "string", - "tags": [], - "label": "savedQuery", - "description": [ - "\nid of the used saved query" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.viewMode", - "type": "CompoundType", - "tags": [], - "label": "viewMode", - "description": [], - "signature": [ - "VIEW_MODE", - " | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - }, - { - "parentPluginId": "discover", - "id": "def-public.DiscoverUrlGeneratorState.hideAggregatedPreview", - "type": "CompoundType", - "tags": [], - "label": "hideAggregatedPreview", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "discover", "id": "def-public.ISearchEmbeddable", @@ -1329,40 +1073,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "discover", - "id": "def-public.DISCOVER_APP_URL_GENERATOR", - "type": "string", - "tags": [ - "deprecated" - ], - "label": "DISCOVER_APP_URL_GENERATOR", - "description": [], - "signature": [ - "\"DISCOVER_APP_URL_GENERATOR\"" - ], - "path": "src/plugins/discover/public/url_generator.ts", - "deprecated": true, - "references": [ - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" - }, - { - "plugin": "dataVisualizer", - "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" - } - ], - "initialIsOpen": false - }, { "parentPluginId": "discover", "id": "def-public.DiscoverAppLocator", @@ -1471,42 +1181,6 @@ "path": "src/plugins/discover/public/plugin.tsx", "deprecated": false, "children": [ - { - "parentPluginId": "discover", - "id": "def-public.DiscoverStart.urlGenerator", - "type": "Object", - "tags": [ - "deprecated" - ], - "label": "urlGenerator", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorContract", - "text": "UrlGeneratorContract" - }, - "<\"DISCOVER_APP_URL_GENERATOR\"> | undefined" - ], - "path": "src/plugins/discover/public/plugin.tsx", - "deprecated": true, - "references": [ - { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_discover_link.tsx" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx" - }, - { - "plugin": "osquery", - "path": "x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx" - } - ] - }, { "parentPluginId": "discover", "id": "def-public.DiscoverStart.locator", @@ -1548,6 +1222,20 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "discover", + "id": "def-common.APP_ID", + "type": "string", + "tags": [], + "label": "APP_ID", + "description": [], + "signature": [ + "\"discover\"" + ], + "path": "src/plugins/discover/common/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "discover", "id": "def-common.CONTEXT_DEFAULT_SIZE_SETTING", diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 55432ba1f4b9c..5295ea65340d1 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github summary: API docs for the discover plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-disco | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 93 | 0 | 65 | 7 | +| 77 | 0 | 61 | 7 | ## Client diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 3f3b44e44ec55..0106c5f2b9f3f 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the discoverEnhanced plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/elastic_apm_synthtrace.mdx b/api_docs/elastic_apm_synthtrace.mdx index d5fdbe2cbf708..4673509bf632a 100644 --- a/api_docs/elastic_apm_synthtrace.mdx +++ b/api_docs/elastic_apm_synthtrace.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/elastic-apm-synthtrace title: "@elastic/apm-synthtrace" image: https://source.unsplash.com/400x175/?github summary: API docs for the @elastic/apm-synthtrace plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-synthtrace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/elastic_datemath.mdx b/api_docs/elastic_datemath.mdx index 6c3e950ece95f..d82dbbd595e47 100644 --- a/api_docs/elastic_datemath.mdx +++ b/api_docs/elastic_datemath.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/elastic-datemath title: "@elastic/datemath" image: https://source.unsplash.com/400x175/?github summary: API docs for the @elastic/datemath plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/datemath'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 36bf7d9bf5c68..2e114a9c58a69 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -287,9 +287,7 @@ "label": "reportUiCounter", "description": [], "signature": [ - "((appName: string, type: ", - "UiCounterMetricType", - ", eventNames: string | string[], count?: number | undefined) => void) | undefined" + "((appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void) | undefined" ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_action.ts", "deprecated": false, @@ -5204,9 +5202,7 @@ "section": "def-public.NotificationsStart", "text": "NotificationsStart" }, - "; SavedObjectFinder: React.ComponentType; showCreateNewMenu?: boolean | undefined; reportUiCounter?: ((appName: string, type: ", - "UiCounterMetricType", - ", eventNames: string | string[], count?: number | undefined) => void) | undefined; theme: ", + "; SavedObjectFinder: React.ComponentType; showCreateNewMenu?: boolean | undefined; reportUiCounter?: ((appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void) | undefined; theme: ", { "pluginId": "core", "scope": "public", @@ -5493,9 +5489,7 @@ "label": "reportUiCounter", "description": [], "signature": [ - "((appName: string, type: ", - "UiCounterMetricType", - ", eventNames: string | string[], count?: number | undefined) => void) | undefined" + "((appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void) | undefined" ], "path": "src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/open_add_panel_flyout.tsx", "deprecated": false diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 9280c19746734..2b941ad5280c7 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github summary: API docs for the embeddable plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 354cfc6def55c..8ae2bb846b988 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the embeddableEnhanced plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 70e712a3db5dd..eb871c7201ce9 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the encryptedSavedObjects plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index cce7f38777bbc..f1aafa68afd5a 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the enterpriseSearch plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 8e8abb63f697f..c2604395841a5 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github summary: API docs for the esUiShared plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/event_log.devdocs.json b/api_docs/event_log.devdocs.json index d7c3221ead97b..aa6cf99efe5ad 100644 --- a/api_docs/event_log.devdocs.json +++ b/api_docs/event_log.devdocs.json @@ -893,7 +893,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; error?: Readonly<{ message?: string | undefined; type?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: number | undefined; total_indexing_duration_ms?: number | undefined; total_search_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; space_ids?: string[] | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; outcome?: string | undefined; url?: string | undefined; original?: string | undefined; duration?: number | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; dataset?: string | undefined; severity?: number | undefined; created?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" + "(Readonly<{ user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; error?: Readonly<{ message?: string | undefined; type?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: number | undefined; number_of_searches?: number | undefined; total_indexing_duration_ms?: number | undefined; es_search_duration_ms?: number | undefined; total_search_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; space_ids?: string[] | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; outcome?: string | undefined; url?: string | undefined; original?: string | undefined; duration?: number | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; dataset?: string | undefined; severity?: number | undefined; created?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined)[]" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false @@ -912,7 +912,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial | undefined; message?: string | undefined; error?: Readonly<{ message?: string | undefined; type?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: number | undefined; total_indexing_duration_ms?: number | undefined; total_search_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; space_ids?: string[] | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; outcome?: string | undefined; url?: string | undefined; original?: string | undefined; duration?: number | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; dataset?: string | undefined; severity?: number | undefined; created?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" + "DeepPartial | undefined; message?: string | undefined; error?: Readonly<{ message?: string | undefined; type?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: number | undefined; number_of_searches?: number | undefined; total_indexing_duration_ms?: number | undefined; es_search_duration_ms?: number | undefined; total_search_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; space_ids?: string[] | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; outcome?: string | undefined; url?: string | undefined; original?: string | undefined; duration?: number | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; dataset?: string | undefined; severity?: number | undefined; created?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -926,7 +926,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; error?: Readonly<{ message?: string | undefined; type?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: number | undefined; total_indexing_duration_ms?: number | undefined; total_search_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; space_ids?: string[] | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; outcome?: string | undefined; url?: string | undefined; original?: string | undefined; duration?: number | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; dataset?: string | undefined; severity?: number | undefined; created?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" + "Readonly<{ user?: Readonly<{ name?: string | undefined; } & {}> | undefined; message?: string | undefined; error?: Readonly<{ message?: string | undefined; type?: string | undefined; id?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; tags?: string[] | undefined; kibana?: Readonly<{ alert?: Readonly<{ rule?: Readonly<{ execution?: Readonly<{ status?: string | undefined; metrics?: Readonly<{ number_of_triggered_actions?: number | undefined; number_of_searches?: number | undefined; total_indexing_duration_ms?: number | undefined; es_search_duration_ms?: number | undefined; total_search_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; } & {}> | undefined; uuid?: string | undefined; status_order?: number | undefined; } & {}> | undefined; } & {}> | undefined; } & {}> | undefined; version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ id?: string | undefined; scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; space_ids?: string[] | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; rule?: Readonly<{ id?: string | undefined; description?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; outcome?: string | undefined; url?: string | undefined; original?: string | undefined; duration?: number | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; hash?: string | undefined; dataset?: string | undefined; severity?: number | undefined; created?: string | undefined; ingested?: string | undefined; module?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; } & {}> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index cf9e1a8537912..34fe15801fc5c 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github summary: API docs for the eventLog plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,7 +12,7 @@ import eventLogObj from './event_log.devdocs.json'; -Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) for questions regarding this plugin. +Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 3771b9bde60b7..383d917b5c625 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionError plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_gauge.devdocs.json b/api_docs/expression_gauge.devdocs.json index 23b99f9dfb25b..0fb3ff94df9ab 100644 --- a/api_docs/expression_gauge.devdocs.json +++ b/api_docs/expression_gauge.devdocs.json @@ -3,76 +3,6 @@ "client": { "classes": [], "functions": [ - { - "parentPluginId": "expressionGauge", - "id": "def-public.GaugeIconHorizontal", - "type": "Function", - "tags": [], - "label": "GaugeIconHorizontal", - "description": [], - "signature": [ - "({ title, titleId, ...props }: Omit<", - "EuiIconProps", - ", \"type\">) => JSX.Element" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/gauge_icon.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "expressionGauge", - "id": "def-public.GaugeIconHorizontal.$1", - "type": "Object", - "tags": [], - "label": "{ title, titleId, ...props }", - "description": [], - "signature": [ - "Omit<", - "EuiIconProps", - ", \"type\">" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/gauge_icon.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "expressionGauge", - "id": "def-public.GaugeIconVertical", - "type": "Function", - "tags": [], - "label": "GaugeIconVertical", - "description": [], - "signature": [ - "({ title, titleId, ...props }: Omit<", - "EuiIconProps", - ", \"type\">) => JSX.Element" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/gauge_icon.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "expressionGauge", - "id": "def-public.GaugeIconVertical.$1", - "type": "Object", - "tags": [], - "label": "{ title, titleId, ...props }", - "description": [], - "signature": [ - "Omit<", - "EuiIconProps", - ", \"type\">" - ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/gauge_icon.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "expressionGauge", "id": "def-public.getGoalValue", @@ -89,9 +19,17 @@ "section": "def-common.DatatableRow", "text": "DatatableRow" }, - " | undefined, state?: GaugeAccessorsType | undefined) => any" + " | undefined, accessors?: ", + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.Accessors", + "text": "Accessors" + }, + " | undefined) => any" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "children": [ { @@ -111,7 +49,7 @@ }, " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false }, @@ -120,12 +58,19 @@ "id": "def-public.getGoalValue.$2", "type": "Object", "tags": [], - "label": "state", + "label": "accessors", "description": [], "signature": [ - "GaugeAccessorsType | undefined" + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.Accessors", + "text": "Accessors" + }, + " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false } @@ -149,9 +94,17 @@ "section": "def-common.DatatableRow", "text": "DatatableRow" }, - " | undefined, state?: GaugeAccessorsType | undefined) => number" + " | undefined, accessors?: ", + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.Accessors", + "text": "Accessors" + }, + " | undefined) => number" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "children": [ { @@ -171,7 +124,7 @@ }, " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false }, @@ -180,12 +133,19 @@ "id": "def-public.getMaxValue.$2", "type": "Object", "tags": [], - "label": "state", + "label": "accessors", "description": [], "signature": [ - "GaugeAccessorsType | undefined" + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.Accessors", + "text": "Accessors" + }, + " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false } @@ -209,9 +169,17 @@ "section": "def-common.DatatableRow", "text": "DatatableRow" }, - " | undefined, state?: GaugeAccessorsType | undefined) => any" + " | undefined, accessors?: ", + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.Accessors", + "text": "Accessors" + }, + " | undefined) => any" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "children": [ { @@ -231,7 +199,7 @@ }, " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false }, @@ -240,12 +208,19 @@ "id": "def-public.getMinValue.$2", "type": "Object", "tags": [], - "label": "state", + "label": "accessors", "description": [], "signature": [ - "GaugeAccessorsType | undefined" + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.Accessors", + "text": "Accessors" + }, + " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false } @@ -261,7 +236,7 @@ "label": "getValueFromAccessor", "description": [], "signature": [ - "(accessorName: GaugeAccessors, row?: ", + "(accessor: string, row?: ", { "pluginId": "expressions", "scope": "common", @@ -269,22 +244,22 @@ "section": "def-common.DatatableRow", "text": "DatatableRow" }, - " | undefined, state?: GaugeAccessorsType | undefined) => any" + " | undefined) => any" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "children": [ { "parentPluginId": "expressionGauge", "id": "def-public.getValueFromAccessor.$1", - "type": "CompoundType", + "type": "string", "tags": [], - "label": "accessorName", + "label": "accessor", "description": [], "signature": [ - "GaugeAccessors" + "string" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": true }, @@ -305,23 +280,79 @@ }, " | undefined" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils/accessors.ts", "deprecated": false, "isRequired": false - }, + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "expressionGauge", + "id": "def-public.HorizontalBulletIcon", + "type": "Function", + "tags": [], + "label": "HorizontalBulletIcon", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx", + "deprecated": false, + "children": [ { "parentPluginId": "expressionGauge", - "id": "def-public.getValueFromAccessor.$3", + "id": "def-public.HorizontalBulletIcon.$1", "type": "Object", "tags": [], - "label": "state", + "label": "{ title, titleId, ...props }", "description": [], "signature": [ - "GaugeAccessorsType | undefined" + "Omit<", + "EuiIconProps", + ", \"type\">" ], - "path": "src/plugins/chart_expressions/expression_gauge/public/components/utils.ts", + "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/horizontal_bullet_icon.tsx", "deprecated": false, - "isRequired": false + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "expressionGauge", + "id": "def-public.VerticalBulletIcon", + "type": "Function", + "tags": [], + "label": "VerticalBulletIcon", + "description": [], + "signature": [ + "({ title, titleId, ...props }: Omit<", + "EuiIconProps", + ", \"type\">) => JSX.Element" + ], + "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "expressionGauge", + "id": "def-public.VerticalBulletIcon.$1", + "type": "Object", + "tags": [], + "label": "{ title, titleId, ...props }", + "description": [], + "signature": [ + "Omit<", + "EuiIconProps", + ", \"type\">" + ], + "path": "src/plugins/chart_expressions/expression_gauge/public/components/icons/vertical_bullet_icon.tsx", + "deprecated": false, + "isRequired": true } ], "returnComment": [], @@ -363,6 +394,71 @@ } ], "interfaces": [ + { + "parentPluginId": "expressionGauge", + "id": "def-common.Accessors", + "type": "Interface", + "tags": [], + "label": "Accessors", + "description": [], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "expressionGauge", + "id": "def-common.Accessors.min", + "type": "string", + "tags": [], + "label": "min", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false + }, + { + "parentPluginId": "expressionGauge", + "id": "def-common.Accessors.max", + "type": "string", + "tags": [], + "label": "max", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false + }, + { + "parentPluginId": "expressionGauge", + "id": "def-common.Accessors.metric", + "type": "string", + "tags": [], + "label": "metric", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false + }, + { + "parentPluginId": "expressionGauge", + "id": "def-common.Accessors.goal", + "type": "string", + "tags": [], + "label": "goal", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "expressionGauge", "id": "def-common.ColorStop", @@ -597,7 +693,17 @@ "section": "def-common.GaugeState", "text": "GaugeState" }, - " & { shape: \"horizontalBullet\" | \"verticalBullet\"; colorMode: \"palette\" | \"none\"; palette?: ", + " & { shape: ", + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.GaugeShape", + "text": "GaugeShape" + }, + "; colorMode: ", + "GaugeColorMode", + "; palette?: ", { "pluginId": "charts", "scope": "common", @@ -633,52 +739,84 @@ "children": [ { "parentPluginId": "expressionGauge", - "id": "def-common.GaugeState.metricAccessor", - "type": "string", + "id": "def-common.GaugeState.metric", + "type": "CompoundType", "tags": [], - "label": "metricAccessor", + "label": "metric", "description": [], "signature": [ - "string | undefined" + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false }, { "parentPluginId": "expressionGauge", - "id": "def-common.GaugeState.minAccessor", - "type": "string", + "id": "def-common.GaugeState.min", + "type": "CompoundType", "tags": [], - "label": "minAccessor", + "label": "min", "description": [], "signature": [ - "string | undefined" + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false }, { "parentPluginId": "expressionGauge", - "id": "def-common.GaugeState.maxAccessor", - "type": "string", + "id": "def-common.GaugeState.max", + "type": "CompoundType", "tags": [], - "label": "maxAccessor", + "label": "max", "description": [], "signature": [ - "string | undefined" + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false }, { "parentPluginId": "expressionGauge", - "id": "def-common.GaugeState.goalAccessor", - "type": "string", + "id": "def-common.GaugeState.goal", + "type": "CompoundType", "tags": [], - "label": "goalAccessor", + "label": "goal", "description": [], "signature": [ - "string | undefined" + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false @@ -691,7 +829,7 @@ "label": "ticksPosition", "description": [], "signature": [ - "\"auto\" | \"bands\"" + "\"auto\" | \"hidden\" | \"bands\"" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false @@ -735,6 +873,33 @@ "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false }, + { + "parentPluginId": "expressionGauge", + "id": "def-common.GaugeState.centralMajorMode", + "type": "CompoundType", + "tags": [], + "label": "centralMajorMode", + "description": [], + "signature": [ + "GaugeCentralMajorMode", + " | undefined" + ], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false + }, + { + "parentPluginId": "expressionGauge", + "id": "def-common.GaugeState.centralMajor", + "type": "string", + "tags": [], + "label": "centralMajor", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", + "deprecated": false + }, { "parentPluginId": "expressionGauge", "id": "def-common.GaugeState.colorMode", @@ -743,7 +908,8 @@ "label": "colorMode", "description": [], "signature": [ - "\"palette\" | \"none\" | undefined" + "GaugeColorMode", + " | undefined" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false @@ -784,7 +950,7 @@ "label": "shape", "description": [], "signature": [ - "\"horizontalBullet\" | \"verticalBullet\"" + "\"arc\" | \"circle\" | \"horizontalBullet\" | \"verticalBullet\"" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false @@ -892,7 +1058,17 @@ "section": "def-common.GaugeState", "text": "GaugeState" }, - " & { shape: \"horizontalBullet\" | \"verticalBullet\"; colorMode: \"palette\" | \"none\"; palette?: ", + " & { shape: ", + { + "pluginId": "expressionGauge", + "scope": "common", + "docId": "kibExpressionGaugePluginApi", + "section": "def-common.GaugeShape", + "text": "GaugeShape" + }, + "; colorMode: ", + "GaugeColorMode", + "; palette?: ", { "pluginId": "charts", "scope": "common", @@ -967,7 +1143,7 @@ "label": "GaugeShape", "description": [], "signature": [ - "\"horizontalBullet\" | \"verticalBullet\"" + "\"arc\" | \"circle\" | \"horizontalBullet\" | \"verticalBullet\"" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false, @@ -981,7 +1157,7 @@ "label": "GaugeTicksPosition", "description": [], "signature": [ - "\"auto\" | \"bands\"" + "\"auto\" | \"hidden\" | \"bands\"" ], "path": "src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts", "deprecated": false, @@ -1055,7 +1231,7 @@ "label": "GaugeColorModes", "description": [], "signature": [ - "{ readonly palette: \"palette\"; readonly none: \"none\"; }" + "{ readonly PALETTE: \"palette\"; readonly NONE: \"none\"; }" ], "path": "src/plugins/chart_expressions/expression_gauge/common/constants.ts", "deprecated": false, @@ -1069,7 +1245,7 @@ "label": "GaugeLabelMajorModes", "description": [], "signature": [ - "{ readonly auto: \"auto\"; readonly custom: \"custom\"; readonly none: \"none\"; }" + "{ readonly AUTO: \"auto\"; readonly CUSTOM: \"custom\"; readonly NONE: \"none\"; }" ], "path": "src/plugins/chart_expressions/expression_gauge/common/constants.ts", "deprecated": false, @@ -1083,7 +1259,7 @@ "label": "GaugeShapes", "description": [], "signature": [ - "{ readonly horizontalBullet: \"horizontalBullet\"; readonly verticalBullet: \"verticalBullet\"; }" + "{ readonly HORIZONTAL_BULLET: \"horizontalBullet\"; readonly VERTICAL_BULLET: \"verticalBullet\"; readonly ARC: \"arc\"; readonly CIRCLE: \"circle\"; }" ], "path": "src/plugins/chart_expressions/expression_gauge/common/constants.ts", "deprecated": false, @@ -1097,7 +1273,7 @@ "label": "GaugeTicksPositions", "description": [], "signature": [ - "{ readonly auto: \"auto\"; readonly bands: \"bands\"; }" + "{ readonly HIDDEN: \"hidden\"; readonly AUTO: \"auto\"; readonly BANDS: \"bands\"; }" ], "path": "src/plugins/chart_expressions/expression_gauge/common/constants.ts", "deprecated": false, diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 6696301e4bc44..2abf50d176ff3 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionGauge plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 62 | 0 | 62 | 1 | +| 68 | 0 | 68 | 3 | ## Client diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index fa90a715a7342..22aea3abb63e5 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionHeatmap plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index d673fc8e08c42..6d819ea85996c 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionImage plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index aef334ac07f78..cec75ddec416e 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionMetric plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_metric_vis.devdocs.json b/api_docs/expression_metric_vis.devdocs.json index 5c454d684d08d..5f3dfc7ec873f 100644 --- a/api_docs/expression_metric_vis.devdocs.json +++ b/api_docs/expression_metric_vis.devdocs.json @@ -187,6 +187,38 @@ "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", "deprecated": false }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.labelFont", + "type": "Object", + "tags": [], + "label": "labelFont", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionTypeStyle", + "text": "ExpressionTypeStyle" + } + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.labelPosition", + "type": "CompoundType", + "tags": [], + "label": "labelPosition", + "description": [], + "signature": [ + "\"top\" | \"bottom\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false + }, { "parentPluginId": "expressionMetricVis", "id": "def-common.MetricArguments.metric", @@ -227,6 +259,16 @@ "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", "deprecated": false }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.colorFullBackground", + "type": "boolean", + "tags": [], + "label": "colorFullBackground", + "description": [], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false + }, { "parentPluginId": "expressionMetricVis", "id": "def-common.MetricArguments.autoScale", @@ -381,7 +423,7 @@ { "parentPluginId": "expressionMetricVis", "id": "def-common.MetricVisParam.labels", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "labels", "description": [], @@ -392,7 +434,18 @@ "docId": "kibChartsPluginApi", "section": "def-common.Labels", "text": "Labels" - } + }, + " & { style: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionTypeStyle", + "text": "ExpressionTypeStyle" + }, + "; position: ", + "LabelPositionType", + "; }" ], "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", "deprecated": false @@ -425,6 +478,16 @@ "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", "deprecated": false }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricVisParam.colorFullBackground", + "type": "boolean", + "tags": [], + "label": "colorFullBackground", + "description": [], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", + "deprecated": false + }, { "parentPluginId": "expressionMetricVis", "id": "def-common.MetricVisParam.autoScale", diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 5bee79dab1d4c..beafb155508eb 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionMetricVis plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 42 | 0 | 42 | 0 | +| 46 | 0 | 46 | 1 | ## Common diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index c3dde75d963c9..ed9ab01670968 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionPartitionVis plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 4a60852a160e4..1ae5326e8e5e9 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionRepeatImage plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 23a1e311b2c80..73eecd5468cac 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionRevealImage plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 169c7141854e7..069299b8cd10f 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionShape plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 35cc2b1b3a219..aa8f68f33cd96 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressionTagcloud plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index b82d123b6e7c0..e0d1d8f1d4f41 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github summary: API docs for the expressions plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 51d7619c38d44..e10a65e82387f 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github summary: API docs for the features plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index a3c9f8b458d77..81dcab018752d 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github summary: API docs for the fieldFormats plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index d0162f67adf48..74161484515c0 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github summary: API docs for the fileUpload plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index 42124757b9882..d76f39a27491d 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -2055,6 +2055,40 @@ ], "returnComment": [] }, + { + "parentPluginId": "fleet", + "id": "def-public.pagePathGetters.integration_policy_upgrade", + "type": "Function", + "tags": [], + "label": "integration_policy_upgrade", + "description": [ + "// Upgrades happen on the same edit form, just with a flag set. Separate page record here\n// allows us to set different breadcrumbds for upgrades when needed." + ], + "signature": [ + "({ packagePolicyId }: ", + "DynamicPagePathValues", + ") => [string, string]" + ], + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-public.pagePathGetters.integration_policy_upgrade.$1", + "type": "Object", + "tags": [], + "label": "{ packagePolicyId }", + "description": [], + "signature": [ + "DynamicPagePathValues" + ], + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "fleet", "id": "def-public.pagePathGetters.policies", @@ -4907,25 +4941,6 @@ "path": "x-pack/plugins/fleet/server/plugin.ts", "deprecated": false, "children": [ - { - "parentPluginId": "fleet", - "id": "def-server.FleetSetupDeps.licensing", - "type": "Object", - "tags": [], - "label": "licensing", - "description": [], - "signature": [ - { - "pluginId": "licensing", - "scope": "server", - "docId": "kibLicensingPluginApi", - "section": "def-server.LicensingPluginSetup", - "text": "LicensingPluginSetup" - } - ], - "path": "x-pack/plugins/fleet/server/plugin.ts", - "deprecated": false - }, { "parentPluginId": "fleet", "id": "def-server.FleetSetupDeps.security", @@ -5199,25 +5214,1787 @@ "pluginId": "fleet", "scope": "common", "docId": "kibFleetPluginApi", - "section": "def-common.RegistrySearchResult", - "text": "RegistrySearchResult" + "section": "def-common.RegistryPackage", + "text": "RegistryPackage" + }, + " | ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.BundledPackage", + "text": "BundledPackage" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.fetchFindLatestPackage.$1", + "type": "string", + "tags": [], + "label": "packageName", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.getRegistryPackage", + "type": "Function", + "tags": [], + "label": "getRegistryPackage", + "description": [], + "signature": [ + "(packageName: string, packageVersion: string) => Promise<{ packageInfo: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.RegistryPackage", + "text": "RegistryPackage" + }, + "; paths: string[]; }>" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.getRegistryPackage.$1", + "type": "string", + "tags": [], + "label": "packageName", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.getRegistryPackage.$2", + "type": "string", + "tags": [], + "label": "packageVersion", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.reinstallEsAssets", + "type": "Function", + "tags": [], + "label": "reinstallEsAssets", + "description": [], + "signature": [ + "(packageInfo: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.InstallablePackage", + "text": "InstallablePackage" + }, + ", assetPaths: string[]) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.EsAssetReference", + "text": "EsAssetReference" + }, + "[]>" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.reinstallEsAssets.$1", + "type": "CompoundType", + "tags": [], + "label": "packageInfo", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.InstallablePackage", + "text": "InstallablePackage" + } + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackageClient.reinstallEsAssets.$2", + "type": "Array", + "tags": [], + "label": "assetPaths", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface", + "type": "Interface", + "tags": [], + "label": "PackagePolicyServiceInterface", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", packagePolicy: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + ", options?: { spaceId?: string | undefined; id?: string | undefined; user?: ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined; bumpRevision?: boolean | undefined; force?: boolean | undefined; skipEnsureInstalled?: boolean | undefined; skipUniqueNameVerification?: boolean | undefined; overwrite?: boolean | undefined; } | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$2", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$3", + "type": "Object", + "tags": [], + "label": "packagePolicy", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.spaceId", + "type": "string", + "tags": [], + "label": "spaceId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.user", + "type": "Object", + "tags": [], + "label": "user", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.bumpRevision", + "type": "CompoundType", + "tags": [], + "label": "bumpRevision", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.force", + "type": "CompoundType", + "tags": [], + "label": "force", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.skipEnsureInstalled", + "type": "CompoundType", + "tags": [], + "label": "skipEnsureInstalled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.skipUniqueNameVerification", + "type": "CompoundType", + "tags": [], + "label": "skipUniqueNameVerification", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.create.$4.overwrite", + "type": "CompoundType", + "tags": [], + "label": "overwrite", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate", + "type": "Function", + "tags": [], + "label": "bulkCreate", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", packagePolicies: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + "[], agentPolicyId: string, options?: { user?: ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined; bumpRevision?: boolean | undefined; } | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + "[]>" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$2", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$3", + "type": "Array", + "tags": [], + "label": "packagePolicies", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + "[]" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$4", + "type": "string", + "tags": [], + "label": "agentPolicyId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$5", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$5.user", + "type": "Object", + "tags": [], + "label": "user", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.bulkCreate.$5.bumpRevision", + "type": "CompoundType", + "tags": [], + "label": "bumpRevision", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", id: string) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + " | null>" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.get.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.get.$2", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs", + "type": "Function", + "tags": [], + "label": "getByIDs", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", ids: string[]) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + "[] | null>" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs.$2", + "type": "Array", + "tags": [], + "label": "ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.list", + "type": "Function", + "tags": [], + "label": "list", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", options: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListWithKuery", + "text": "ListWithKuery" + }, + ") => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListResult", + "text": "ListResult" + }, + "<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + ">>" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.list.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.list.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListWithKuery", + "text": "ListWithKuery" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.listIds", + "type": "Function", + "tags": [], + "label": "listIds", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", options: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListWithKuery", + "text": "ListWithKuery" + }, + ") => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListResult", + "text": "ListResult" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.listIds.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.listIds.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListWithKuery", + "text": "ListWithKuery" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", id: string, packagePolicyUpdate: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.UpdatePackagePolicy", + "text": "UpdatePackagePolicy" + }, + ", options?: { user?: ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined; } | undefined, currentVersion?: string | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$2", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$3", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$4", + "type": "Object", + "tags": [], + "label": "packagePolicyUpdate", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.UpdatePackagePolicy", + "text": "UpdatePackagePolicy" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$5", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$5.user", + "type": "Object", + "tags": [], + "label": "user", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.update.$6", + "type": "string", + "tags": [], + "label": "currentVersion", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete", + "type": "Function", + "tags": [], + "label": "delete", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", ids: string[], options?: { user?: ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined; skipUnassignFromAgentPolicies?: boolean | undefined; force?: boolean | undefined; } | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.DeletePackagePoliciesResponse", + "text": "DeletePackagePoliciesResponse" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$2", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$3", + "type": "Array", + "tags": [], + "label": "ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$4", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$4.user", + "type": "Object", + "tags": [], + "label": "user", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$4.skipUnassignFromAgentPolicies", + "type": "CompoundType", + "tags": [], + "label": "skipUnassignFromAgentPolicies", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.delete.$4.force", + "type": "CompoundType", + "tags": [], + "label": "force", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade", + "type": "Function", + "tags": [], + "label": "upgrade", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", esClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ", ids: string[], options?: { user?: ", + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined; } | undefined, packagePolicy?: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + " | undefined, pkgVersion?: string | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.UpgradePackagePolicyResponse", + "text": "UpgradePackagePolicyResponse" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$2", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$3", + "type": "Array", + "tags": [], + "label": "ids", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$4", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$4.user", + "type": "Object", + "tags": [], + "label": "user", + "description": [], + "signature": [ + { + "pluginId": "security", + "scope": "common", + "docId": "kibSecurityPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$5", + "type": "Object", + "tags": [], + "label": "packagePolicy", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.upgrade.$6", + "type": "string", + "tags": [], + "label": "pkgVersion", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getUpgradeDryRunDiff", + "type": "Function", + "tags": [], + "label": "getUpgradeDryRunDiff", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", id: string, packagePolicy?: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + " | undefined, pkgVersion?: string | undefined) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.UpgradePackagePolicyDryRunResponseItem", + "text": "UpgradePackagePolicyDryRunResponseItem" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getUpgradeDryRunDiff.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getUpgradeDryRunDiff.$2", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getUpgradeDryRunDiff.$3", + "type": "Object", + "tags": [], + "label": "packagePolicy", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" + }, + " | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": false + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getUpgradeDryRunDiff.$4", + "type": "string", + "tags": [], + "label": "pkgVersion", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.enrichPolicyWithDefaultsFromPackage", + "type": "Function", + "tags": [], + "label": "enrichPolicyWithDefaultsFromPackage", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", newPolicy: ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + ") => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + ">" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.enrichPolicyWithDefaultsFromPackage.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.enrichPolicyWithDefaultsFromPackage.$2", + "type": "Object", + "tags": [], + "label": "newPolicy", + "description": [], + "signature": [ + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.buildPackagePolicyFromPackage", + "type": "Function", + "tags": [], + "label": "buildPackagePolicyFromPackage", + "description": [], + "signature": [ + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", pkgName: string) => Promise<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + " | undefined>" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.buildPackagePolicyFromPackage.$1", + "type": "Object", + "tags": [], + "label": "soClient", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.buildPackagePolicyFromPackage.$2", + "type": "string", + "tags": [], + "label": "pkgName", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.runExternalCallbacks", + "type": "Function", + "tags": [], + "label": "runExternalCallbacks", + "description": [], + "signature": [ + "(externalCallbackType: A, packagePolicy: A extends \"postPackagePolicyDelete\" ? ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.DeletePackagePoliciesResponse", + "text": "DeletePackagePoliciesResponse" + }, + " : ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + }, + ", context: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + }, + ", request: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ") => Promise" ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "children": [ { "parentPluginId": "fleet", - "id": "def-server.PackageClient.fetchFindLatestPackage.$1", - "type": "string", + "id": "def-server.PackagePolicyServiceInterface.runExternalCallbacks.$1", + "type": "Uncategorized", "tags": [], - "label": "packageName", + "label": "externalCallbackType", "description": [], "signature": [ - "string" + "A" ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.runExternalCallbacks.$2", + "type": "Uncategorized", + "tags": [], + "label": "packagePolicy", + "description": [], + "signature": [ + "A extends \"postPackagePolicyDelete\" ? ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.DeletePackagePoliciesResponse", + "text": "DeletePackagePoliciesResponse" + }, + " : ", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.NewPackagePolicy", + "text": "NewPackagePolicy" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.runExternalCallbacks.$3", + "type": "Object", + "tags": [], + "label": "context", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.RequestHandlerContext", + "text": "RequestHandlerContext" + } + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.runExternalCallbacks.$4", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "isRequired": true } @@ -5226,50 +7003,42 @@ }, { "parentPluginId": "fleet", - "id": "def-server.PackageClient.getRegistryPackage", + "id": "def-server.PackagePolicyServiceInterface.runDeleteExternalCallbacks", "type": "Function", "tags": [], - "label": "getRegistryPackage", + "label": "runDeleteExternalCallbacks", "description": [], "signature": [ - "(packageName: string, packageVersion: string) => Promise<{ packageInfo: ", + "(deletedPackagePolicies: ", { "pluginId": "fleet", "scope": "common", "docId": "kibFleetPluginApi", - "section": "def-common.RegistryPackage", - "text": "RegistryPackage" + "section": "def-common.DeletePackagePoliciesResponse", + "text": "DeletePackagePoliciesResponse" }, - "; paths: string[]; }>" + ") => Promise" ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "children": [ { "parentPluginId": "fleet", - "id": "def-server.PackageClient.getRegistryPackage.$1", - "type": "string", - "tags": [], - "label": "packageName", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "fleet", - "id": "def-server.PackageClient.getRegistryPackage.$2", - "type": "string", + "id": "def-server.PackagePolicyServiceInterface.runDeleteExternalCallbacks.$1", + "type": "Array", "tags": [], - "label": "packageVersion", + "label": "deletedPackagePolicies", "description": [], "signature": [ - "string" + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.DeletePackagePoliciesResponse", + "text": "DeletePackagePoliciesResponse" + } ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "isRequired": true } @@ -5278,64 +7047,72 @@ }, { "parentPluginId": "fleet", - "id": "def-server.PackageClient.reinstallEsAssets", + "id": "def-server.PackagePolicyServiceInterface.getUpgradePackagePolicyInfo", "type": "Function", "tags": [], - "label": "reinstallEsAssets", + "label": "getUpgradePackagePolicyInfo", "description": [], "signature": [ - "(packageInfo: ", + "(soClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + }, + ", id: string) => Promise<{ packagePolicy: ", { "pluginId": "fleet", "scope": "common", "docId": "kibFleetPluginApi", - "section": "def-common.InstallablePackage", - "text": "InstallablePackage" + "section": "def-common.PackagePolicy", + "text": "PackagePolicy" }, - ", assetPaths: string[]) => Promise<", + "; packageInfo: ", { "pluginId": "fleet", "scope": "common", "docId": "kibFleetPluginApi", - "section": "def-common.EsAssetReference", - "text": "EsAssetReference" + "section": "def-common.PackageInfo", + "text": "PackageInfo" }, - "[]>" + "; }>" ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "children": [ { "parentPluginId": "fleet", - "id": "def-server.PackageClient.reinstallEsAssets.$1", - "type": "CompoundType", + "id": "def-server.PackagePolicyServiceInterface.getUpgradePackagePolicyInfo.$1", + "type": "Object", "tags": [], - "label": "packageInfo", + "label": "soClient", "description": [], "signature": [ { - "pluginId": "fleet", - "scope": "common", - "docId": "kibFleetPluginApi", - "section": "def-common.InstallablePackage", - "text": "InstallablePackage" + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" } ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "isRequired": true }, { "parentPluginId": "fleet", - "id": "def-server.PackageClient.reinstallEsAssets.$2", - "type": "Array", + "id": "def-server.PackagePolicyServiceInterface.getUpgradePackagePolicyInfo.$2", + "type": "string", "tags": [], - "label": "assetPaths", + "label": "id", "description": [], "signature": [ - "string[]" + "string" ], - "path": "x-pack/plugins/fleet/server/services/epm/package_service.ts", + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "isRequired": true } @@ -5480,20 +7257,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "fleet", - "id": "def-server.PackagePolicyServiceInterface", - "type": "Type", - "tags": [], - "label": "PackagePolicyServiceInterface", - "description": [], - "signature": [ - "PackagePolicyService" - ], - "path": "x-pack/plugins/fleet/server/services/package_policy.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "fleet", "id": "def-server.PostPackagePolicyCreateCallback", @@ -5899,7 +7662,13 @@ "\nServices for Fleet's package policies" ], "signature": [ - "PackagePolicyService" + { + "pluginId": "fleet", + "scope": "server", + "docId": "kibFleetPluginApi", + "section": "def-server.PackagePolicyServiceInterface", + "text": "PackagePolicyServiceInterface" + } ], "path": "x-pack/plugins/fleet/server/plugin.ts", "deprecated": false @@ -8239,6 +10008,52 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.BundledPackage", + "type": "Interface", + "tags": [], + "label": "BundledPackage", + "description": [], + "path": "x-pack/plugins/fleet/common/types/models/epm.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-common.BundledPackage.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "x-pack/plugins/fleet/common/types/models/epm.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.BundledPackage.version", + "type": "string", + "tags": [], + "label": "version", + "description": [], + "path": "x-pack/plugins/fleet/common/types/models/epm.ts", + "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.BundledPackage.buffer", + "type": "Object", + "tags": [], + "label": "buffer", + "description": [], + "signature": [ + "Buffer" + ], + "path": "x-pack/plugins/fleet/common/types/models/epm.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.CategorySummaryItem", @@ -12845,19 +14660,6 @@ "path": "x-pack/plugins/fleet/common/types/models/output.ts", "deprecated": false }, - { - "parentPluginId": "fleet", - "id": "def-common.NewOutput.api_key", - "type": "string", - "tags": [], - "label": "api_key", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "x-pack/plugins/fleet/common/types/models/output.ts", - "deprecated": false - }, { "parentPluginId": "fleet", "id": "def-common.NewOutput.config_yaml", @@ -14283,6 +16085,29 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.PostLogstashApiKeyResponse", + "type": "Interface", + "tags": [], + "label": "PostLogstashApiKeyResponse", + "description": [], + "path": "x-pack/plugins/fleet/common/types/rest_spec/output.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-common.PostLogstashApiKeyResponse.api_key", + "type": "string", + "tags": [], + "label": "api_key", + "description": [], + "path": "x-pack/plugins/fleet/common/types/rest_spec/output.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.PostNewAgentActionRequest", @@ -16594,7 +18419,7 @@ "section": "def-common.RegistryPackage", "text": "RegistryPackage" }, - ", \"internal\" | \"data_streams\" | \"assets\" | \"readme\">" + ", \"internal\" | \"data_streams\" | \"elasticsearch\" | \"assets\" | \"readme\">" ], "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false, @@ -17087,7 +18912,7 @@ "label": "EnrollmentAPIKeySOAttributes", "description": [], "signature": [ - "{ name?: string | undefined; active: boolean; created_at: string; policy_id?: string | undefined; api_key: string; api_key_id: string; }" + "{ name?: string | undefined; active: boolean; created_at: string; policy_id?: string | undefined; api_key_id: string; api_key: string; }" ], "path": "x-pack/plugins/fleet/common/types/models/enrollment_api_key.ts", "deprecated": false, @@ -17198,6 +19023,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.FLEET_PACKAGES", + "type": "Array", + "tags": [], + "label": "FLEET_PACKAGES", + "description": [], + "signature": [ + "{ name: string; version: string; }[]" + ], + "path": "x-pack/plugins/fleet/common/constants/preconfiguration.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.FLEET_SERVER_ARTIFACTS_INDEX", @@ -17312,7 +19151,7 @@ "section": "def-common.Output", "text": "Output" }, - ", \"type\" | \"hosts\" | \"ca_sha256\" | \"api_key\"> & { [key: string]: any; }" + ", \"type\" | \"hosts\" | \"ca_sha256\"> & { [key: string]: any; }" ], "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", "deprecated": false, @@ -20796,6 +22635,16 @@ "description": [], "path": "x-pack/plugins/fleet/common/constants/routes.ts", "deprecated": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.OUTPUT_API_ROUTES.LOGSTASH_API_KEY_PATTERN", + "type": "string", + "tags": [], + "label": "LOGSTASH_API_KEY_PATTERN", + "description": [], + "path": "x-pack/plugins/fleet/common/constants/routes.ts", + "deprecated": false } ], "initialIsOpen": false diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 32601da708967..1f568ea590a21 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github summary: API docs for the fleet plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1263 | 8 | 1147 | 10 | +| 1349 | 8 | 1232 | 9 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 700f34f5be2b3..f8624c715d520 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github summary: API docs for the globalSearch plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/home.mdx b/api_docs/home.mdx index bbe95667a2714..0528f339d4001 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github summary: API docs for the home plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index b74d8f2b4628d..dd2534b5fda7e 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the indexLifecycleManagement plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index d7d0a6728fdda..4e48dc476769f 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the indexManagement plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 05fbc69fac209..a5e862e78d8a9 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github summary: API docs for the infra plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 2d6a65b046718..a407daf9c283b 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github summary: API docs for the inspector plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 88b0781bebd99..5badcf76a69c7 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github summary: API docs for the interactiveSetup plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 214442ee13ad9..3d2ed640d1466 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ace plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index bfcf60c676903..f3a59546b2e10 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/alerts plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_analytics.devdocs.json b/api_docs/kbn_analytics.devdocs.json index deb67871ae603..338249b503611 100644 --- a/api_docs/kbn_analytics.devdocs.json +++ b/api_docs/kbn_analytics.devdocs.json @@ -356,15 +356,7 @@ "label": "reportUiCounter", "description": [], "signature": [ - "(appName: string, type: ", - { - "pluginId": "@kbn/analytics", - "scope": "common", - "docId": "kibKbnAnalyticsPluginApi", - "section": "def-common.UiCounterMetricType", - "text": "UiCounterMetricType" - }, - ", eventNames: string | string[], count?: number | undefined) => void" + "(appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void" ], "path": "packages/kbn-analytics/src/reporter.ts", "deprecated": false, @@ -386,18 +378,12 @@ { "parentPluginId": "@kbn/analytics", "id": "def-common.Reporter.reportUiCounter.$2", - "type": "CompoundType", + "type": "string", "tags": [], "label": "type", "description": [], "signature": [ - { - "pluginId": "@kbn/analytics", - "scope": "common", - "docId": "kibKbnAnalyticsPluginApi", - "section": "def-common.UiCounterMetricType", - "text": "UiCounterMetricType" - } + "string" ], "path": "packages/kbn-analytics/src/reporter.ts", "deprecated": false, @@ -756,15 +742,7 @@ "label": "uiCounter", "description": [], "signature": [ - "Record | undefined" + "Record | undefined" ], "path": "packages/kbn-analytics/src/report.ts", "deprecated": false @@ -1138,30 +1116,7 @@ "label": "UiCounterMetricType", "description": [], "signature": [ - { - "pluginId": "@kbn/analytics", - "scope": "common", - "docId": "kibKbnAnalyticsPluginApi", - "section": "def-common.METRIC_TYPE", - "text": "METRIC_TYPE" - }, - ".COUNT | ", - { - "pluginId": "@kbn/analytics", - "scope": "common", - "docId": "kibKbnAnalyticsPluginApi", - "section": "def-common.METRIC_TYPE", - "text": "METRIC_TYPE" - }, - ".LOADED | ", - { - "pluginId": "@kbn/analytics", - "scope": "common", - "docId": "kibKbnAnalyticsPluginApi", - "section": "def-common.METRIC_TYPE", - "text": "METRIC_TYPE" - }, - ".CLICK" + "string" ], "path": "packages/kbn-analytics/src/metrics/ui_counter.ts", "deprecated": false, diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 334415086381e..d27399356410b 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/analytics plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 3c5e4f4a334b4..591b9f17af029 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/apm-config-loader plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 18b0e128d481d..b3bdd40a5f05c 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/apm-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index 4311c83b2ef29..a243aceb5ff3c 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/cli-dev-mode plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 8ac635c043f99..320749b4d9324 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 41a38da07a6ae..ad7de68b1df04 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/config-schema plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index d5605911d5337..612576a8e3b99 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/crypto plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_dev_utils.devdocs.json b/api_docs/kbn_dev_utils.devdocs.json index b83698e7ad147..d3ebe0cab44de 100644 --- a/api_docs/kbn_dev_utils.devdocs.json +++ b/api_docs/kbn_dev_utils.devdocs.json @@ -10,6 +10,154 @@ }, "server": { "classes": [ + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient", + "type": "Class", + "tags": [], + "label": "CiStatsClient", + "description": [], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.fromEnv", + "type": "Function", + "tags": [], + "label": "fromEnv", + "description": [ + "\nCreate a CiStatsReporter by inspecting the ENV for the necessary config" + ], + "signature": [ + "(log: ", + { + "pluginId": "@kbn/dev-utils", + "scope": "server", + "docId": "kibKbnDevUtilsPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + }, + ") => ", + { + "pluginId": "@kbn/dev-utils", + "scope": "server", + "docId": "kibKbnDevUtilsPluginApi", + "section": "def-server.CiStatsClient", + "text": "CiStatsClient" + } + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.fromEnv.$1", + "type": "Object", + "tags": [], + "label": "log", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dev-utils", + "scope": "server", + "docId": "kibKbnDevUtilsPluginApi", + "section": "def-server.ToolingLog", + "text": "ToolingLog" + } + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dev-utils", + "scope": "server", + "docId": "kibKbnDevUtilsPluginApi", + "section": "def-server.Config", + "text": "Config" + }, + " | undefined" + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.isEnabled", + "type": "Function", + "tags": [], + "label": "isEnabled", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.getLatestTestGroupStats", + "type": "Function", + "tags": [], + "label": "getLatestTestGroupStats", + "description": [], + "signature": [ + "(options: LatestTestGroupStatsOptions) => Promise" + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/dev-utils", + "id": "def-server.CiStatsClient.getLatestTestGroupStats.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "LatestTestGroupStatsOptions" + ], + "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/dev-utils", "id": "def-server.CiStatsReporter", @@ -2777,36 +2925,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "@kbn/dev-utils", - "id": "def-server.CiStatsMetadata", - "type": "Interface", - "tags": [], - "label": "CiStatsMetadata", - "description": [ - "Container for metadata that can be attached to different ci-stats objects" - ], - "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/dev-utils", - "id": "def-server.CiStatsMetadata.Unnamed", - "type": "IndexSignature", - "tags": [], - "label": "[key: string]: string | number | boolean | string[] | undefined", - "description": [ - "\nArbitrary key-value pairs which can be attached to CiStatsTiming and CiStatsMetric\nobjects stored in the ci-stats service" - ], - "signature": [ - "[key: string]: string | number | boolean | string[] | undefined" - ], - "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/dev-utils", "id": "def-server.CiStatsMetric", @@ -2895,13 +3013,7 @@ "Arbitrary key-value pairs which can be used for additional filtering/reporting" ], "signature": [ - { - "pluginId": "@kbn/dev-utils", - "scope": "server", - "docId": "kibKbnDevUtilsPluginApi", - "section": "def-server.CiStatsMetadata", - "text": "CiStatsMetadata" - }, + "CiStatsMetadata", " | undefined" ], "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts", @@ -3036,13 +3148,7 @@ "\nArbitrary metadata associated with this group. We currently look for a ciGroup metadata property for highlighting that when appropriate" ], "signature": [ - { - "pluginId": "@kbn/dev-utils", - "scope": "server", - "docId": "kibKbnDevUtilsPluginApi", - "section": "def-server.CiStatsMetadata", - "text": "CiStatsMetadata" - } + "CiStatsMetadata" ], "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_test_group_types.ts", "deprecated": false @@ -3271,13 +3377,7 @@ "hash of key-value pairs which will be stored with the timing for additional filtering and reporting" ], "signature": [ - { - "pluginId": "@kbn/dev-utils", - "scope": "server", - "docId": "kibKbnDevUtilsPluginApi", - "section": "def-server.CiStatsMetadata", - "text": "CiStatsMetadata" - }, + "CiStatsMetadata", " | undefined" ], "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts", @@ -3794,13 +3894,7 @@ "Default metadata to add to each metric" ], "signature": [ - { - "pluginId": "@kbn/dev-utils", - "scope": "server", - "docId": "kibKbnDevUtilsPluginApi", - "section": "def-server.CiStatsMetadata", - "text": "CiStatsMetadata" - }, + "CiStatsMetadata", " | undefined" ], "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts", diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 0e6e20f0cdb3a..e3a8dba905e6e 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/dev-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 275 | 3 | 193 | 0 | +| 281 | 3 | 200 | 1 | ## Server diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 0c87e23c1e49b..03433dfc96ff1 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/doc-links plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index 5202bb66e17d5..71c27a0c7d3ba 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/docs-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index adc62206d6682..c4ab4a20c6ccf 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-archiver plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 19d6ff0d82c5b..98a6b082a1c5f 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/es-query plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index b6bd61aa31dde..14bad8dd91659 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/field-types plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index 871d8e319dcc0..17d50c56410a5 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/i18n plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 6cd7ec34b7f4c..ae829be4405ce 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/interpreter plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_io_ts_utils.devdocs.json b/api_docs/kbn_io_ts_utils.devdocs.json index 0eac86c5269a4..6a4ae05e82231 100644 --- a/api_docs/kbn_io_ts_utils.devdocs.json +++ b/api_docs/kbn_io_ts_utils.devdocs.json @@ -59,10 +59,10 @@ " | ", "StringType", " | ", - "BooleanType", - " | ", "NumberType", " | ", + "BooleanType", + " | ", "RecordC", "<", "Mixed", diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index d0a2008e5aaa2..82a860e90ca52 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/io-ts-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 24aba4cd08494..a2cab655436d6 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/logging plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index edc05dc05891c..a8ad21c2d7a0c 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/logging-mocks plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index b05b0b386d08a..5f48d0e1a0f2a 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/mapbox-gl plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 47d516c8740eb..c30545ca73456 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/monaco plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 72185ab05f010..45bee567c2c54 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/optimizer plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index 6bf6431ac8edc..d8a0079d931a8 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-generator plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index ed37bf1b924c0..f550e199abc75 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/plugin-helpers plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_pm.mdx b/api_docs/kbn_pm.mdx index 5b8f5c91a1d95..8fd9428d27ffc 100644 --- a/api_docs/kbn_pm.mdx +++ b/api_docs/kbn_pm.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-pm title: "@kbn/pm" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/pm plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/pm'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index b2ecbc9ab2ff0..b52661ae1db0d 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/react-field plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 250c80df3d9e5..bee3b0a9954d9 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/rule-data-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_autocomplete.devdocs.json b/api_docs/kbn_securitysolution_autocomplete.devdocs.json index 0aa872b1cbfc3..b84469fdb9c65 100644 --- a/api_docs/kbn_securitysolution_autocomplete.devdocs.json +++ b/api_docs/kbn_securitysolution_autocomplete.devdocs.json @@ -262,9 +262,9 @@ "\nGiven an array of lists and optionally a field this will return all\nthe lists that match against the field based on the types from the field\n\nNOTE: That we support one additional property from \"FieldSpec\" located here:\nsrc/plugins/data/common/index_patterns/fields/types.ts\nThis type property is esTypes. If it exists and is on there we will read off the esTypes." ], "signature": [ - "(lists: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[], field?: (", + "(lists: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[], field?: (", "DataViewFieldBase", - " & { esTypes?: string[] | undefined; }) | undefined) => { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]" + " & { esTypes?: string[] | undefined; }) | undefined) => { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]" ], "path": "packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts", "deprecated": false, @@ -279,7 +279,7 @@ "The lists to match against the field" ], "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]" ], "path": "packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index d80a51415eae1..51c458f97016b 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_es_utils.devdocs.json b/api_docs/kbn_securitysolution_es_utils.devdocs.json index 057adfd0b97eb..06b914a4aeee5 100644 --- a/api_docs/kbn_securitysolution_es_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_es_utils.devdocs.json @@ -388,7857 +388,2433 @@ "label": "esClient", "description": [], "signature": [ - "{ eql: { delete: (params: ", - "EqlDeleteRequest", - " | ", - "EqlDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlDeleteResponse", - ", TContext>>; get: (params: ", - "EqlGetRequest", - " | ", - "EqlGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlGetResponse", - ", TContext>>; getStatus: (params: ", - "EqlGetStatusRequest", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", " | ", - "EqlGetStatusRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlGetStatusResponse", - ", TContext>>; search: (params: ", - "EqlSearchRequest", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", " | ", - "EqlSearchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "EqlSearchResponse", - ", TContext>>; }; search: , unknown>>; , TContext = unknown>(params?: ", + ">>(this: That, params?: ", "SearchRequest", " | ", "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", + " | undefined): Promise<", "SearchResponse", - ", TContext>>; create: (params: ", + ">; }; create: { (this: That, params: ", "CreateRequest", " | ", "CreateRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", "CreateResponse", - ", TContext>>; monitoring: { bulk: (params: ", - "MonitoringBulkRequest", - " | ", - "MonitoringBulkRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MonitoringBulkResponse", - ", TContext>>; }; security: { authenticate: (params?: ", - "SecurityAuthenticateRequest", - " | ", - "SecurityAuthenticateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityAuthenticateResponse", - ", TContext>>; changePassword: (params?: ", - "SecurityChangePasswordRequest", - " | ", - "SecurityChangePasswordRequest", - " | undefined, options?: ", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityChangePasswordResponse", - ", TContext>>; clearApiKeyCache: (params: ", - "SecurityClearApiKeyCacheRequest", - " | ", - "SecurityClearApiKeyCacheRequest", - ", options?: ", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearApiKeyCacheResponse", - ", TContext>>; clearCachedPrivileges: (params: ", - "SecurityClearCachedPrivilegesRequest", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", " | ", - "SecurityClearCachedPrivilegesRequest", + "DeleteRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedPrivilegesResponse", - ", TContext>>; clearCachedRealms: (params: ", - "SecurityClearCachedRealmsRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", " | ", - "SecurityClearCachedRealmsRequest", + "DeleteRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityClearCachedRealmsResponse", - ", TContext>>; clearCachedRoles: (params: ", - "SecurityClearCachedRolesRequest", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", " | ", - "SecurityClearCachedRolesRequest", + "DeleteRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedRolesResponse", - ", TContext>>; clearCachedServiceTokens: (params: ", - "SecurityClearCachedServiceTokensRequest", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", " | ", - "SecurityClearCachedServiceTokensRequest", + "GetRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedServiceTokensResponse", - ", TContext>>; createApiKey: (params?: ", - "SecurityCreateApiKeyRequest", - " | ", - "SecurityCreateApiKeyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityCreateApiKeyResponse", - ", TContext>>; createServiceToken: (params: ", - "SecurityCreateServiceTokenRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", " | ", - "SecurityCreateServiceTokenRequest", + "GetRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityCreateServiceTokenResponse", - ", TContext>>; deletePrivileges: (params: ", - "SecurityDeletePrivilegesRequest", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", " | ", - "SecurityDeletePrivilegesRequest", + "GetRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityDeletePrivilegesResponse", - ", TContext>>; deleteRole: (params: ", - "SecurityDeleteRoleRequest", - " | ", - "SecurityDeleteRoleRequest", - ", options?: ", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeleteRoleResponse", - ", TContext>>; deleteRoleMapping: (params: ", - "SecurityDeleteRoleMappingRequest", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", " | ", - "SecurityDeleteRoleMappingRequest", + "ClosePointInTimeRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeleteRoleMappingResponse", - ", TContext>>; deleteServiceToken: (params: ", - "SecurityDeleteServiceTokenRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", " | ", - "SecurityDeleteServiceTokenRequest", + "ClosePointInTimeRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityDeleteServiceTokenResponse", - ", TContext>>; deleteUser: (params: ", - "SecurityDeleteUserRequest", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", " | ", - "SecurityDeleteUserRequest", + "ClosePointInTimeRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityDeleteUserResponse", - ", TContext>>; disableUser: (params: ", - "SecurityDisableUserRequest", - " | ", - "SecurityDisableUserRequest", - ", options?: ", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDisableUserResponse", - ", TContext>>; enableUser: (params: ", - "SecurityEnableUserRequest", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", " | ", - "SecurityEnableUserRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityEnableUserResponse", - ", TContext>>; enrollKibana: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; enrollNode: (params?: ", - "TODO", + "ClearScrollRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getApiKey: (params?: ", - "SecurityGetApiKeyRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", " | ", - "SecurityGetApiKeyRequest", + "ClearScrollRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityGetApiKeyResponse", - ", TContext>>; getBuiltinPrivileges: (params?: ", - "SecurityGetBuiltinPrivilegesRequest", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", " | ", - "SecurityGetBuiltinPrivilegesRequest", + "ClearScrollRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetBuiltinPrivilegesResponse", - ", TContext>>; getPrivileges: (params?: ", - "SecurityGetPrivilegesRequest", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", " | ", - "SecurityGetPrivilegesRequest", + "CountRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetPrivilegesResponse", - ", TContext>>; getRole: (params?: ", - "SecurityGetRoleRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", " | ", - "SecurityGetRoleRequest", + "CountRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityGetRoleResponse", - ", TContext>>; getRoleMapping: (params?: ", - "SecurityGetRoleMappingRequest", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", " | ", - "SecurityGetRoleMappingRequest", + "CountRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetRoleMappingResponse", - ", TContext>>; getServiceAccounts: (params?: ", - "SecurityGetServiceAccountsRequest", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", " | ", - "SecurityGetServiceAccountsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetServiceAccountsResponse", - ", TContext>>; getServiceCredentials: (params: ", - "SecurityGetServiceCredentialsRequest", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", " | ", - "SecurityGetServiceCredentialsRequest", + "DeleteByQueryRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityGetServiceCredentialsResponse", - ", TContext>>; getToken: (params?: ", - "SecurityGetTokenRequest", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", " | ", - "SecurityGetTokenRequest", - " | undefined, options?: ", + "DeleteByQueryRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetTokenResponse", - ", TContext>>; getUser: (params?: ", - "SecurityGetUserRequest", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", " | ", - "SecurityGetUserRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetUserResponse", - ", TContext>>; getUserPrivileges: (params?: ", - "SecurityGetUserPrivilegesRequest", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", " | ", - "SecurityGetUserPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityGetUserPrivilegesResponse", - ", TContext>>; grantApiKey: (params?: ", - "SecurityGrantApiKeyRequest", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", " | ", - "SecurityGrantApiKeyRequest", - " | undefined, options?: ", + "DeleteByQueryRethrottleRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGrantApiKeyResponse", - ", TContext>>; hasPrivileges: (params?: ", - "SecurityHasPrivilegesRequest", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", " | ", - "SecurityHasPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityHasPrivilegesResponse", - ", TContext>>; invalidateApiKey: (params?: ", - "SecurityInvalidateApiKeyRequest", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", " | ", - "SecurityInvalidateApiKeyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SecurityInvalidateApiKeyResponse", - ", TContext>>; invalidateToken: (params?: ", - "SecurityInvalidateTokenRequest", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", " | ", - "SecurityInvalidateTokenRequest", - " | undefined, options?: ", + "DeleteScriptRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityInvalidateTokenResponse", - ", TContext>>; putPrivileges: (params?: ", - "SecurityPutPrivilegesRequest", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", " | ", - "SecurityPutPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutPrivilegesResponse", - ", TContext>>; putRole: (params: ", - "SecurityPutRoleRequest", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", " | ", - "SecurityPutRoleRequest", + "ExistsRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "SecurityPutRoleResponse", - ", TContext>>; putRoleMapping: (params: ", - "SecurityPutRoleMappingRequest", + ">; (this: That, params: ", + "ExistsRequest", " | ", - "SecurityPutRoleMappingRequest", + "ExistsRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutRoleMappingResponse", - ", TContext>>; putUser: (params: ", - "SecurityPutUserRequest", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", " | ", - "SecurityPutUserRequest", + "ExistsSourceRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutUserResponse", - ", TContext>>; queryApiKeys: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlAuthenticate: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "TODO", - ", unknown>>; samlCompleteLogout: (params?: ", - "TODO", - " | undefined, options?: ", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TODO", - ", unknown>>; samlInvalidate: (params?: ", - "TODO", - " | undefined, options?: ", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlLogout: (params?: ", - "TODO", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlPrepareAuthentication: (params?: ", - "TODO", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TODO", - ", unknown>>; samlServiceProviderMetadata: (params?: ", - "TODO", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; }; name: string | symbol; index: (params: ", - "IndexRequest", - " | ", - "IndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndexResponse", - ", TContext>>; delete: (params: ", - "DeleteRequest", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", " | ", - "DeleteRequest", + "GetScriptRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteResponse", - ", TContext>>; get: (params: ", - "GetRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", " | ", - "GetRequest", + "GetScriptRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "GetResponse", - ", TContext>>; update: (params: ", - "UpdateRequest", - " | ", - "UpdateRequest", - ", options?: ", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "UpdateResponse", - ", TContext>>; closePointInTime: (params?: ", - "ClosePointInTimeRequest", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", " | ", - "ClosePointInTimeRequest", + "GetScriptContextRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClosePointInTimeResponse", - ", TContext>>; transform: { deleteTransform: (params: ", - "TransformDeleteTransformRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", " | ", - "TransformDeleteTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TransformDeleteTransformResponse", - ", TContext>>; getTransform: (params?: ", - "TransformGetTransformRequest", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", " | ", - "TransformGetTransformRequest", + "GetScriptContextRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformGetTransformResponse", - ", TContext>>; getTransformStats: (params: ", - "TransformGetTransformStatsRequest", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", " | ", - "TransformGetTransformStatsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformGetTransformStatsResponse", - ", TContext>>; previewTransform: (params?: ", - "TransformPreviewTransformRequest", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", " | ", - "TransformPreviewTransformRequest", + "GetScriptLanguagesRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TransformPreviewTransformResponse", - ", TContext>>; putTransform: (params: ", - "TransformPutTransformRequest", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", " | ", - "TransformPutTransformRequest", - ", options?: ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformPutTransformResponse", - ", TContext>>; resetTransform: (params: ", - "TransformResetTransformRequest", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", " | ", - "TransformResetTransformRequest", + "GetSourceRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformResetTransformResponse", - ", TContext>>; startTransform: (params: ", - "TransformStartTransformRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", " | ", - "TransformStartTransformRequest", + "GetSourceRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "TransformStartTransformResponse", - ", TContext>>; stopTransform: (params: ", - "TransformStopTransformRequest", + ">; (this: That, params: ", + "GetSourceRequest", " | ", - "TransformStopTransformRequest", + "GetSourceRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformStopTransformResponse", - ", TContext>>; updateTransform: (params: ", - "TransformUpdateTransformRequest", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", " | ", - "TransformUpdateTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TransformUpdateTransformResponse", - ", TContext>>; upgradeTransforms: (params?: ", - "TransformUpgradeTransformsRequest", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", " | ", - "TransformUpgradeTransformsRequest", + "InfoRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformUpgradeTransformsResponse", - ", TContext>>; }; helpers: ", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", "default", - "; asyncSearch: { delete: (params: ", - "AsyncSearchDeleteRequest", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", " | ", - "AsyncSearchDeleteRequest", + "KnnSearchRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchDeleteResponse", - ", TContext>>; get: (params: ", - "AsyncSearchGetRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", " | ", - "AsyncSearchGetRequest", + "KnnSearchRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "AsyncSearchGetResponse", - ", TContext>>; status: (params: ", - "AsyncSearchStatusRequest", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", " | ", - "AsyncSearchStatusRequest", + "KnnSearchRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchStatusResponse", - ", TContext>>; submit: (params?: ", - "AsyncSearchSubmitRequest", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", " | ", - "AsyncSearchSubmitRequest", + "MgetRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchSubmitResponse", - ", TContext>>; }; autoscaling: { deleteAutoscalingPolicy: (params: ", - "AutoscalingDeleteAutoscalingPolicyRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", " | ", - "AutoscalingDeleteAutoscalingPolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "AutoscalingDeleteAutoscalingPolicyResponse", - ", TContext>>; getAutoscalingCapacity: (params?: ", - "AutoscalingGetAutoscalingCapacityRequest", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", " | ", - "AutoscalingGetAutoscalingCapacityRequest", + "MgetRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "AutoscalingGetAutoscalingCapacityResponse", - ", TContext>>; getAutoscalingPolicy: (params: ", - "AutoscalingGetAutoscalingPolicyRequest", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", " | ", - "AutoscalingGetAutoscalingPolicyRequest", + "MsearchRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "AutoscalingAutoscalingPolicy", - ", TContext>>; putAutoscalingPolicy: (params: ", - "AutoscalingPutAutoscalingPolicyRequest", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", " | ", - "AutoscalingPutAutoscalingPolicyRequest", + "MsearchTemplateRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AutoscalingPutAutoscalingPolicyResponse", - ", TContext>>; }; bulk: (params: ", - "BulkRequest", - " | ", - "BulkRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "BulkResponse", - ", TContext>>; cat: { aliases: (params?: ", - "CatAliasesRequest", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", " | ", - "CatAliasesRequest", + "MtermvectorsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatAliasesResponse", - ", TContext>>; allocation: (params?: ", - "CatAllocationRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", " | ", - "CatAllocationRequest", + "MtermvectorsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatAllocationResponse", - ", TContext>>; count: (params?: ", - "CatCountRequest", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", " | ", - "CatCountRequest", + "MtermvectorsRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatCountResponse", - ", TContext>>; fielddata: (params?: ", - "CatFielddataRequest", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", " | ", - "CatFielddataRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatFielddataResponse", - ", TContext>>; health: (params?: ", - "CatHealthRequest", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", " | ", - "CatHealthRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatHealthResponse", - ", TContext>>; help: (params?: ", - "CatHelpRequest", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", " | ", - "CatHelpRequest", - " | undefined, options?: ", + "OpenPointInTimeRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatHelpResponse", - ", TContext>>; indices: (params?: ", - "CatIndicesRequest", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", " | ", - "CatIndicesRequest", + "PingRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatIndicesResponse", - ", TContext>>; master: (params?: ", - "CatMasterRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", " | ", - "CatMasterRequest", + "PingRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "CatMasterResponse", - ", TContext>>; mlDataFrameAnalytics: (params?: ", - "CatMlDataFrameAnalyticsRequest", + ">; (this: That, params?: ", + "PingRequest", " | ", - "CatMlDataFrameAnalyticsRequest", + "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlDataFrameAnalyticsResponse", - ", TContext>>; mlDatafeeds: (params?: ", - "CatMlDatafeedsRequest", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", " | ", - "CatMlDatafeedsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlDatafeedsResponse", - ", TContext>>; mlJobs: (params?: ", - "CatMlJobsRequest", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", " | ", - "CatMlJobsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatMlJobsResponse", - ", TContext>>; mlTrainedModels: (params?: ", - "CatMlTrainedModelsRequest", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", " | ", - "CatMlTrainedModelsRequest", - " | undefined, options?: ", + "PutScriptRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlTrainedModelsResponse", - ", TContext>>; nodeattrs: (params?: ", - "CatNodeattrsRequest", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", " | ", - "CatNodeattrsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatNodeattrsResponse", - ", TContext>>; nodes: (params?: ", - "CatNodesRequest", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", " | ", - "CatNodesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatNodesResponse", - ", TContext>>; pendingTasks: (params?: ", - "CatPendingTasksRequest", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", " | ", - "CatPendingTasksRequest", - " | undefined, options?: ", + "RankEvalRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatPendingTasksResponse", - ", TContext>>; plugins: (params?: ", - "CatPluginsRequest", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", " | ", - "CatPluginsRequest", + "ReindexRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatPluginsResponse", - ", TContext>>; recovery: (params?: ", - "CatRecoveryRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", " | ", - "CatRecoveryRequest", + "ReindexRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatRecoveryResponse", - ", TContext>>; repositories: (params?: ", - "CatRepositoriesRequest", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", " | ", - "CatRepositoriesRequest", + "ReindexRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatRepositoriesResponse", - ", TContext>>; segments: (params?: ", - "CatSegmentsRequest", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", " | ", - "CatSegmentsRequest", - " | undefined, options?: ", + "ReindexRethrottleRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatSegmentsResponse", - ", TContext>>; shards: (params?: ", - "CatShardsRequest", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", " | ", - "CatShardsRequest", + "RenderSearchTemplateRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatShardsResponse", - ", TContext>>; snapshots: (params?: ", - "CatSnapshotsRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", " | ", - "CatSnapshotsRequest", + "RenderSearchTemplateRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatSnapshotsResponse", - ", TContext>>; tasks: (params?: ", - "CatTasksRequest", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", " | ", - "CatTasksRequest", + "RenderSearchTemplateRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatTasksResponse", - ", TContext>>; templates: (params?: ", - "CatTemplatesRequest", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", " | ", - "CatTemplatesRequest", + "ScriptsPainlessExecuteRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatTemplatesResponse", - ", TContext>>; threadPool: (params?: ", - "CatThreadPoolRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", " | ", - "CatThreadPoolRequest", + "ScriptsPainlessExecuteRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CatThreadPoolResponse", - ", TContext>>; transforms: (params?: ", - "CatTransformsRequest", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", " | ", - "CatTransformsRequest", + "ScriptsPainlessExecuteRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatTransformsResponse", - ", TContext>>; }; ccr: { deleteAutoFollowPattern: (params: ", - "CcrDeleteAutoFollowPatternRequest", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", " | ", - "CcrDeleteAutoFollowPatternRequest", + "ScrollRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrDeleteAutoFollowPatternResponse", - ", TContext>>; follow: (params: ", - "CcrFollowRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", " | ", - "CcrFollowRequest", + "ScrollRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CcrFollowResponse", - ", TContext>>; followInfo: (params: ", - "CcrFollowInfoRequest", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", " | ", - "CcrFollowInfoRequest", + "ScrollRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrFollowInfoResponse", - ", TContext>>; followStats: (params: ", - "CcrFollowStatsRequest", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", " | ", - "CcrFollowStatsRequest", + "SearchMvtRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "CcrFollowStatsResponse", - ", TContext>>; forgetFollower: (params: ", - "CcrForgetFollowerRequest", + ">; (this: That, params: ", + "SearchMvtRequest", " | ", - "CcrForgetFollowerRequest", + "SearchMvtRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrForgetFollowerResponse", - ", TContext>>; getAutoFollowPattern: (params?: ", - "CcrGetAutoFollowPatternRequest", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", " | ", - "CcrGetAutoFollowPatternRequest", + "SearchShardsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrGetAutoFollowPatternResponse", - ", TContext>>; pauseAutoFollowPattern: (params: ", - "CcrPauseAutoFollowPatternRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", " | ", - "CcrPauseAutoFollowPatternRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CcrPauseAutoFollowPatternResponse", - ", TContext>>; pauseFollow: (params: ", - "CcrPauseFollowRequest", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", " | ", - "CcrPauseFollowRequest", - ", options?: ", + "SearchShardsRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CcrPauseFollowResponse", - ", TContext>>; putAutoFollowPattern: (params: ", - "CcrPutAutoFollowPatternRequest", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", " | ", - "CcrPutAutoFollowPatternRequest", - ", options?: ", + "SearchTemplateRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrPutAutoFollowPatternResponse", - ", TContext>>; resumeAutoFollowPattern: (params: ", - "CcrResumeAutoFollowPatternRequest", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", " | ", - "CcrResumeAutoFollowPatternRequest", + "TermsEnumRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrResumeAutoFollowPatternResponse", - ", TContext>>; resumeFollow: (params: ", - "CcrResumeFollowRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", " | ", - "CcrResumeFollowRequest", + "TermsEnumRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CcrResumeFollowResponse", - ", TContext>>; stats: (params?: ", - "CcrStatsRequest", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", " | ", - "CcrStatsRequest", - " | undefined, options?: ", + "TermsEnumRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "CcrStatsResponse", - ", TContext>>; unfollow: (params: ", - "CcrUnfollowRequest", - " | ", - "CcrUnfollowRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrUnfollowResponse", - ", TContext>>; }; clearScroll: (params?: ", - "ClearScrollRequest", - " | ", - "ClearScrollRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClearScrollResponse", - ", TContext>>; cluster: { allocationExplain: (params?: ", - "ClusterAllocationExplainRequest", - " | ", - "ClusterAllocationExplainRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterAllocationExplainResponse", - ", TContext>>; deleteComponentTemplate: (params: ", - "ClusterDeleteComponentTemplateRequest", - " | ", - "ClusterDeleteComponentTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterDeleteComponentTemplateResponse", - ", TContext>>; deleteVotingConfigExclusions: (params?: ", - "ClusterDeleteVotingConfigExclusionsRequest", - " | ", - "ClusterDeleteVotingConfigExclusionsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsComponentTemplate: (params: ", - "ClusterExistsComponentTemplateRequest", - " | ", - "ClusterExistsComponentTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; getComponentTemplate: (params?: ", - "ClusterGetComponentTemplateRequest", - " | ", - "ClusterGetComponentTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterGetComponentTemplateResponse", - ", TContext>>; getSettings: (params?: ", - "ClusterGetSettingsRequest", - " | ", - "ClusterGetSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterGetSettingsResponse", - ", TContext>>; health: (params?: ", - "ClusterHealthRequest", - " | ", - "ClusterHealthRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterHealthResponse", - ", TContext>>; pendingTasks: (params?: ", - "ClusterPendingTasksRequest", - " | ", - "ClusterPendingTasksRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterPendingTasksResponse", - ", TContext>>; postVotingConfigExclusions: (params?: ", - "ClusterPostVotingConfigExclusionsRequest", - " | ", - "ClusterPostVotingConfigExclusionsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; putComponentTemplate: (params: ", - "ClusterPutComponentTemplateRequest", - " | ", - "ClusterPutComponentTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterPutComponentTemplateResponse", - ", TContext>>; putSettings: (params?: ", - "ClusterPutSettingsRequest", - " | ", - "ClusterPutSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterPutSettingsResponse", - ", TContext>>; remoteInfo: (params?: ", - "ClusterRemoteInfoRequest", - " | ", - "ClusterRemoteInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterRemoteInfoResponse", - ", TContext>>; reroute: (params?: ", - "ClusterRerouteRequest", - " | ", - "ClusterRerouteRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterRerouteResponse", - ", TContext>>; state: (params?: ", - "ClusterStateRequest", - " | ", - "ClusterStateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; stats: (params?: ", - "ClusterStatsRequest", - " | ", - "ClusterStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterStatsResponse", - ", TContext>>; }; count: (params?: ", - "CountRequest", - " | ", - "CountRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CountResponse", - ", TContext>>; danglingIndices: { deleteDanglingIndex: (params: ", - "DanglingIndicesDeleteDanglingIndexRequest", - " | ", - "DanglingIndicesDeleteDanglingIndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DanglingIndicesDeleteDanglingIndexResponse", - ", TContext>>; importDanglingIndex: (params: ", - "DanglingIndicesImportDanglingIndexRequest", - " | ", - "DanglingIndicesImportDanglingIndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DanglingIndicesImportDanglingIndexResponse", - ", TContext>>; listDanglingIndices: (params?: ", - "DanglingIndicesListDanglingIndicesRequest", - " | ", - "DanglingIndicesListDanglingIndicesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DanglingIndicesListDanglingIndicesResponse", - ", TContext>>; }; deleteByQuery: (params: ", - "DeleteByQueryRequest", - " | ", - "DeleteByQueryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteByQueryResponse", - ", TContext>>; deleteByQueryRethrottle: (params: ", - "DeleteByQueryRethrottleRequest", - " | ", - "DeleteByQueryRethrottleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteByQueryRethrottleResponse", - ", TContext>>; deleteScript: (params: ", - "DeleteScriptRequest", - " | ", - "DeleteScriptRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteScriptResponse", - ", TContext>>; enrich: { deletePolicy: (params: ", - "EnrichDeletePolicyRequest", - " | ", - "EnrichDeletePolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichDeletePolicyResponse", - ", TContext>>; executePolicy: (params: ", - "EnrichExecutePolicyRequest", - " | ", - "EnrichExecutePolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichExecutePolicyResponse", - ", TContext>>; getPolicy: (params?: ", - "EnrichGetPolicyRequest", - " | ", - "EnrichGetPolicyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichGetPolicyResponse", - ", TContext>>; putPolicy: (params: ", - "EnrichPutPolicyRequest", - " | ", - "EnrichPutPolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichPutPolicyResponse", - ", TContext>>; stats: (params?: ", - "EnrichStatsRequest", - " | ", - "EnrichStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichStatsResponse", - ", TContext>>; }; exists: (params: ", - "ExistsRequest", - " | ", - "ExistsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsSource: (params: ", - "ExistsSourceRequest", - " | ", - "ExistsSourceRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; explain: (params: ", - "ExplainRequest", - " | ", - "ExplainRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ExplainResponse", - ", TContext>>; features: { getFeatures: (params?: ", - "FeaturesGetFeaturesRequest", - " | ", - "FeaturesGetFeaturesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FeaturesGetFeaturesResponse", - ", TContext>>; resetFeatures: (params?: ", - "FeaturesResetFeaturesRequest", - " | ", - "FeaturesResetFeaturesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FeaturesResetFeaturesResponse", - ", TContext>>; }; fieldCaps: (params?: ", - "FieldCapsRequest", - " | ", - "FieldCapsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FieldCapsResponse", - ", TContext>>; fleet: { globalCheckpoints: (params: ", - "FleetGlobalCheckpointsRequest", - " | ", - "FleetGlobalCheckpointsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FleetGlobalCheckpointsResponse", - ", TContext>>; msearch: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; search: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; }; getScript: (params: ", - "GetScriptRequest", - " | ", - "GetScriptRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetScriptResponse", - ", TContext>>; getScriptContext: (params?: ", - "GetScriptContextRequest", - " | ", - "GetScriptContextRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetScriptContextResponse", - ", TContext>>; getScriptLanguages: (params?: ", - "GetScriptLanguagesRequest", - " | ", - "GetScriptLanguagesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetScriptLanguagesResponse", - ", TContext>>; getSource: (params: ", - "GetSourceRequest", - " | ", - "GetSourceRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; graph: { explore: (params: ", - "GraphExploreRequest", - " | ", - "GraphExploreRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GraphExploreResponse", - ", TContext>>; }; ilm: { deleteLifecycle: (params: ", - "IlmDeleteLifecycleRequest", - " | ", - "IlmDeleteLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmDeleteLifecycleResponse", - ", TContext>>; explainLifecycle: (params: ", - "IlmExplainLifecycleRequest", - " | ", - "IlmExplainLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmExplainLifecycleResponse", - ", TContext>>; getLifecycle: (params?: ", - "IlmGetLifecycleRequest", - " | ", - "IlmGetLifecycleRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmGetLifecycleResponse", - ", TContext>>; getStatus: (params?: ", - "IlmGetStatusRequest", - " | ", - "IlmGetStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmGetStatusResponse", - ", TContext>>; migrateToDataTiers: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; moveToStep: (params: ", - "IlmMoveToStepRequest", - " | ", - "IlmMoveToStepRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmMoveToStepResponse", - ", TContext>>; putLifecycle: (params: ", - "IlmPutLifecycleRequest", - " | ", - "IlmPutLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmPutLifecycleResponse", - ", TContext>>; removePolicy: (params: ", - "IlmRemovePolicyRequest", - " | ", - "IlmRemovePolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmRemovePolicyResponse", - ", TContext>>; retry: (params: ", - "IlmRetryRequest", - " | ", - "IlmRetryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmRetryResponse", - ", TContext>>; start: (params?: ", - "IlmStartRequest", - " | ", - "IlmStartRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmStartResponse", - ", TContext>>; stop: (params?: ", - "IlmStopRequest", - " | ", - "IlmStopRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmStopResponse", - ", TContext>>; }; indices: { addBlock: (params: ", - "IndicesAddBlockRequest", - " | ", - "IndicesAddBlockRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesAddBlockResponse", - ", TContext>>; analyze: (params?: ", - "IndicesAnalyzeRequest", - " | ", - "IndicesAnalyzeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesAnalyzeResponse", - ", TContext>>; clearCache: (params?: ", - "IndicesClearCacheRequest", - " | ", - "IndicesClearCacheRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesClearCacheResponse", - ", TContext>>; clone: (params: ", - "IndicesCloneRequest", - " | ", - "IndicesCloneRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCloneResponse", - ", TContext>>; close: (params: ", - "IndicesCloseRequest", - " | ", - "IndicesCloseRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCloseResponse", - ", TContext>>; create: (params: ", - "IndicesCreateRequest", - " | ", - "IndicesCreateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCreateResponse", - ", TContext>>; createDataStream: (params: ", - "IndicesCreateDataStreamRequest", - " | ", - "IndicesCreateDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCreateDataStreamResponse", - ", TContext>>; dataStreamsStats: (params?: ", - "IndicesDataStreamsStatsRequest", - " | ", - "IndicesDataStreamsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDataStreamsStatsResponse", - ", TContext>>; delete: (params: ", - "IndicesDeleteRequest", - " | ", - "IndicesDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteResponse", - ", TContext>>; deleteAlias: (params: ", - "IndicesDeleteAliasRequest", - " | ", - "IndicesDeleteAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteAliasResponse", - ", TContext>>; deleteDataStream: (params: ", - "IndicesDeleteDataStreamRequest", - " | ", - "IndicesDeleteDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteDataStreamResponse", - ", TContext>>; deleteIndexTemplate: (params: ", - "IndicesDeleteIndexTemplateRequest", - " | ", - "IndicesDeleteIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteIndexTemplateResponse", - ", TContext>>; deleteTemplate: (params: ", - "IndicesDeleteTemplateRequest", - " | ", - "IndicesDeleteTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteTemplateResponse", - ", TContext>>; diskUsage: (params: ", - "IndicesDiskUsageRequest", - " | ", - "IndicesDiskUsageRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; exists: (params: ", - "IndicesExistsRequest", - " | ", - "IndicesExistsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsAlias: (params: ", - "IndicesExistsAliasRequest", - " | ", - "IndicesExistsAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsIndexTemplate: (params: ", - "IndicesExistsIndexTemplateRequest", - " | ", - "IndicesExistsIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsTemplate: (params: ", - "IndicesExistsTemplateRequest", - " | ", - "IndicesExistsTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; fieldUsageStats: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; flush: (params?: ", - "IndicesFlushRequest", - " | ", - "IndicesFlushRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesFlushResponse", - ", TContext>>; forcemerge: (params?: ", - "IndicesForcemergeRequest", - " | ", - "IndicesForcemergeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesForcemergeResponse", - ", TContext>>; get: (params: ", - "IndicesGetRequest", - " | ", - "IndicesGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetResponse", - ", TContext>>; getAlias: (params?: ", - "IndicesGetAliasRequest", - " | ", - "IndicesGetAliasRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetAliasResponse", - ", TContext>>; getDataStream: (params?: ", - "IndicesGetDataStreamRequest", - " | ", - "IndicesGetDataStreamRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetDataStreamResponse", - ", TContext>>; getFieldMapping: (params: ", - "IndicesGetFieldMappingRequest", - " | ", - "IndicesGetFieldMappingRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetFieldMappingResponse", - ", TContext>>; getIndexTemplate: (params?: ", - "IndicesGetIndexTemplateRequest", - " | ", - "IndicesGetIndexTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetIndexTemplateResponse", - ", TContext>>; getMapping: (params?: ", - "IndicesGetMappingRequest", - " | ", - "IndicesGetMappingRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetMappingResponse", - ", TContext>>; getSettings: (params?: ", - "IndicesGetSettingsRequest", - " | ", - "IndicesGetSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetSettingsResponse", - ", TContext>>; getTemplate: (params?: ", - "IndicesGetTemplateRequest", - " | ", - "IndicesGetTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetTemplateResponse", - ", TContext>>; migrateToDataStream: (params: ", - "IndicesMigrateToDataStreamRequest", - " | ", - "IndicesMigrateToDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesMigrateToDataStreamResponse", - ", TContext>>; modifyDataStream: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; open: (params: ", - "IndicesOpenRequest", - " | ", - "IndicesOpenRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesOpenResponse", - ", TContext>>; promoteDataStream: (params: ", - "IndicesPromoteDataStreamRequest", - " | ", - "IndicesPromoteDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; putAlias: (params: ", - "IndicesPutAliasRequest", - " | ", - "IndicesPutAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutAliasResponse", - ", TContext>>; putIndexTemplate: (params: ", - "IndicesPutIndexTemplateRequest", - " | ", - "IndicesPutIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutIndexTemplateResponse", - ", TContext>>; putMapping: (params: ", - "IndicesPutMappingRequest", - " | ", - "IndicesPutMappingRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutMappingResponse", - ", TContext>>; putSettings: (params?: ", - "IndicesPutSettingsRequest", - " | ", - "IndicesPutSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutSettingsResponse", - ", TContext>>; putTemplate: (params: ", - "IndicesPutTemplateRequest", - " | ", - "IndicesPutTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutTemplateResponse", - ", TContext>>; recovery: (params?: ", - "IndicesRecoveryRequest", - " | ", - "IndicesRecoveryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesRecoveryResponse", - ", TContext>>; refresh: (params?: ", - "IndicesRefreshRequest", - " | ", - "IndicesRefreshRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesRefreshResponse", - ", TContext>>; reloadSearchAnalyzers: (params: ", - "IndicesReloadSearchAnalyzersRequest", - " | ", - "IndicesReloadSearchAnalyzersRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesReloadSearchAnalyzersResponse", - ", TContext>>; resolveIndex: (params: ", - "IndicesResolveIndexRequest", - " | ", - "IndicesResolveIndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesResolveIndexResponse", - ", TContext>>; rollover: (params: ", - "IndicesRolloverRequest", - " | ", - "IndicesRolloverRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesRolloverResponse", - ", TContext>>; segments: (params?: ", - "IndicesSegmentsRequest", - " | ", - "IndicesSegmentsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSegmentsResponse", - ", TContext>>; shardStores: (params?: ", - "IndicesShardStoresRequest", - " | ", - "IndicesShardStoresRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesShardStoresResponse", - ", TContext>>; shrink: (params: ", - "IndicesShrinkRequest", - " | ", - "IndicesShrinkRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesShrinkResponse", - ", TContext>>; simulateIndexTemplate: (params: ", - "IndicesSimulateIndexTemplateRequest", - " | ", - "IndicesSimulateIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSimulateIndexTemplateResponse", - ", TContext>>; simulateTemplate: (params?: ", - "IndicesSimulateTemplateRequest", - " | ", - "IndicesSimulateTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSimulateTemplateResponse", - ", TContext>>; split: (params: ", - "IndicesSplitRequest", - " | ", - "IndicesSplitRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSplitResponse", - ", TContext>>; stats: (params?: ", - "IndicesStatsRequest", - " | ", - "IndicesStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesStatsResponse", - ", TContext>>; unfreeze: (params: ", - "IndicesUnfreezeRequest", - " | ", - "IndicesUnfreezeRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesUnfreezeResponse", - ", TContext>>; updateAliases: (params?: ", - "IndicesUpdateAliasesRequest", - " | ", - "IndicesUpdateAliasesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesUpdateAliasesResponse", - ", TContext>>; validateQuery: (params?: ", - "IndicesValidateQueryRequest", - " | ", - "IndicesValidateQueryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesValidateQueryResponse", - ", TContext>>; }; info: (params?: ", - "InfoRequest", - " | ", - "InfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "InfoResponse", - ", TContext>>; ingest: { deletePipeline: (params: ", - "IngestDeletePipelineRequest", - " | ", - "IngestDeletePipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestDeletePipelineResponse", - ", TContext>>; geoIpStats: (params?: ", - "IngestGeoIpStatsRequest", - " | ", - "IngestGeoIpStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestGeoIpStatsResponse", - ", TContext>>; getPipeline: (params?: ", - "IngestGetPipelineRequest", - " | ", - "IngestGetPipelineRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestGetPipelineResponse", - ", TContext>>; processorGrok: (params?: ", - "IngestProcessorGrokRequest", - " | ", - "IngestProcessorGrokRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestProcessorGrokResponse", - ", TContext>>; putPipeline: (params: ", - "IngestPutPipelineRequest", - " | ", - "IngestPutPipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestPutPipelineResponse", - ", TContext>>; simulate: (params?: ", - "IngestSimulateRequest", - " | ", - "IngestSimulateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestSimulateResponse", - ", TContext>>; }; knnSearch: (params: ", - "KnnSearchRequest", - " | ", - "KnnSearchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "KnnSearchResponse", - ", TContext>>; license: { delete: (params?: ", - "LicenseDeleteRequest", - " | ", - "LicenseDeleteRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseDeleteResponse", - ", TContext>>; get: (params?: ", - "LicenseGetRequest", - " | ", - "LicenseGetRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseGetResponse", - ", TContext>>; getBasicStatus: (params?: ", - "LicenseGetBasicStatusRequest", - " | ", - "LicenseGetBasicStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseGetBasicStatusResponse", - ", TContext>>; getTrialStatus: (params?: ", - "LicenseGetTrialStatusRequest", - " | ", - "LicenseGetTrialStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseGetTrialStatusResponse", - ", TContext>>; post: (params?: ", - "LicensePostRequest", - " | ", - "LicensePostRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicensePostResponse", - ", TContext>>; postStartBasic: (params?: ", - "LicensePostStartBasicRequest", - " | ", - "LicensePostStartBasicRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicensePostStartBasicResponse", - ", TContext>>; postStartTrial: (params?: ", - "LicensePostStartTrialRequest", - " | ", - "LicensePostStartTrialRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicensePostStartTrialResponse", - ", TContext>>; }; logstash: { deletePipeline: (params: ", - "LogstashDeletePipelineRequest", - " | ", - "LogstashDeletePipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; getPipeline: (params: ", - "LogstashGetPipelineRequest", - " | ", - "LogstashGetPipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LogstashGetPipelineResponse", - ", TContext>>; putPipeline: (params: ", - "LogstashPutPipelineRequest", - " | ", - "LogstashPutPipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; }; mget: (params?: ", - "MgetRequest", - " | ", - "MgetRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MgetResponse", - ", TContext>>; migration: { deprecations: (params?: ", - "MigrationDeprecationsRequest", - " | ", - "MigrationDeprecationsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MigrationDeprecationsResponse", - ", TContext>>; getFeatureUpgradeStatus: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; postFeatureUpgrade: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; }; ml: { closeJob: (params: ", - "MlCloseJobRequest", - " | ", - "MlCloseJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlCloseJobResponse", - ", TContext>>; deleteCalendar: (params: ", - "MlDeleteCalendarRequest", - " | ", - "MlDeleteCalendarRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteCalendarResponse", - ", TContext>>; deleteCalendarEvent: (params: ", - "MlDeleteCalendarEventRequest", - " | ", - "MlDeleteCalendarEventRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteCalendarEventResponse", - ", TContext>>; deleteCalendarJob: (params: ", - "MlDeleteCalendarJobRequest", - " | ", - "MlDeleteCalendarJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteCalendarJobResponse", - ", TContext>>; deleteDataFrameAnalytics: (params: ", - "MlDeleteDataFrameAnalyticsRequest", - " | ", - "MlDeleteDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteDataFrameAnalyticsResponse", - ", TContext>>; deleteDatafeed: (params: ", - "MlDeleteDatafeedRequest", - " | ", - "MlDeleteDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteDatafeedResponse", - ", TContext>>; deleteExpiredData: (params?: ", - "MlDeleteExpiredDataRequest", - " | ", - "MlDeleteExpiredDataRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteExpiredDataResponse", - ", TContext>>; deleteFilter: (params: ", - "MlDeleteFilterRequest", - " | ", - "MlDeleteFilterRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteFilterResponse", - ", TContext>>; deleteForecast: (params: ", - "MlDeleteForecastRequest", - " | ", - "MlDeleteForecastRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteForecastResponse", - ", TContext>>; deleteJob: (params: ", - "MlDeleteJobRequest", - " | ", - "MlDeleteJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteJobResponse", - ", TContext>>; deleteModelSnapshot: (params: ", - "MlDeleteModelSnapshotRequest", - " | ", - "MlDeleteModelSnapshotRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteModelSnapshotResponse", - ", TContext>>; deleteTrainedModel: (params: ", - "MlDeleteTrainedModelRequest", - " | ", - "MlDeleteTrainedModelRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteTrainedModelResponse", - ", TContext>>; deleteTrainedModelAlias: (params: ", - "MlDeleteTrainedModelAliasRequest", - " | ", - "MlDeleteTrainedModelAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteTrainedModelAliasResponse", - ", TContext>>; estimateModelMemory: (params?: ", - "MlEstimateModelMemoryRequest", - " | ", - "MlEstimateModelMemoryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlEstimateModelMemoryResponse", - ", TContext>>; evaluateDataFrame: (params?: ", - "MlEvaluateDataFrameRequest", - " | ", - "MlEvaluateDataFrameRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlEvaluateDataFrameResponse", - ", TContext>>; explainDataFrameAnalytics: (params?: ", - "MlExplainDataFrameAnalyticsRequest", - " | ", - "MlExplainDataFrameAnalyticsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlExplainDataFrameAnalyticsResponse", - ", TContext>>; flushJob: (params: ", - "MlFlushJobRequest", - " | ", - "MlFlushJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlFlushJobResponse", - ", TContext>>; forecast: (params: ", - "MlForecastRequest", - " | ", - "MlForecastRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlForecastResponse", - ", TContext>>; getBuckets: (params: ", - "MlGetBucketsRequest", - " | ", - "MlGetBucketsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetBucketsResponse", - ", TContext>>; getCalendarEvents: (params: ", - "MlGetCalendarEventsRequest", - " | ", - "MlGetCalendarEventsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetCalendarEventsResponse", - ", TContext>>; getCalendars: (params?: ", - "MlGetCalendarsRequest", - " | ", - "MlGetCalendarsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetCalendarsResponse", - ", TContext>>; getCategories: (params: ", - "MlGetCategoriesRequest", - " | ", - "MlGetCategoriesRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetCategoriesResponse", - ", TContext>>; getDataFrameAnalytics: (params?: ", - "MlGetDataFrameAnalyticsRequest", - " | ", - "MlGetDataFrameAnalyticsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDataFrameAnalyticsResponse", - ", TContext>>; getDataFrameAnalyticsStats: (params?: ", - "MlGetDataFrameAnalyticsStatsRequest", - " | ", - "MlGetDataFrameAnalyticsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDataFrameAnalyticsStatsResponse", - ", TContext>>; getDatafeedStats: (params?: ", - "MlGetDatafeedStatsRequest", - " | ", - "MlGetDatafeedStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDatafeedStatsResponse", - ", TContext>>; getDatafeeds: (params?: ", - "MlGetDatafeedsRequest", - " | ", - "MlGetDatafeedsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDatafeedsResponse", - ", TContext>>; getFilters: (params?: ", - "MlGetFiltersRequest", - " | ", - "MlGetFiltersRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetFiltersResponse", - ", TContext>>; getInfluencers: (params: ", - "MlGetInfluencersRequest", - " | ", - "MlGetInfluencersRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetInfluencersResponse", - ", TContext>>; getJobStats: (params?: ", - "MlGetJobStatsRequest", - " | ", - "MlGetJobStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetJobStatsResponse", - ", TContext>>; getJobs: (params?: ", - "MlGetJobsRequest", - " | ", - "MlGetJobsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetJobsResponse", - ", TContext>>; getModelSnapshotUpgradeStats: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getModelSnapshots: (params: ", - "MlGetModelSnapshotsRequest", - " | ", - "MlGetModelSnapshotsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetModelSnapshotsResponse", - ", TContext>>; getOverallBuckets: (params: ", - "MlGetOverallBucketsRequest", - " | ", - "MlGetOverallBucketsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetOverallBucketsResponse", - ", TContext>>; getRecords: (params: ", - "MlGetRecordsRequest", - " | ", - "MlGetRecordsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetRecordsResponse", - ", TContext>>; getTrainedModels: (params?: ", - "MlGetTrainedModelsRequest", - " | ", - "MlGetTrainedModelsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetTrainedModelsResponse", - ", TContext>>; getTrainedModelsStats: (params?: ", - "MlGetTrainedModelsStatsRequest", - " | ", - "MlGetTrainedModelsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetTrainedModelsStatsResponse", - ", TContext>>; inferTrainedModelDeployment: (params: ", - "MlInferTrainedModelDeploymentRequest", - " | ", - "MlInferTrainedModelDeploymentRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlInferTrainedModelDeploymentResponse", - ", TContext>>; info: (params?: ", - "MlInfoRequest", - " | ", - "MlInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlInfoResponse", - ", TContext>>; openJob: (params: ", - "MlOpenJobRequest", - " | ", - "MlOpenJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlOpenJobResponse", - ", TContext>>; postCalendarEvents: (params: ", - "MlPostCalendarEventsRequest", - " | ", - "MlPostCalendarEventsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPostCalendarEventsResponse", - ", TContext>>; postData: (params: ", - "MlPostDataRequest", - " | ", - "MlPostDataRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPostDataResponse", - ", TContext>>; previewDataFrameAnalytics: (params?: ", - "MlPreviewDataFrameAnalyticsRequest", - " | ", - "MlPreviewDataFrameAnalyticsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPreviewDataFrameAnalyticsResponse", - ", TContext>>; previewDatafeed: (params?: ", - "MlPreviewDatafeedRequest", - " | ", - "MlPreviewDatafeedRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPreviewDatafeedResponse", - ", TContext>>; putCalendar: (params: ", - "MlPutCalendarRequest", - " | ", - "MlPutCalendarRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutCalendarResponse", - ", TContext>>; putCalendarJob: (params: ", - "MlPutCalendarJobRequest", - " | ", - "MlPutCalendarJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutCalendarJobResponse", - ", TContext>>; putDataFrameAnalytics: (params: ", - "MlPutDataFrameAnalyticsRequest", - " | ", - "MlPutDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutDataFrameAnalyticsResponse", - ", TContext>>; putDatafeed: (params: ", - "MlPutDatafeedRequest", - " | ", - "MlPutDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutDatafeedResponse", - ", TContext>>; putFilter: (params: ", - "MlPutFilterRequest", - " | ", - "MlPutFilterRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutFilterResponse", - ", TContext>>; putJob: (params: ", - "MlPutJobRequest", - " | ", - "MlPutJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutJobResponse", - ", TContext>>; putTrainedModel: (params: ", - "MlPutTrainedModelRequest", - " | ", - "MlPutTrainedModelRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlTrainedModelConfig", - ", TContext>>; putTrainedModelAlias: (params: ", - "MlPutTrainedModelAliasRequest", - " | ", - "MlPutTrainedModelAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutTrainedModelAliasResponse", - ", TContext>>; putTrainedModelDefinitionPart: (params: ", - "MlPutTrainedModelDefinitionPartRequest", - " | ", - "MlPutTrainedModelDefinitionPartRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutTrainedModelDefinitionPartResponse", - ", TContext>>; putTrainedModelVocabulary: (params: ", - "MlPutTrainedModelVocabularyRequest", - " | ", - "MlPutTrainedModelVocabularyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutTrainedModelVocabularyResponse", - ", TContext>>; resetJob: (params: ", - "MlResetJobRequest", - " | ", - "MlResetJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlResetJobResponse", - ", TContext>>; revertModelSnapshot: (params: ", - "MlRevertModelSnapshotRequest", - " | ", - "MlRevertModelSnapshotRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlRevertModelSnapshotResponse", - ", TContext>>; setUpgradeMode: (params?: ", - "MlSetUpgradeModeRequest", - " | ", - "MlSetUpgradeModeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlSetUpgradeModeResponse", - ", TContext>>; startDataFrameAnalytics: (params: ", - "MlStartDataFrameAnalyticsRequest", - " | ", - "MlStartDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStartDataFrameAnalyticsResponse", - ", TContext>>; startDatafeed: (params: ", - "MlStartDatafeedRequest", - " | ", - "MlStartDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStartDatafeedResponse", - ", TContext>>; startTrainedModelDeployment: (params: ", - "MlStartTrainedModelDeploymentRequest", - " | ", - "MlStartTrainedModelDeploymentRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStartTrainedModelDeploymentResponse", - ", TContext>>; stopDataFrameAnalytics: (params: ", - "MlStopDataFrameAnalyticsRequest", - " | ", - "MlStopDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStopDataFrameAnalyticsResponse", - ", TContext>>; stopDatafeed: (params: ", - "MlStopDatafeedRequest", - " | ", - "MlStopDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStopDatafeedResponse", - ", TContext>>; stopTrainedModelDeployment: (params: ", - "MlStopTrainedModelDeploymentRequest", - " | ", - "MlStopTrainedModelDeploymentRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStopTrainedModelDeploymentResponse", - ", TContext>>; updateDataFrameAnalytics: (params: ", - "MlUpdateDataFrameAnalyticsRequest", - " | ", - "MlUpdateDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateDataFrameAnalyticsResponse", - ", TContext>>; updateDatafeed: (params: ", - "MlUpdateDatafeedRequest", - " | ", - "MlUpdateDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateDatafeedResponse", - ", TContext>>; updateFilter: (params: ", - "MlUpdateFilterRequest", - " | ", - "MlUpdateFilterRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateFilterResponse", - ", TContext>>; updateJob: (params: ", - "MlUpdateJobRequest", - " | ", - "MlUpdateJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateJobResponse", - ", TContext>>; updateModelSnapshot: (params: ", - "MlUpdateModelSnapshotRequest", - " | ", - "MlUpdateModelSnapshotRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateModelSnapshotResponse", - ", TContext>>; upgradeJobSnapshot: (params: ", - "MlUpgradeJobSnapshotRequest", - " | ", - "MlUpgradeJobSnapshotRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpgradeJobSnapshotResponse", - ", TContext>>; validate: (params?: ", - "MlValidateRequest", - " | ", - "MlValidateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlValidateResponse", - ", TContext>>; validateDetector: (params?: ", - "MlValidateDetectorRequest", - " | ", - "MlValidateDetectorRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlValidateDetectorResponse", - ", TContext>>; }; msearch: , TContext = unknown>(params?: ", - "MsearchRequest", - " | ", - "MsearchRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MsearchResponse", - ", TContext>>; msearchTemplate: , TContext = unknown>(params?: ", - "MsearchTemplateRequest", - " | ", - "MsearchTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MsearchTemplateResponse", - ", TContext>>; mtermvectors: (params?: ", - "MtermvectorsRequest", - " | ", - "MtermvectorsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MtermvectorsResponse", - ", TContext>>; nodes: { clearRepositoriesMeteringArchive: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getRepositoriesMeteringInfo: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; hotThreads: (params?: ", - "NodesHotThreadsRequest", - " | ", - "NodesHotThreadsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesHotThreadsResponse", - ", TContext>>; info: (params?: ", - "NodesInfoRequest", - " | ", - "NodesInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesInfoResponse", - ", TContext>>; reloadSecureSettings: (params?: ", - "NodesReloadSecureSettingsRequest", - " | ", - "NodesReloadSecureSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesReloadSecureSettingsResponse", - ", TContext>>; stats: (params?: ", - "NodesStatsRequest", - " | ", - "NodesStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesStatsResponse", - ", TContext>>; usage: (params?: ", - "NodesUsageRequest", - " | ", - "NodesUsageRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesUsageResponse", - ", TContext>>; }; openPointInTime: (params: ", - "OpenPointInTimeRequest", - " | ", - "OpenPointInTimeRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "OpenPointInTimeResponse", - ", TContext>>; ping: (params?: ", - "PingRequest", - " | ", - "PingRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; putScript: (params: ", - "PutScriptRequest", - " | ", - "PutScriptRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "PutScriptResponse", - ", TContext>>; rankEval: (params: ", - "RankEvalRequest", - " | ", - "RankEvalRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RankEvalResponse", - ", TContext>>; reindex: (params?: ", - "ReindexRequest", - " | ", - "ReindexRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ReindexResponse", - ", TContext>>; reindexRethrottle: (params: ", - "ReindexRethrottleRequest", - " | ", - "ReindexRethrottleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ReindexRethrottleResponse", - ", TContext>>; renderSearchTemplate: (params?: ", - "RenderSearchTemplateRequest", - " | ", - "RenderSearchTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RenderSearchTemplateResponse", - ", TContext>>; rollup: { deleteJob: (params: ", - "RollupDeleteJobRequest", - " | ", - "RollupDeleteJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupDeleteJobResponse", - ", TContext>>; getJobs: (params?: ", - "RollupGetJobsRequest", - " | ", - "RollupGetJobsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupGetJobsResponse", - ", TContext>>; getRollupCaps: (params?: ", - "RollupGetRollupCapsRequest", - " | ", - "RollupGetRollupCapsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupGetRollupCapsResponse", - ", TContext>>; getRollupIndexCaps: (params: ", - "RollupGetRollupIndexCapsRequest", - " | ", - "RollupGetRollupIndexCapsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupGetRollupIndexCapsResponse", - ", TContext>>; putJob: (params: ", - "RollupPutJobRequest", - " | ", - "RollupPutJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupPutJobResponse", - ", TContext>>; rollup: (params: ", - "RollupRollupRequest", - " | ", - "RollupRollupRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; rollupSearch: , TContext = unknown>(params: ", - "RollupRollupSearchRequest", - " | ", - "RollupRollupSearchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupRollupSearchResponse", - ", TContext>>; startJob: (params: ", - "RollupStartJobRequest", - " | ", - "RollupStartJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupStartJobResponse", - ", TContext>>; stopJob: (params: ", - "RollupStopJobRequest", - " | ", - "RollupStopJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupStopJobResponse", - ", TContext>>; }; scriptsPainlessExecute: (params?: ", - "ScriptsPainlessExecuteRequest", - " | ", - "ScriptsPainlessExecuteRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ScriptsPainlessExecuteResponse", - ", TContext>>; scroll: , TContext = unknown>(params?: ", - "ScrollRequest", - " | ", - "ScrollRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ScrollResponse", - ", TContext>>; searchMvt: (params: ", - "SearchMvtRequest", - " | ", - "SearchMvtRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; searchShards: (params?: ", - "SearchShardsRequest", - " | ", - "SearchShardsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchShardsResponse", - ", TContext>>; searchTemplate: (params?: ", - "SearchTemplateRequest", - " | ", - "SearchTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchTemplateResponse", - ", TContext>>; searchableSnapshots: { cacheStats: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; clearCache: (params?: ", - "SearchableSnapshotsClearCacheRequest", - " | ", - "SearchableSnapshotsClearCacheRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; mount: (params: ", - "SearchableSnapshotsMountRequest", - " | ", - "SearchableSnapshotsMountRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchableSnapshotsMountResponse", - ", TContext>>; stats: (params?: ", - "SearchableSnapshotsStatsRequest", - " | ", - "SearchableSnapshotsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchableSnapshotsStatsResponse", - ", TContext>>; }; shutdown: { deleteNode: (params: ", - "ShutdownDeleteNodeRequest", - " | ", - "ShutdownDeleteNodeRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ShutdownDeleteNodeResponse", - ", TContext>>; getNode: (params?: ", - "ShutdownGetNodeRequest", - " | ", - "ShutdownGetNodeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ShutdownGetNodeResponse", - ", TContext>>; putNode: (params: ", - "ShutdownPutNodeRequest", - " | ", - "ShutdownPutNodeRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ShutdownPutNodeResponse", - ", TContext>>; }; slm: { deleteLifecycle: (params: ", - "SlmDeleteLifecycleRequest", - " | ", - "SlmDeleteLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmDeleteLifecycleResponse", - ", TContext>>; executeLifecycle: (params: ", - "SlmExecuteLifecycleRequest", - " | ", - "SlmExecuteLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmExecuteLifecycleResponse", - ", TContext>>; executeRetention: (params?: ", - "SlmExecuteRetentionRequest", - " | ", - "SlmExecuteRetentionRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmExecuteRetentionResponse", - ", TContext>>; getLifecycle: (params?: ", - "SlmGetLifecycleRequest", - " | ", - "SlmGetLifecycleRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmGetLifecycleResponse", - ", TContext>>; getStats: (params?: ", - "SlmGetStatsRequest", - " | ", - "SlmGetStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmGetStatsResponse", - ", TContext>>; getStatus: (params?: ", - "SlmGetStatusRequest", - " | ", - "SlmGetStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmGetStatusResponse", - ", TContext>>; putLifecycle: (params: ", - "SlmPutLifecycleRequest", - " | ", - "SlmPutLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmPutLifecycleResponse", - ", TContext>>; start: (params?: ", - "SlmStartRequest", - " | ", - "SlmStartRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmStartResponse", - ", TContext>>; stop: (params?: ", - "SlmStopRequest", - " | ", - "SlmStopRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmStopResponse", - ", TContext>>; }; snapshot: { cleanupRepository: (params: ", - "SnapshotCleanupRepositoryRequest", - " | ", - "SnapshotCleanupRepositoryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCleanupRepositoryResponse", - ", TContext>>; clone: (params: ", - "SnapshotCloneRequest", - " | ", - "SnapshotCloneRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCloneResponse", - ", TContext>>; create: (params: ", - "SnapshotCreateRequest", - " | ", - "SnapshotCreateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCreateResponse", - ", TContext>>; createRepository: (params: ", - "SnapshotCreateRepositoryRequest", - " | ", - "SnapshotCreateRepositoryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCreateRepositoryResponse", - ", TContext>>; delete: (params: ", - "SnapshotDeleteRequest", - " | ", - "SnapshotDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotDeleteResponse", - ", TContext>>; deleteRepository: (params: ", - "SnapshotDeleteRepositoryRequest", - " | ", - "SnapshotDeleteRepositoryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotDeleteRepositoryResponse", - ", TContext>>; get: (params: ", - "SnapshotGetRequest", - " | ", - "SnapshotGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotGetResponse", - ", TContext>>; getRepository: (params?: ", - "SnapshotGetRepositoryRequest", - " | ", - "SnapshotGetRepositoryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotGetRepositoryResponse", - ", TContext>>; repositoryAnalyze: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; restore: (params: ", - "SnapshotRestoreRequest", - " | ", - "SnapshotRestoreRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotRestoreResponse", - ", TContext>>; status: (params?: ", - "SnapshotStatusRequest", - " | ", - "SnapshotStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotStatusResponse", - ", TContext>>; verifyRepository: (params: ", - "SnapshotVerifyRepositoryRequest", - " | ", - "SnapshotVerifyRepositoryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotVerifyRepositoryResponse", - ", TContext>>; }; sql: { clearCursor: (params?: ", - "SqlClearCursorRequest", - " | ", - "SqlClearCursorRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SqlClearCursorResponse", - ", TContext>>; deleteAsync: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getAsync: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getAsyncStatus: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; query: (params?: ", - "SqlQueryRequest", - " | ", - "SqlQueryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SqlQueryResponse", - ", TContext>>; translate: (params?: ", - "SqlTranslateRequest", - " | ", - "SqlTranslateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SqlTranslateResponse", - ", TContext>>; }; ssl: { certificates: (params?: ", - "SslCertificatesRequest", - " | ", - "SslCertificatesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SslCertificatesResponse", - ", TContext>>; }; tasks: { cancel: (params?: ", - "TasksCancelRequest", - " | ", - "TasksCancelRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TasksCancelResponse", - ", TContext>>; get: (params: ", - "TasksGetRequest", - " | ", - "TasksGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TasksGetResponse", - ", TContext>>; list: (params?: ", - "TasksListRequest", - " | ", - "TasksListRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TasksListResponse", - ", TContext>>; }; termsEnum: (params: ", - "TermsEnumRequest", - " | ", - "TermsEnumRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TermsEnumResponse", - ", TContext>>; termvectors: (params: ", - "TermvectorsRequest", - " | ", - "TermvectorsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TermvectorsResponse", - ", TContext>>; textStructure: { findStructure: (params: ", - "TextStructureFindStructureRequest", - " | ", - "TextStructureFindStructureRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TextStructureFindStructureResponse", - ", TContext>>; }; updateByQuery: (params: ", - "UpdateByQueryRequest", - " | ", - "UpdateByQueryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "UpdateByQueryResponse", - ", TContext>>; updateByQueryRethrottle: (params: ", - "UpdateByQueryRethrottleRequest", - " | ", - "UpdateByQueryRethrottleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "UpdateByQueryRethrottleResponse", - ", TContext>>; watcher: { ackWatch: (params: ", - "WatcherAckWatchRequest", - " | ", - "WatcherAckWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherAckWatchResponse", - ", TContext>>; activateWatch: (params: ", - "WatcherActivateWatchRequest", - " | ", - "WatcherActivateWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherActivateWatchResponse", - ", TContext>>; deactivateWatch: (params: ", - "WatcherDeactivateWatchRequest", - " | ", - "WatcherDeactivateWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherDeactivateWatchResponse", - ", TContext>>; deleteWatch: (params: ", - "WatcherDeleteWatchRequest", - " | ", - "WatcherDeleteWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherDeleteWatchResponse", - ", TContext>>; executeWatch: (params?: ", - "WatcherExecuteWatchRequest", - " | ", - "WatcherExecuteWatchRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherExecuteWatchResponse", - ", TContext>>; getWatch: (params: ", - "WatcherGetWatchRequest", - " | ", - "WatcherGetWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherGetWatchResponse", - ", TContext>>; putWatch: (params: ", - "WatcherPutWatchRequest", - " | ", - "WatcherPutWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherPutWatchResponse", - ", TContext>>; queryWatches: (params?: ", - "WatcherQueryWatchesRequest", - " | ", - "WatcherQueryWatchesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherQueryWatchesResponse", - ", TContext>>; start: (params?: ", - "WatcherStartRequest", - " | ", - "WatcherStartRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherStartResponse", - ", TContext>>; stats: (params?: ", - "WatcherStatsRequest", - " | ", - "WatcherStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherStatsResponse", - ", TContext>>; stop: (params?: ", - "WatcherStopRequest", - " | ", - "WatcherStopRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherStopResponse", - ", TContext>>; }; xpack: { info: (params?: ", - "XpackInfoRequest", - " | ", - "XpackInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "XpackInfoResponse", - ", TContext>>; usage: (params?: ", - "XpackUsageRequest", - " | ", - "XpackUsageRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "XpackUsageResponse", - ", TContext>>; }; }" - ], - "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/securitysolution-es-utils", - "id": "def-server.getIndexAliases.$1.alias", - "type": "string", - "tags": [], - "label": "alias", - "description": [], - "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [ - "an array of {@link IndexAlias } objects" - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/securitysolution-es-utils", - "id": "def-server.getIndexCount", - "type": "Function", - "tags": [], - "label": "getIndexCount", - "description": [ - "\nRetrieves the count of documents in a given index\n" - ], - "signature": [ - "({ esClient, index, }: { esClient: ", - "ElasticsearchClient", - "; index: string; }) => Promise" - ], - "path": "packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/securitysolution-es-utils", - "id": "def-server.getIndexCount.$1", - "type": "Object", - "tags": [], - "label": "{\n esClient,\n index,\n}", - "description": [], - "path": "packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/securitysolution-es-utils", - "id": "def-server.getIndexCount.$1.esClient", - "type": "Object", - "tags": [], - "label": "esClient", - "description": [], - "signature": [ - "{ eql: { delete: (params: ", - "EqlDeleteRequest", - " | ", - "EqlDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlDeleteResponse", - ", TContext>>; get: (params: ", - "EqlGetRequest", - " | ", - "EqlGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlGetResponse", - ", TContext>>; getStatus: (params: ", - "EqlGetStatusRequest", - " | ", - "EqlGetStatusRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlGetStatusResponse", - ", TContext>>; search: (params: ", - "EqlSearchRequest", - " | ", - "EqlSearchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EqlSearchResponse", - ", TContext>>; }; search: , TContext = unknown>(params?: ", - "SearchRequest", - " | ", - "SearchRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchResponse", - ", TContext>>; create: (params: ", - "CreateRequest", - " | ", - "CreateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CreateResponse", - ", TContext>>; monitoring: { bulk: (params: ", - "MonitoringBulkRequest", - " | ", - "MonitoringBulkRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MonitoringBulkResponse", - ", TContext>>; }; security: { authenticate: (params?: ", - "SecurityAuthenticateRequest", - " | ", - "SecurityAuthenticateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityAuthenticateResponse", - ", TContext>>; changePassword: (params?: ", - "SecurityChangePasswordRequest", - " | ", - "SecurityChangePasswordRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityChangePasswordResponse", - ", TContext>>; clearApiKeyCache: (params: ", - "SecurityClearApiKeyCacheRequest", - " | ", - "SecurityClearApiKeyCacheRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearApiKeyCacheResponse", - ", TContext>>; clearCachedPrivileges: (params: ", - "SecurityClearCachedPrivilegesRequest", - " | ", - "SecurityClearCachedPrivilegesRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedPrivilegesResponse", - ", TContext>>; clearCachedRealms: (params: ", - "SecurityClearCachedRealmsRequest", - " | ", - "SecurityClearCachedRealmsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedRealmsResponse", - ", TContext>>; clearCachedRoles: (params: ", - "SecurityClearCachedRolesRequest", - " | ", - "SecurityClearCachedRolesRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedRolesResponse", - ", TContext>>; clearCachedServiceTokens: (params: ", - "SecurityClearCachedServiceTokensRequest", - " | ", - "SecurityClearCachedServiceTokensRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityClearCachedServiceTokensResponse", - ", TContext>>; createApiKey: (params?: ", - "SecurityCreateApiKeyRequest", - " | ", - "SecurityCreateApiKeyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityCreateApiKeyResponse", - ", TContext>>; createServiceToken: (params: ", - "SecurityCreateServiceTokenRequest", - " | ", - "SecurityCreateServiceTokenRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityCreateServiceTokenResponse", - ", TContext>>; deletePrivileges: (params: ", - "SecurityDeletePrivilegesRequest", - " | ", - "SecurityDeletePrivilegesRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeletePrivilegesResponse", - ", TContext>>; deleteRole: (params: ", - "SecurityDeleteRoleRequest", - " | ", - "SecurityDeleteRoleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeleteRoleResponse", - ", TContext>>; deleteRoleMapping: (params: ", - "SecurityDeleteRoleMappingRequest", - " | ", - "SecurityDeleteRoleMappingRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeleteRoleMappingResponse", - ", TContext>>; deleteServiceToken: (params: ", - "SecurityDeleteServiceTokenRequest", - " | ", - "SecurityDeleteServiceTokenRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeleteServiceTokenResponse", - ", TContext>>; deleteUser: (params: ", - "SecurityDeleteUserRequest", - " | ", - "SecurityDeleteUserRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDeleteUserResponse", - ", TContext>>; disableUser: (params: ", - "SecurityDisableUserRequest", - " | ", - "SecurityDisableUserRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityDisableUserResponse", - ", TContext>>; enableUser: (params: ", - "SecurityEnableUserRequest", - " | ", - "SecurityEnableUserRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityEnableUserResponse", - ", TContext>>; enrollKibana: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; enrollNode: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getApiKey: (params?: ", - "SecurityGetApiKeyRequest", - " | ", - "SecurityGetApiKeyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetApiKeyResponse", - ", TContext>>; getBuiltinPrivileges: (params?: ", - "SecurityGetBuiltinPrivilegesRequest", - " | ", - "SecurityGetBuiltinPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetBuiltinPrivilegesResponse", - ", TContext>>; getPrivileges: (params?: ", - "SecurityGetPrivilegesRequest", - " | ", - "SecurityGetPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetPrivilegesResponse", - ", TContext>>; getRole: (params?: ", - "SecurityGetRoleRequest", - " | ", - "SecurityGetRoleRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetRoleResponse", - ", TContext>>; getRoleMapping: (params?: ", - "SecurityGetRoleMappingRequest", - " | ", - "SecurityGetRoleMappingRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetRoleMappingResponse", - ", TContext>>; getServiceAccounts: (params?: ", - "SecurityGetServiceAccountsRequest", - " | ", - "SecurityGetServiceAccountsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetServiceAccountsResponse", - ", TContext>>; getServiceCredentials: (params: ", - "SecurityGetServiceCredentialsRequest", - " | ", - "SecurityGetServiceCredentialsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetServiceCredentialsResponse", - ", TContext>>; getToken: (params?: ", - "SecurityGetTokenRequest", - " | ", - "SecurityGetTokenRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetTokenResponse", - ", TContext>>; getUser: (params?: ", - "SecurityGetUserRequest", - " | ", - "SecurityGetUserRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetUserResponse", - ", TContext>>; getUserPrivileges: (params?: ", - "SecurityGetUserPrivilegesRequest", - " | ", - "SecurityGetUserPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGetUserPrivilegesResponse", - ", TContext>>; grantApiKey: (params?: ", - "SecurityGrantApiKeyRequest", - " | ", - "SecurityGrantApiKeyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityGrantApiKeyResponse", - ", TContext>>; hasPrivileges: (params?: ", - "SecurityHasPrivilegesRequest", - " | ", - "SecurityHasPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityHasPrivilegesResponse", - ", TContext>>; invalidateApiKey: (params?: ", - "SecurityInvalidateApiKeyRequest", - " | ", - "SecurityInvalidateApiKeyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityInvalidateApiKeyResponse", - ", TContext>>; invalidateToken: (params?: ", - "SecurityInvalidateTokenRequest", - " | ", - "SecurityInvalidateTokenRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityInvalidateTokenResponse", - ", TContext>>; putPrivileges: (params?: ", - "SecurityPutPrivilegesRequest", - " | ", - "SecurityPutPrivilegesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutPrivilegesResponse", - ", TContext>>; putRole: (params: ", - "SecurityPutRoleRequest", - " | ", - "SecurityPutRoleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutRoleResponse", - ", TContext>>; putRoleMapping: (params: ", - "SecurityPutRoleMappingRequest", - " | ", - "SecurityPutRoleMappingRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutRoleMappingResponse", - ", TContext>>; putUser: (params: ", - "SecurityPutUserRequest", - " | ", - "SecurityPutUserRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SecurityPutUserResponse", - ", TContext>>; queryApiKeys: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlAuthenticate: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlCompleteLogout: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlInvalidate: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlLogout: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlPrepareAuthentication: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; samlServiceProviderMetadata: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; }; name: string | symbol; index: (params: ", - "IndexRequest", - " | ", - "IndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndexResponse", - ", TContext>>; delete: (params: ", - "DeleteRequest", - " | ", - "DeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteResponse", - ", TContext>>; get: (params: ", - "GetRequest", - " | ", - "GetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetResponse", - ", TContext>>; update: (params: ", - "UpdateRequest", - " | ", - "UpdateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "UpdateResponse", - ", TContext>>; closePointInTime: (params?: ", - "ClosePointInTimeRequest", - " | ", - "ClosePointInTimeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClosePointInTimeResponse", - ", TContext>>; transform: { deleteTransform: (params: ", - "TransformDeleteTransformRequest", - " | ", - "TransformDeleteTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformDeleteTransformResponse", - ", TContext>>; getTransform: (params?: ", - "TransformGetTransformRequest", - " | ", - "TransformGetTransformRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformGetTransformResponse", - ", TContext>>; getTransformStats: (params: ", - "TransformGetTransformStatsRequest", - " | ", - "TransformGetTransformStatsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformGetTransformStatsResponse", - ", TContext>>; previewTransform: (params?: ", - "TransformPreviewTransformRequest", - " | ", - "TransformPreviewTransformRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformPreviewTransformResponse", - ", TContext>>; putTransform: (params: ", - "TransformPutTransformRequest", - " | ", - "TransformPutTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformPutTransformResponse", - ", TContext>>; resetTransform: (params: ", - "TransformResetTransformRequest", - " | ", - "TransformResetTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformResetTransformResponse", - ", TContext>>; startTransform: (params: ", - "TransformStartTransformRequest", - " | ", - "TransformStartTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformStartTransformResponse", - ", TContext>>; stopTransform: (params: ", - "TransformStopTransformRequest", - " | ", - "TransformStopTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformStopTransformResponse", - ", TContext>>; updateTransform: (params: ", - "TransformUpdateTransformRequest", - " | ", - "TransformUpdateTransformRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformUpdateTransformResponse", - ", TContext>>; upgradeTransforms: (params?: ", - "TransformUpgradeTransformsRequest", - " | ", - "TransformUpgradeTransformsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TransformUpgradeTransformsResponse", - ", TContext>>; }; helpers: ", - "default", - "; asyncSearch: { delete: (params: ", - "AsyncSearchDeleteRequest", - " | ", - "AsyncSearchDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchDeleteResponse", - ", TContext>>; get: (params: ", - "AsyncSearchGetRequest", - " | ", - "AsyncSearchGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchGetResponse", - ", TContext>>; status: (params: ", - "AsyncSearchStatusRequest", - " | ", - "AsyncSearchStatusRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchStatusResponse", - ", TContext>>; submit: (params?: ", - "AsyncSearchSubmitRequest", - " | ", - "AsyncSearchSubmitRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AsyncSearchSubmitResponse", - ", TContext>>; }; autoscaling: { deleteAutoscalingPolicy: (params: ", - "AutoscalingDeleteAutoscalingPolicyRequest", - " | ", - "AutoscalingDeleteAutoscalingPolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AutoscalingDeleteAutoscalingPolicyResponse", - ", TContext>>; getAutoscalingCapacity: (params?: ", - "AutoscalingGetAutoscalingCapacityRequest", - " | ", - "AutoscalingGetAutoscalingCapacityRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AutoscalingGetAutoscalingCapacityResponse", - ", TContext>>; getAutoscalingPolicy: (params: ", - "AutoscalingGetAutoscalingPolicyRequest", - " | ", - "AutoscalingGetAutoscalingPolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AutoscalingAutoscalingPolicy", - ", TContext>>; putAutoscalingPolicy: (params: ", - "AutoscalingPutAutoscalingPolicyRequest", - " | ", - "AutoscalingPutAutoscalingPolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "AutoscalingPutAutoscalingPolicyResponse", - ", TContext>>; }; bulk: (params: ", - "BulkRequest", - " | ", - "BulkRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "BulkResponse", - ", TContext>>; cat: { aliases: (params?: ", - "CatAliasesRequest", - " | ", - "CatAliasesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatAliasesResponse", - ", TContext>>; allocation: (params?: ", - "CatAllocationRequest", - " | ", - "CatAllocationRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatAllocationResponse", - ", TContext>>; count: (params?: ", - "CatCountRequest", - " | ", - "CatCountRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatCountResponse", - ", TContext>>; fielddata: (params?: ", - "CatFielddataRequest", - " | ", - "CatFielddataRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatFielddataResponse", - ", TContext>>; health: (params?: ", - "CatHealthRequest", - " | ", - "CatHealthRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatHealthResponse", - ", TContext>>; help: (params?: ", - "CatHelpRequest", - " | ", - "CatHelpRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatHelpResponse", - ", TContext>>; indices: (params?: ", - "CatIndicesRequest", - " | ", - "CatIndicesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatIndicesResponse", - ", TContext>>; master: (params?: ", - "CatMasterRequest", - " | ", - "CatMasterRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMasterResponse", - ", TContext>>; mlDataFrameAnalytics: (params?: ", - "CatMlDataFrameAnalyticsRequest", - " | ", - "CatMlDataFrameAnalyticsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlDataFrameAnalyticsResponse", - ", TContext>>; mlDatafeeds: (params?: ", - "CatMlDatafeedsRequest", - " | ", - "CatMlDatafeedsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlDatafeedsResponse", - ", TContext>>; mlJobs: (params?: ", - "CatMlJobsRequest", - " | ", - "CatMlJobsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlJobsResponse", - ", TContext>>; mlTrainedModels: (params?: ", - "CatMlTrainedModelsRequest", - " | ", - "CatMlTrainedModelsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatMlTrainedModelsResponse", - ", TContext>>; nodeattrs: (params?: ", - "CatNodeattrsRequest", - " | ", - "CatNodeattrsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatNodeattrsResponse", - ", TContext>>; nodes: (params?: ", - "CatNodesRequest", - " | ", - "CatNodesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatNodesResponse", - ", TContext>>; pendingTasks: (params?: ", - "CatPendingTasksRequest", - " | ", - "CatPendingTasksRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatPendingTasksResponse", - ", TContext>>; plugins: (params?: ", - "CatPluginsRequest", - " | ", - "CatPluginsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatPluginsResponse", - ", TContext>>; recovery: (params?: ", - "CatRecoveryRequest", - " | ", - "CatRecoveryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatRecoveryResponse", - ", TContext>>; repositories: (params?: ", - "CatRepositoriesRequest", - " | ", - "CatRepositoriesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatRepositoriesResponse", - ", TContext>>; segments: (params?: ", - "CatSegmentsRequest", - " | ", - "CatSegmentsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatSegmentsResponse", - ", TContext>>; shards: (params?: ", - "CatShardsRequest", - " | ", - "CatShardsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatShardsResponse", - ", TContext>>; snapshots: (params?: ", - "CatSnapshotsRequest", - " | ", - "CatSnapshotsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatSnapshotsResponse", - ", TContext>>; tasks: (params?: ", - "CatTasksRequest", - " | ", - "CatTasksRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatTasksResponse", - ", TContext>>; templates: (params?: ", - "CatTemplatesRequest", - " | ", - "CatTemplatesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatTemplatesResponse", - ", TContext>>; threadPool: (params?: ", - "CatThreadPoolRequest", - " | ", - "CatThreadPoolRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatThreadPoolResponse", - ", TContext>>; transforms: (params?: ", - "CatTransformsRequest", - " | ", - "CatTransformsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CatTransformsResponse", - ", TContext>>; }; ccr: { deleteAutoFollowPattern: (params: ", - "CcrDeleteAutoFollowPatternRequest", - " | ", - "CcrDeleteAutoFollowPatternRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrDeleteAutoFollowPatternResponse", - ", TContext>>; follow: (params: ", - "CcrFollowRequest", - " | ", - "CcrFollowRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrFollowResponse", - ", TContext>>; followInfo: (params: ", - "CcrFollowInfoRequest", - " | ", - "CcrFollowInfoRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrFollowInfoResponse", - ", TContext>>; followStats: (params: ", - "CcrFollowStatsRequest", - " | ", - "CcrFollowStatsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrFollowStatsResponse", - ", TContext>>; forgetFollower: (params: ", - "CcrForgetFollowerRequest", - " | ", - "CcrForgetFollowerRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrForgetFollowerResponse", - ", TContext>>; getAutoFollowPattern: (params?: ", - "CcrGetAutoFollowPatternRequest", - " | ", - "CcrGetAutoFollowPatternRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrGetAutoFollowPatternResponse", - ", TContext>>; pauseAutoFollowPattern: (params: ", - "CcrPauseAutoFollowPatternRequest", - " | ", - "CcrPauseAutoFollowPatternRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrPauseAutoFollowPatternResponse", - ", TContext>>; pauseFollow: (params: ", - "CcrPauseFollowRequest", - " | ", - "CcrPauseFollowRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrPauseFollowResponse", - ", TContext>>; putAutoFollowPattern: (params: ", - "CcrPutAutoFollowPatternRequest", - " | ", - "CcrPutAutoFollowPatternRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrPutAutoFollowPatternResponse", - ", TContext>>; resumeAutoFollowPattern: (params: ", - "CcrResumeAutoFollowPatternRequest", - " | ", - "CcrResumeAutoFollowPatternRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrResumeAutoFollowPatternResponse", - ", TContext>>; resumeFollow: (params: ", - "CcrResumeFollowRequest", - " | ", - "CcrResumeFollowRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrResumeFollowResponse", - ", TContext>>; stats: (params?: ", - "CcrStatsRequest", - " | ", - "CcrStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrStatsResponse", - ", TContext>>; unfollow: (params: ", - "CcrUnfollowRequest", - " | ", - "CcrUnfollowRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CcrUnfollowResponse", - ", TContext>>; }; clearScroll: (params?: ", - "ClearScrollRequest", - " | ", - "ClearScrollRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClearScrollResponse", - ", TContext>>; cluster: { allocationExplain: (params?: ", - "ClusterAllocationExplainRequest", - " | ", - "ClusterAllocationExplainRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterAllocationExplainResponse", - ", TContext>>; deleteComponentTemplate: (params: ", - "ClusterDeleteComponentTemplateRequest", - " | ", - "ClusterDeleteComponentTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterDeleteComponentTemplateResponse", - ", TContext>>; deleteVotingConfigExclusions: (params?: ", - "ClusterDeleteVotingConfigExclusionsRequest", - " | ", - "ClusterDeleteVotingConfigExclusionsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsComponentTemplate: (params: ", - "ClusterExistsComponentTemplateRequest", - " | ", - "ClusterExistsComponentTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; getComponentTemplate: (params?: ", - "ClusterGetComponentTemplateRequest", - " | ", - "ClusterGetComponentTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterGetComponentTemplateResponse", - ", TContext>>; getSettings: (params?: ", - "ClusterGetSettingsRequest", - " | ", - "ClusterGetSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterGetSettingsResponse", - ", TContext>>; health: (params?: ", - "ClusterHealthRequest", - " | ", - "ClusterHealthRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterHealthResponse", - ", TContext>>; pendingTasks: (params?: ", - "ClusterPendingTasksRequest", - " | ", - "ClusterPendingTasksRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterPendingTasksResponse", - ", TContext>>; postVotingConfigExclusions: (params?: ", - "ClusterPostVotingConfigExclusionsRequest", - " | ", - "ClusterPostVotingConfigExclusionsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; putComponentTemplate: (params: ", - "ClusterPutComponentTemplateRequest", - " | ", - "ClusterPutComponentTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterPutComponentTemplateResponse", - ", TContext>>; putSettings: (params?: ", - "ClusterPutSettingsRequest", - " | ", - "ClusterPutSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterPutSettingsResponse", - ", TContext>>; remoteInfo: (params?: ", - "ClusterRemoteInfoRequest", - " | ", - "ClusterRemoteInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterRemoteInfoResponse", - ", TContext>>; reroute: (params?: ", - "ClusterRerouteRequest", - " | ", - "ClusterRerouteRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterRerouteResponse", - ", TContext>>; state: (params?: ", - "ClusterStateRequest", - " | ", - "ClusterStateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; stats: (params?: ", - "ClusterStatsRequest", - " | ", - "ClusterStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ClusterStatsResponse", - ", TContext>>; }; count: (params?: ", - "CountRequest", - " | ", - "CountRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "CountResponse", - ", TContext>>; danglingIndices: { deleteDanglingIndex: (params: ", - "DanglingIndicesDeleteDanglingIndexRequest", - " | ", - "DanglingIndicesDeleteDanglingIndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DanglingIndicesDeleteDanglingIndexResponse", - ", TContext>>; importDanglingIndex: (params: ", - "DanglingIndicesImportDanglingIndexRequest", - " | ", - "DanglingIndicesImportDanglingIndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DanglingIndicesImportDanglingIndexResponse", - ", TContext>>; listDanglingIndices: (params?: ", - "DanglingIndicesListDanglingIndicesRequest", - " | ", - "DanglingIndicesListDanglingIndicesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DanglingIndicesListDanglingIndicesResponse", - ", TContext>>; }; deleteByQuery: (params: ", - "DeleteByQueryRequest", - " | ", - "DeleteByQueryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteByQueryResponse", - ", TContext>>; deleteByQueryRethrottle: (params: ", - "DeleteByQueryRethrottleRequest", - " | ", - "DeleteByQueryRethrottleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteByQueryRethrottleResponse", - ", TContext>>; deleteScript: (params: ", - "DeleteScriptRequest", - " | ", - "DeleteScriptRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "DeleteScriptResponse", - ", TContext>>; enrich: { deletePolicy: (params: ", - "EnrichDeletePolicyRequest", - " | ", - "EnrichDeletePolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichDeletePolicyResponse", - ", TContext>>; executePolicy: (params: ", - "EnrichExecutePolicyRequest", - " | ", - "EnrichExecutePolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichExecutePolicyResponse", - ", TContext>>; getPolicy: (params?: ", - "EnrichGetPolicyRequest", - " | ", - "EnrichGetPolicyRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichGetPolicyResponse", - ", TContext>>; putPolicy: (params: ", - "EnrichPutPolicyRequest", - " | ", - "EnrichPutPolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichPutPolicyResponse", - ", TContext>>; stats: (params?: ", - "EnrichStatsRequest", - " | ", - "EnrichStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "EnrichStatsResponse", - ", TContext>>; }; exists: (params: ", - "ExistsRequest", - " | ", - "ExistsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsSource: (params: ", - "ExistsSourceRequest", - " | ", - "ExistsSourceRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; explain: (params: ", - "ExplainRequest", - " | ", - "ExplainRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ExplainResponse", - ", TContext>>; features: { getFeatures: (params?: ", - "FeaturesGetFeaturesRequest", - " | ", - "FeaturesGetFeaturesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FeaturesGetFeaturesResponse", - ", TContext>>; resetFeatures: (params?: ", - "FeaturesResetFeaturesRequest", - " | ", - "FeaturesResetFeaturesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FeaturesResetFeaturesResponse", - ", TContext>>; }; fieldCaps: (params?: ", - "FieldCapsRequest", - " | ", - "FieldCapsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FieldCapsResponse", - ", TContext>>; fleet: { globalCheckpoints: (params: ", - "FleetGlobalCheckpointsRequest", - " | ", - "FleetGlobalCheckpointsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "FleetGlobalCheckpointsResponse", - ", TContext>>; msearch: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; search: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; }; getScript: (params: ", - "GetScriptRequest", - " | ", - "GetScriptRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetScriptResponse", - ", TContext>>; getScriptContext: (params?: ", - "GetScriptContextRequest", - " | ", - "GetScriptContextRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetScriptContextResponse", - ", TContext>>; getScriptLanguages: (params?: ", - "GetScriptLanguagesRequest", - " | ", - "GetScriptLanguagesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GetScriptLanguagesResponse", - ", TContext>>; getSource: (params: ", - "GetSourceRequest", - " | ", - "GetSourceRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; graph: { explore: (params: ", - "GraphExploreRequest", - " | ", - "GraphExploreRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "GraphExploreResponse", - ", TContext>>; }; ilm: { deleteLifecycle: (params: ", - "IlmDeleteLifecycleRequest", - " | ", - "IlmDeleteLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmDeleteLifecycleResponse", - ", TContext>>; explainLifecycle: (params: ", - "IlmExplainLifecycleRequest", - " | ", - "IlmExplainLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmExplainLifecycleResponse", - ", TContext>>; getLifecycle: (params?: ", - "IlmGetLifecycleRequest", - " | ", - "IlmGetLifecycleRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmGetLifecycleResponse", - ", TContext>>; getStatus: (params?: ", - "IlmGetStatusRequest", - " | ", - "IlmGetStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmGetStatusResponse", - ", TContext>>; migrateToDataTiers: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; moveToStep: (params: ", - "IlmMoveToStepRequest", - " | ", - "IlmMoveToStepRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmMoveToStepResponse", - ", TContext>>; putLifecycle: (params: ", - "IlmPutLifecycleRequest", - " | ", - "IlmPutLifecycleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmPutLifecycleResponse", - ", TContext>>; removePolicy: (params: ", - "IlmRemovePolicyRequest", - " | ", - "IlmRemovePolicyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmRemovePolicyResponse", - ", TContext>>; retry: (params: ", - "IlmRetryRequest", - " | ", - "IlmRetryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmRetryResponse", - ", TContext>>; start: (params?: ", - "IlmStartRequest", - " | ", - "IlmStartRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmStartResponse", - ", TContext>>; stop: (params?: ", - "IlmStopRequest", - " | ", - "IlmStopRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IlmStopResponse", - ", TContext>>; }; indices: { addBlock: (params: ", - "IndicesAddBlockRequest", - " | ", - "IndicesAddBlockRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesAddBlockResponse", - ", TContext>>; analyze: (params?: ", - "IndicesAnalyzeRequest", - " | ", - "IndicesAnalyzeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesAnalyzeResponse", - ", TContext>>; clearCache: (params?: ", - "IndicesClearCacheRequest", - " | ", - "IndicesClearCacheRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesClearCacheResponse", - ", TContext>>; clone: (params: ", - "IndicesCloneRequest", - " | ", - "IndicesCloneRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCloneResponse", - ", TContext>>; close: (params: ", - "IndicesCloseRequest", - " | ", - "IndicesCloseRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCloseResponse", - ", TContext>>; create: (params: ", - "IndicesCreateRequest", - " | ", - "IndicesCreateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCreateResponse", - ", TContext>>; createDataStream: (params: ", - "IndicesCreateDataStreamRequest", - " | ", - "IndicesCreateDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesCreateDataStreamResponse", - ", TContext>>; dataStreamsStats: (params?: ", - "IndicesDataStreamsStatsRequest", - " | ", - "IndicesDataStreamsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDataStreamsStatsResponse", - ", TContext>>; delete: (params: ", - "IndicesDeleteRequest", - " | ", - "IndicesDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteResponse", - ", TContext>>; deleteAlias: (params: ", - "IndicesDeleteAliasRequest", - " | ", - "IndicesDeleteAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteAliasResponse", - ", TContext>>; deleteDataStream: (params: ", - "IndicesDeleteDataStreamRequest", - " | ", - "IndicesDeleteDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteDataStreamResponse", - ", TContext>>; deleteIndexTemplate: (params: ", - "IndicesDeleteIndexTemplateRequest", - " | ", - "IndicesDeleteIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteIndexTemplateResponse", - ", TContext>>; deleteTemplate: (params: ", - "IndicesDeleteTemplateRequest", - " | ", - "IndicesDeleteTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesDeleteTemplateResponse", - ", TContext>>; diskUsage: (params: ", - "IndicesDiskUsageRequest", - " | ", - "IndicesDiskUsageRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; exists: (params: ", - "IndicesExistsRequest", - " | ", - "IndicesExistsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsAlias: (params: ", - "IndicesExistsAliasRequest", - " | ", - "IndicesExistsAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsIndexTemplate: (params: ", - "IndicesExistsIndexTemplateRequest", - " | ", - "IndicesExistsIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; existsTemplate: (params: ", - "IndicesExistsTemplateRequest", - " | ", - "IndicesExistsTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; fieldUsageStats: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; flush: (params?: ", - "IndicesFlushRequest", - " | ", - "IndicesFlushRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesFlushResponse", - ", TContext>>; forcemerge: (params?: ", - "IndicesForcemergeRequest", - " | ", - "IndicesForcemergeRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesForcemergeResponse", - ", TContext>>; get: (params: ", - "IndicesGetRequest", - " | ", - "IndicesGetRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetResponse", - ", TContext>>; getAlias: (params?: ", - "IndicesGetAliasRequest", - " | ", - "IndicesGetAliasRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetAliasResponse", - ", TContext>>; getDataStream: (params?: ", - "IndicesGetDataStreamRequest", - " | ", - "IndicesGetDataStreamRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetDataStreamResponse", - ", TContext>>; getFieldMapping: (params: ", - "IndicesGetFieldMappingRequest", - " | ", - "IndicesGetFieldMappingRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetFieldMappingResponse", - ", TContext>>; getIndexTemplate: (params?: ", - "IndicesGetIndexTemplateRequest", - " | ", - "IndicesGetIndexTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetIndexTemplateResponse", - ", TContext>>; getMapping: (params?: ", - "IndicesGetMappingRequest", - " | ", - "IndicesGetMappingRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetMappingResponse", - ", TContext>>; getSettings: (params?: ", - "IndicesGetSettingsRequest", - " | ", - "IndicesGetSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetSettingsResponse", - ", TContext>>; getTemplate: (params?: ", - "IndicesGetTemplateRequest", - " | ", - "IndicesGetTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesGetTemplateResponse", - ", TContext>>; migrateToDataStream: (params: ", - "IndicesMigrateToDataStreamRequest", - " | ", - "IndicesMigrateToDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesMigrateToDataStreamResponse", - ", TContext>>; modifyDataStream: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; open: (params: ", - "IndicesOpenRequest", - " | ", - "IndicesOpenRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesOpenResponse", - ", TContext>>; promoteDataStream: (params: ", - "IndicesPromoteDataStreamRequest", - " | ", - "IndicesPromoteDataStreamRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; putAlias: (params: ", - "IndicesPutAliasRequest", - " | ", - "IndicesPutAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutAliasResponse", - ", TContext>>; putIndexTemplate: (params: ", - "IndicesPutIndexTemplateRequest", - " | ", - "IndicesPutIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutIndexTemplateResponse", - ", TContext>>; putMapping: (params: ", - "IndicesPutMappingRequest", - " | ", - "IndicesPutMappingRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutMappingResponse", - ", TContext>>; putSettings: (params?: ", - "IndicesPutSettingsRequest", - " | ", - "IndicesPutSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutSettingsResponse", - ", TContext>>; putTemplate: (params: ", - "IndicesPutTemplateRequest", - " | ", - "IndicesPutTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesPutTemplateResponse", - ", TContext>>; recovery: (params?: ", - "IndicesRecoveryRequest", - " | ", - "IndicesRecoveryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesRecoveryResponse", - ", TContext>>; refresh: (params?: ", - "IndicesRefreshRequest", - " | ", - "IndicesRefreshRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesRefreshResponse", - ", TContext>>; reloadSearchAnalyzers: (params: ", - "IndicesReloadSearchAnalyzersRequest", - " | ", - "IndicesReloadSearchAnalyzersRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesReloadSearchAnalyzersResponse", - ", TContext>>; resolveIndex: (params: ", - "IndicesResolveIndexRequest", - " | ", - "IndicesResolveIndexRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesResolveIndexResponse", - ", TContext>>; rollover: (params: ", - "IndicesRolloverRequest", - " | ", - "IndicesRolloverRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesRolloverResponse", - ", TContext>>; segments: (params?: ", - "IndicesSegmentsRequest", - " | ", - "IndicesSegmentsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSegmentsResponse", - ", TContext>>; shardStores: (params?: ", - "IndicesShardStoresRequest", - " | ", - "IndicesShardStoresRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesShardStoresResponse", - ", TContext>>; shrink: (params: ", - "IndicesShrinkRequest", - " | ", - "IndicesShrinkRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesShrinkResponse", - ", TContext>>; simulateIndexTemplate: (params: ", - "IndicesSimulateIndexTemplateRequest", - " | ", - "IndicesSimulateIndexTemplateRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSimulateIndexTemplateResponse", - ", TContext>>; simulateTemplate: (params?: ", - "IndicesSimulateTemplateRequest", - " | ", - "IndicesSimulateTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSimulateTemplateResponse", - ", TContext>>; split: (params: ", - "IndicesSplitRequest", - " | ", - "IndicesSplitRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesSplitResponse", - ", TContext>>; stats: (params?: ", - "IndicesStatsRequest", - " | ", - "IndicesStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesStatsResponse", - ", TContext>>; unfreeze: (params: ", - "IndicesUnfreezeRequest", - " | ", - "IndicesUnfreezeRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesUnfreezeResponse", - ", TContext>>; updateAliases: (params?: ", - "IndicesUpdateAliasesRequest", - " | ", - "IndicesUpdateAliasesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesUpdateAliasesResponse", - ", TContext>>; validateQuery: (params?: ", - "IndicesValidateQueryRequest", - " | ", - "IndicesValidateQueryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IndicesValidateQueryResponse", - ", TContext>>; }; info: (params?: ", - "InfoRequest", - " | ", - "InfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "InfoResponse", - ", TContext>>; ingest: { deletePipeline: (params: ", - "IngestDeletePipelineRequest", - " | ", - "IngestDeletePipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestDeletePipelineResponse", - ", TContext>>; geoIpStats: (params?: ", - "IngestGeoIpStatsRequest", - " | ", - "IngestGeoIpStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestGeoIpStatsResponse", - ", TContext>>; getPipeline: (params?: ", - "IngestGetPipelineRequest", - " | ", - "IngestGetPipelineRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestGetPipelineResponse", - ", TContext>>; processorGrok: (params?: ", - "IngestProcessorGrokRequest", - " | ", - "IngestProcessorGrokRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestProcessorGrokResponse", - ", TContext>>; putPipeline: (params: ", - "IngestPutPipelineRequest", - " | ", - "IngestPutPipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestPutPipelineResponse", - ", TContext>>; simulate: (params?: ", - "IngestSimulateRequest", - " | ", - "IngestSimulateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "IngestSimulateResponse", - ", TContext>>; }; knnSearch: (params: ", - "KnnSearchRequest", - " | ", - "KnnSearchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "KnnSearchResponse", - ", TContext>>; license: { delete: (params?: ", - "LicenseDeleteRequest", - " | ", - "LicenseDeleteRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseDeleteResponse", - ", TContext>>; get: (params?: ", - "LicenseGetRequest", - " | ", - "LicenseGetRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseGetResponse", - ", TContext>>; getBasicStatus: (params?: ", - "LicenseGetBasicStatusRequest", - " | ", - "LicenseGetBasicStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseGetBasicStatusResponse", - ", TContext>>; getTrialStatus: (params?: ", - "LicenseGetTrialStatusRequest", - " | ", - "LicenseGetTrialStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicenseGetTrialStatusResponse", - ", TContext>>; post: (params?: ", - "LicensePostRequest", - " | ", - "LicensePostRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicensePostResponse", - ", TContext>>; postStartBasic: (params?: ", - "LicensePostStartBasicRequest", - " | ", - "LicensePostStartBasicRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicensePostStartBasicResponse", - ", TContext>>; postStartTrial: (params?: ", - "LicensePostStartTrialRequest", - " | ", - "LicensePostStartTrialRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LicensePostStartTrialResponse", - ", TContext>>; }; logstash: { deletePipeline: (params: ", - "LogstashDeletePipelineRequest", - " | ", - "LogstashDeletePipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; getPipeline: (params: ", - "LogstashGetPipelineRequest", - " | ", - "LogstashGetPipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "LogstashGetPipelineResponse", - ", TContext>>; putPipeline: (params: ", - "LogstashPutPipelineRequest", - " | ", - "LogstashPutPipelineRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; }; mget: (params?: ", - "MgetRequest", - " | ", - "MgetRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MgetResponse", - ", TContext>>; migration: { deprecations: (params?: ", - "MigrationDeprecationsRequest", - " | ", - "MigrationDeprecationsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MigrationDeprecationsResponse", - ", TContext>>; getFeatureUpgradeStatus: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; postFeatureUpgrade: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; }; ml: { closeJob: (params: ", - "MlCloseJobRequest", - " | ", - "MlCloseJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlCloseJobResponse", - ", TContext>>; deleteCalendar: (params: ", - "MlDeleteCalendarRequest", - " | ", - "MlDeleteCalendarRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteCalendarResponse", - ", TContext>>; deleteCalendarEvent: (params: ", - "MlDeleteCalendarEventRequest", - " | ", - "MlDeleteCalendarEventRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteCalendarEventResponse", - ", TContext>>; deleteCalendarJob: (params: ", - "MlDeleteCalendarJobRequest", - " | ", - "MlDeleteCalendarJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteCalendarJobResponse", - ", TContext>>; deleteDataFrameAnalytics: (params: ", - "MlDeleteDataFrameAnalyticsRequest", - " | ", - "MlDeleteDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteDataFrameAnalyticsResponse", - ", TContext>>; deleteDatafeed: (params: ", - "MlDeleteDatafeedRequest", - " | ", - "MlDeleteDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteDatafeedResponse", - ", TContext>>; deleteExpiredData: (params?: ", - "MlDeleteExpiredDataRequest", - " | ", - "MlDeleteExpiredDataRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteExpiredDataResponse", - ", TContext>>; deleteFilter: (params: ", - "MlDeleteFilterRequest", - " | ", - "MlDeleteFilterRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteFilterResponse", - ", TContext>>; deleteForecast: (params: ", - "MlDeleteForecastRequest", - " | ", - "MlDeleteForecastRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteForecastResponse", - ", TContext>>; deleteJob: (params: ", - "MlDeleteJobRequest", - " | ", - "MlDeleteJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteJobResponse", - ", TContext>>; deleteModelSnapshot: (params: ", - "MlDeleteModelSnapshotRequest", - " | ", - "MlDeleteModelSnapshotRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteModelSnapshotResponse", - ", TContext>>; deleteTrainedModel: (params: ", - "MlDeleteTrainedModelRequest", - " | ", - "MlDeleteTrainedModelRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteTrainedModelResponse", - ", TContext>>; deleteTrainedModelAlias: (params: ", - "MlDeleteTrainedModelAliasRequest", - " | ", - "MlDeleteTrainedModelAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlDeleteTrainedModelAliasResponse", - ", TContext>>; estimateModelMemory: (params?: ", - "MlEstimateModelMemoryRequest", - " | ", - "MlEstimateModelMemoryRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlEstimateModelMemoryResponse", - ", TContext>>; evaluateDataFrame: (params?: ", - "MlEvaluateDataFrameRequest", - " | ", - "MlEvaluateDataFrameRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlEvaluateDataFrameResponse", - ", TContext>>; explainDataFrameAnalytics: (params?: ", - "MlExplainDataFrameAnalyticsRequest", - " | ", - "MlExplainDataFrameAnalyticsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlExplainDataFrameAnalyticsResponse", - ", TContext>>; flushJob: (params: ", - "MlFlushJobRequest", - " | ", - "MlFlushJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlFlushJobResponse", - ", TContext>>; forecast: (params: ", - "MlForecastRequest", - " | ", - "MlForecastRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlForecastResponse", - ", TContext>>; getBuckets: (params: ", - "MlGetBucketsRequest", - " | ", - "MlGetBucketsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetBucketsResponse", - ", TContext>>; getCalendarEvents: (params: ", - "MlGetCalendarEventsRequest", - " | ", - "MlGetCalendarEventsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetCalendarEventsResponse", - ", TContext>>; getCalendars: (params?: ", - "MlGetCalendarsRequest", - " | ", - "MlGetCalendarsRequest", - " | undefined, options?: ", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetCalendarsResponse", - ", TContext>>; getCategories: (params: ", - "MlGetCategoriesRequest", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", " | ", - "MlGetCategoriesRequest", + "UpdateByQueryRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetCategoriesResponse", - ", TContext>>; getDataFrameAnalytics: (params?: ", - "MlGetDataFrameAnalyticsRequest", - " | ", - "MlGetDataFrameAnalyticsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDataFrameAnalyticsResponse", - ", TContext>>; getDataFrameAnalyticsStats: (params?: ", - "MlGetDataFrameAnalyticsStatsRequest", - " | ", - "MlGetDataFrameAnalyticsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDataFrameAnalyticsStatsResponse", - ", TContext>>; getDatafeedStats: (params?: ", - "MlGetDatafeedStatsRequest", - " | ", - "MlGetDatafeedStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDatafeedStatsResponse", - ", TContext>>; getDatafeeds: (params?: ", - "MlGetDatafeedsRequest", - " | ", - "MlGetDatafeedsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetDatafeedsResponse", - ", TContext>>; getFilters: (params?: ", - "MlGetFiltersRequest", - " | ", - "MlGetFiltersRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetFiltersResponse", - ", TContext>>; getInfluencers: (params: ", - "MlGetInfluencersRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", " | ", - "MlGetInfluencersRequest", + "UpdateByQueryRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetInfluencersResponse", - ", TContext>>; getJobStats: (params?: ", - "MlGetJobStatsRequest", - " | ", - "MlGetJobStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetJobStatsResponse", - ", TContext>>; getJobs: (params?: ", - "MlGetJobsRequest", - " | ", - "MlGetJobsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlGetJobsResponse", - ", TContext>>; getModelSnapshotUpgradeStats: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getModelSnapshots: (params: ", - "MlGetModelSnapshotsRequest", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", " | ", - "MlGetModelSnapshotsRequest", + "UpdateByQueryRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetModelSnapshotsResponse", - ", TContext>>; getOverallBuckets: (params: ", - "MlGetOverallBucketsRequest", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", " | ", - "MlGetOverallBucketsRequest", + "UpdateByQueryRethrottleRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetOverallBucketsResponse", - ", TContext>>; getRecords: (params: ", - "MlGetRecordsRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", " | ", - "MlGetRecordsRequest", + "UpdateByQueryRethrottleRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetRecordsResponse", - ", TContext>>; getTrainedModels: (params?: ", - "MlGetTrainedModelsRequest", - " | ", - "MlGetTrainedModelsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlGetTrainedModelsResponse", - ", TContext>>; getTrainedModelsStats: (params?: ", - "MlGetTrainedModelsStatsRequest", - " | ", - "MlGetTrainedModelsStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlGetTrainedModelsStatsResponse", - ", TContext>>; inferTrainedModelDeployment: (params: ", - "MlInferTrainedModelDeploymentRequest", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", " | ", - "MlInferTrainedModelDeploymentRequest", + "UpdateByQueryRethrottleRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlInferTrainedModelDeploymentResponse", - ", TContext>>; info: (params?: ", - "MlInfoRequest", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" + ], + "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/securitysolution-es-utils", + "id": "def-server.getIndexAliases.$1.alias", + "type": "string", + "tags": [], + "label": "alias", + "description": [], + "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [ + "an array of {@link IndexAlias } objects" + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-es-utils", + "id": "def-server.getIndexCount", + "type": "Function", + "tags": [], + "label": "getIndexCount", + "description": [ + "\nRetrieves the count of documents in a given index\n" + ], + "signature": [ + "({ esClient, index, }: { esClient: ", + "ElasticsearchClient", + "; index: string; }) => Promise" + ], + "path": "packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/securitysolution-es-utils", + "id": "def-server.getIndexCount.$1", + "type": "Object", + "tags": [], + "label": "{\n esClient,\n index,\n}", + "description": [], + "path": "packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/securitysolution-es-utils", + "id": "def-server.getIndexCount.$1.esClient", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", " | ", - "MlInfoRequest", + "SearchRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlInfoResponse", - ", TContext>>; openJob: (params: ", - "MlOpenJobRequest", - " | ", - "MlOpenJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlOpenJobResponse", - ", TContext>>; postCalendarEvents: (params: ", - "MlPostCalendarEventsRequest", - " | ", - "MlPostCalendarEventsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPostCalendarEventsResponse", - ", TContext>>; postData: (params: ", - "MlPostDataRequest", - " | ", - "MlPostDataRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPostDataResponse", - ", TContext>>; previewDataFrameAnalytics: (params?: ", - "MlPreviewDataFrameAnalyticsRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", " | ", - "MlPreviewDataFrameAnalyticsRequest", + "SearchRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlPreviewDataFrameAnalyticsResponse", - ", TContext>>; previewDatafeed: (params?: ", - "MlPreviewDatafeedRequest", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", " | ", - "MlPreviewDatafeedRequest", + "SearchRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPreviewDatafeedResponse", - ", TContext>>; putCalendar: (params: ", - "MlPutCalendarRequest", - " | ", - "MlPutCalendarRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutCalendarResponse", - ", TContext>>; putCalendarJob: (params: ", - "MlPutCalendarJobRequest", - " | ", - "MlPutCalendarJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutCalendarJobResponse", - ", TContext>>; putDataFrameAnalytics: (params: ", - "MlPutDataFrameAnalyticsRequest", - " | ", - "MlPutDataFrameAnalyticsRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutDataFrameAnalyticsResponse", - ", TContext>>; putDatafeed: (params: ", - "MlPutDatafeedRequest", - " | ", - "MlPutDatafeedRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutDatafeedResponse", - ", TContext>>; putFilter: (params: ", - "MlPutFilterRequest", - " | ", - "MlPutFilterRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutFilterResponse", - ", TContext>>; putJob: (params: ", - "MlPutJobRequest", - " | ", - "MlPutJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutJobResponse", - ", TContext>>; putTrainedModel: (params: ", - "MlPutTrainedModelRequest", - " | ", - "MlPutTrainedModelRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlTrainedModelConfig", - ", TContext>>; putTrainedModelAlias: (params: ", - "MlPutTrainedModelAliasRequest", - " | ", - "MlPutTrainedModelAliasRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutTrainedModelAliasResponse", - ", TContext>>; putTrainedModelDefinitionPart: (params: ", - "MlPutTrainedModelDefinitionPartRequest", - " | ", - "MlPutTrainedModelDefinitionPartRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutTrainedModelDefinitionPartResponse", - ", TContext>>; putTrainedModelVocabulary: (params: ", - "MlPutTrainedModelVocabularyRequest", - " | ", - "MlPutTrainedModelVocabularyRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlPutTrainedModelVocabularyResponse", - ", TContext>>; resetJob: (params: ", - "MlResetJobRequest", - " | ", - "MlResetJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlResetJobResponse", - ", TContext>>; revertModelSnapshot: (params: ", - "MlRevertModelSnapshotRequest", - " | ", - "MlRevertModelSnapshotRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlRevertModelSnapshotResponse", - ", TContext>>; setUpgradeMode: (params?: ", - "MlSetUpgradeModeRequest", - " | ", - "MlSetUpgradeModeRequest", - " | undefined, options?: ", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlSetUpgradeModeResponse", - ", TContext>>; startDataFrameAnalytics: (params: ", - "MlStartDataFrameAnalyticsRequest", - " | ", - "MlStartDataFrameAnalyticsRequest", - ", options?: ", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStartDataFrameAnalyticsResponse", - ", TContext>>; startDatafeed: (params: ", - "MlStartDatafeedRequest", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", " | ", - "MlStartDatafeedRequest", + "DeleteRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStartDatafeedResponse", - ", TContext>>; startTrainedModelDeployment: (params: ", - "MlStartTrainedModelDeploymentRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", " | ", - "MlStartTrainedModelDeploymentRequest", + "DeleteRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlStartTrainedModelDeploymentResponse", - ", TContext>>; stopDataFrameAnalytics: (params: ", - "MlStopDataFrameAnalyticsRequest", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", " | ", - "MlStopDataFrameAnalyticsRequest", + "DeleteRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStopDataFrameAnalyticsResponse", - ", TContext>>; stopDatafeed: (params: ", - "MlStopDatafeedRequest", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", " | ", - "MlStopDatafeedRequest", + "GetRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlStopDatafeedResponse", - ", TContext>>; stopTrainedModelDeployment: (params: ", - "MlStopTrainedModelDeploymentRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", " | ", - "MlStopTrainedModelDeploymentRequest", + "GetRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlStopTrainedModelDeploymentResponse", - ", TContext>>; updateDataFrameAnalytics: (params: ", - "MlUpdateDataFrameAnalyticsRequest", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", " | ", - "MlUpdateDataFrameAnalyticsRequest", + "GetRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlUpdateDataFrameAnalyticsResponse", - ", TContext>>; updateDatafeed: (params: ", - "MlUpdateDatafeedRequest", - " | ", - "MlUpdateDatafeedRequest", - ", options?: ", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateDatafeedResponse", - ", TContext>>; updateFilter: (params: ", - "MlUpdateFilterRequest", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", " | ", - "MlUpdateFilterRequest", + "ClosePointInTimeRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpdateFilterResponse", - ", TContext>>; updateJob: (params: ", - "MlUpdateJobRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", " | ", - "MlUpdateJobRequest", + "ClosePointInTimeRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlUpdateJobResponse", - ", TContext>>; updateModelSnapshot: (params: ", - "MlUpdateModelSnapshotRequest", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", " | ", - "MlUpdateModelSnapshotRequest", + "ClosePointInTimeRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlUpdateModelSnapshotResponse", - ", TContext>>; upgradeJobSnapshot: (params: ", - "MlUpgradeJobSnapshotRequest", - " | ", - "MlUpgradeJobSnapshotRequest", - ", options?: ", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlUpgradeJobSnapshotResponse", - ", TContext>>; validate: (params?: ", - "MlValidateRequest", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", " | ", - "MlValidateRequest", + "ClearScrollRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MlValidateResponse", - ", TContext>>; validateDetector: (params?: ", - "MlValidateDetectorRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", " | ", - "MlValidateDetectorRequest", + "ClearScrollRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "MlValidateDetectorResponse", - ", TContext>>; }; msearch: , TContext = unknown>(params?: ", - "MsearchRequest", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", " | ", - "MsearchRequest", + "ClearScrollRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MsearchResponse", - ", TContext>>; msearchTemplate: , TContext = unknown>(params?: ", - "MsearchTemplateRequest", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", " | ", - "MsearchTemplateRequest", + "CountRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MsearchTemplateResponse", - ", TContext>>; mtermvectors: (params?: ", - "MtermvectorsRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", " | ", - "MtermvectorsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "MtermvectorsResponse", - ", TContext>>; nodes: { clearRepositoriesMeteringArchive: (params?: ", - "TODO", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getRepositoriesMeteringInfo: (params?: ", - "TODO", + "CountRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TODO", - ", unknown>>; hotThreads: (params?: ", - "NodesHotThreadsRequest", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", " | ", - "NodesHotThreadsRequest", + "CountRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesHotThreadsResponse", - ", TContext>>; info: (params?: ", - "NodesInfoRequest", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", " | ", - "NodesInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesInfoResponse", - ", TContext>>; reloadSecureSettings: (params?: ", - "NodesReloadSecureSettingsRequest", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", " | ", - "NodesReloadSecureSettingsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "NodesReloadSecureSettingsResponse", - ", TContext>>; stats: (params?: ", - "NodesStatsRequest", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", " | ", - "NodesStatsRequest", - " | undefined, options?: ", + "DeleteByQueryRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "NodesStatsResponse", - ", TContext>>; usage: (params?: ", - "NodesUsageRequest", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", " | ", - "NodesUsageRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "NodesUsageResponse", - ", TContext>>; }; openPointInTime: (params: ", - "OpenPointInTimeRequest", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", " | ", - "OpenPointInTimeRequest", + "DeleteByQueryRethrottleRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "OpenPointInTimeResponse", - ", TContext>>; ping: (params?: ", - "PingRequest", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", " | ", - "PingRequest", - " | undefined, options?: ", + "DeleteScriptRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; putScript: (params: ", - "PutScriptRequest", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", " | ", - "PutScriptRequest", + "ExistsRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "PutScriptResponse", - ", TContext>>; rankEval: (params: ", - "RankEvalRequest", + ">; (this: That, params: ", + "ExistsRequest", " | ", - "RankEvalRequest", + "ExistsRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "RankEvalResponse", - ", TContext>>; reindex: (params?: ", - "ReindexRequest", + ">; (this: That, params: ", + "ExistsSourceRequest", " | ", - "ReindexRequest", - " | undefined, options?: ", + "ExistsSourceRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "ReindexResponse", - ", TContext>>; reindexRethrottle: (params: ", - "ReindexRethrottleRequest", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", " | ", - "ReindexRethrottleRequest", + "ExplainRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "ReindexRethrottleResponse", - ", TContext>>; renderSearchTemplate: (params?: ", - "RenderSearchTemplateRequest", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", " | ", - "RenderSearchTemplateRequest", + "FieldCapsRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "RenderSearchTemplateResponse", - ", TContext>>; rollup: { deleteJob: (params: ", - "RollupDeleteJobRequest", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", " | ", - "RollupDeleteJobRequest", + "GetScriptRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupDeleteJobResponse", - ", TContext>>; getJobs: (params?: ", - "RollupGetJobsRequest", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", " | ", - "RollupGetJobsRequest", + "GetScriptContextRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupGetJobsResponse", - ", TContext>>; getRollupCaps: (params?: ", - "RollupGetRollupCapsRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", " | ", - "RollupGetRollupCapsRequest", + "GetScriptContextRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "RollupGetRollupCapsResponse", - ", TContext>>; getRollupIndexCaps: (params: ", - "RollupGetRollupIndexCapsRequest", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", " | ", - "RollupGetRollupIndexCapsRequest", - ", options?: ", + "GetScriptContextRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupGetRollupIndexCapsResponse", - ", TContext>>; putJob: (params: ", - "RollupPutJobRequest", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", " | ", - "RollupPutJobRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "RollupPutJobResponse", - ", TContext>>; rollup: (params: ", - "RollupRollupRequest", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", " | ", - "RollupRollupRequest", - ", options?: ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; rollupSearch: , TContext = unknown>(params: ", - "RollupRollupSearchRequest", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", " | ", - "RollupRollupSearchRequest", + "GetSourceRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupRollupSearchResponse", - ", TContext>>; startJob: (params: ", - "RollupStartJobRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", " | ", - "RollupStartJobRequest", + "GetSourceRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "RollupStartJobResponse", - ", TContext>>; stopJob: (params: ", - "RollupStopJobRequest", + ">; (this: That, params: ", + "GetSourceRequest", " | ", - "RollupStopJobRequest", + "GetSourceRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "RollupStopJobResponse", - ", TContext>>; }; scriptsPainlessExecute: (params?: ", - "ScriptsPainlessExecuteRequest", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", " | ", - "ScriptsPainlessExecuteRequest", + "InfoRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "ScriptsPainlessExecuteResponse", - ", TContext>>; scroll: , TContext = unknown>(params?: ", - "ScrollRequest", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", " | ", - "ScrollRequest", + "InfoRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "ScrollResponse", - ", TContext>>; searchMvt: (params: ", - "SearchMvtRequest", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", " | ", - "SearchMvtRequest", + "KnnSearchRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; searchShards: (params?: ", - "SearchShardsRequest", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", " | ", - "SearchShardsRequest", + "MgetRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchShardsResponse", - ", TContext>>; searchTemplate: (params?: ", - "SearchTemplateRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", " | ", - "SearchTemplateRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SearchTemplateResponse", - ", TContext>>; searchableSnapshots: { cacheStats: (params?: ", - "TODO", + "MgetRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TODO", - ", unknown>>; clearCache: (params?: ", - "SearchableSnapshotsClearCacheRequest", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", " | ", - "SearchableSnapshotsClearCacheRequest", + "MgetRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - ">; mount: (params: ", - "SearchableSnapshotsMountRequest", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", " | ", - "SearchableSnapshotsMountRequest", + "MsearchRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SearchableSnapshotsMountResponse", - ", TContext>>; stats: (params?: ", - "SearchableSnapshotsStatsRequest", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", " | ", - "SearchableSnapshotsStatsRequest", - " | undefined, options?: ", + "MsearchRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SearchableSnapshotsStatsResponse", - ", TContext>>; }; shutdown: { deleteNode: (params: ", - "ShutdownDeleteNodeRequest", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", " | ", - "ShutdownDeleteNodeRequest", + "MsearchTemplateRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "ShutdownDeleteNodeResponse", - ", TContext>>; getNode: (params?: ", - "ShutdownGetNodeRequest", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", " | ", - "ShutdownGetNodeRequest", + "MtermvectorsRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ShutdownGetNodeResponse", - ", TContext>>; putNode: (params: ", - "ShutdownPutNodeRequest", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", " | ", - "ShutdownPutNodeRequest", + "OpenPointInTimeRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "ShutdownPutNodeResponse", - ", TContext>>; }; slm: { deleteLifecycle: (params: ", - "SlmDeleteLifecycleRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", " | ", - "SlmDeleteLifecycleRequest", + "OpenPointInTimeRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SlmDeleteLifecycleResponse", - ", TContext>>; executeLifecycle: (params: ", - "SlmExecuteLifecycleRequest", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", " | ", - "SlmExecuteLifecycleRequest", + "OpenPointInTimeRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmExecuteLifecycleResponse", - ", TContext>>; executeRetention: (params?: ", - "SlmExecuteRetentionRequest", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", " | ", - "SlmExecuteRetentionRequest", + "PingRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmExecuteRetentionResponse", - ", TContext>>; getLifecycle: (params?: ", - "SlmGetLifecycleRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", " | ", - "SlmGetLifecycleRequest", + "PingRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "SlmGetLifecycleResponse", - ", TContext>>; getStats: (params?: ", - "SlmGetStatsRequest", + ">; (this: That, params?: ", + "PingRequest", " | ", - "SlmGetStatsRequest", + "PingRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SlmGetStatsResponse", - ", TContext>>; getStatus: (params?: ", - "SlmGetStatusRequest", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", " | ", - "SlmGetStatusRequest", - " | undefined, options?: ", + "PutScriptRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SlmGetStatusResponse", - ", TContext>>; putLifecycle: (params: ", - "SlmPutLifecycleRequest", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", " | ", - "SlmPutLifecycleRequest", + "RankEvalRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmPutLifecycleResponse", - ", TContext>>; start: (params?: ", - "SlmStartRequest", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", " | ", - "SlmStartRequest", + "ReindexRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SlmStartResponse", - ", TContext>>; stop: (params?: ", - "SlmStopRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", " | ", - "SlmStopRequest", + "ReindexRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SlmStopResponse", - ", TContext>>; }; snapshot: { cleanupRepository: (params: ", - "SnapshotCleanupRepositoryRequest", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", " | ", - "SnapshotCleanupRepositoryRequest", - ", options?: ", + "ReindexRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCleanupRepositoryResponse", - ", TContext>>; clone: (params: ", - "SnapshotCloneRequest", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", " | ", - "SnapshotCloneRequest", + "ReindexRethrottleRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCloneResponse", - ", TContext>>; create: (params: ", - "SnapshotCreateRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", " | ", - "SnapshotCreateRequest", + "ReindexRethrottleRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SnapshotCreateResponse", - ", TContext>>; createRepository: (params: ", - "SnapshotCreateRepositoryRequest", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", " | ", - "SnapshotCreateRepositoryRequest", + "ReindexRethrottleRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotCreateRepositoryResponse", - ", TContext>>; delete: (params: ", - "SnapshotDeleteRequest", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", " | ", - "SnapshotDeleteRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotDeleteResponse", - ", TContext>>; deleteRepository: (params: ", - "SnapshotDeleteRepositoryRequest", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", " | ", - "SnapshotDeleteRepositoryRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SnapshotDeleteRepositoryResponse", - ", TContext>>; get: (params: ", - "SnapshotGetRequest", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", " | ", - "SnapshotGetRequest", - ", options?: ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotGetResponse", - ", TContext>>; getRepository: (params?: ", - "SnapshotGetRepositoryRequest", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", " | ", - "SnapshotGetRepositoryRequest", + "ScriptsPainlessExecuteRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SnapshotGetRepositoryResponse", - ", TContext>>; repositoryAnalyze: (params?: ", - "TODO", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; restore: (params: ", - "SnapshotRestoreRequest", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", " | ", - "SnapshotRestoreRequest", + "ScrollRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotRestoreResponse", - ", TContext>>; status: (params?: ", - "SnapshotStatusRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", " | ", - "SnapshotStatusRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SnapshotStatusResponse", - ", TContext>>; verifyRepository: (params: ", - "SnapshotVerifyRepositoryRequest", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", " | ", - "SnapshotVerifyRepositoryRequest", + "ScrollRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SnapshotVerifyRepositoryResponse", - ", TContext>>; }; sql: { clearCursor: (params?: ", - "SqlClearCursorRequest", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", " | ", - "SqlClearCursorRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - "<", - "SqlClearCursorResponse", - ", TContext>>; deleteAsync: (params?: ", - "TODO", - " | undefined, options?: ", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getAsync: (params?: ", - "TODO", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TODO", - ", unknown>>; getAsyncStatus: (params?: ", - "TODO", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TODO", - ", unknown>>; query: (params?: ", - "SqlQueryRequest", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", " | ", - "SqlQueryRequest", + "SearchShardsRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SqlQueryResponse", - ", TContext>>; translate: (params?: ", - "SqlTranslateRequest", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", " | ", - "SqlTranslateRequest", + "SearchTemplateRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "SqlTranslateResponse", - ", TContext>>; }; ssl: { certificates: (params?: ", - "SslCertificatesRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", " | ", - "SslCertificatesRequest", + "SearchTemplateRequest", " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "SslCertificatesResponse", - ", TContext>>; }; tasks: { cancel: (params?: ", - "TasksCancelRequest", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", " | ", - "TasksCancelRequest", + "SearchTemplateRequest", " | undefined, options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TasksCancelResponse", - ", TContext>>; get: (params: ", - "TasksGetRequest", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", " | ", - "TasksGetRequest", + "TermsEnumRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TasksGetResponse", - ", TContext>>; list: (params?: ", - "TasksListRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", " | ", - "TasksListRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "TasksListResponse", - ", TContext>>; }; termsEnum: (params: ", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", "TermsEnumRequest", " | ", "TermsEnumRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", + " | undefined): Promise<", "TermsEnumResponse", - ", TContext>>; termvectors: (params: ", + ">; }; termvectors: { (this: That, params: ", "TermvectorsRequest", " | ", "TermvectorsRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", "TermvectorsResponse", - ", TContext>>; textStructure: { findStructure: (params: ", - "TextStructureFindStructureRequest", - " | ", - "TextStructureFindStructureRequest", - ", options?: ", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "TextStructureFindStructureResponse", - ", TContext>>; }; updateByQuery: (params: ", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", "UpdateByQueryRequest", " | ", "UpdateByQueryRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", "UpdateByQueryResponse", - ", TContext>>; updateByQueryRethrottle: (params: ", - "UpdateByQueryRethrottleRequest", - " | ", - "UpdateByQueryRethrottleRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "UpdateByQueryRethrottleResponse", - ", TContext>>; watcher: { ackWatch: (params: ", - "WatcherAckWatchRequest", - " | ", - "WatcherAckWatchRequest", - ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherAckWatchResponse", - ", TContext>>; activateWatch: (params: ", - "WatcherActivateWatchRequest", + ">; (this: That, params: ", + "UpdateByQueryRequest", " | ", - "WatcherActivateWatchRequest", + "UpdateByQueryRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "WatcherActivateWatchResponse", - ", TContext>>; deactivateWatch: (params: ", - "WatcherDeactivateWatchRequest", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", " | ", - "WatcherDeactivateWatchRequest", + "UpdateByQueryRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherDeactivateWatchResponse", - ", TContext>>; deleteWatch: (params: ", - "WatcherDeleteWatchRequest", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", " | ", - "WatcherDeleteWatchRequest", + "UpdateByQueryRethrottleRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherDeleteWatchResponse", - ", TContext>>; executeWatch: (params?: ", - "WatcherExecuteWatchRequest", - " | ", - "WatcherExecuteWatchRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherExecuteWatchResponse", - ", TContext>>; getWatch: (params: ", - "WatcherGetWatchRequest", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", " | ", - "WatcherGetWatchRequest", + "UpdateByQueryRethrottleRequest", ", options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", "<", - "WatcherGetWatchResponse", - ", TContext>>; putWatch: (params: ", - "WatcherPutWatchRequest", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", " | ", - "WatcherPutWatchRequest", + "UpdateByQueryRethrottleRequest", ", options?: ", "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherPutWatchResponse", - ", TContext>>; queryWatches: (params?: ", - "WatcherQueryWatchesRequest", - " | ", - "WatcherQueryWatchesRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherQueryWatchesResponse", - ", TContext>>; start: (params?: ", - "WatcherStartRequest", - " | ", - "WatcherStartRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherStartResponse", - ", TContext>>; stats: (params?: ", - "WatcherStatsRequest", - " | ", - "WatcherStatsRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherStatsResponse", - ", TContext>>; stop: (params?: ", - "WatcherStopRequest", - " | ", - "WatcherStopRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "WatcherStopResponse", - ", TContext>>; }; xpack: { info: (params?: ", - "XpackInfoRequest", - " | ", - "XpackInfoRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "XpackInfoResponse", - ", TContext>>; usage: (params?: ", - "XpackUsageRequest", - " | ", - "XpackUsageRequest", - " | undefined, options?: ", - "TransportRequestOptions", - " | undefined) => Promise<", - "TransportResult", - "<", - "XpackUsageResponse", - ", TContext>>; }; }" + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts", "deprecated": false diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 9c1d6f347ed78..389625b519633 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index e6386cd95314f..7226d52c43acf 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index b6b8cb1d3b43e..e915b4c87a395 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json b/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json index 5976f7481cb35..2845cc96a8108 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json +++ b/api_docs/kbn_securitysolution_io_ts_list_types.devdocs.json @@ -27,7 +27,7 @@ "label": "updateExceptionListItemValidate", "description": [], "signature": [ - "(schema: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" + "(schema: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -40,7 +40,7 @@ "label": "schema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -58,7 +58,7 @@ "label": "validateComments", "description": [], "signature": [ - "(item: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" + "(item: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => string[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -71,7 +71,7 @@ "label": "item", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_validation/index.ts", "deprecated": false, @@ -153,7 +153,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false @@ -1216,7 +1216,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false @@ -1307,7 +1307,7 @@ "label": "exceptions", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts", "deprecated": false @@ -1914,7 +1914,7 @@ "label": "CreateEndpointListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"os_types\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"os_types\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -1942,7 +1942,7 @@ "label": "CreateExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts", "deprecated": false, @@ -1956,7 +1956,7 @@ "label": "CreateExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; comments: { comment: string; }[] | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts", "deprecated": false, @@ -2026,7 +2026,7 @@ "label": "CreateListSchema", "description": [], "signature": [ - "{ description: string; name: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; } & { deserializer?: string | undefined; id?: string | undefined; meta?: object | undefined; serializer?: string | undefined; version?: number | undefined; }" + "{ description: string; name: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; } & { deserializer?: string | undefined; id?: string | undefined; meta?: object | undefined; serializer?: string | undefined; version?: number | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts", "deprecated": false, @@ -2040,7 +2040,7 @@ "label": "CreateListSchemaDecoded", "description": [], "signature": [ - "{ type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; id: string | undefined; description: string; name: string; meta: object | undefined; serializer: string | undefined; deserializer: string | undefined; } & { version: number; }" + "{ type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; id: string | undefined; description: string; name: string; meta: object | undefined; serializer: string | undefined; deserializer: string | undefined; } & { version: number; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts", "deprecated": false, @@ -2334,7 +2334,7 @@ "label": "EntriesArray", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2348,7 +2348,7 @@ "label": "EntriesArrayOrUndefined", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[] | undefined" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[] | undefined" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2362,7 +2362,7 @@ "label": "Entry", "description": [], "signature": [ - "{ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }" + "{ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts", "deprecated": false, @@ -2390,7 +2390,7 @@ "label": "EntryList", "description": [], "signature": [ - "{ field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; }" + "{ field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.ts", "deprecated": false, @@ -2460,7 +2460,7 @@ "label": "ExceptionListItemSchema", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts", "deprecated": false, @@ -2782,7 +2782,7 @@ "label": "FoundExceptionListItemSchema", "description": [], "signature": [ - "{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; }" + "{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts", "deprecated": false, @@ -2796,7 +2796,7 @@ "label": "FoundExceptionListSchema", "description": [], "signature": [ - "{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }" + "{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts", "deprecated": false, @@ -2810,7 +2810,7 @@ "label": "FoundListItemSchema", "description": [], "signature": [ - "{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; }" + "{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts", "deprecated": false, @@ -2824,7 +2824,7 @@ "label": "FoundListSchema", "description": [], "signature": [ - "{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }" + "{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts", "deprecated": false, @@ -2886,6 +2886,48 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.ImportComment", + "type": "Type", + "tags": [], + "label": "ImportComment", + "description": [], + "signature": [ + "({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; }" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.ImportCommentsArray", + "type": "Type", + "tags": [], + "label": "ImportCommentsArray", + "description": [], + "signature": [ + "(({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[]" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.ImportCommentsArrayOrUndefined", + "type": "Type", + "tags": [], + "label": "ImportCommentsArrayOrUndefined", + "description": [], + "signature": [ + "(({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.ImportExceptionListItemSchema", @@ -2894,7 +2936,7 @@ "label": "ImportExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: { comment: string; }[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts", "deprecated": false, @@ -2908,7 +2950,7 @@ "label": "ImportExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: { comment: string; }[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: { comment: string; }[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; item_id: string; list_id: string; name: string; type: \"simple\"; } & { id?: string | undefined; comments?: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[] | undefined; created_at?: string | undefined; updated_at?: string | undefined; created_by?: string | undefined; updated_by?: string | undefined; _version?: string | undefined; tie_breaker_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"item_id\" | \"namespace_type\"> & { comments: (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[]; tags: string[]; item_id: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts", "deprecated": false, @@ -2964,7 +3006,7 @@ "label": "ImportListItemQuerySchema", "description": [], "signature": [ - "{ deserializer: string | undefined; list_id: string | undefined; serializer: string | undefined; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined; }" + "{ deserializer: string | undefined; list_id: string | undefined; serializer: string | undefined; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts", "deprecated": false, @@ -2978,7 +3020,7 @@ "label": "ImportListItemQuerySchemaEncoded", "description": [], "signature": [ - "{ deserializer?: string | undefined; list_id?: string | undefined; serializer?: string | undefined; type?: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined; }" + "{ deserializer?: string | undefined; list_id?: string | undefined; serializer?: string | undefined; type?: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts", "deprecated": false, @@ -3090,7 +3132,7 @@ "label": "ListArraySchema", "description": [], "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts", "deprecated": false, @@ -3132,7 +3174,7 @@ "label": "ListItemArraySchema", "description": [], "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]" + "{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts", "deprecated": false, @@ -3160,7 +3202,7 @@ "label": "ListItemSchema", "description": [], "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }" + "{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts", "deprecated": false, @@ -3188,7 +3230,7 @@ "label": "ListSchema", "description": [], "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts", "deprecated": false, @@ -3208,6 +3250,34 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.MaxSize", + "type": "Type", + "tags": [], + "label": "MaxSize", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.MaxSizeOrUndefined", + "type": "Type", + "tags": [], + "label": "MaxSizeOrUndefined", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.Meta", @@ -3370,7 +3440,7 @@ "label": "NonEmptyEntriesArray", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -3384,7 +3454,7 @@ "label": "NonEmptyEntriesArrayDecoded", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -3572,6 +3642,48 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.Pit", + "type": "Type", + "tags": [], + "label": "Pit", + "description": [], + "signature": [ + "{ id: string; keepAlive: string | undefined; }" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.PitId", + "type": "Type", + "tags": [], + "label": "PitId", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.PitOrUndefined", + "type": "Type", + "tags": [], + "label": "PitOrUndefined", + "description": [], + "signature": [ + "{ id: string; keepAlive: string | undefined; } | undefined" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.ReadEndpointListItemSchema", @@ -3698,6 +3810,34 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.SearchAfter", + "type": "Type", + "tags": [], + "label": "SearchAfter", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.SearchAfterOrUndefined", + "type": "Type", + "tags": [], + "label": "SearchAfterOrUndefined", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.SearchListItemArraySchema", @@ -3706,7 +3846,7 @@ "label": "SearchListItemArraySchema", "description": [], "signature": [ - "{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]" + "{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts", "deprecated": false, @@ -3720,7 +3860,7 @@ "label": "SearchListItemSchema", "description": [], "signature": [ - "{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }" + "{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts", "deprecated": false, @@ -3860,7 +4000,7 @@ "label": "Type", "description": [], "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"" + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts", "deprecated": false, @@ -3874,7 +4014,7 @@ "label": "TypeOrUndefined", "description": [], "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined" + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts", "deprecated": false, @@ -3930,7 +4070,7 @@ "label": "UpdateEndpointListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -3944,7 +4084,7 @@ "label": "UpdateEndpointListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts", "deprecated": false, @@ -3958,7 +4098,7 @@ "label": "UpdateExceptionListItemSchema", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts", "deprecated": false, @@ -3972,7 +4112,7 @@ "label": "UpdateExceptionListItemSchemaDecoded", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"namespace_type\" | \"os_types\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; _version: string | undefined; comments: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id: string | undefined; item_id: string | undefined; meta: object | undefined; namespace_type: \"single\" | \"agnostic\" | undefined; os_types: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags: string[] | undefined; }, \"tags\" | \"entries\" | \"comments\" | \"namespace_type\" | \"os_types\"> & { comments: ({ comment: string; } & { id?: string | undefined; })[]; tags: string[]; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; }" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts", "deprecated": false, @@ -4505,7 +4645,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; list_id: ", "Type", "; name: ", "StringC", @@ -4685,6 +4825,23 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.DefaultImportCommentsArray", + "type": "Object", + "tags": [], + "label": "DefaultImportCommentsArray", + "description": [ + "\nTypes the DefaultImportCommentsArray as:\n - If null or undefined, then a default array of type ImportCommentsArray will be set" + ], + "signature": [ + "Type", + "<(({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[], (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[], unknown>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.DefaultListArray", @@ -6151,6 +6308,8 @@ "label": "foundExceptionListItemSchema", "description": [], "signature": [ + "IntersectionC", + "<[", "ExactC", "<", "TypeC", @@ -6308,7 +6467,13 @@ "NumberC", "; total: ", "NumberC", - "; }>>" + "; }>>, ", + "ExactC", + "<", + "PartialC", + "<{ pit: ", + "StringC", + "; }>>]>" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts", "deprecated": false, @@ -6322,6 +6487,8 @@ "label": "foundExceptionListSchema", "description": [], "signature": [ + "IntersectionC", + "<[", "ExactC", "<", "TypeC", @@ -6379,7 +6546,13 @@ "NumberC", "; total: ", "NumberC", - "; }>>" + "; }>>, ", + "ExactC", + "<", + "PartialC", + "<{ pit: ", + "StringC", + "; }>>]>" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts", "deprecated": false, @@ -6602,6 +6775,143 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.importComment", + "type": "Object", + "tags": [], + "label": "importComment", + "description": [], + "signature": [ + "UnionC", + "<[", + "IntersectionC", + "<[", + "ExactC", + "<", + "TypeC", + "<{ comment: ", + "Type", + "; created_at: ", + "StringC", + "; created_by: ", + "StringC", + "; id: ", + "Type", + "; }>>, ", + "ExactC", + "<", + "PartialC", + "<{ updated_at: ", + "StringC", + "; updated_by: ", + "StringC", + "; }>>]>, ", + "ExactC", + "<", + "TypeC", + "<{ comment: ", + "Type", + "; }>>]>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.importCommentsArray", + "type": "Object", + "tags": [], + "label": "importCommentsArray", + "description": [], + "signature": [ + "ArrayC", + "<", + "UnionC", + "<[", + "IntersectionC", + "<[", + "ExactC", + "<", + "TypeC", + "<{ comment: ", + "Type", + "; created_at: ", + "StringC", + "; created_by: ", + "StringC", + "; id: ", + "Type", + "; }>>, ", + "ExactC", + "<", + "PartialC", + "<{ updated_at: ", + "StringC", + "; updated_by: ", + "StringC", + "; }>>]>, ", + "ExactC", + "<", + "TypeC", + "<{ comment: ", + "Type", + "; }>>]>>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.importCommentsArrayOrUndefined", + "type": "Object", + "tags": [], + "label": "importCommentsArrayOrUndefined", + "description": [], + "signature": [ + "UnionC", + "<[", + "ArrayC", + "<", + "UnionC", + "<[", + "IntersectionC", + "<[", + "ExactC", + "<", + "TypeC", + "<{ comment: ", + "Type", + "; created_at: ", + "StringC", + "; created_by: ", + "StringC", + "; id: ", + "Type", + "; }>>, ", + "ExactC", + "<", + "PartialC", + "<{ updated_at: ", + "StringC", + "; updated_by: ", + "StringC", + "; }>>]>, ", + "ExactC", + "<", + "TypeC", + "<{ comment: ", + "Type", + "; }>>]>>, ", + "UndefinedC", + "]>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.importExceptionListItemSchema", @@ -6621,7 +6931,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; item_id: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; item_id: ", "Type", "; list_id: ", "Type", @@ -6637,7 +6947,7 @@ "Type", "; comments: ", "Type", - "<{ comment: string; }[], { comment: string; }[], unknown>; created_at: ", + "<(({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[], (({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; }) | { comment: string; })[], unknown>; created_at: ", "StringC", "; updated_at: ", "StringC", @@ -7277,6 +7587,40 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.max_size", + "type": "Object", + "tags": [], + "label": "max_size", + "description": [], + "signature": [ + "Type", + "" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.maxSizeOrUndefined", + "type": "Object", + "tags": [], + "label": "maxSizeOrUndefined", + "description": [], + "signature": [ + "UnionC", + "<[", + "Type", + ", ", + "UndefinedC", + "]>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.meta", @@ -7520,7 +7864,7 @@ ], "signature": [ "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>" + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>" ], "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts", "deprecated": false, @@ -7724,6 +8068,74 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.pit", + "type": "Object", + "tags": [], + "label": "pit", + "description": [], + "signature": [ + "ExactC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; keepAlive: ", + "UnionC", + "<[", + "StringC", + ", ", + "UndefinedC", + "]>; }>>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.pitId", + "type": "Object", + "tags": [], + "label": "pitId", + "description": [], + "signature": [ + "StringC" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.pitOrUndefined", + "type": "Object", + "tags": [], + "label": "pitOrUndefined", + "description": [], + "signature": [ + "UnionC", + "<[", + "ExactC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; keepAlive: ", + "UnionC", + "<[", + "StringC", + ", ", + "UndefinedC", + "]>; }>>, ", + "UndefinedC", + "]>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.readEndpointListItemSchema", @@ -7833,6 +8245,44 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.search_after", + "type": "Object", + "tags": [], + "label": "search_after", + "description": [], + "signature": [ + "ArrayC", + "<", + "StringC", + ">" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/securitysolution-io-ts-list-types", + "id": "def-common.searchAfterOrUndefined", + "type": "Object", + "tags": [], + "label": "searchAfterOrUndefined", + "description": [], + "signature": [ + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "UndefinedC", + "]>" + ], + "path": "packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/securitysolution-io-ts-list-types", "id": "def-common.searchListItemArraySchema", @@ -8347,7 +8797,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", @@ -8400,7 +8850,7 @@ "StringC", "; entries: ", "Type", - "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", + "<({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[], unknown>; name: ", "StringC", "; type: ", "KeyofC", diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 2282d741d999e..fa61c1e33f4a1 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 439 | 1 | 428 | 0 | +| 460 | 1 | 448 | 0 | ## Common diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 494c3b0bf5669..f9d13496dc80c 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index c29e8441e9ee2..befa30c455347 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_api.devdocs.json b/api_docs/kbn_securitysolution_list_api.devdocs.json index b4ccd4cd6e1c1..8b5693496f42a 100644 --- a/api_docs/kbn_securitysolution_list_api.devdocs.json +++ b/api_docs/kbn_securitysolution_list_api.devdocs.json @@ -62,7 +62,7 @@ "signature": [ "({ http, listItem, signal, }: ", "AddExceptionListItemProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -206,7 +206,7 @@ "signature": [ "({ http, id, namespaceType, signal, }: ", "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -245,7 +245,7 @@ "section": "def-common.DeleteListParams", "text": "DeleteListParams" }, - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/list_api/index.ts", "deprecated": false, @@ -399,7 +399,7 @@ "signature": [ "({ http, id, namespaceType, signal, }: ", "ApiCallByIdProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -432,7 +432,7 @@ "signature": [ "({ filterOptions, http, listIds, namespaceTypes, pagination, signal, }: ", "ApiCallByListIdProps", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -465,7 +465,7 @@ "signature": [ "({ filters, http, namespaceTypes, pagination, signal, }: ", "ApiCallFetchExceptionListsProps", - ") => Promise<{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -504,7 +504,7 @@ "section": "def-common.FindListsParams", "text": "FindListsParams" }, - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/list_api/index.ts", "deprecated": false, @@ -549,7 +549,7 @@ "section": "def-common.ImportListParams", "text": "ImportListParams" }, - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-api/src/list_api/index.ts", "deprecated": false, @@ -743,7 +743,7 @@ "signature": [ "({ http, listItem, signal, }: ", "UpdateExceptionListItemProps", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-api/src/api/index.ts", "deprecated": false, @@ -1076,7 +1076,7 @@ "label": "type", "description": [], "signature": [ - "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined" + "\"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\" | undefined" ], "path": "packages/kbn-securitysolution-list-api/src/list_api/types.ts", "deprecated": false diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 575b8941de370..5222943dbf581 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 5c3aed816d7ab..d9a1d1f5f6fd6 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_hooks.devdocs.json b/api_docs/kbn_securitysolution_list_hooks.devdocs.json index f850c93307660..f835d18574804 100644 --- a/api_docs/kbn_securitysolution_list_hooks.devdocs.json +++ b/api_docs/kbn_securitysolution_list_hooks.devdocs.json @@ -29,7 +29,7 @@ "\nThis adds an id to the incoming exception item entries as ReactJS prefers to have\nan id added to them for use as a stable id. Later if we decide to change the data\nmodel to have id's within the array then this code should be removed. If not, then\nthis code should stay as an adapter for ReactJS.\n\nThis does break the type system slightly as we are lying a bit to the type system as we return\nthe same exceptionItem as we have previously but are augmenting the arrays with an id which TypeScript\ndoesn't mind us doing here. However, downstream you will notice that you have an id when the type\ndoes not indicate it. In that case use (ExceptionItem & { id: string }) temporarily if you're using the id. If you're not,\nyou can ignore the id and just use the normal TypeScript with ReactJS.\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -44,7 +44,7 @@ "The exceptionItem to add an id to the threat matches." ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -66,7 +66,7 @@ "\nThis removes an id from the exceptionItem entries as ReactJS prefers to have\nan id added to them for use as a stable id. Later if we decide to change the data\nmodel to have id's within the array then this code should be removed. If not, then\nthis code should stay as an adapter for ReactJS.\n" ], "signature": [ - "(exceptionItem: T) => T" + "(exceptionItem: T) => T" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -103,7 +103,7 @@ "\nTransforms the output of rules to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the input called \"myNewTransform\" do it\nin the form of:\nflow(addIdToExceptionItemEntries, myNewTransform)(exceptionItem)\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -118,7 +118,7 @@ "The exceptionItem to transform the output of" ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -138,7 +138,7 @@ "label": "transformNewItemOutput", "description": [], "signature": [ - "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "(exceptionItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) => { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -151,7 +151,7 @@ "label": "exceptionItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -171,7 +171,7 @@ "\nTransforms the output of exception items to compensate for technical debt or UI concerns such as\nReactJS preferences for having ids within arrays if the data is not modeled that way.\n\nIf you add a new transform of the output called \"myNewTransform\" do it\nin the form of:\nflow(removeIdFromExceptionItemsEntries, myNewTransform)(exceptionItem)\n" ], "signature": [ - "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "(exceptionItem: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })) => { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -186,7 +186,7 @@ "The exceptionItem to transform the output of" ], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; })" ], "path": "packages/kbn-securitysolution-list-hooks/src/transforms/index.ts", "deprecated": false, @@ -317,7 +317,7 @@ "OptionalSignalArgs", "<", "DeleteListParams", - ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" + ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts", "deprecated": false, @@ -445,7 +445,7 @@ "OptionalSignalArgs", "<", "FindListsParams", - ">], { cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ">], { cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts", "deprecated": false, @@ -467,7 +467,7 @@ "OptionalSignalArgs", "<", "ImportListParams", - ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" + ">], { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts", "deprecated": false, @@ -623,7 +623,7 @@ "label": "addExceptionListItem", "description": [], "signature": [ - "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -646,7 +646,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false @@ -664,7 +664,7 @@ "label": "updateExceptionListItem", "description": [], "signature": [ - "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + "(arg: { listItem: { description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }; }) => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -687,7 +687,7 @@ "label": "listItem", "description": [], "signature": [ - "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" + "{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false @@ -771,7 +771,7 @@ "signature": [ "(arg: ", "ApiCallMemoProps", - " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }) => Promise" + " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }) => Promise" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -785,7 +785,7 @@ "description": [], "signature": [ "ApiCallMemoProps", - " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }" + " & { onSuccess: (arg: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }) => void; }" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_api/index.ts", "deprecated": false, @@ -954,7 +954,7 @@ "label": "ReturnExceptionListAndItems", "description": [], "signature": [ - "[boolean, { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[], ", + "[boolean, { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[], ", "Pagination", ", Func | null]" ], @@ -996,7 +996,7 @@ "label": "ReturnPersistExceptionItem", "description": [], "signature": [ - "[PersistReturnExceptionItem, React.Dispatch<({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | null>]" + "[PersistReturnExceptionItem, React.Dispatch<({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; name: string; type: \"simple\"; } & { _version?: string | undefined; comments?: ({ comment: string; } & { id?: string | undefined; })[] | undefined; id?: string | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | null>]" ], "path": "packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 6ccd70fd06ddf..4ca3060b2331c 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_list_utils.devdocs.json b/api_docs/kbn_securitysolution_list_utils.devdocs.json index 700f473e170f0..25511e6b717bf 100644 --- a/api_docs/kbn_securitysolution_list_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_list_utils.devdocs.json @@ -27,7 +27,7 @@ "label": "addIdToEntries", "description": [], "signature": [ - "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -40,7 +40,7 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -58,7 +58,7 @@ "label": "buildExceptionFilter", "description": [], "signature": [ - "({ lists, excludeExceptions, chunkSize, }: { lists: ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]; excludeExceptions: boolean; chunkSize: number; }) => ", + "({ lists, excludeExceptions, chunkSize, }: { lists: ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]; excludeExceptions: boolean; chunkSize: number; }) => ", "Filter", " | undefined" ], @@ -83,7 +83,7 @@ "label": "lists", "description": [], "signature": [ - "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" + "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "packages/kbn-securitysolution-list-utils/src/build_exception_filter/index.ts", "deprecated": false @@ -690,7 +690,7 @@ "section": "def-common.ExceptionsBuilderExceptionItem", "text": "ExceptionsBuilderExceptionItem" }, - "[]) => ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" + "[]) => ({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -944,7 +944,7 @@ "section": "def-common.FormattedBuilderEntry", "text": "FormattedBuilderEntry" }, - ") => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }" + ") => ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -1086,7 +1086,7 @@ "section": "def-common.FormattedBuilderEntry", "text": "FormattedBuilderEntry" }, - ", newField: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }) => { index: number; updatedEntry: ", + ", newField: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }) => { index: number; updatedEntry: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -1131,7 +1131,7 @@ "- newly selected list" ], "signature": [ - "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }" + "{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }" ], "path": "packages/kbn-securitysolution-list-utils/src/helpers/index.ts", "deprecated": false, @@ -2503,7 +2503,7 @@ "label": "hasLargeValueList", "description": [], "signature": [ - "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => boolean" + "(entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]) => boolean" ], "path": "packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts", "deprecated": false, @@ -2516,7 +2516,7 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts", "deprecated": false, @@ -3161,7 +3161,7 @@ "label": "BuilderEntry", "description": [], "signature": [ - "(({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }) | ", + "(({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; }) & { id?: string | undefined; }) | ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -3220,7 +3220,7 @@ "label": "CreateExceptionListItemBuilderSchema", "description": [], "signature": [ - "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"meta\" | \"entries\"> & { meta: { temporaryUuid: string; }; entries: ", + "Omit<{ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }, \"meta\" | \"entries\"> & { meta: { temporaryUuid: string; }; entries: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", @@ -3354,7 +3354,7 @@ "label": "ExceptionListItemBuilderSchema", "description": [], "signature": [ - "Omit<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }, \"entries\"> & { entries: ", + "Omit<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }, \"entries\"> & { entries: ", { "pluginId": "@kbn/securitysolution-list-utils", "scope": "common", diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index cb856bd39b1f2..ac515fe68aae3 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index df9006730e5e9..814c363c133e2 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-rules plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index d7194de125dc6..a515d88d4ba12 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index abf0e1b40b03e..d6da384558737 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/securitysolution-utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 5bba1c3605331..9363d91c90516 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/server-http-tools plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index bcee696d4d2d0..fb55be6af9b4b 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/server-route-repository plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 35b4f33aaf0cb..10c9c97f87ab8 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/std plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 1a613590c4320..3bca34bf83a42 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/storybook plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 3c5db96b7fed1..00cce163578f7 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/telemetry-tools plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_test.devdocs.json b/api_docs/kbn_test.devdocs.json index d00b1b11254a3..8a782d0acba7e 100644 --- a/api_docs/kbn_test.devdocs.json +++ b/api_docs/kbn_test.devdocs.json @@ -1561,40 +1561,6 @@ } ], "functions": [ - { - "parentPluginId": "@kbn/test", - "id": "def-server.convertToKibanaClient", - "type": "Function", - "tags": [], - "label": "convertToKibanaClient", - "description": [], - "signature": [ - "(esClient: ", - "default", - ") => ", - "KibanaClient" - ], - "path": "packages/kbn-test/src/es/client_to_kibana_client.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/test", - "id": "def-server.convertToKibanaClient.$1", - "type": "Object", - "tags": [], - "label": "esClient", - "description": [], - "signature": [ - "default" - ], - "path": "packages/kbn-test/src/es/client_to_kibana_client.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/test", "id": "def-server.createEsClientForFtrConfig", @@ -3594,22 +3560,6 @@ "children": [], "returnComment": [] }, - { - "parentPluginId": "@kbn/test", - "id": "def-server.ICluster.getKibanaEsClient", - "type": "Function", - "tags": [], - "label": "getKibanaEsClient", - "description": [], - "signature": [ - "() => ", - "KibanaClient" - ], - "path": "packages/kbn-test/src/es/test_es_cluster.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "@kbn/test", "id": "def-server.ICluster.getHostUrls", diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 85d43290c5d5e..f027ef7377b14 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/test plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact Operations for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 244 | 5 | 208 | 9 | +| 241 | 5 | 205 | 9 | ## Server diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 8519cb0e98180..d8b5fba1fa6fc 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/test-jest-helpers plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index d1cb8efadd949..0c66237c7b058 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/typed-react-router-config plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index b5b49f0306c69..6030535a0250e 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/ui-theme plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 6fdbb2fff69ea..4adbc63e50aa5 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utility-types plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index bf2153da29e25..c71b131336f05 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github summary: API docs for the @kbn/utils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index efd679a9766f5..b78215b0382bc 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaOverview plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_react.devdocs.json b/api_docs/kibana_react.devdocs.json index c253bc77f6a6b..adea589d4eb95 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -3871,14 +3871,42 @@ "parentPluginId": "kibanaReact", "id": "def-public.ExitFullScreenButton", "type": "Object", - "tags": [], + "tags": [ + "deprecated" + ], "label": "ExitFullScreenButton", "description": [], "signature": [ "typeof ExitFullScreenButtonUi" ], "path": "src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx", - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/services/kibana_react.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/plugin.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/plugin.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/plugin.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx" + } + ], "initialIsOpen": false }, { diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 304d46f440097..cc5c4251f5619 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaReact plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 088865fd838c2..327c3cc9c973a 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github summary: API docs for the kibanaUtils plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/lens.devdocs.json b/api_docs/lens.devdocs.json index 241ebb73f5b81..3a5c531a23308 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -231,7 +231,7 @@ "label": "params", "description": [], "signature": [ - "{ interval: string; }" + "{ interval: string; ignoreTimeRange?: boolean | undefined; }" ], "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", "deprecated": false @@ -1282,6 +1282,45 @@ ], "path": "x-pack/plugins/lens/common/expressions/metric_chart/types.ts", "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.MetricState.titlePosition", + "type": "CompoundType", + "tags": [], + "label": "titlePosition", + "description": [], + "signature": [ + "\"top\" | \"bottom\" | undefined" + ], + "path": "x-pack/plugins/lens/common/expressions/metric_chart/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.MetricState.size", + "type": "string", + "tags": [], + "label": "size", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/lens/common/expressions/metric_chart/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.MetricState.textAlign", + "type": "CompoundType", + "tags": [], + "label": "textAlign", + "description": [], + "signature": [ + "\"left\" | \"right\" | \"center\" | undefined" + ], + "path": "x-pack/plugins/lens/common/expressions/metric_chart/types.ts", + "deprecated": false } ], "initialIsOpen": false @@ -1414,7 +1453,7 @@ "tags": [], "label": "PieVisualizationState", "description": [], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, "children": [ { @@ -1427,7 +1466,7 @@ "signature": [ "\"pie\" | \"donut\" | \"treemap\" | \"mosaic\" | \"waffle\"" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1438,10 +1477,16 @@ "label": "layers", "description": [], "signature": [ - "PieLayerState", + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.PieLayerState", + "text": "PieLayerState" + }, "[]" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1461,7 +1506,7 @@ }, "<{ [key: string]: unknown; }> | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false } ], @@ -1534,7 +1579,7 @@ "tags": [], "label": "SharedPieLayerState", "description": [], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, "children": [ { @@ -1547,7 +1592,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1560,7 +1605,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1573,7 +1618,7 @@ "signature": [ "\"percent\" | \"hidden\" | \"value\"" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1586,7 +1631,7 @@ "signature": [ "\"default\" | \"hide\" | \"inside\"" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1599,7 +1644,7 @@ "signature": [ "\"default\" | \"show\" | \"hide\"" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1610,9 +1655,10 @@ "label": "legendPosition", "description": [], "signature": [ - "\"top\" | \"bottom\" | \"left\" | \"right\" | undefined" + "Position", + " | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1625,7 +1671,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1638,7 +1684,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1651,7 +1697,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1664,7 +1710,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1677,7 +1723,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false }, { @@ -1690,7 +1736,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false } ], @@ -2310,7 +2356,7 @@ }, "; label: string; icon?: ", "IconType", - " | undefined; disabled?: boolean | undefined; tooltipContent?: string | undefined; initialDimensions?: { groupId: string; columnId: string; dataType: string; label: string; staticValue: unknown; }[] | undefined; }[]" + " | undefined; disabled?: boolean | undefined; toolTipContent?: string | undefined; initialDimensions?: { groupId: string; columnId: string; dataType: string; label: string; staticValue: unknown; }[] | undefined; }[]" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false, @@ -2643,6 +2689,72 @@ ], "returnComment": [] }, + { + "parentPluginId": "lens", + "id": "def-public.Visualization.updateLayersConfigurationFromContext", + "type": "Function", + "tags": [], + "label": "updateLayersConfigurationFromContext", + "description": [ + "\nUpdate the configuration for the visualization. This is used to update the state" + ], + "signature": [ + "((props: VisualizationConfigurationFromContextChangeProps) => T) | undefined" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-public.Visualization.updateLayersConfigurationFromContext.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "VisualizationConfigurationFromContextChangeProps" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "lens", + "id": "def-public.Visualization.getVisualizationSuggestionFromContext", + "type": "Function", + "tags": [], + "label": "getVisualizationSuggestionFromContext", + "description": [ + "\nUpdate the visualization state from the context." + ], + "signature": [ + "((props: VisualizationStateFromContextChangeProps) => ", + "Suggestion", + ") | undefined" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-public.Visualization.getVisualizationSuggestionFromContext.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "VisualizationStateFromContextChangeProps" + ], + "path": "x-pack/plugins/lens/public/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "lens", "id": "def-public.Visualization.renderDimensionEditor", @@ -3694,6 +3806,7 @@ "label": "GaugeVisualizationState", "description": [], "signature": [ + "Omit<", { "pluginId": "expressionGauge", "scope": "common", @@ -3701,7 +3814,7 @@ "section": "def-common.GaugeState", "text": "GaugeState" }, - " & { layerId: string; layerType: ", + ", \"goal\" | \"max\" | \"min\" | \"metric\"> & { metricAccessor?: string | undefined; minAccessor?: string | undefined; maxAccessor?: string | undefined; goalAccessor?: string | undefined; } & { layerId: string; layerType: ", { "pluginId": "lens", "scope": "common", @@ -3943,7 +4056,13 @@ "label": "PieLayerState", "description": [], "signature": [ - "SharedPieLayerState", + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.SharedPieLayerState", + "text": "SharedPieLayerState" + }, " & { layerId: string; layerType: ", { "pluginId": "lens", @@ -3954,7 +4073,7 @@ }, "; }" ], - "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", + "path": "x-pack/plugins/lens/common/types.ts", "deprecated": false, "initialIsOpen": false }, @@ -4016,7 +4135,13 @@ "text": "XYState" }, "> | LensAttributes<\"lnsPie\", ", - "PieVisualizationState", + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.PieVisualizationState", + "text": "PieVisualizationState" + }, "> | LensAttributes<\"lnsDatatable\", ", { "pluginId": "lens", @@ -5980,6 +6105,242 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "lens", + "id": "def-common.PieVisualizationState", + "type": "Interface", + "tags": [], + "label": "PieVisualizationState", + "description": [], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-common.PieVisualizationState.shape", + "type": "CompoundType", + "tags": [], + "label": "shape", + "description": [], + "signature": [ + "\"pie\" | \"donut\" | \"treemap\" | \"mosaic\" | \"waffle\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.PieVisualizationState.layers", + "type": "Array", + "tags": [], + "label": "layers", + "description": [], + "signature": [ + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.PieLayerState", + "text": "PieLayerState" + }, + "[]" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.PieVisualizationState.palette", + "type": "Object", + "tags": [], + "label": "palette", + "description": [], + "signature": [ + { + "pluginId": "charts", + "scope": "common", + "docId": "kibChartsPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<{ [key: string]: unknown; }> | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState", + "type": "Interface", + "tags": [], + "label": "SharedPieLayerState", + "description": [], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.groups", + "type": "Array", + "tags": [], + "label": "groups", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.metric", + "type": "string", + "tags": [], + "label": "metric", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.numberDisplay", + "type": "CompoundType", + "tags": [], + "label": "numberDisplay", + "description": [], + "signature": [ + "\"percent\" | \"hidden\" | \"value\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.categoryDisplay", + "type": "CompoundType", + "tags": [], + "label": "categoryDisplay", + "description": [], + "signature": [ + "\"default\" | \"hide\" | \"inside\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.legendDisplay", + "type": "CompoundType", + "tags": [], + "label": "legendDisplay", + "description": [], + "signature": [ + "\"default\" | \"show\" | \"hide\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.legendPosition", + "type": "CompoundType", + "tags": [], + "label": "legendPosition", + "description": [], + "signature": [ + "Position", + " | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.showValuesInLegend", + "type": "CompoundType", + "tags": [], + "label": "showValuesInLegend", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.nestedLegend", + "type": "CompoundType", + "tags": [], + "label": "nestedLegend", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.percentDecimals", + "type": "number", + "tags": [], + "label": "percentDecimals", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.emptySizeRatio", + "type": "number", + "tags": [], + "label": "emptySizeRatio", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.legendMaxLines", + "type": "number", + "tags": [], + "label": "legendMaxLines", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-common.SharedPieLayerState.truncateLegend", + "type": "CompoundType", + "tags": [], + "label": "truncateLegend", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "lens", "id": "def-common.TopValuesResult", @@ -6024,7 +6385,19 @@ "initialIsOpen": false } ], - "enums": [], + "enums": [ + { + "parentPluginId": "lens", + "id": "def-common.EmptySizeRatios", + "type": "Enum", + "tags": [], + "label": "EmptySizeRatios", + "description": [], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "initialIsOpen": false + } + ], "misc": [ { "parentPluginId": "lens", @@ -6054,6 +6427,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "lens", + "id": "def-common.CategoryDisplayType", + "type": "Type", + "tags": [], + "label": "CategoryDisplayType", + "description": [], + "signature": [ + "\"default\" | \"hide\" | \"inside\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "lens", "id": "def-common.CustomPaletteParamsConfig", @@ -6185,6 +6572,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "lens", + "id": "def-common.LegendDisplayType", + "type": "Type", + "tags": [], + "label": "LegendDisplayType", + "description": [], + "signature": [ + "\"default\" | \"show\" | \"hide\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "lens", "id": "def-common.LENS_EDIT_BY_VALUE", @@ -6227,6 +6628,63 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "lens", + "id": "def-common.NumberDisplayType", + "type": "Type", + "tags": [], + "label": "NumberDisplayType", + "description": [], + "signature": [ + "\"percent\" | \"hidden\" | \"value\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-common.PieChartType", + "type": "Type", + "tags": [], + "label": "PieChartType", + "description": [], + "signature": [ + "\"pie\" | \"donut\" | \"treemap\" | \"mosaic\" | \"waffle\"" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-common.PieLayerState", + "type": "Type", + "tags": [], + "label": "PieLayerState", + "description": [], + "signature": [ + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.SharedPieLayerState", + "text": "SharedPieLayerState" + }, + " & { layerId: string; layerType: ", + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.LayerType", + "text": "LayerType" + }, + "; }" + ], + "path": "x-pack/plugins/lens/common/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "lens", "id": "def-common.PLUGIN_ID", @@ -6293,6 +6751,20 @@ } ], "objects": [ + { + "parentPluginId": "lens", + "id": "def-common.CategoryDisplay", + "type": "Object", + "tags": [], + "label": "CategoryDisplay", + "description": [], + "signature": [ + "{ readonly DEFAULT: \"default\"; readonly INSIDE: \"inside\"; readonly HIDE: \"hide\"; }" + ], + "path": "x-pack/plugins/lens/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "lens", "id": "def-common.layerTypes", @@ -6331,6 +6803,48 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-common.LegendDisplay", + "type": "Object", + "tags": [], + "label": "LegendDisplay", + "description": [], + "signature": [ + "{ readonly DEFAULT: \"default\"; readonly SHOW: \"show\"; readonly HIDE: \"hide\"; }" + ], + "path": "x-pack/plugins/lens/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-common.NumberDisplay", + "type": "Object", + "tags": [], + "label": "NumberDisplay", + "description": [], + "signature": [ + "{ readonly HIDDEN: \"hidden\"; readonly PERCENT: \"percent\"; readonly VALUE: \"value\"; }" + ], + "path": "x-pack/plugins/lens/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-common.PieChartTypes", + "type": "Object", + "tags": [], + "label": "PieChartTypes", + "description": [], + "signature": [ + "{ readonly PIE: \"pie\"; readonly DONUT: \"donut\"; readonly TREEMAP: \"treemap\"; readonly MOSAIC: \"mosaic\"; readonly WAFFLE: \"waffle\"; }" + ], + "path": "x-pack/plugins/lens/common/constants.ts", + "deprecated": false, + "initialIsOpen": false } ] } diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index b322bfce65ece..ca6411a26645f 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github summary: API docs for the lens plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 365 | 0 | 316 | 44 | +| 399 | 0 | 348 | 42 | ## Client @@ -56,6 +56,9 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) ### Interfaces +### Enums + + ### Consts, variables and types diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 765d8eebc09bd..a7d065be74db7 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github summary: API docs for the licenseApiGuard plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index c589b8950018c..c7370959536ec 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the licenseManagement plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/licensing.devdocs.json b/api_docs/licensing.devdocs.json index 0f8d44f2f39f7..40e6f7874ec34 100644 --- a/api_docs/licensing.devdocs.json +++ b/api_docs/licensing.devdocs.json @@ -734,10 +734,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/plugin.ts" }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/plugin.ts" - }, { "plugin": "apm", "path": "x-pack/plugins/apm/public/context/license/license_context.tsx" @@ -2531,10 +2527,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/server/plugin.ts" }, - { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/plugin.ts" - }, { "plugin": "remoteClusters", "path": "x-pack/plugins/remote_clusters/server/plugin.ts" diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 4ddbb3b79197e..cbfea8a751fa0 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github summary: API docs for the licensing plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/lists.devdocs.json b/api_docs/lists.devdocs.json index 755ff1c172200..c010e8333785a 100644 --- a/api_docs/lists.devdocs.json +++ b/api_docs/lists.devdocs.json @@ -311,7 +311,7 @@ "label": "exceptionItems", "description": [], "signature": [ - "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" + "({ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | ({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }))[]" ], "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", "deprecated": false @@ -324,7 +324,7 @@ "label": "exceptionsToDelete", "description": [], "signature": [ - "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" + "{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]" ], "path": "x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx", "deprecated": false @@ -587,7 +587,7 @@ "signature": [ "({ itemId, id, namespaceType, }: ", "GetExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -659,7 +659,7 @@ "signature": [ "({ comments, description, entries, itemId, meta, name, osTypes, tags, type, }: ", "CreateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -693,7 +693,7 @@ "signature": [ "({ _version, comments, description, entries, id, itemId, meta, name, osTypes, tags, type, }: ", "UpdateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -727,7 +727,7 @@ "signature": [ "({ itemId, id, }: ", "GetEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -915,7 +915,7 @@ "section": "def-server.CreateExceptionListItemOptions", "text": "CreateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -977,7 +977,7 @@ "section": "def-server.UpdateExceptionListItemOptions", "text": "UpdateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1024,7 +1024,7 @@ "signature": [ "({ id, itemId, namespaceType, }: ", "DeleteExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1098,7 +1098,7 @@ "signature": [ "({ id, itemId, }: ", "DeleteEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1128,9 +1128,9 @@ "label": "findExceptionListItem", "description": [], "signature": [ - "({ listId, filter, perPage, page, sortField, sortOrder, namespaceType, }: ", + "({ listId, filter, perPage, pit, page, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1140,7 +1140,7 @@ "id": "def-server.ExceptionListClient.findExceptionListItem.$1", "type": "Object", "tags": [], - "label": "{\n listId,\n filter,\n perPage,\n page,\n sortField,\n sortOrder,\n namespaceType,\n }", + "label": "{\n listId,\n filter,\n perPage,\n pit,\n page,\n searchAfter,\n sortField,\n sortOrder,\n namespaceType,\n }", "description": [], "signature": [ "FindExceptionListItemOptions" @@ -1160,9 +1160,9 @@ "label": "findExceptionListsItem", "description": [], "signature": [ - "({ listId, filter, perPage, page, sortField, sortOrder, namespaceType, }: ", + "({ listId, filter, perPage, pit, page, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListsItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1172,7 +1172,7 @@ "id": "def-server.ExceptionListClient.findExceptionListsItem.$1", "type": "Object", "tags": [], - "label": "{\n listId,\n filter,\n perPage,\n page,\n sortField,\n sortOrder,\n namespaceType,\n }", + "label": "{\n listId,\n filter,\n perPage,\n pit,\n page,\n searchAfter,\n sortField,\n sortOrder,\n namespaceType,\n }", "description": [], "signature": [ "FindExceptionListsItemOptions" @@ -1192,9 +1192,9 @@ "label": "findValueListExceptionListItems", "description": [], "signature": [ - "({ perPage, page, sortField, sortOrder, valueListId, }: ", + "({ perPage, pit, page, searchAfter, sortField, sortOrder, valueListId, }: ", "FindValueListExceptionListsItems", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1204,7 +1204,7 @@ "id": "def-server.ExceptionListClient.findValueListExceptionListItems.$1", "type": "Object", "tags": [], - "label": "{\n perPage,\n page,\n sortField,\n sortOrder,\n valueListId,\n }", + "label": "{\n perPage,\n pit,\n page,\n searchAfter,\n sortField,\n sortOrder,\n valueListId,\n }", "description": [], "signature": [ "FindValueListExceptionListsItems" @@ -1224,9 +1224,9 @@ "label": "findExceptionList", "description": [], "signature": [ - "({ filter, perPage, page, sortField, sortOrder, namespaceType, }: ", + "({ filter, perPage, page, pit, searchAfter, sortField, sortOrder, namespaceType, }: ", "FindExceptionListOptions", - ") => Promise<{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ data: { _version: string | undefined; created_at: string; created_by: string; description: string; id: string; immutable: boolean; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"endpoint\" | \"detection\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1236,7 +1236,7 @@ "id": "def-server.ExceptionListClient.findExceptionList.$1", "type": "Object", "tags": [], - "label": "{\n filter,\n perPage,\n page,\n sortField,\n sortOrder,\n namespaceType,\n }", + "label": "{\n filter,\n perPage,\n page,\n pit,\n searchAfter,\n sortField,\n sortOrder,\n namespaceType,\n }", "description": [], "signature": [ "FindExceptionListOptions" @@ -1258,9 +1258,9 @@ "\nThis is the same as \"findExceptionList\" except it applies specifically to the endpoint list and will\nauto-call the \"createEndpointList\" for you so that you have the best chance of the endpoint\nbeing there if it did not exist before. If the list did not exist before, then creating it here should give you\na good guarantee that you will get an empty record set rather than null. I keep the null as the return value in\nthe off chance that you still might somehow not get into a race condition where the endpoint list does\nnot exist because someone deleted it in-between the initial create and then the find." ], "signature": [ - "({ filter, perPage, page, sortField, sortOrder, }: ", + "({ filter, perPage, page, pit, searchAfter, sortField, sortOrder, }: ", "FindEndpointListItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<({ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } & { pit?: string | undefined; }) | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1270,7 +1270,7 @@ "id": "def-server.ExceptionListClient.findEndpointListItem.$1", "type": "Object", "tags": [], - "label": "{\n filter,\n perPage,\n page,\n sortField,\n sortOrder,\n }", + "label": "{\n filter,\n perPage,\n page,\n pit,\n searchAfter,\n sortField,\n sortOrder,\n }", "description": [], "signature": [ "FindEndpointListItemOptions" @@ -1412,6 +1412,237 @@ "returnComment": [ "summary of imported count and errors" ] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.openPointInTime", + "type": "Function", + "tags": [ + "params", + "params", + "return" + ], + "label": "openPointInTime", + "description": [ + "\nOpens a point in time (PIT) for either exception lists or exception list items.\nSee: https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html" + ], + "signature": [ + "({ namespaceType, options, }: ", + "OpenPointInTimeOptions", + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsOpenPointInTimeResponse", + "text": "SavedObjectsOpenPointInTimeResponse" + }, + ">" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.openPointInTime.$1", + "type": "Object", + "tags": [], + "label": "{\n namespaceType,\n options,\n }", + "description": [], + "signature": [ + "OpenPointInTimeOptions" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [ + "The point in time (PIT)" + ] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.closePointInTime", + "type": "Function", + "tags": [ + "params", + "return" + ], + "label": "closePointInTime", + "description": [ + "\nCloses a point in time (PIT) for either exception lists or exception list items.\nSee: https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html" + ], + "signature": [ + "({ pit, }: ", + "ClosePointInTimeOptions", + ") => Promise<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClosePointInTimeResponse", + "text": "SavedObjectsClosePointInTimeResponse" + }, + ">" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.closePointInTime.$1", + "type": "Object", + "tags": [], + "label": "{\n pit,\n }", + "description": [], + "signature": [ + "ClosePointInTimeOptions" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [ + "The point in time (PIT)" + ] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findExceptionListItemPointInTimeFinder", + "type": "Function", + "tags": [], + "label": "findExceptionListItemPointInTimeFinder", + "description": [ + "\nFinds an exception list item within a point in time (PIT) and then calls the function\n`executeFunctionOnStream` until the maxPerPage is reached and stops.\nNOTE: This is slightly different from the saved objects version in that it takes\nan injected function, so that we avoid doing additional plumbing with generators\nto try to keep the maintenance of this machinery simpler for now.\n\nIf you want to stream all results up to 10k into memory for correlation this would be:" + ], + "signature": [ + "({ executeFunctionOnStream, filter, listId, maxSize, namespaceType, perPage, sortField, sortOrder, }: ", + "FindExceptionListItemPointInTimeFinderOptions", + ") => Promise" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findExceptionListItemPointInTimeFinder.$1", + "type": "Object", + "tags": [], + "label": "{\n executeFunctionOnStream,\n filter,\n listId,\n maxSize,\n namespaceType,\n perPage,\n sortField,\n sortOrder,\n }", + "description": [], + "signature": [ + "FindExceptionListItemPointInTimeFinderOptions" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findExceptionListPointInTimeFinder", + "type": "Function", + "tags": [], + "label": "findExceptionListPointInTimeFinder", + "description": [ + "\nFinds an exception list within a point in time (PIT) and then calls the function\n`executeFunctionOnStream` until the maxPerPage is reached and stops.\nNOTE: This is slightly different from the saved objects version in that it takes\nan injected function, so that we avoid doing additional plumbing with generators\nto try to keep the maintenance of this machinery simpler for now.\n\nIf you want to stream all results up to 10k into memory for correlation this would be:" + ], + "signature": [ + "({ executeFunctionOnStream, filter, maxSize, namespaceType, perPage, sortField, sortOrder, }: ", + "FindExceptionListPointInTimeFinderOptions", + ") => Promise" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findExceptionListPointInTimeFinder.$1", + "type": "Object", + "tags": [], + "label": "{\n executeFunctionOnStream,\n filter,\n maxSize,\n namespaceType,\n perPage,\n sortField,\n sortOrder,\n }", + "description": [], + "signature": [ + "FindExceptionListPointInTimeFinderOptions" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findExceptionListsItemPointInTimeFinder", + "type": "Function", + "tags": [], + "label": "findExceptionListsItemPointInTimeFinder", + "description": [ + "\nFinds exception list items within a point in time (PIT) and then calls the function\n`executeFunctionOnStream` until the maxPerPage is reached and stops.\nNOTE: This is slightly different from the saved objects version in that it takes\nan injected function, so that we avoid doing additional plumbing with generators\nto try to keep the maintenance of this machinery simpler for now.\n\nIf you want to stream all results up to 10k into memory for correlation this would be:" + ], + "signature": [ + "({ listId, namespaceType, executeFunctionOnStream, maxSize, filter, perPage, sortField, sortOrder, }: ", + "FindExceptionListItemsPointInTimeFinderOptions", + ") => Promise" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findExceptionListsItemPointInTimeFinder.$1", + "type": "Object", + "tags": [], + "label": "{\n listId,\n namespaceType,\n executeFunctionOnStream,\n maxSize,\n filter,\n perPage,\n sortField,\n sortOrder,\n }", + "description": [], + "signature": [ + "FindExceptionListItemsPointInTimeFinderOptions" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findValueListExceptionListItemsPointInTimeFinder", + "type": "Function", + "tags": [], + "label": "findValueListExceptionListItemsPointInTimeFinder", + "description": [ + "\nFinds value lists within exception lists within a point in time (PIT) and then calls the function\n`executeFunctionOnStream` until the maxPerPage is reached and stops.\nNOTE: This is slightly different from the saved objects version in that it takes\nan injected function, so that we avoid doing additional plumbing with generators\nto try to keep the maintenance of this machinery simpler for now.\n\nIf you want to stream all results up to 10k into memory for correlation this would be:" + ], + "signature": [ + "({ valueListId, executeFunctionOnStream, perPage, maxSize, sortField, sortOrder, }: ", + "FindValueListExceptionListsItemsPointInTimeFinder", + ") => Promise" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.findValueListExceptionListItemsPointInTimeFinder.$1", + "type": "Object", + "tags": [], + "label": "{\n valueListId,\n executeFunctionOnStream,\n perPage,\n maxSize,\n sortField,\n sortOrder,\n }", + "description": [], + "signature": [ + "FindValueListExceptionListsItemsPointInTimeFinder" + ], + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false @@ -1496,7 +1727,7 @@ "signature": [ "({ id }: ", "GetListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1528,7 +1759,7 @@ "signature": [ "({ id, deserializer, immutable, serializer, name, description, type, meta, version, }: ", "CreateListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1560,7 +1791,7 @@ "signature": [ "({ id, deserializer, serializer, name, description, immutable, type, meta, version, }: ", "CreateListIfItDoesNotExistOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1892,7 +2123,7 @@ "signature": [ "({ id }: ", "DeleteListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1924,7 +2155,7 @@ "signature": [ "({ listId, value, type, }: ", "DeleteListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1956,7 +2187,7 @@ "signature": [ "({ id }: ", "DeleteListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2020,7 +2251,7 @@ "signature": [ "({ deserializer, serializer, type, listId, stream, meta, version, }: ", "ImportListItemsToStreamOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2052,7 +2283,7 @@ "signature": [ "({ listId, value, type, }: ", "GetListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2084,7 +2315,7 @@ "signature": [ "({ id, deserializer, serializer, listId, value, type, meta, }: ", "CreateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2116,7 +2347,7 @@ "signature": [ "({ _version, id, value, meta, }: ", "UpdateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2148,7 +2379,7 @@ "signature": [ "({ _version, id, name, description, meta, version, }: ", "UpdateListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2180,7 +2411,7 @@ "signature": [ "({ id }: ", "GetListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2212,7 +2443,7 @@ "signature": [ "({ type, listId, value, }: ", "GetListItemsByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2244,7 +2475,7 @@ "signature": [ "({ type, listId, value, }: ", "SearchListItemByValuesOptions", - ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" + ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2276,7 +2507,7 @@ "signature": [ "({ filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2308,7 +2539,7 @@ "signature": [ "({ listId, filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListItemOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -2367,7 +2598,7 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", "deprecated": false @@ -2633,7 +2864,7 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"long\" | \"double\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"keyword\" | \"ip\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"text\" | \"binary\" | \"date_nanos\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"half_float\" | \"double\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\" | \"date_range\" | \"ip_range\" | \"shape\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", "deprecated": false @@ -3594,20 +3825,1196 @@ { "parentPluginId": "lists", "id": "def-server.ListPluginSetup.getListClient.$1", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "esClient", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", "TransportRequestOptions", " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "x-pack/plugins/lists/server/types.ts", "deprecated": false diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index a735ff2b4cd28..629537e8b1f37 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github summary: API docs for the lists plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Security detections response](https://github.com/orgs/elastic/teams/sec | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 185 | 0 | 155 | 43 | +| 197 | 0 | 161 | 49 | ## Client diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 566e1554ba995..89e8e7c972ec4 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github summary: API docs for the management plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 489e901f7d10b..f24d400d6861a 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github summary: API docs for the maps plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index f7666202229f7..10c3d2cb1b131 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github summary: API docs for the mapsEms plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/metrics_entities.devdocs.json b/api_docs/metrics_entities.devdocs.json index b2aa696e1aa60..ea314e0b71ec9 100644 --- a/api_docs/metrics_entities.devdocs.json +++ b/api_docs/metrics_entities.devdocs.json @@ -51,20 +51,1196 @@ { "parentPluginId": "metricsEntities", "id": "def-server.MetricsEntitiesPluginSetup.getMetricsEntitiesClient.$1", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "esClient", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "x-pack/plugins/metrics_entities/server/types.ts", "deprecated": false diff --git a/api_docs/metrics_entities.mdx b/api_docs/metrics_entities.mdx index 851e57c811243..3e4aaaa14ca7d 100644 --- a/api_docs/metrics_entities.mdx +++ b/api_docs/metrics_entities.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/metricsEntities title: "metricsEntities" image: https://source.unsplash.com/400x175/?github summary: API docs for the metricsEntities plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsEntities'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ml.devdocs.json b/api_docs/ml.devdocs.json index 5246fd09dc4a3..0c79b0a86e5c7 100644 --- a/api_docs/ml.devdocs.json +++ b/api_docs/ml.devdocs.json @@ -2868,7 +2868,9 @@ "signature": [ "{ [x: string]: ", "MappingRuntimeField", - "; }" + " | ", + "MappingRuntimeField", + "[]; }" ], "path": "x-pack/plugins/ml/common/types/fields.ts", "deprecated": false, diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 59345386930e3..dec516a13252c 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github summary: API docs for the ml plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/monitoring.devdocs.json b/api_docs/monitoring.devdocs.json index 260f6222fb20e..faaf5ce4c9742 100644 --- a/api_docs/monitoring.devdocs.json +++ b/api_docs/monitoring.devdocs.json @@ -76,7 +76,7 @@ { "parentPluginId": "monitoring", "id": "def-server.IBulkUploader.start.$1", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "esClient", "description": [], @@ -113,6 +113,46 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "monitoring", + "id": "def-server.MonitoringConfig", + "type": "Interface", + "tags": [], + "label": "MonitoringConfig", + "description": [ + "\nA functional representation of the `monitoring.*` configuration tree passed in from kibana.yml" + ], + "signature": [ + { + "pluginId": "monitoring", + "scope": "server", + "docId": "kibMonitoringPluginApi", + "section": "def-server.MonitoringConfig", + "text": "MonitoringConfig" + }, + " extends MonitoringConfigTypeOverriddenUI" + ], + "path": "x-pack/plugins/monitoring/server/config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "monitoring", + "id": "def-server.MonitoringConfig.ui", + "type": "Object", + "tags": [], + "label": "ui", + "description": [ + "\nA functional representation of the `monitoring.ui.*` configuration tree passed in from kibana.yml" + ], + "signature": [ + "MonitoringConfigTypeOverriddenUIElasticsearch" + ], + "path": "x-pack/plugins/monitoring/server/config.ts", + "deprecated": false + } + ], + "initialIsOpen": false } ], "enums": [], @@ -138,22 +178,6 @@ "path": "x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts", "deprecated": false, "initialIsOpen": false - }, - { - "parentPluginId": "monitoring", - "id": "def-server.MonitoringConfig", - "type": "Type", - "tags": [], - "label": "MonitoringConfig", - "description": [], - "signature": [ - "{ ui: { elasticsearch: ", - "MonitoringElasticsearchConfig", - "; enabled: boolean; container: Readonly<{} & { logstash: Readonly<{} & { enabled: boolean; }>; apm: Readonly<{} & { enabled: boolean; }>; elasticsearch: Readonly<{} & { enabled: boolean; }>; }>; logs: Readonly<{} & { index: string; }>; debug_mode: boolean; debug_log_path: string; ccs: Readonly<{} & { enabled: boolean; }>; max_bucket_size: number; min_interval_seconds: number; show_license_expiration: boolean; }; tests: Readonly<{} & { cloud_detector: Readonly<{} & { enabled: boolean; }>; }>; kibana: Readonly<{} & { collection: Readonly<{} & { interval: number; enabled: boolean; }>; }>; agent: Readonly<{} & { interval: string; }>; licensing: Readonly<{} & { api_polling_frequency: moment.Duration; }>; cluster_alerts: Readonly<{} & { enabled: boolean; email_notifications: Readonly<{} & { enabled: boolean; email_address: string; }>; }>; }" - ], - "path": "x-pack/plugins/monitoring/server/config.ts", - "deprecated": false, - "initialIsOpen": false } ], "objects": [], diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 14d5fc10d93b1..f0162e7b13d8f 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github summary: API docs for the monitoring plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitorin | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 10 | 2 | +| 11 | 0 | 9 | 1 | ## Server diff --git a/api_docs/navigation.devdocs.json b/api_docs/navigation.devdocs.json index 2ccfffb665c5c..1dcdc5134d353 100644 --- a/api_docs/navigation.devdocs.json +++ b/api_docs/navigation.devdocs.json @@ -396,6 +396,169 @@ "path": "src/plugins/navigation/public/top_nav_menu/top_nav_menu_data.tsx", "deprecated": false }, + { + "parentPluginId": "navigation", + "id": "def-public.TopNavMenuData.badge", + "type": "CompoundType", + "tags": [], + "label": "badge", + "description": [], + "signature": [ + "(", + "CommonProps", + " & ", + "DisambiguateSet", + "<(", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">), WithSpanProps> & WithSpanProps & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & LabelAsString) | (", + "CommonProps", + " & ", + "DisambiguateSet", + "<(", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">), WithSpanProps> & WithSpanProps & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & ", + "DisambiguateSet", + "<{ title: string; tooltipContent?: React.ReactNode; }, { tooltipContent: React.ReactNode; title?: string | undefined; }> & { tooltipContent: React.ReactNode; title?: string | undefined; } & { label: React.ReactNode; }) | (", + "CommonProps", + " & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">)> & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\"> & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & LabelAsString) | (", + "CommonProps", + " & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">)> & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\"> & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & ", + "DisambiguateSet", + "<{ title: string; tooltipContent?: React.ReactNode; }, { tooltipContent: React.ReactNode; title?: string | undefined; }> & { tooltipContent: React.ReactNode; title?: string | undefined; } & { label: React.ReactNode; }) | (", + "CommonProps", + " & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">)> & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\"> & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & ", + "DisambiguateSet", + "<{ tooltipContent: React.ReactNode; title?: string | undefined; }, { title: string; tooltipContent?: React.ReactNode; }> & { title: string; tooltipContent?: React.ReactNode; } & { label: React.ReactNode; }) | (", + "CommonProps", + " & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">)> & ", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\"> & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & LabelAsString) | (", + "CommonProps", + " & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">)> & ", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\"> & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & ", + "DisambiguateSet", + "<{ title: string; tooltipContent?: React.ReactNode; }, { tooltipContent: React.ReactNode; title?: string | undefined; }> & { tooltipContent: React.ReactNode; title?: string | undefined; } & { label: React.ReactNode; }) | (", + "CommonProps", + " & ", + "DisambiguateSet", + " & { href: string; target?: string | undefined; rel?: string | undefined; } & Omit, \"onClick\" | \"color\" | \"href\">) | (", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\">)> & ", + "DisambiguateSet", + " & { onClick?: React.MouseEventHandler | undefined; onClickAriaLabel?: string | undefined; } & Omit, \"onClick\" | \"color\"> & { iconType?: ", + "IconType", + " | undefined; label: React.ReactNode; tooltipContent?: React.ReactNode; tooltipPosition?: ", + "ToolTipPositions", + " | undefined; title?: string | undefined; color?: \"subdued\" | \"accent\" | \"hollow\" | undefined; size?: ", + "BetaBadgeSize", + " | undefined; } & ", + "DisambiguateSet", + " & ", + "DisambiguateSet", + "<{ tooltipContent: React.ReactNode; title?: string | undefined; }, { title: string; tooltipContent?: React.ReactNode; }> & { title: string; tooltipContent?: React.ReactNode; } & { label: React.ReactNode; }) | undefined" + ], + "path": "src/plugins/navigation/public/top_nav_menu/top_nav_menu_data.tsx", + "deprecated": false + }, { "parentPluginId": "navigation", "id": "def-public.TopNavMenuData.emphasize", diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index fed7d30a00462..25463fc209fca 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github summary: API docs for the navigation plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 31 | 0 | 31 | 2 | +| 32 | 0 | 32 | 2 | ## Client diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 4b2bc38f00043..36108b988c631 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github summary: API docs for the newsfeed plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index a7dafca1f6c52..71c8be78ca64d 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -90,7 +90,13 @@ "description": [], "signature": [ "({ reportType, allSeries }: { reportType: ", - "ReportViewType", + { + "pluginId": "observability", + "scope": "public", + "docId": "kibObservabilityPluginApi", + "section": "def-public.ReportViewType", + "text": "ReportViewType" + }, "; allSeries: ", { "pluginId": "observability", @@ -1891,13 +1897,26 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.reportType", + "id": "def-public.ExploratoryEmbeddableProps.appId", "type": "CompoundType", "tags": [], - "label": "reportType", + "label": "appId", "description": [], "signature": [ - "\"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\"" + "\"observability\" | \"securitySolutionUI\" | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.appendTitle", + "type": "Object", + "tags": [], + "label": "appendTitle", + "description": [], + "signature": [ + "JSX.Element | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false @@ -1914,63 +1933,91 @@ "pluginId": "observability", "scope": "public", "docId": "kibObservabilityPluginApi", - "section": "def-public.SeriesUrl", - "text": "SeriesUrl" + "section": "def-public.AllSeries", + "text": "AllSeries" }, - "[]" + " | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.appendTitle", + "id": "def-public.ExploratoryEmbeddableProps.axisTitlesVisibility", "type": "Object", "tags": [], - "label": "appendTitle", + "label": "axisTitlesVisibility", "description": [], "signature": [ - "JSX.Element | undefined" + "AxesSettingsConfig", + " | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.title", + "id": "def-public.ExploratoryEmbeddableProps.customHeight", "type": "CompoundType", "tags": [], - "label": "title", + "label": "customHeight", "description": [], "signature": [ - "string | JSX.Element" + "string | number | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.showCalculationMethod", - "type": "CompoundType", + "id": "def-public.ExploratoryEmbeddableProps.customLensAttrs", + "type": "Any", "tags": [], - "label": "showCalculationMethod", + "label": "customLensAttrs", "description": [], "signature": [ - "boolean | undefined" + "any" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.axisTitlesVisibility", + "id": "def-public.ExploratoryEmbeddableProps.customTimeRange", "type": "Object", "tags": [], - "label": "axisTitlesVisibility", + "label": "customTimeRange", "description": [], "signature": [ - "AxesSettingsConfig", - " | undefined" + "{ from: string; to: string; } | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.dataTypesIndexPatterns", + "type": "Object", + "tags": [], + "label": "dataTypesIndexPatterns", + "description": [], + "signature": [ + "Partial> | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.isSingleMetric", + "type": "CompoundType", + "tags": [], + "label": "isSingleMetric", + "description": [], + "signature": [ + "boolean | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false @@ -1990,15 +2037,54 @@ }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.dataTypesIndexPatterns", - "type": "Object", + "id": "def-public.ExploratoryEmbeddableProps.onBrushEnd", + "type": "Function", "tags": [], - "label": "dataTypesIndexPatterns", + "label": "onBrushEnd", "description": [], "signature": [ - "Partial> | undefined" + "((param: { range: number[]; }) => void) | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.onBrushEnd.$1", + "type": "Object", + "tags": [], + "label": "param", + "description": [], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.onBrushEnd.$1.range", + "type": "Array", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "number[]" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.caseOwner", + "type": "string", + "tags": [], + "label": "caseOwner", + "description": [], + "signature": [ + "string | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false @@ -2019,28 +2105,74 @@ }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.withActions", + "id": "def-public.ExploratoryEmbeddableProps.reportType", "type": "CompoundType", "tags": [], - "label": "withActions", + "label": "reportType", "description": [], "signature": [ - "boolean | ", - "ActionTypes", - "[] | undefined" + "\"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\"" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false }, { "parentPluginId": "observability", - "id": "def-public.ExploratoryEmbeddableProps.appId", + "id": "def-public.ExploratoryEmbeddableProps.showCalculationMethod", "type": "CompoundType", "tags": [], - "label": "appId", + "label": "showCalculationMethod", "description": [], "signature": [ - "\"security\" | \"observability\" | undefined" + "boolean | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.singleMetricOptions", + "type": "Object", + "tags": [], + "label": "singleMetricOptions", + "description": [], + "signature": [ + "SingleMetricOptions", + " | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.title", + "type": "CompoundType", + "tags": [], + "label": "title", + "description": [], + "signature": [ + "string | JSX.Element | undefined" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "observability", + "id": "def-public.ExploratoryEmbeddableProps.withActions", + "type": "CompoundType", + "tags": [], + "label": "withActions", + "description": [], + "signature": [ + "boolean | ", + { + "pluginId": "observability", + "scope": "public", + "docId": "kibObservabilityPluginApi", + "section": "def-public.ActionTypes", + "text": "ActionTypes" + }, + "[] | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false @@ -4246,9 +4378,6 @@ "tags": [], "label": "METRIC_TYPE", "description": [], - "signature": [ - "METRIC_TYPE" - ], "path": "node_modules/@types/kbn__analytics/index.d.ts", "deprecated": false, "initialIsOpen": false @@ -4266,6 +4395,20 @@ } ], "misc": [ + { + "parentPluginId": "observability", + "id": "def-public.ActionTypes", + "type": "Type", + "tags": [], + "label": "ActionTypes", + "description": [], + "signature": [ + "\"save\" | \"explore\" | \"addToCase\" | \"openInLens\"" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/use_actions.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-public.AddInspectorRequest", @@ -4364,9 +4507,6 @@ "tags": [], "label": "DropResult", "description": [], - "signature": [ - "DropResult" - ], "path": "x-pack/plugins/observability/public/typings/eui_draggable/index.ts", "deprecated": false, "initialIsOpen": false @@ -4670,6 +4810,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-public.ReportViewType", + "type": "Type", + "tags": [], + "label": "ReportViewType", + "description": [], + "signature": [ + "\"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\"" + ], + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-public.SectionLinkProps", @@ -4851,7 +5005,13 @@ "{ navigation: { PageTemplate: (pageTemplateProps: ", "WrappedPageTemplateProps", ") => JSX.Element; }; createExploratoryViewUrl: ({ reportType, allSeries }: { reportType: ", - "ReportViewType", + { + "pluginId": "observability", + "scope": "public", + "docId": "kibObservabilityPluginApi", + "section": "def-public.ReportViewType", + "text": "ReportViewType" + }, "; allSeries: ", { "pluginId": "observability", @@ -4958,7 +5118,9 @@ "MappingDynamicTemplate", ">[] | undefined; _field_names?: ", "MappingFieldNamesField", - " | undefined; _meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; _routing?: ", "MappingRoutingField", @@ -5018,7 +5180,9 @@ "MappingDynamicTemplate", ">[] | undefined; _field_names?: ", "MappingFieldNamesField", - " | undefined; _meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; _routing?: ", "MappingRoutingField", @@ -5034,20 +5198,1196 @@ { "parentPluginId": "observability", "id": "def-server.createOrUpdateIndex.$1.client", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "client", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "x-pack/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false @@ -5618,7 +6958,9 @@ "MappingDynamicTemplate", ">[] | undefined; _field_names?: ", "MappingFieldNamesField", - " | undefined; _meta?: Record | undefined; numeric_detection?: boolean | undefined; properties?: Record | undefined; _routing?: ", "MappingRoutingField", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 14e27eb0bf971..6323873410fe8 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github summary: API docs for the observability plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 347 | 1 | 344 | 29 | +| 358 | 2 | 355 | 28 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index af61f147edd50..7d2c7d8e70371 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github summary: API docs for the osquery plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index cb494473fa913..524c624763ac4 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -3,7 +3,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory summary: Directory of public APIs available through plugins or packages. -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,57 +12,57 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 214 | 170 | 32 | +| 236 | 170 | 40 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 23638 | 175 | 17954 | 779 | +| 23879 | 176 | 18164 | 1087 | ## Plugin Directory | Plugin name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 125 | 0 | 125 | 11 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 125 | 0 | 125 | 11 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 23 | 0 | 19 | 1 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 289 | 0 | 281 | 19 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 299 | 0 | 291 | 19 | | | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 40 | 0 | 40 | 49 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 78 | 1 | 69 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | -| | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 74 | 0 | 51 | 19 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 319 | 2 | 286 | 4 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 82 | 0 | 59 | 20 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 321 | 2 | 288 | 4 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 28 | 0 | 23 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Controls Plugin contains embeddable components intended to create a simple query interface for end users, and a powerful editing suite that allows dashboard authors to build controls | 118 | 0 | 117 | 3 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2366 | 15 | 973 | 32 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2368 | 15 | 975 | 32 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 96 | 0 | 77 | 1 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 138 | 0 | 136 | 14 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 51 | 0 | 50 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3386 | 40 | 2791 | 26 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 141 | 0 | 139 | 14 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 52 | 0 | 51 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3392 | 40 | 2795 | 26 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Enhanced data plugin. (See src/plugins/data.) Enhances the main data plugin with a search session management UI. Includes a reusable search session indicator component to use in other applications. Exposes routes for managing search sessions. Includes a service that monitors, updates, and cleans up search session saved objects. | 16 | 0 | 16 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout from any kibana app | 13 | 0 | 7 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable data view field editor across Kibana | 42 | 0 | 37 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data view management app | 2 | 0 | 2 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 742 | 3 | 597 | 7 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 765 | 3 | 616 | 10 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 23 | 2 | 19 | 1 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | -| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 93 | 0 | 65 | 7 | +| | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 77 | 0 | 61 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 468 | 0 | 381 | 4 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 48 | 0 | 44 | 0 | | | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 2 | 0 | 2 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 110 | 3 | 106 | 3 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 82 | 0 | 82 | 6 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 82 | 0 | 82 | 6 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 62 | 0 | 62 | 1 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 68 | 0 | 68 | 3 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 114 | 0 | 110 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'image' function and renderer to expressions | 26 | 0 | 26 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'metric' function and renderer to expressions | 32 | 0 | 27 | 0 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression MetricVis plugin adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 42 | 0 | 42 | 0 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression MetricVis plugin adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 46 | 0 | 46 | 1 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts. | 70 | 0 | 70 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'repeatImage' function and renderer to expressions | 32 | 0 | 32 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 14 | 0 | 14 | 3 | @@ -72,7 +72,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 222 | 0 | 98 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 286 | 6 | 247 | 3 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 62 | 0 | 62 | 2 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1263 | 8 | 1147 | 10 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1349 | 8 | 1232 | 9 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | @@ -90,44 +90,44 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 236 | 0 | 201 | 5 | | kibanaUsageCollection | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 0 | 0 | 0 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 615 | 3 | 420 | 9 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 365 | 0 | 316 | 44 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 399 | 0 | 348 | 42 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 3 | 0 | 3 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | -| | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 185 | 0 | 155 | 43 | +| | [Security detections response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 197 | 0 | 161 | 49 | | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 6 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 216 | 0 | 215 | 27 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 67 | 0 | 67 | 0 | | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 4 | 0 | 4 | 1 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 196 | 8 | 79 | 30 | -| | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 10 | 0 | 10 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 31 | 0 | 31 | 2 | +| | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 11 | 0 | 9 | 1 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 32 | 0 | 32 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 347 | 1 | 344 | 29 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 358 | 2 | 355 | 28 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 10 | 0 | 10 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 228 | 2 | 177 | 11 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | -| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 29 | 0 | 29 | 0 | +| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 36 | 0 | 16 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 0 | 21 | 0 | -| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 177 | 0 | 150 | 7 | +| | [RAC](https://github.com/orgs/elastic/teams/rac) | - | 181 | 0 | 154 | 7 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 24 | 0 | 19 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 192 | 2 | 151 | 5 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 103 | 0 | 90 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 54 | 0 | 50 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 90 | 0 | 45 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 33 | 0 | 14 | 0 | -| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Kibana Screenshotting Plugin | 17 | 0 | 8 | 5 | +| | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Kibana Screenshotting Plugin | 18 | 0 | 8 | 5 | | searchprofiler | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 183 | 0 | 103 | 0 | | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 45 | 0 | 45 | 18 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 139 | 0 | 80 | 12 | -| | [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) | A plugin providing components and services for shared user experiences in Kibana. | 10 | 0 | 0 | 1 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 20 | 1 | 20 | 1 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 113 | 0 | 54 | 10 | +| | [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) | A plugin providing components and services for shared user experiences in Kibana. | 14 | 0 | 0 | 1 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 1 | 21 | 1 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 250 | 0 | 61 | 0 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 4 | 0 | 4 | 0 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 71 | 0 | 33 | 7 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 4 | 0 | 4 | 0 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 71 | 0 | 33 | 7 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 41 | 0 | 0 | 0 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 33 | 0 | 33 | 6 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 1 | 0 | 1 | 0 | @@ -135,8 +135,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 444 | 1 | 338 | 34 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 246 | 0 | 234 | 18 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 129 | 0 | 90 | 11 | +| | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 246 | 0 | 234 | 20 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 130 | 0 | 91 | 11 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 203 | 0 | 141 | 9 | | upgradeAssistant | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | uptime | [Uptime](https://github.com/orgs/elastic/teams/uptime) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 0 | @@ -156,7 +156,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 57 | 0 | 51 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 316 | 12 | 296 | 15 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 347 | 12 | 326 | 14 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | ## Package Directory @@ -174,7 +174,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 66 | 0 | 46 | 2 | | | [Owner missing] | - | 125 | 3 | 123 | 17 | | | [Owner missing] | - | 13 | 0 | 7 | 0 | -| | [Owner missing] | - | 275 | 3 | 193 | 0 | +| | [Owner missing] | - | 281 | 3 | 200 | 1 | | | [Owner missing] | - | 62 | 0 | 62 | 2 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 27 | 0 | 14 | 1 | @@ -197,7 +197,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc... | 57 | 0 | 51 | 1 | | | [Owner missing] | Security Solution utilities for React hooks | 14 | 0 | 6 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 148 | 0 | 129 | 0 | -| | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 439 | 1 | 428 | 0 | +| | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 460 | 1 | 448 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 48 | 0 | 26 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 28 | 0 | 21 | 0 | | | [Owner missing] | security solution list REST API | 59 | 0 | 58 | 0 | @@ -212,7 +212,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 96 | 1 | 63 | 2 | | | Operations | - | 22 | 2 | 21 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | -| | Operations | - | 244 | 5 | 208 | 9 | +| | Operations | - | 241 | 5 | 205 | 9 | | | [Owner missing] | - | 128 | 8 | 101 | 2 | | | [Owner missing] | - | 83 | 0 | 83 | 1 | | | [Owner missing] | - | 7 | 0 | 6 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index f0c1a5198b863..f103c43789f02 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github summary: API docs for the presentationUtil plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 085102143d332..ecf9bafdbf1c2 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github summary: API docs for the remoteClusters plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/reporting.devdocs.json b/api_docs/reporting.devdocs.json index a640789f47d3f..5d2eecdff0fcb 100644 --- a/api_docs/reporting.devdocs.json +++ b/api_docs/reporting.devdocs.json @@ -3,207 +3,157 @@ "client": { "classes": [], "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [], - "start": { - "parentPluginId": "reporting", - "id": "def-public.ReportingStart", - "type": "Type", - "tags": [], - "label": "ReportingStart", - "description": [], - "signature": [ - { - "pluginId": "reporting", - "scope": "public", - "docId": "kibReportingPluginApi", - "section": "def-public.ReportingSetup", - "text": "ReportingSetup" - } - ], - "path": "x-pack/plugins/reporting/public/index.ts", - "deprecated": false, - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [ + "interfaces": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin", - "type": "Class", + "id": "def-public.ApplicationProps", + "type": "Interface", "tags": [], - "label": "ReportingPlugin", - "description": [], - "signature": [ - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingPlugin", - "text": "ReportingPlugin" - }, - " implements ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.Plugin", - "text": "Plugin" - }, - "<", - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetup", - "text": "ReportingSetup" - }, - ", ", - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetup", - "text": "ReportingSetup" - }, - ", ", - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetupDeps", - "text": "ReportingSetupDeps" - }, - ", ", - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingStartDeps", - "text": "ReportingStartDeps" - }, - ">" + "label": "ApplicationProps", + "description": [ + "\nProperties for displaying a share menu with Reporting features." ], - "path": "x-pack/plugins/reporting/server/plugin.ts", + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", "deprecated": false, "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.Unnamed", + "id": "def-public.ApplicationProps.getJobParams", "type": "Function", "tags": [], - "label": "Constructor", - "description": [], + "label": "getJobParams", + "description": [ + "\nA function that Reporting calls to get the sharing data from the application." + ], "signature": [ - "any" + "(forShareUrl?: boolean | undefined) => Omit<{ layout?: { id?: string | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", + "LayoutSelectorDictionary", + "> | undefined; zoom?: number | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }, \"version\" | \"browserTimezone\">" ], - "path": "x-pack/plugins/reporting/server/plugin.ts", + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", "deprecated": false, + "returnComment": [], "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.Unnamed.$1", - "type": "Object", + "id": "def-public.ApplicationProps.getJobParams.$1", + "type": "CompoundType", "tags": [], - "label": "initContext", + "label": "forShareUrl", "description": [], "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.PluginInitializerContext", - "text": "PluginInitializerContext" - }, - "; loadDelay: number | moment.Duration; maxAttempts: number; }>; roles: Readonly<{} & { enabled: boolean; allow: string[]; }>; kibanaServer: Readonly<{ hostname?: string | undefined; protocol?: string | undefined; port?: number | undefined; } & {}>; queue: Readonly<{} & { timeout: number | moment.Duration; pollInterval: number | moment.Duration; indexInterval: string; pollEnabled: boolean; pollIntervalErrorMultiplier: number; }>; csv: Readonly<{} & { scroll: Readonly<{} & { size: number; duration: string; }>; checkForFormulas: boolean; escapeFormulaValues: boolean; enablePanelActionDownload: boolean; maxSizeBytes: number | ", - "ByteSizeValue", - "; useByteOrderMarkEncoding: boolean; }>; poll: Readonly<{} & { jobCompletionNotifier: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; jobsRefresh: Readonly<{} & { interval: number; intervalErrorMultiplier: number; }>; }>; }>>" + "boolean | undefined" ], - "path": "x-pack/plugins/reporting/server/plugin.ts", - "deprecated": false, - "isRequired": true + "path": "x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx", + "deprecated": false } + ] + }, + { + "parentPluginId": "reporting", + "id": "def-public.ApplicationProps.layoutOption", + "type": "CompoundType", + "tags": [], + "label": "layoutOption", + "description": [ + "\nOption to control how the screenshot(s) is/are placed in the PDF" ], - "returnComment": [] + "signature": [ + "\"canvas\" | \"print\" | undefined" + ], + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", + "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.setup", + "id": "def-public.ApplicationProps.objectId", + "type": "string", + "tags": [], + "label": "objectId", + "description": [ + "\nSaved object ID" + ], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", + "deprecated": false + }, + { + "parentPluginId": "reporting", + "id": "def-public.ApplicationProps.onClose", "type": "Function", "tags": [], - "label": "setup", - "description": [], + "label": "onClose", + "description": [ + "\nA function to callback when the Reporting panel should be closed" + ], "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - ", plugins: ", + "() => void" + ], + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "reporting", + "id": "def-public.ReportingPublicComponents", + "type": "Interface", + "tags": [], + "label": "ReportingPublicComponents", + "description": [ + "\nReact components used to display share menus with Reporting features in an application." + ], + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "reporting", + "id": "def-public.ReportingPublicComponents.ReportingPanelPDF", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "ReportingPanelPDF", + "description": [ + "\nAn element to display a form to export the page as PDF" + ], + "signature": [ + "(props: ", { "pluginId": "reporting", - "scope": "server", + "scope": "public", "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetupDeps", - "text": "ReportingSetupDeps" + "section": "def-public.ApplicationProps", + "text": "ApplicationProps" }, - ") => ", - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetup", - "text": "ReportingSetup" - } + ") => JSX.Element" ], - "path": "x-pack/plugins/reporting/server/plugin.ts", - "deprecated": false, + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.setup.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - "" - ], - "path": "x-pack/plugins/reporting/server/plugin.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.setup.$2", + "id": "def-public.ReportingPublicComponents.ReportingPanelPDF.$1", "type": "Object", "tags": [], - "label": "plugins", + "label": "props", "description": [], "signature": [ { "pluginId": "reporting", - "scope": "server", + "scope": "public", "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetupDeps", - "text": "ReportingSetupDeps" + "section": "def-public.ApplicationProps", + "text": "ApplicationProps" } ], - "path": "x-pack/plugins/reporting/server/plugin.ts", + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", "deprecated": false, "isRequired": true } @@ -212,77 +162,90 @@ }, { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.start", + "id": "def-public.ReportingPublicComponents.ReportingPanelPDFV2", "type": "Function", "tags": [], - "label": "start", - "description": [], + "label": "ReportingPanelPDFV2", + "description": [ + "\nAn element to display a form to export the page as PDF" + ], "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - }, - ", plugins: ", + "(props: ", { "pluginId": "reporting", - "scope": "server", + "scope": "public", "docId": "kibReportingPluginApi", - "section": "def-server.ReportingStartDeps", - "text": "ReportingStartDeps" + "section": "def-public.ApplicationProps", + "text": "ApplicationProps" }, - ") => ", - { - "pluginId": "reporting", - "scope": "server", - "docId": "kibReportingPluginApi", - "section": "def-server.ReportingSetup", - "text": "ReportingSetup" - } + ") => JSX.Element" ], - "path": "x-pack/plugins/reporting/server/plugin.ts", + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", "deprecated": false, "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.start.$1", + "id": "def-public.ReportingPublicComponents.ReportingPanelPDFV2.$1", "type": "Object", "tags": [], - "label": "core", + "label": "props", "description": [], "signature": [ { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" + "pluginId": "reporting", + "scope": "public", + "docId": "kibReportingPluginApi", + "section": "def-public.ApplicationProps", + "text": "ApplicationProps" } ], - "path": "x-pack/plugins/reporting/server/plugin.ts", + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", "deprecated": false, "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "reporting", + "id": "def-public.ReportingPublicComponents.ReportingPanelPNGV2", + "type": "Function", + "tags": [], + "label": "ReportingPanelPNGV2", + "description": [ + "\nAn element to display a form to export the page as PNG" + ], + "signature": [ + "(props: ", + { + "pluginId": "reporting", + "scope": "public", + "docId": "kibReportingPluginApi", + "section": "def-public.ApplicationProps", + "text": "ApplicationProps" }, + ") => JSX.Element" + ], + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", + "deprecated": false, + "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingPlugin.start.$2", + "id": "def-public.ReportingPublicComponents.ReportingPanelPNGV2.$1", "type": "Object", "tags": [], - "label": "plugins", + "label": "props", "description": [], "signature": [ { "pluginId": "reporting", - "scope": "server", + "scope": "public", "docId": "kibReportingPluginApi", - "section": "def-server.ReportingStartDeps", - "text": "ReportingStartDeps" + "section": "def-public.ApplicationProps", + "text": "ApplicationProps" } ], - "path": "x-pack/plugins/reporting/server/plugin.ts", + "path": "x-pack/plugins/reporting/public/shared/get_shared_components.tsx", "deprecated": false, "isRequired": true } @@ -293,133 +256,195 @@ "initialIsOpen": false } ], + "enums": [], + "misc": [], + "objects": [], + "start": { + "parentPluginId": "reporting", + "id": "def-public.ReportingStart", + "type": "Type", + "tags": [], + "label": "ReportingStart", + "description": [ + "\nStart contract for the Reporting plugin." + ], + "signature": [ + { + "pluginId": "reporting", + "scope": "public", + "docId": "kibReportingPluginApi", + "section": "def-public.ReportingSetup", + "text": "ReportingSetup" + } + ], + "path": "x-pack/plugins/reporting/public/index.ts", + "deprecated": false, + "lifecycle": "start", + "initialIsOpen": true + } + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [], + "start": { + "parentPluginId": "reporting", + "id": "def-server.ReportingStart", + "type": "Type", + "tags": [], + "label": "ReportingStart", + "description": [ + "\nPlugin Start Contract" + ], + "signature": [ + { + "pluginId": "reporting", + "scope": "server", + "docId": "kibReportingPluginApi", + "section": "def-server.ReportingSetup", + "text": "ReportingSetup" + } + ], + "path": "x-pack/plugins/reporting/server/types.ts", + "deprecated": false, + "lifecycle": "start", + "initialIsOpen": true + } + }, + "common": { + "classes": [], "functions": [], "interfaces": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps", + "id": "def-common.BasePayload", "type": "Interface", - "tags": [], - "label": "ReportingSetupDeps", + "tags": [ + "deprecated" + ], + "label": "BasePayload", "description": [], - "path": "x-pack/plugins/reporting/server/types.ts", - "deprecated": false, + "signature": [ + { + "pluginId": "reporting", + "scope": "common", + "docId": "kibReportingPluginApi", + "section": "def-common.BasePayload", + "text": "BasePayload" + }, + " extends { layout?: { id?: string | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", + "LayoutSelectorDictionary", + "> | undefined; zoom?: number | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }" + ], + "path": "x-pack/plugins/reporting/common/types/base.ts", + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps.features", - "type": "Object", + "id": "def-common.BasePayload.headers", + "type": "string", "tags": [], - "label": "features", + "label": "headers", "description": [], - "signature": [ - { - "pluginId": "features", - "scope": "server", - "docId": "kibFeaturesPluginApi", - "section": "def-server.PluginSetupContract", - "text": "PluginSetupContract" - } - ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/base.ts", "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps.screenshotMode", - "type": "Object", + "id": "def-common.BasePayload.spaceId", + "type": "string", "tags": [], - "label": "screenshotMode", + "label": "spaceId", "description": [], "signature": [ - { - "pluginId": "screenshotMode", - "scope": "server", - "docId": "kibScreenshotModePluginApi", - "section": "def-server.ScreenshotModePluginSetup", - "text": "ScreenshotModePluginSetup" - } + "string | undefined" ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/base.ts", "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps.security", - "type": "Object", + "id": "def-common.BasePayload.isDeprecated", + "type": "CompoundType", "tags": [], - "label": "security", + "label": "isDeprecated", "description": [], "signature": [ - { - "pluginId": "security", - "scope": "server", - "docId": "kibSecurityPluginApi", - "section": "def-server.SecurityPluginSetup", - "text": "SecurityPluginSetup" - }, - " | undefined" + "boolean | undefined" ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/base.ts", "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "reporting", + "id": "def-common.BasePayloadV2", + "type": "Interface", + "tags": [], + "label": "BasePayloadV2", + "description": [ + "\nReport job parameters, after they are processed in the request handler." + ], + "signature": [ + { + "pluginId": "reporting", + "scope": "common", + "docId": "kibReportingPluginApi", + "section": "def-common.BasePayloadV2", + "text": "BasePayloadV2" }, + " extends ", + { + "pluginId": "reporting", + "scope": "common", + "docId": "kibReportingPluginApi", + "section": "def-common.BaseParamsV2", + "text": "BaseParamsV2" + } + ], + "path": "x-pack/plugins/reporting/common/types/base.ts", + "deprecated": false, + "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps.spaces", - "type": "Object", + "id": "def-common.BasePayloadV2.headers", + "type": "string", "tags": [], - "label": "spaces", + "label": "headers", "description": [], - "signature": [ - { - "pluginId": "spaces", - "scope": "server", - "docId": "kibSpacesPluginApi", - "section": "def-server.SpacesPluginSetup", - "text": "SpacesPluginSetup" - }, - " | undefined" - ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/base.ts", "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps.taskManager", - "type": "Object", + "id": "def-common.BasePayloadV2.spaceId", + "type": "string", "tags": [], - "label": "taskManager", + "label": "spaceId", "description": [], "signature": [ - { - "pluginId": "taskManager", - "scope": "server", - "docId": "kibTaskManagerPluginApi", - "section": "def-server.TaskManagerSetupContract", - "text": "TaskManagerSetupContract" - } + "string | undefined" ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/base.ts", "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingSetupDeps.usageCollection", - "type": "Object", + "id": "def-common.BasePayloadV2.isDeprecated", + "type": "CompoundType", "tags": [], - "label": "usageCollection", + "label": "isDeprecated", "description": [], "signature": [ - { - "pluginId": "usageCollection", - "scope": "server", - "docId": "kibUsageCollectionPluginApi", - "section": "def-server.UsageCollectionSetup", - "text": "UsageCollectionSetup" - }, - " | undefined" + "boolean | undefined" ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/base.ts", "deprecated": false } ], @@ -427,170 +452,160 @@ }, { "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps", + "id": "def-common.LocatorParams", "type": "Interface", "tags": [], - "label": "ReportingStartDeps", + "label": "LocatorParams", "description": [], - "path": "x-pack/plugins/reporting/server/types.ts", + "signature": [ + { + "pluginId": "reporting", + "scope": "common", + "docId": "kibReportingPluginApi", + "section": "def-common.LocatorParams", + "text": "LocatorParams" + }, + "

" + ], + "path": "x-pack/plugins/reporting/common/types/url.ts", "deprecated": false, "children": [ { "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps.data", - "type": "Object", + "id": "def-common.LocatorParams.id", + "type": "string", "tags": [], - "label": "data", + "label": "id", "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "server", - "docId": "kibDataPluginApi", - "section": "def-server.DataPluginStart", - "text": "DataPluginStart" - } - ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/url.ts", "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps.fieldFormats", - "type": "Object", + "id": "def-common.LocatorParams.version", + "type": "string", "tags": [], - "label": "fieldFormats", - "description": [], - "signature": [ - { - "pluginId": "fieldFormats", - "scope": "server", - "docId": "kibFieldFormatsPluginApi", - "section": "def-server.FieldFormatsStart", - "text": "FieldFormatsStart" - } + "label": "version", + "description": [ + "\nKibana version used to create the params" ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/url.ts", "deprecated": false }, { "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps.licensing", - "type": "Object", + "id": "def-common.LocatorParams.params", + "type": "Uncategorized", "tags": [], - "label": "licensing", - "description": [], - "signature": [ - { - "pluginId": "licensing", - "scope": "server", - "docId": "kibLicensingPluginApi", - "section": "def-server.LicensingPluginStart", - "text": "LicensingPluginStart" - } + "label": "params", + "description": [ + "\nData to recreate the user's state in the application" ], - "path": "x-pack/plugins/reporting/server/types.ts", - "deprecated": false - }, - { - "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps.screenshotting", - "type": "Object", - "tags": [], - "label": "screenshotting", - "description": [], "signature": [ - { - "pluginId": "screenshotting", - "scope": "server", - "docId": "kibScreenshottingPluginApi", - "section": "def-server.ScreenshottingStart", - "text": "ScreenshottingStart" - } + "P" ], - "path": "x-pack/plugins/reporting/server/types.ts", + "path": "x-pack/plugins/reporting/common/types/url.ts", "deprecated": false - }, + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "reporting", + "id": "def-common.BaseParams", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "BaseParams", + "description": [], + "signature": [ + "{ layout?: { id?: string | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", + "LayoutSelectorDictionary", + "> | undefined; zoom?: number | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }" + ], + "path": "x-pack/plugins/reporting/common/types/base.ts", + "deprecated": true, + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "reporting", + "id": "def-common.BaseParamsV2", + "type": "Type", + "tags": [], + "label": "BaseParamsV2", + "description": [ + "\nReport job parameters that an application must return from its\ngetSharingData function." + ], + "signature": [ + "{ layout?: { id?: string | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", + "LayoutSelectorDictionary", + "> | undefined; zoom?: number | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; } & { locatorParams: ", { - "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps.security", - "type": "Object", - "tags": [], - "label": "security", - "description": [], - "signature": [ - { - "pluginId": "security", - "scope": "server", - "docId": "kibSecurityPluginApi", - "section": "def-server.SecurityPluginStart", - "text": "SecurityPluginStart" - }, - " | undefined" - ], - "path": "x-pack/plugins/reporting/server/types.ts", - "deprecated": false + "pluginId": "reporting", + "scope": "common", + "docId": "kibReportingPluginApi", + "section": "def-common.LocatorParams", + "text": "LocatorParams" }, + "<", + "SerializableRecord", + ">[]; }" + ], + "path": "x-pack/plugins/reporting/common/types/base.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "reporting", + "id": "def-common.JobAppParamsPDF", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "JobAppParamsPDF", + "description": [], + "signature": [ + "{ title: string; layout: { id?: string | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", + "LayoutSelectorDictionary", + "> | undefined; zoom?: number | undefined; }; objectType: string; relativeUrls: string[]; isDeprecated?: boolean | undefined; }" + ], + "path": "x-pack/plugins/reporting/common/types/export_types/printable_pdf.ts", + "deprecated": true, + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "reporting", + "id": "def-common.JobAppParamsPDFV2", + "type": "Type", + "tags": [], + "label": "JobAppParamsPDFV2", + "description": [], + "signature": [ + "{ title: string; layout: { id?: string | undefined; dimensions?: { width: number; height: number; } | undefined; selectors?: Partial<", + "LayoutSelectorDictionary", + "> | undefined; zoom?: number | undefined; }; objectType: string; locatorParams: ", { - "parentPluginId": "reporting", - "id": "def-server.ReportingStartDeps.taskManager", - "type": "CompoundType", - "tags": [], - "label": "taskManager", - "description": [], - "signature": [ - "Pick<", - "TaskScheduling", - ", \"schedule\" | \"runNow\" | \"ephemeralRunNow\" | \"ensureScheduled\"> & Pick<", - "TaskStore", - ", \"remove\" | \"fetch\" | \"get\"> & { removeIfExists: (id: string) => Promise; } & { supportsEphemeralTasks: () => boolean; }" - ], - "path": "x-pack/plugins/reporting/server/types.ts", - "deprecated": false - } + "pluginId": "reporting", + "scope": "common", + "docId": "kibReportingPluginApi", + "section": "def-common.LocatorParams", + "text": "LocatorParams" + }, + "<", + "SerializableRecord", + ">[]; }" ], + "path": "x-pack/plugins/reporting/common/types/export_types/printable_pdf_v2.ts", + "deprecated": false, "initialIsOpen": false } ], - "enums": [], - "misc": [], - "objects": [], - "start": { - "parentPluginId": "reporting", - "id": "def-server.ReportingSetup", - "type": "Interface", - "tags": [], - "label": "ReportingSetup", - "description": [], - "path": "x-pack/plugins/reporting/server/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "reporting", - "id": "def-server.ReportingSetup.usesUiCapabilities", - "type": "Function", - "tags": [], - "label": "usesUiCapabilities", - "description": [], - "signature": [ - "() => boolean" - ], - "path": "x-pack/plugins/reporting/server/types.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index dc8d44f12f053..7c9910df59325 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github summary: API docs for the reporting plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,21 +18,26 @@ Contact [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 29 | 0 | 29 | 0 | +| 36 | 0 | 16 | 0 | ## Client ### Start +### Interfaces + + ## Server ### Start -### Classes - +## Common ### Interfaces - + + +### Consts, variables and types + diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 6d4e6d4174a7c..77265782f6aea 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github summary: API docs for the rollup plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/rule_registry.devdocs.json b/api_docs/rule_registry.devdocs.json index 78b9493cdc7f0..bf18fe6cf235b 100644 --- a/api_docs/rule_registry.devdocs.json +++ b/api_docs/rule_registry.devdocs.json @@ -102,7 +102,7 @@ "UpdateOptions", ") => Promise<{ _version: string | undefined; get?: ", "InlineGet", - ">> | undefined; _id: string; _index: string; _primary_term: number; result: ", + " | undefined; _id: string; _index: string; _primary_term: number; result: ", "Result", "; _seq_no: number; _shards: ", "ShardStatistics", @@ -148,14 +148,10 @@ " = never>({ ids, query, index, status, }: ", "BulkUpdateOptions", ") => Promise<", - "TransportResult", - "<", "BulkResponse", - ", unknown> | ", - "TransportResult", - "<", + " | ", "UpdateByQueryResponse", - ", unknown>>" + ">" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", "deprecated": false, @@ -1424,7 +1420,7 @@ }, "; injectReferences: (params: TParams, references: ", "SavedObjectReference", - "[]) => TParams; } | undefined; isExportable: boolean; defaultScheduleInterval?: string | undefined; minimumScheduleInterval?: string | undefined; ruleTaskTimeout?: string | undefined; cancelAlertsOnRuleTimeout?: boolean | undefined; }" + "[]) => TParams; } | undefined; isExportable: boolean; defaultScheduleInterval?: string | undefined; minimumScheduleInterval?: string | undefined; ruleTaskTimeout?: string | undefined; cancelAlertsOnRuleTimeout?: boolean | undefined; doesSetRecoveryContext?: boolean | undefined; }" ], "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts", "deprecated": false, @@ -2396,7 +2392,7 @@ "signature": [ "(request: ", "BulkRequest", - ") => Promise<", + ") => Promise<", "TransportResult", "<", "BulkResponse", @@ -2414,7 +2410,7 @@ "description": [], "signature": [ "BulkRequest", - "" + "" ], "path": "x-pack/plugins/rule_registry/server/rule_data_client/types.ts", "deprecated": false, @@ -3358,7 +3354,86 @@ ], "interfaces": [], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-common.BASE_RAC_ALERTS_API_PATH", + "type": "string", + "tags": [], + "label": "BASE_RAC_ALERTS_API_PATH", + "description": [], + "signature": [ + "\"/internal/rac/alerts\"" + ], + "path": "x-pack/plugins/rule_registry/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-common.ParsedTechnicalFields", + "type": "Type", + "tags": [], + "label": "ParsedTechnicalFields", + "description": [], + "signature": [ + "{ readonly '@timestamp': string; readonly \"kibana.alert.rule.rule_type_id\": string; readonly \"kibana.alert.rule.consumer\": string; readonly \"kibana.alert.rule.producer\": string; readonly \"kibana.space_ids\": string[]; readonly \"kibana.alert.uuid\": string; readonly \"kibana.alert.status\": string; readonly \"kibana.alert.rule.category\": string; readonly \"kibana.alert.rule.uuid\": string; readonly \"kibana.alert.rule.name\": string; readonly tags?: string[] | undefined; readonly 'event.action'?: string | undefined; readonly \"kibana.alert.rule.parameters\"?: { [key: string]: unknown; } | undefined; readonly \"kibana.alert.start\"?: string | undefined; readonly \"kibana.alert.end\"?: string | undefined; readonly \"kibana.alert.duration.us\"?: number | undefined; readonly \"kibana.alert.severity\"?: string | undefined; readonly \"kibana.version\"?: string | undefined; readonly \"ecs.version\"?: string | undefined; readonly \"kibana.alert.risk_score\"?: number | undefined; readonly \"kibana.alert.workflow_status\"?: string | undefined; readonly \"kibana.alert.workflow_user\"?: string | undefined; readonly \"kibana.alert.workflow_reason\"?: string | undefined; readonly \"kibana.alert.system_status\"?: string | undefined; readonly \"kibana.alert.action_group\"?: string | undefined; readonly \"kibana.alert.reason\"?: string | undefined; readonly \"kibana.alert.rule.author\"?: string | undefined; readonly \"kibana.alert.rule.created_at\"?: string | undefined; readonly \"kibana.alert.rule.created_by\"?: string | undefined; readonly \"kibana.alert.rule.description\"?: string | undefined; readonly \"kibana.alert.rule.enabled\"?: string | undefined; readonly \"kibana.alert.rule.execution.uuid\"?: string | undefined; readonly \"kibana.alert.rule.from\"?: string | undefined; readonly \"kibana.alert.rule.interval\"?: string | undefined; readonly \"kibana.alert.rule.license\"?: string | undefined; readonly \"kibana.alert.rule.note\"?: string | undefined; readonly \"kibana.alert.rule.references\"?: string[] | undefined; readonly \"kibana.alert.rule.rule_id\"?: string | undefined; readonly \"kibana.alert.rule.rule_name_override\"?: string | undefined; readonly \"kibana.alert.rule.tags\"?: string[] | undefined; readonly \"kibana.alert.rule.to\"?: string | undefined; readonly \"kibana.alert.rule.type\"?: string | undefined; readonly \"kibana.alert.rule.updated_at\"?: string | undefined; readonly \"kibana.alert.rule.updated_by\"?: string | undefined; readonly \"kibana.alert.rule.version\"?: string | undefined; readonly 'event.kind'?: string | undefined; }" + ], + "path": "x-pack/plugins/rule_registry/common/parse_technical_fields.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-common.RuleRegistrySearchRequest", + "type": "Type", + "tags": [], + "label": "RuleRegistrySearchRequest", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchRequest", + "text": "IEsSearchRequest" + }, + " & { featureIds: ", + "AlertConsumers", + "[]; query?: { bool: ", + "QueryDslBoolQuery", + "; } | undefined; }" + ], + "path": "x-pack/plugins/rule_registry/common/search_strategy/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-common.RuleRegistrySearchResponse", + "type": "Type", + "tags": [], + "label": "RuleRegistrySearchResponse", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + "<", + "SearchResponse", + ">>" + ], + "path": "x-pack/plugins/rule_registry/common/search_strategy/index.ts", + "deprecated": false, + "initialIsOpen": false + } + ], "objects": [] } } \ No newline at end of file diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 1b5a31be87f0e..ceaafbcfd53fc 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github summary: API docs for the ruleRegistry plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [RAC](https://github.com/orgs/elastic/teams/rac) for questions regarding | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 177 | 0 | 150 | 7 | +| 181 | 0 | 154 | 7 | ## Server @@ -51,3 +51,6 @@ Contact [RAC](https://github.com/orgs/elastic/teams/rac) for questions regarding ### Functions +### Consts, variables and types + + diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 2310c4e8b845d..62d32f4377d87 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github summary: API docs for the runtimeFields plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 2f459203940f2..c59b8a3a0b912 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjects plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 3682bce8aa36c..cbca46895104e 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsManagement plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 64e3375dd0071..0a319ced3e08c 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsTagging plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 061ec8cb2d4e1..19d7dcaf1b284 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github summary: API docs for the savedObjectsTaggingOss plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index f59458fcd467c..e1d2c1f8f13db 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github summary: API docs for the screenshotMode plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/screenshotting.devdocs.json b/api_docs/screenshotting.devdocs.json index 901ed0e503f1f..686b42fa6fcfa 100644 --- a/api_docs/screenshotting.devdocs.json +++ b/api_docs/screenshotting.devdocs.json @@ -47,6 +47,28 @@ ], "path": "x-pack/plugins/screenshotting/server/screenshots/index.ts", "deprecated": false + }, + { + "parentPluginId": "screenshotting", + "id": "def-server.ScreenshotOptions.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "\nSource Kibana request object from where the headers will be extracted." + ], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + " | undefined" + ], + "path": "x-pack/plugins/screenshotting/server/screenshots/index.ts", + "deprecated": false } ], "initialIsOpen": false @@ -79,18 +101,16 @@ }, { "parentPluginId": "screenshotting", - "id": "def-server.ScreenshotResult.metrics$", + "id": "def-server.ScreenshotResult.metrics", "type": "Object", "tags": [], - "label": "metrics$", + "label": "metrics", "description": [ "\nCollected performance metrics during the screenshotting session." ], "signature": [ - "Observable", - "<", "PerformanceMetrics", - ">" + " | undefined" ], "path": "x-pack/plugins/screenshotting/server/screenshots/index.ts", "deprecated": false diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 238fe8da05edb..7225ea68d75a2 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github summary: API docs for the screenshotting plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 17 | 0 | 8 | 5 | +| 18 | 0 | 8 | 5 | ## Server diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 467d61cc2c66d..327961afb0c23 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github summary: API docs for the security plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index f077b298d7c67..21a9c7aa21836 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -62,7 +62,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly metricsEntitiesEnabled: boolean; readonly ruleRegistryEnabled: boolean; readonly tGridEnabled: boolean; readonly tGridEventRenderedViewEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly usersEnabled: boolean; readonly disableIsolationUIPendingStatuses: boolean; readonly riskyHostsEnabled: boolean; readonly securityRulesCancelEnabled: boolean; readonly pendingActionResponsesWithAck: boolean; readonly rulesBulkEditEnabled: boolean; readonly policyListEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; }" + "{ readonly metricsEntitiesEnabled: boolean; readonly ruleRegistryEnabled: boolean; readonly tGridEnabled: boolean; readonly tGridEventRenderedViewEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly usersEnabled: boolean; readonly disableIsolationUIPendingStatuses: boolean; readonly riskyHostsEnabled: boolean; readonly securityRulesCancelEnabled: boolean; readonly pendingActionResponsesWithAck: boolean; readonly policyListEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/plugin.tsx", "deprecated": false @@ -887,7 +887,7 @@ "label": "ConfigType", "description": [], "signature": [ - "Readonly<{} & { signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }> & { experimentalFeatures: Readonly<{ metricsEntitiesEnabled: boolean; ruleRegistryEnabled: boolean; tGridEnabled: boolean; tGridEventRenderedViewEnabled: boolean; excludePoliciesInFilterEnabled: boolean; usersEnabled: boolean; disableIsolationUIPendingStatuses: boolean; riskyHostsEnabled: boolean; securityRulesCancelEnabled: boolean; pendingActionResponsesWithAck: boolean; rulesBulkEditEnabled: boolean; policyListEnabled: boolean; previewTelemetryUrlEnabled: boolean; }>; }" + "Readonly<{} & { signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }> & { experimentalFeatures: Readonly<{ metricsEntitiesEnabled: boolean; ruleRegistryEnabled: boolean; tGridEnabled: boolean; tGridEventRenderedViewEnabled: boolean; excludePoliciesInFilterEnabled: boolean; usersEnabled: boolean; disableIsolationUIPendingStatuses: boolean; riskyHostsEnabled: boolean; securityRulesCancelEnabled: boolean; pendingActionResponsesWithAck: boolean; policyListEnabled: boolean; previewTelemetryUrlEnabled: boolean; }>; }" ], "path": "x-pack/plugins/security_solution/server/config.ts", "deprecated": false, diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index b7544d9b0750e..65ce31d2f969c 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github summary: API docs for the securitySolution plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/share.devdocs.json b/api_docs/share.devdocs.json index a85ad1a605548..9733101e0dd11 100644 --- a/api_docs/share.devdocs.json +++ b/api_docs/share.devdocs.json @@ -1,164 +1,7 @@ { "id": "share", "client": { - "classes": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService", - "type": "Class", - "tags": [], - "label": "UrlGeneratorsService", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorsService", - "text": "UrlGeneratorsService" - }, - " implements ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.Plugin", - "text": "Plugin" - }, - "<", - "UrlGeneratorsSetup", - ", ", - "UrlGeneratorsStart", - ", object, object>" - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService.setup", - "type": "Function", - "tags": [], - "label": "setup", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - ") => ", - "UrlGeneratorsSetup" - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService.setup.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService.start", - "type": "Function", - "tags": [], - "label": "start", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.CoreStart", - "text": "CoreStart" - }, - ") => ", - "UrlGeneratorsStart" - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService.start.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.CoreStart", - "text": "CoreStart" - } - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsService.stop", - "type": "Function", - "tags": [], - "label": "stop", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - } - ], + "classes": [], "functions": [ { "parentPluginId": "share", @@ -1287,348 +1130,6 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorContract", - "type": "Interface", - "tags": [], - "label": "UrlGeneratorContract", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorContract", - "text": "UrlGeneratorContract" - }, - "" - ], - "path": "src/plugins/share/public/url_generators/url_generator_contract.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorContract.id", - "type": "Uncategorized", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "Id" - ], - "path": "src/plugins/share/public/url_generators/url_generator_contract.ts", - "deprecated": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorContract.createUrl", - "type": "Function", - "tags": [], - "label": "createUrl", - "description": [], - "signature": [ - "(state: ", - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"State\"]) => Promise" - ], - "path": "src/plugins/share/public/url_generators/url_generator_contract.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorContract.createUrl.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"State\"]" - ], - "path": "src/plugins/share/public/url_generators/url_generator_contract.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorContract.isDeprecated", - "type": "boolean", - "tags": [], - "label": "isDeprecated", - "description": [], - "path": "src/plugins/share/public/url_generators/url_generator_contract.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition", - "type": "Interface", - "tags": [], - "label": "UrlGeneratorsDefinition", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorsDefinition", - "text": "UrlGeneratorsDefinition" - }, - "" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition.id", - "type": "Uncategorized", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "Id" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition.createUrl", - "type": "Function", - "tags": [], - "label": "createUrl", - "description": [], - "signature": [ - "((state: ", - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"State\"]) => Promise) | undefined" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition.createUrl.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"State\"]" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition.isDeprecated", - "type": "CompoundType", - "tags": [], - "label": "isDeprecated", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition.migrate", - "type": "Function", - "tags": [], - "label": "migrate", - "description": [], - "signature": [ - "((state: ", - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"State\"]) => Promise<{ state: ", - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"MigratedState\"]; id: ", - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"MigratedId\"]; }>) | undefined" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorsDefinition.migrate.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorStateMapping", - "text": "UrlGeneratorStateMapping" - }, - "[Id][\"State\"]" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorState", - "type": "Interface", - "tags": [], - "label": "UrlGeneratorState", - "description": [], - "signature": [ - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorState", - "text": "UrlGeneratorState" - }, - "" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorState.State", - "type": "Uncategorized", - "tags": [], - "label": "State", - "description": [], - "signature": [ - "S" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorState.MigratedId", - "type": "Uncategorized", - "tags": [], - "label": "MigratedId", - "description": [], - "signature": [ - "I | undefined" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorState.MigratedState", - "type": "Uncategorized", - "tags": [], - "label": "MigratedState", - "description": [], - "signature": [ - "MS | undefined" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorStateMapping", - "type": "Interface", - "tags": [], - "label": "UrlGeneratorStateMapping", - "description": [], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorStateMapping.Unnamed", - "type": "IndexSignature", - "tags": [], - "label": "[key: string]: UrlGeneratorState", - "description": [], - "signature": [ - "[key: string]: ", - { - "pluginId": "share", - "scope": "public", - "docId": "kibSharePluginApi", - "section": "def-public.UrlGeneratorState", - "text": "UrlGeneratorState" - }, - "" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false - } - ], - "initialIsOpen": false } ], "enums": [], @@ -1691,20 +1192,6 @@ "path": "src/plugins/share/public/lib/download_as.ts", "deprecated": false, "initialIsOpen": false - }, - { - "parentPluginId": "share", - "id": "def-public.UrlGeneratorId", - "type": "Type", - "tags": [], - "label": "UrlGeneratorId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", - "deprecated": false, - "initialIsOpen": false } ], "objects": [], @@ -1724,9 +1211,7 @@ "section": "def-public.ShareMenuProvider", "text": "ShareMenuProvider" }, - ") => void; } & { urlGenerators: ", - "UrlGeneratorsSetup", - "; url: ", + ") => void; } & { url: ", { "pluginId": "share", "scope": "public", @@ -1769,9 +1254,7 @@ "section": "def-public.ShowShareMenuOptions", "text": "ShowShareMenuOptions" }, - ") => void; } & { urlGenerators: ", - "UrlGeneratorsStart", - "; url: ", + ") => void; } & { url: ", { "pluginId": "share", "scope": "public", diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 3bd65c24a93e8..c8e8681241069 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github summary: API docs for the share plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 139 | 0 | 80 | 12 | +| 113 | 0 | 54 | 10 | ## Client @@ -31,9 +31,6 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services ### Functions -### Classes - - ### Interfaces diff --git a/api_docs/shared_u_x.devdocs.json b/api_docs/shared_u_x.devdocs.json index aa8fad30bea40..dbcd1b5d825c5 100644 --- a/api_docs/shared_u_x.devdocs.json +++ b/api_docs/shared_u_x.devdocs.json @@ -72,6 +72,76 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "sharedUX", + "id": "def-public.LazyNoDataViewsPage", + "type": "Function", + "tags": [], + "label": "LazyNoDataViewsPage", + "description": [ + "\nThe Lazily-loaded `NoDataViews` component. Consumers should use `React.Suspennse` or the\n`withSuspense` HOC to load this component." + ], + "signature": [ + "React.ExoticComponent<", + "Props", + "> & { readonly _result: ({ onDataViewCreated, dataViewsDocLink }: ", + "Props", + ") => JSX.Element; }" + ], + "path": "src/plugins/shared_ux/public/components/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "sharedUX", + "id": "def-public.LazyNoDataViewsPage.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P" + ], + "path": "node_modules/@types/react/index.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "sharedUX", + "id": "def-public.NoDataViewsPage", + "type": "Function", + "tags": [], + "label": "NoDataViewsPage", + "description": [ + "\nA `NoDataViewsPage` component that is wrapped by the `withSuspense` HOC. This component can\nbe used directly by consumers and will load the `LazyNoDataViewsPage` component lazily with\na predefined fallback and error boundary." + ], + "signature": [ + "React.ForwardRefExoticComponent<", + "Props", + " & React.RefAttributes<{}>>" + ], + "path": "src/plugins/shared_ux/public/components/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "sharedUX", + "id": "def-public.NoDataViewsPage.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P" + ], + "path": "node_modules/@types/react/index.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false } ], "interfaces": [], diff --git a/api_docs/shared_u_x.mdx b/api_docs/shared_u_x.mdx index 3842d195dd13a..d1bb3ce87f625 100644 --- a/api_docs/shared_u_x.mdx +++ b/api_docs/shared_u_x.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/sharedUX title: "sharedUX" image: https://source.unsplash.com/400x175/?github summary: API docs for the sharedUX plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sharedUX'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) for questio | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 0 | 1 | +| 14 | 0 | 0 | 1 | ## Client diff --git a/api_docs/snapshot_restore.devdocs.json b/api_docs/snapshot_restore.devdocs.json index c16e7c3ee72f4..871ad98b1c9f9 100644 --- a/api_docs/snapshot_restore.devdocs.json +++ b/api_docs/snapshot_restore.devdocs.json @@ -92,10 +92,24 @@ }, { "parentPluginId": "snapshotRestore", - "id": "def-common.DEFAULT_REPOSITORY_TYPES", + "id": "def-common.MAJOR_VERSION", + "type": "string", + "tags": [], + "label": "MAJOR_VERSION", + "description": [], + "signature": [ + "\"8.0.0\"" + ], + "path": "x-pack/plugins/snapshot_restore/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "snapshotRestore", + "id": "def-common.MODULE_REPOSITORY_TYPES", "type": "Array", "tags": [], - "label": "DEFAULT_REPOSITORY_TYPES", + "label": "MODULE_REPOSITORY_TYPES", "description": [], "signature": [ "RepositoryType", @@ -107,13 +121,14 @@ }, { "parentPluginId": "snapshotRestore", - "id": "def-common.MAJOR_VERSION", - "type": "string", + "id": "def-common.ON_PREM_REPOSITORY_TYPES", + "type": "Array", "tags": [], - "label": "MAJOR_VERSION", + "label": "ON_PREM_REPOSITORY_TYPES", "description": [], "signature": [ - "\"8.0.0\"" + "RepositoryType", + "[]" ], "path": "x-pack/plugins/snapshot_restore/common/constants.ts", "deprecated": false, diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index d689ed141f11e..748b06fdf1290 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github summary: API docs for the snapshotRestore plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-ma | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 20 | 1 | 20 | 1 | +| 21 | 1 | 21 | 1 | ## Common diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 351ab8a9cc9e5..55a04276cce79 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github summary: API docs for the spaces plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 86e42c4ca9784..c14cf169d0b7d 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github summary: API docs for the stackAlerts plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,7 +12,7 @@ import stackAlertsObj from './stack_alerts.devdocs.json'; -Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) for questions regarding this plugin. +Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 0a060cebf89a8..329f94578041c 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github summary: API docs for the taskManager plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,7 +12,7 @@ import taskManagerObj from './task_manager.devdocs.json'; -Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) for questions regarding this plugin. +Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index bcf333d15759a..08ffa7a550949 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetry plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_collection_manager.devdocs.json b/api_docs/telemetry_collection_manager.devdocs.json index b115d5bd092a2..605df559f4e9e 100644 --- a/api_docs/telemetry_collection_manager.devdocs.json +++ b/api_docs/telemetry_collection_manager.devdocs.json @@ -67,20 +67,1196 @@ { "parentPluginId": "telemetryCollectionManager", "id": "def-server.StatsCollectionConfig.esClient", - "type": "CompoundType", + "type": "Object", "tags": [], "label": "esClient", "description": [], "signature": [ - "Omit<", - "KibanaClient", - ", \"extend\" | \"connectionPool\" | \"transport\" | \"serializer\" | \"child\" | \"close\" | \"diagnostic\"> & { transport: { request(params: ", - "TransportRequestParams", + "{ eql: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CreateResponse", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CreateResponse", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CreateResponse", + ">; }; monitoring: ", + "default", + "; security: ", + "default", + "; name: string | symbol; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "IndexResponse", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "IndexResponse", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "IndexResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteResponse", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteResponse", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", ", options?: ", "TransportRequestOptions", " | undefined): Promise<", + "DeleteResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", "TransportResult", - ">; }; }" + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; transform: ", + "default", + "; helpers: ", + "default", + "; [kInternal]: symbol | null; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kRollup]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; Internal: ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryRethrottleResponse", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteScriptResponse", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteScriptResponse", + ">; }; enrich: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; ilm: ", + "default", + "; indices: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "PutScriptResponse", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "PutScriptResponse", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "PutScriptResponse", + ">; }; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params?: ", + "ReindexRequest", + " | ", + "ReindexRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" ], "path": "src/plugins/telemetry_collection_manager/server/types.ts", "deprecated": false diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index bc2c0f5af00f6..71b8ce22c566c 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryCollectionManager plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index af0f47c295473..891a489ed434d 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryCollectionXpack plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index bbba1f0c8d9db..1a21fba680212 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github summary: API docs for the telemetryManagementSection plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/timelines.devdocs.json b/api_docs/timelines.devdocs.json index afb4824423c36..fc58e82ce9db0 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -4732,7 +4732,9 @@ "signature": [ "{ [x: string]: ", "MappingRuntimeField", - "; }" + " | ", + "MappingRuntimeField", + "[]; }" ], "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false @@ -5498,7 +5500,9 @@ "signature": [ "{ [x: string]: ", "MappingRuntimeField", - "; }" + " | ", + "MappingRuntimeField", + "[]; }" ], "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index e31f0c1d8f6e0..b56abcf7950b2 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github summary: API docs for the timelines plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index f41e3edf27439..609643309e3c9 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github summary: API docs for the transform plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/triggers_actions_ui.devdocs.json b/api_docs/triggers_actions_ui.devdocs.json index f006caf3eb91d..90dbbb848171d 100644 --- a/api_docs/triggers_actions_ui.devdocs.json +++ b/api_docs/triggers_actions_ui.devdocs.json @@ -210,9 +210,9 @@ "description": [], "signature": [ "React.ExoticComponent<", - "AlertConditionsProps", + "RuleConditionsProps", " & { children?: React.ReactNode; }> & { readonly _result: ({ headline, actionGroups, onInitializeConditionsFor, onResetConditionsFor, includeBuiltInActionGroups, children, }: React.PropsWithChildren<", - "AlertConditionsProps", + "RuleConditionsProps", ">) => JSX.Element; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/index.tsx", @@ -252,9 +252,9 @@ "text": "ActionGroupWithCondition" }, " | undefined; } & Pick<", - "AlertConditionsProps", + "RuleConditionsProps", ", \"onResetConditionsFor\"> & { children?: React.ReactNode; }> & { readonly _result: ({ actionGroup, onResetConditionsFor, children, ...otherProps }: React.PropsWithChildren<", - "AlertConditionsGroupProps", + "RuleConditionsGroupProps", ">) => JSX.Element | null; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/index.tsx", @@ -756,13 +756,13 @@ }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations", + "id": "def-public.loadRuleAggregations", "type": "Function", "tags": [], - "label": "loadAlertAggregations", + "label": "loadRuleAggregations", "description": [], "signature": [ - "({\n http,\n searchText,\n typesFilter,\n actionTypesFilter,\n alertStatusesFilter,\n}: { http: ", + "({\n http,\n searchText,\n typesFilter,\n actionTypesFilter,\n ruleStatusesFilter,\n}: { http: ", { "pluginId": "core", "scope": "public", @@ -770,32 +770,26 @@ "section": "def-public.HttpSetup", "text": "HttpSetup" }, - "; searchText?: string | undefined; typesFilter?: string[] | undefined; actionTypesFilter?: string[] | undefined; alertStatusesFilter?: string[] | undefined; }) => Promise<", - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.AlertAggregations", - "text": "AlertAggregations" - }, + "; searchText?: string | undefined; typesFilter?: string[] | undefined; actionTypesFilter?: string[] | undefined; ruleStatusesFilter?: string[] | undefined; }) => Promise<", + "RuleAggregations", ">" ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false, "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations.$1", + "id": "def-public.loadRuleAggregations.$1", "type": "Object", "tags": [], - "label": "{\n http,\n searchText,\n typesFilter,\n actionTypesFilter,\n alertStatusesFilter,\n}", + "label": "{\n http,\n searchText,\n typesFilter,\n actionTypesFilter,\n ruleStatusesFilter,\n}", "description": [], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false, "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations.$1.http", + "id": "def-public.loadRuleAggregations.$1.http", "type": "Object", "tags": [], "label": "http", @@ -809,12 +803,12 @@ "text": "HttpSetup" } ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations.$1.searchText", + "id": "def-public.loadRuleAggregations.$1.searchText", "type": "string", "tags": [], "label": "searchText", @@ -822,12 +816,12 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations.$1.typesFilter", + "id": "def-public.loadRuleAggregations.$1.typesFilter", "type": "Array", "tags": [], "label": "typesFilter", @@ -835,12 +829,12 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations.$1.actionTypesFilter", + "id": "def-public.loadRuleAggregations.$1.actionTypesFilter", "type": "Array", "tags": [], "label": "actionTypesFilter", @@ -848,20 +842,20 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadAlertAggregations.$1.alertStatusesFilter", + "id": "def-public.loadRuleAggregations.$1.ruleStatusesFilter", "type": "Array", "tags": [], - "label": "alertStatusesFilter", + "label": "ruleStatusesFilter", "description": [], "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts", "deprecated": false } ] @@ -1645,14 +1639,8 @@ "label": "setRuleProperty", "description": [], "signature": [ - "(key: Prop, value: ", - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.SanitizedAlert", - "text": "SanitizedAlert" - }, + "(key: Prop, value: ", + "SanitizedRule", "[Prop] | null) => void" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", @@ -1680,13 +1668,7 @@ "label": "value", "description": [], "signature": [ - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.SanitizedAlert", - "text": "SanitizedAlert" - }, + "SanitizedRule", "[Prop] | null" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", @@ -2169,23 +2151,23 @@ }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.AlertFlyoutCloseReason", + "id": "def-public.COMPARATORS", "type": "Enum", "tags": [], - "label": "AlertFlyoutCloseReason", + "label": "COMPARATORS", "description": [], - "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "triggersActionsUi", - "id": "def-public.COMPARATORS", + "id": "def-public.RuleFlyoutCloseReason", "type": "Enum", "tags": [], - "label": "COMPARATORS", + "label": "RuleFlyoutCloseReason", "description": [], - "path": "x-pack/plugins/triggers_actions_ui/public/common/constants/comparators.ts", + "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, "initialIsOpen": false }, @@ -2236,7 +2218,7 @@ }, " & ({ conditions?: T | undefined; isRequired?: false | undefined; } | { conditions: T; isRequired: true; })" ], - "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx", + "path": "x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.tsx", "deprecated": false, "initialIsOpen": false }, @@ -2324,47 +2306,15 @@ "label": "Rule", "description": [], "signature": [ - "{ id: string; monitoring?: ", - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.RuleMonitoring", - "text": "RuleMonitoring" - }, - " | undefined; name: string; tags: string[]; enabled: boolean; params: ", - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.AlertTypeParams", - "text": "AlertTypeParams" - }, - "; actions: ", - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.AlertAction", - "text": "AlertAction" - }, - "[]; throttle: string | null; alertTypeId: string; consumer: string; schedule: ", - { - "pluginId": "alerting", - "scope": "common", - "docId": "kibAlertingPluginApi", - "section": "def-common.IntervalSchedule", - "text": "IntervalSchedule" - }, - "; scheduledTaskId?: string | undefined; createdBy: string | null; updatedBy: string | null; createdAt: Date; updatedAt: Date; apiKeyOwner: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\" | null; muteAll: boolean; mutedInstanceIds: string[]; executionStatus: ", + "Omit<", { "pluginId": "alerting", "scope": "common", "docId": "kibAlertingPluginApi", - "section": "def-common.AlertExecutionStatus", - "text": "AlertExecutionStatus" + "section": "def-common.SanitizedAlert", + "text": "SanitizedAlert" }, - "; }" + ", \"alertTypeId\"> & { ruleTypeId: string; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, @@ -3408,9 +3358,9 @@ "description": [], "signature": [ "(props: Omit<", - "AlertAddProps", + "RuleAddProps", ">, \"actionTypeRegistry\" | \"ruleTypeRegistry\">) => React.ReactElement<", - "AlertAddProps", + "RuleAddProps", ">, string | React.JSXElementConstructor>" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", @@ -3425,7 +3375,7 @@ "description": [], "signature": [ "Omit<", - "AlertAddProps", + "RuleAddProps", ">, \"actionTypeRegistry\" | \"ruleTypeRegistry\">" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", @@ -3444,9 +3394,9 @@ "description": [], "signature": [ "(props: Omit<", - "AlertEditProps", + "RuleEditProps", ">, \"actionTypeRegistry\" | \"ruleTypeRegistry\">) => React.ReactElement<", - "AlertEditProps", + "RuleEditProps", ">, string | React.JSXElementConstructor>" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", @@ -3461,7 +3411,7 @@ "description": [], "signature": [ "Omit<", - "AlertEditProps", + "RuleEditProps", ">, \"actionTypeRegistry\" | \"ruleTypeRegistry\">" ], "path": "x-pack/plugins/triggers_actions_ui/public/plugin.ts", diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index a34a9ae8bf1ac..6eb7cf35af149 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github summary: API docs for the triggersActionsUi plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -12,13 +12,13 @@ import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; -Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) for questions regarding this plugin. +Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 246 | 0 | 234 | 18 | +| 246 | 0 | 234 | 20 | ## Client diff --git a/api_docs/ui_actions.devdocs.json b/api_docs/ui_actions.devdocs.json index 5eb77b541a142..925dfa5a64c1a 100644 --- a/api_docs/ui_actions.devdocs.json +++ b/api_docs/ui_actions.devdocs.json @@ -1989,6 +1989,19 @@ ], "path": "src/plugins/ui_actions/public/types.ts", "deprecated": false + }, + { + "parentPluginId": "uiActions", + "id": "def-public.VisualizeFieldContext.originatingApp", + "type": "string", + "tags": [], + "label": "originatingApp", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/ui_actions/public/types.ts", + "deprecated": false } ], "initialIsOpen": false diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index e29a381c58846..fb8e90253f03f 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github summary: API docs for the uiActions plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 129 | 0 | 90 | 11 | +| 130 | 0 | 91 | 11 | ## Client diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index c0da2c7d4f60f..a3633934b1d90 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github summary: API docs for the uiActionsEnhanced plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index aba7d3eace322..567e080676d96 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github summary: API docs for the urlForwarding plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/usage_collection.devdocs.json b/api_docs/usage_collection.devdocs.json index 6cd6a743a1afc..0db23a5c1de9a 100644 --- a/api_docs/usage_collection.devdocs.json +++ b/api_docs/usage_collection.devdocs.json @@ -141,9 +141,7 @@ "Report whenever a UI event occurs for UI counters to report it" ], "signature": [ - "(appName: string, type: ", - "UiCounterMetricType", - ", eventNames: string | string[], count?: number | undefined) => void" + "(appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void" ], "path": "src/plugins/usage_collection/public/plugin.tsx", "deprecated": false, @@ -165,12 +163,12 @@ { "parentPluginId": "usageCollection", "id": "def-public.UsageCollectionSetup.reportUiCounter.$2", - "type": "CompoundType", + "type": "string", "tags": [], "label": "type", "description": [], "signature": [ - "UiCounterMetricType" + "string" ], "path": "src/plugins/usage_collection/public/plugin.tsx", "deprecated": false, @@ -233,9 +231,7 @@ "Report whenever a UI event occurs for UI counters to report it" ], "signature": [ - "(appName: string, type: ", - "UiCounterMetricType", - ", eventNames: string | string[], count?: number | undefined) => void" + "(appName: string, type: string, eventNames: string | string[], count?: number | undefined) => void" ], "path": "src/plugins/usage_collection/public/plugin.tsx", "deprecated": false, @@ -257,12 +253,12 @@ { "parentPluginId": "usageCollection", "id": "def-public.UsageCollectionStart.reportUiCounter.$2", - "type": "CompoundType", + "type": "string", "tags": [], "label": "type", "description": [], "signature": [ - "UiCounterMetricType" + "string" ], "path": "src/plugins/usage_collection/public/plugin.tsx", "deprecated": false, @@ -673,7 +669,7 @@ "\nPossible type values in the schema" ], "signature": [ - "\"boolean\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"text\" | \"integer\" | \"short\" | \"byte\" | \"float\"" + "\"boolean\" | \"keyword\" | \"date\" | \"text\" | \"integer\" | \"long\" | \"short\" | \"byte\" | \"float\" | \"double\"" ], "path": "src/plugins/usage_collection/server/collector/types.ts", "deprecated": false, diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 148112e4cedd7..094129f39acac 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github summary: API docs for the usageCollection plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 178021f899567..0d917900d0779 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github summary: API docs for the ux plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 39ed269626843..734b98bcf4d69 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github summary: API docs for the visDefaultEditor plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index fae7bb9740083..18e54123753bd 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeHeatmap plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 4fc45fcb6aba5..cde65bc547e04 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypePie plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 2cc7aedc0273d..2b248fe2c786a 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTable plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index 9c9cad5c2e3e5..8504bdd821d90 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTimelion plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 9f5ac15c84c38..466b84e5c8c8c 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeTimeseries plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 631d63a22c18e..ecc9a52457d3c 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeVega plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_vislib.devdocs.json b/api_docs/vis_type_vislib.devdocs.json index ad1196c648308..502f92a30a92d 100644 --- a/api_docs/vis_type_vislib.devdocs.json +++ b/api_docs/vis_type_vislib.devdocs.json @@ -39,7 +39,7 @@ "label": "type", "description": [], "signature": [ - "\"goal\" | \"heatmap\" | \"metric\" | \"gauge\" | \"pie\"" + "\"goal\" | \"heatmap\" | \"gauge\" | \"metric\" | \"pie\"" ], "path": "src/plugins/vis_types/vislib/public/types.ts", "deprecated": false @@ -338,7 +338,7 @@ "label": "VislibChartType", "description": [], "signature": [ - "\"goal\" | \"heatmap\" | \"metric\" | \"gauge\" | \"pie\"" + "\"goal\" | \"heatmap\" | \"gauge\" | \"metric\" | \"pie\"" ], "path": "src/plugins/vis_types/vislib/public/types.ts", "deprecated": false, diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 6efbe56cf250b..38e6a565d2537 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeVislib plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index b66a01e52859b..22b7747b48476 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github summary: API docs for the visTypeXy plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index 8c02d49b762fb..49e78b9d9604d 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -83,6 +83,35 @@ "path": "src/plugins/visualizations/public/vis_types/base_vis_type.ts", "deprecated": false }, + { + "parentPluginId": "visualizations", + "id": "def-public.BaseVisType.navigateToLens", + "type": "Function", + "tags": [], + "label": "navigateToLens", + "description": [], + "signature": [ + "((params?: ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + " | undefined) => Promise<", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.NavigateToLensContext", + "text": "NavigateToLensContext" + }, + " | null> | undefined) | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/base_vis_type.ts", + "deprecated": false + }, { "parentPluginId": "visualizations", "id": "def-public.BaseVisType.icon", @@ -1264,7 +1293,7 @@ }, "[]; }" ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "children": [ { @@ -1283,7 +1312,7 @@ "text": "Datatable" } ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "isRequired": true }, @@ -1304,7 +1333,7 @@ }, "[]" ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "isRequired": true } @@ -2061,6 +2090,63 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-public.NavigateToLensContext", + "type": "Interface", + "tags": [], + "label": "NavigateToLensContext", + "description": [], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.NavigateToLensContext.layers", + "type": "Object", + "tags": [], + "label": "layers", + "description": [], + "signature": [ + "{ [key: string]: ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEditorLayersContext", + "text": "VisualizeEditorLayersContext" + }, + "; }" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.NavigateToLensContext.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.NavigateToLensContext.configuration", + "type": "Object", + "tags": [], + "label": "configuration", + "description": [], + "signature": [ + "{ fill: string | number; legend: { isVisible: boolean; position: string; shouldTruncate: boolean; maxLines: number; showSingleSeries: boolean; }; gridLinesVisibility: { x: boolean; yLeft: boolean; yRight: boolean; }; extents: { yLeftExtent: AxisExtents; yRightExtent: AxisExtents; }; }" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-public.Schema", @@ -3495,6 +3581,61 @@ ], "returnComment": [] }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisTypeDefinition.navigateToLens", + "type": "Function", + "tags": [], + "label": "navigateToLens", + "description": [ + "\nIf given, it will navigateToLens with the given viz params.\nEvery visualization that wants to be edited also in Lens should have this function.\nIt receives the current visualization params as a parameter and should return the correct config\nin order to be displayed in the Lens editor." + ], + "signature": [ + "((params?: ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + " | undefined) => Promise<", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.NavigateToLensContext", + "text": "NavigateToLensContext" + }, + " | null> | undefined) | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisTypeDefinition.navigateToLens.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, { "parentPluginId": "visualizations", "id": "def-public.VisTypeDefinition.getUsedIndexPattern", @@ -4207,6 +4348,218 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext", + "type": "Interface", + "tags": [], + "label": "VisualizeEditorLayersContext", + "description": [], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.indexPatternId", + "type": "string", + "tags": [], + "label": "indexPatternId", + "description": [], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.splitWithDateHistogram", + "type": "CompoundType", + "tags": [], + "label": "splitWithDateHistogram", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.timeFieldName", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.chartType", + "type": "string", + "tags": [], + "label": "chartType", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.axisPosition", + "type": "string", + "tags": [], + "label": "axisPosition", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.termsParams", + "type": "Object", + "tags": [], + "label": "termsParams", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.splitField", + "type": "string", + "tags": [], + "label": "splitField", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.splitMode", + "type": "string", + "tags": [], + "label": "splitMode", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.splitFilters", + "type": "Array", + "tags": [], + "label": "splitFilters", + "description": [], + "signature": [ + "SplitByFilters[] | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.palette", + "type": "Object", + "tags": [], + "label": "palette", + "description": [], + "signature": [ + { + "pluginId": "charts", + "scope": "common", + "docId": "kibChartsPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<{ [key: string]: unknown; }> | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.metrics", + "type": "Array", + "tags": [], + "label": "metrics", + "description": [], + "signature": [ + "VisualizeEditorMetricContext[]" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.timeInterval", + "type": "string", + "tags": [], + "label": "timeInterval", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.format", + "type": "string", + "tags": [], + "label": "format", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.label", + "type": "string", + "tags": [], + "label": "label", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEditorLayersContext.layerId", + "type": "string", + "tags": [], + "label": "layerId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/visualizations/public/vis_types/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-public.VisualizeInput", @@ -4374,6 +4727,20 @@ } ], "misc": [ + { + "parentPluginId": "visualizations", + "id": "def-public.ACTION_CONVERT_TO_LENS", + "type": "string", + "tags": [], + "label": "ACTION_CONVERT_TO_LENS", + "description": [], + "signature": [ + "\"ACTION_CONVERT_TO_LENS\"" + ], + "path": "src/plugins/visualizations/public/triggers/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-public.Dimension", @@ -4382,19 +4749,9 @@ "label": "Dimension", "description": [], "signature": [ - "[(", - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.ExpressionValueVisDimension", - "text": "ExpressionValueVisDimension" - }, - " | ", - "ExpressionValueXYDimension", - ")[] | undefined, string]" + "[DimensionColumn[] | undefined, string]" ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "initialIsOpen": false }, @@ -4414,7 +4771,7 @@ "section": "def-common.DatatableColumn", "text": "DatatableColumn" }, - "; format: { id?: string | undefined; params: Record; }; }" + "; format: { id?: string | undefined; params?: Record | undefined; }; }" ], "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false, @@ -4582,6 +4939,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-public.VISUALIZE_EDITOR_TRIGGER", + "type": "string", + "tags": [], + "label": "VISUALIZE_EDITOR_TRIGGER", + "description": [], + "signature": [ + "\"VISUALIZE_EDITOR_TRIGGER\"" + ], + "path": "src/plugins/visualizations/public/triggers/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-public.VISUALIZE_EMBEDDABLE_TYPE", @@ -5267,6 +5638,148 @@ "common": { "classes": [], "functions": [ + { + "parentPluginId": "visualizations", + "id": "def-common.findAccessorOrFail", + "type": "Function", + "tags": [], + "label": "findAccessorOrFail", + "description": [], + "signature": [ + "(accessor: string | number, columns: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + "[]) => number | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + } + ], + "path": "src/plugins/visualizations/common/utils/accessors.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-common.findAccessorOrFail.$1", + "type": "CompoundType", + "tags": [], + "label": "accessor", + "description": [], + "signature": [ + "string | number" + ], + "path": "src/plugins/visualizations/common/utils/accessors.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-common.findAccessorOrFail.$2", + "type": "Array", + "tags": [], + "label": "columns", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + "[]" + ], + "path": "src/plugins/visualizations/common/utils/accessors.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.getAccessorByDimension", + "type": "Function", + "tags": [], + "label": "getAccessorByDimension", + "description": [], + "signature": [ + "(dimension: string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + }, + ", columns: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + "[]) => string" + ], + "path": "src/plugins/visualizations/common/utils/accessors.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-common.getAccessorByDimension.$1", + "type": "CompoundType", + "tags": [], + "label": "dimension", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.ExpressionValueVisDimension", + "text": "ExpressionValueVisDimension" + } + ], + "path": "src/plugins/visualizations/common/utils/accessors.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-common.getAccessorByDimension.$2", + "type": "Array", + "tags": [], + "label": "columns", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + "[]" + ], + "path": "src/plugins/visualizations/common/utils/accessors.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-common.prepareLogTable", @@ -5327,7 +5840,7 @@ }, "[]; }" ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "children": [ { @@ -5346,7 +5859,7 @@ "text": "Datatable" } ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "isRequired": true }, @@ -5367,7 +5880,7 @@ }, "[]" ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "isRequired": true } @@ -5902,19 +6415,9 @@ "label": "Dimension", "description": [], "signature": [ - "[(", - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.ExpressionValueVisDimension", - "text": "ExpressionValueVisDimension" - }, - " | ", - "ExpressionValueXYDimension", - ")[] | undefined, string]" + "[DimensionColumn[] | undefined, string]" ], - "path": "src/plugins/visualizations/common/prepare_log_table.ts", + "path": "src/plugins/visualizations/common/utils/prepare_log_table.ts", "deprecated": false, "initialIsOpen": false }, @@ -5934,7 +6437,7 @@ "section": "def-common.DatatableColumn", "text": "DatatableColumn" }, - "; format: { id?: string | undefined; params: Record; }; }" + "; format: { id?: string | undefined; params?: Record | undefined; }; }" ], "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false, diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index c7470bc20d9e8..c154e7e2d2e65 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -4,7 +4,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github summary: API docs for the visualizations plugin -date: 2022-02-11 +date: 2022-02-28 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 316 | 12 | 296 | 15 | +| 347 | 12 | 326 | 14 | ## Client diff --git a/docs/canvas/canvas-function-reference.asciidoc b/docs/canvas/canvas-function-reference.asciidoc index 24a7608f98fa7..efc82bbe71f77 100644 --- a/docs/canvas/canvas-function-reference.asciidoc +++ b/docs/canvas/canvas-function-reference.asciidoc @@ -13,7 +13,7 @@ A *** denotes a required argument. A † denotes an argument can be passed multiple times. -<> | B | <> | <> | <> | <> | <> | <> | <> | <> | K | <> | <> | <> | O | <> | Q | <> | <> | <> | <> | <> | W | X | Y | Z +<> | B | <> | <> | <> | <> | <> | <> | <> | <> | <> | <> | <> | <> | O | <> | Q | <> | <> | <> | <> | <> | W | X | Y | Z [float] [[a_fns]] @@ -35,7 +35,8 @@ all condition={gt 10} condition={lt 20} *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | math "mean(percent_uptime)" | formatnumber "0.0%" @@ -83,7 +84,8 @@ alterColumn column="@timestamp" name="foo" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | alterColumn "time" name="time_in_ms" type="number" | table @@ -131,7 +133,8 @@ any condition={lte 10} condition={gt 30} *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | filterrows { getCell "project" | any {eq "elasticsearch"} {eq "kibana"} {eq "x-pack"} @@ -175,7 +178,8 @@ as name="bar" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | ply by="project" fn={math "count(username)" | as "num_users"} fn={math "mean(price)" | as "price"} | pointseries x="project" y="num_users" size="price" color="project" @@ -257,7 +261,8 @@ axisConfig position="right" min=0 max=10 tickSize=1 *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | pointseries x="size(cost)" y="project" color="project" | plot defaultStyle={seriesStyle bars=0.75 horizontalBars=true} @@ -380,7 +385,7 @@ Clears the _context_, and returns `null`. [[clog_fn]] === `clog` -It outputs the _context_ in the console. This function is for debug purpose. +Outputs the _input_ in the console. This function is for debug purposes *Expression syntax* [source,js] @@ -391,74 +396,20 @@ clog *Code example* [source,text] ---- -filters - | demodata - | clog - | filterrows fn={getCell "age" | gt 70} - | clog - | pointseries x="time" y="mean(price)" - | plot defaultStyle={seriesStyle lines=1 fill=1} - | render +kibana +| demodata +| clog +| filterrows fn={getCell "age" | gt 70} +| clog +| pointseries x="time" y="mean(price)" +| plot defaultStyle={seriesStyle lines=1 fill=1} +| render ---- This prints the `datatable` objects in the browser console before and after the `filterrows` function. *Accepts:* `any` -*Returns:* `any` - -[float] -[[createTable_fn]] -=== `createTable` - -Creates a datatable with a list of columns, and 1 or more empty rows. -To populate the rows, use <> or <>. - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|ids *** † - -|`string` -|Column ids to generate in positional order. ID represents the key in the row. - -|`names` † -|`string` -|Column names to generate in positional order. Names are not required to be unique, and default to the ID if not provided. - -|`rowCount` - -Default: 1 -|`number` -|The number of empty rows to add to the table, to be assigned a value later. -|=== - -*Expression syntax* -[source,js] ----- -createTable id="a" id="b" -createTable id="a" name="A" id="b" name="B" rowCount=5 ----- - -*Code example* -[source,text] ----- -var_set - name="logs" value={essql "select count(*) as a from kibana_sample_data_logs"} - name="commerce" value={essql "select count(*) as b from kibana_sample_data_ecommerce"} -| createTable ids="totalA" ids="totalB" -| staticColumn name="totalA" value={var "logs" | getCell "a"} -| alterColumn column="totalA" type="number" -| staticColumn name="totalB" value={var "commerce" | getCell "b"} -| alterColumn column="totalB" type="number" -| mathColumn id="percent" name="percent" expression="totalA / totalB" -| render ----- - -This creates a table based on the results of two `essql` queries, joined -into one table. - -*Accepts:* `null` +*Returns:* Depends on your input and arguments [float] @@ -477,7 +428,8 @@ columns exclude="username, country, age" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | columns include="price, cost, state, project" | table @@ -521,7 +473,8 @@ compare op="lte" to=100 *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | mapColumn project fn={getCell project | @@ -673,6 +626,59 @@ Using the `context` function allows us to pass the output, or _context_, of the *Returns:* Depends on your input and arguments +[float] +[[createTable_fn]] +=== `createTable` + +Creates a datatable with a list of columns, and 1 or more empty rows. To populate the rows, use <> or <>. + +*Expression syntax* +[source,js] +---- +createTable id="a" id="b" +createTable id="a" name="A" id="b" name="B" rowCount=5 +---- + +*Code example* +[source,text] +---- +var_set +name="logs" value={essql "select count(*) as a from kibana_sample_data_logs"} +name="commerce" value={essql "select count(*) as b from kibana_sample_data_ecommerce"} +| createTable ids="totalA" ids="totalB" +| staticColumn name="totalA" value={var "logs" | getCell "a"} +| alterColumn column="totalA" type="number" +| staticColumn name="totalB" value={var "commerce" | getCell "b"} +| alterColumn column="totalB" type="number" +| mathColumn id="percent" name="percent" expression="totalA / totalB" +| render +---- +This creates a table based on the results of two `essql` queries, joined into one table. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`ids` † +|`string` +|Column ids to generate in positional order. ID represents the key in the row. + +|`names` † +|`string` +|Column names to generate in positional order. Names are not required to be unique, and default to the ID if not provided. + +|`rowCount` +|`number` +|The number of empty rows to add to the table, to be assigned a value later + +Default: `1` +|=== + +*Returns:* `datatable` + + [float] [[csv_fn]] === `csv` @@ -793,7 +799,8 @@ demodata type="shirts" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | table | render @@ -876,6 +883,10 @@ This creates a dropdown filter element. It requires a data source and uses the u |`string` |The group name for the filter. +|`labelColumn` +|`string` +|The column or field to use as the label in the dropdown control + |`valueColumn` *** |`string` |The column or field from which to extract the unique values for the dropdown control. @@ -887,6 +898,32 @@ This creates a dropdown filter element. It requires a data source and uses the u [[e_fns]] == E +[float] +[[embeddable_fn]] +=== `embeddable` + +Returns an embeddable with the provided configuration + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `config` +|`string` +|The base64 encoded embeddable input object + +|`type` *** +|`string` +|The embeddable type +|=== + +*Returns:* `embeddable` + + [float] [[eq_fn]] === `eq` @@ -905,7 +942,8 @@ eq "foo" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | mapColumn project fn={getCell project | @@ -953,7 +991,8 @@ escount query="response:404" index="kibana_sample_data_logs" *Code example* [source,text] ---- -filters +kibana +| selectFilter | escount "Cancelled:true" index="kibana_sample_data_flights" | math "value" | progress shape="semicircle" @@ -980,7 +1019,7 @@ Default: `"-_index:.kibana"` |`index` |`string` -|An index or {data-source}. For example, `"logstash-*"`. +|An index or data view. For example, `"logstash-*"`. Default: `"_all"` |=== @@ -1007,7 +1046,8 @@ esdocs index="kibana_sample_data_flights" sort="AvgTicketPrice, asc" *Code example* [source,text] ---- -filters +kibana +| selectFilter | esdocs index="kibana_sample_data_ecommerce" fields="customer_gender, taxful_total_price, order_date" sort="order_date, asc" @@ -1020,7 +1060,7 @@ filters palette={palette "#7ECAE3" "#003A4D" gradient=true} | render ---- -This retrieves the first 10000 documents data from the `kibana_sample_data_ecommerce` {data-source} sorted by `order_date` in ascending order, and only requests the `customer_gender`, `taxful_total_price`, and `order_date` fields. +This retrieves the first 10000 documents data from the `kibana_sample_data_ecommerce` index sorted by `order_date` in ascending order, and only requests the `customer_gender`, `taxful_total_price`, and `order_date` fields. *Accepts:* `filter` @@ -1048,7 +1088,7 @@ Default: `1000` |`index` |`string` -|An index or {data-source}. For example, `"logstash-*"`. +|An index or data view. For example, `"logstash-*"`. Default: `"_all"` @@ -1080,7 +1120,8 @@ essql "SELECT * FROM "apm*"" count=10000 *Code example* [source,text] ---- -filters +kibana +| selectFilter | essql query="SELECT Carrier, FlightDelayMin, AvgTicketPrice FROM "kibana_sample_data_flights"" | table | render @@ -1105,6 +1146,12 @@ Aliases: `q`, `query` Default: `1000` +|`parameter` † + +Alias: `param` +|`string`, `number`, `boolean` +|A parameter to be passed to the SQL query. + |`timezone` Alias: `tz` @@ -1134,7 +1181,8 @@ exactly column="project" value="beats" *Code example* [source,text] ---- -filters +kibana +| selectFilter | exactly column=project value=elasticsearch | demodata | pointseries x=project y="mean(age)" @@ -1188,7 +1236,8 @@ filterrows fn={getCell "age" | gt 50} *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | filterrows {getCell "country" | any {eq "IN"} {eq "US"} {eq "CN"}} | mapColumn "@timestamp" @@ -1297,7 +1346,8 @@ font lHeight=32 *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | pointseries x="project" y="size(cost)" color="project" | plot defaultStyle={seriesStyle bars=0.75} legend=false @@ -1323,23 +1373,25 @@ filters |`string` |The horizontal text alignment. -Default: `"left"` +Default: `${ theme "font.align" default="left" }` |`color` |`string` |The text color. +Default: `${ theme "font.color" }` + |`family` |`string` |An acceptable CSS web font string -Default: `"'Open Sans', Helvetica, Arial, sans-serif"` +Default: `${ theme "font.family" default="'Open Sans', Helvetica, Arial, sans-serif" }` |`italic` |`boolean` |Italicize the text? -Default: `false` +Default: `${ theme "font.italic" default=false }` |`lHeight` @@ -1347,25 +1399,31 @@ Alias: `lineHeight` |`number`, `null` |The line height in pixels -Default: `null` +Default: `${ theme "font.lHeight" }` |`size` |`number` -|The font size in pixels +|The font size + +Default: `${ theme "font.size" default=14 }` -Default: `14` +|`sizeUnit` +|`string` +|The font size unit + +Default: `"px"` |`underline` |`boolean` |Underline the text? -Default: `false` +Default: `${ theme "font.underline" default=false }` |`weight` |`string` |The font weight. For example, `"normal"`, `"bold"`, `"bolder"`, `"lighter"`, `"100"`, `"200"`, `"300"`, `"400"`, `"500"`, `"600"`, `"700"`, `"800"`, or `"900"`. -Default: `"normal"` +Default: `${ theme "font.weight" default="normal" }` |=== *Returns:* `style` @@ -1387,7 +1445,8 @@ formatdate "MM/DD/YYYY" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | mapColumn "time" fn={getCell time | formatdate "MMM 'YY"} | pointseries x="time" y="sum(price)" color="state" @@ -1428,7 +1487,8 @@ formatnumber "0.0a" *Code example* [source,text] ---- -filters +kibana +| selectFilter | demodata | math "mean(percent_uptime)" | progress shape="gauge" @@ -1609,11 +1669,7 @@ Aliases: `dataurl`, `url` |`string`, `null` |The HTTP(S) URL or `base64` data URL of an image. -Example value for the _Unnamed_ argument, formatted as a `base64` data URL: -[source, url] ------------- -data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmlld0JveD0iMCAwIDI3MC42MDAwMSAyNjkuNTQ2NjYiCiAgIGhlaWdodD0iMjY5LjU0NjY2IgogICB3aWR0aD0iMjcwLjYwMDAxIgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBpZD0ic3ZnMiIKICAgdmVyc2lvbj0iMS4xIj48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGE4Ij48cmRmOlJERj48Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+PGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+PGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPjwvY2M6V29yaz48L3JkZjpSREY+PC9tZXRhZGF0YT48ZGVmcwogICAgIGlkPSJkZWZzNiIgLz48ZwogICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMzMywwLDAsLTEuMzMzMzMzMywwLDI2OS41NDY2NykiCiAgICAgaWQ9ImcxMCI+PGcKICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoMC4xKSIKICAgICAgIGlkPSJnMTIiPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMTQiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMjAyOS40OCw5NjIuNDQxIGMgMCwxNzAuMDk5IC0xMDUuNDYsMzE4Ljc5OSAtMjY0LjE3LDM3Ni42NTkgNi45OCwzNS44NiAxMC42Miw3MS43MSAxMC42MiwxMDkuMDUgMCwzMTYuMTkgLTI1Ny4yNCw1NzMuNDMgLTU3My40Nyw1NzMuNDMgLTE4NC43MiwwIC0zNTYuNTU4LC04OC41OSAtNDY0LjUzLC0yMzcuODUgLTUzLjA5LDQxLjE4IC0xMTguMjg1LDYzLjc1IC0xODYuMzA1LDYzLjc1IC0xNjcuODM2LDAgLTMwNC4zODMsLTEzNi41NCAtMzA0LjM4MywtMzA0LjM4IDAsLTM3LjA4IDYuNjE3LC03Mi41OCAxOS4wMzEsLTEwNi4wOCBDIDEwOC40ODgsMTM4MC4wOSAwLDEyMjcuODkgMCwxMDU4Ljg4IDAsODg3LjkxIDEwNS45NzcsNzM4LjUzOSAyNjUuMzk4LDY4MS4wOSBjIC02Ljc2OSwtMzUuNDQyIC0xMC40NiwtNzIuMDIgLTEwLjQ2LC0xMDkgQyAyNTQuOTM4LDI1Ni42MjEgNTExLjU2NiwwIDgyNy4wMjcsMCAxMDEyLjIsMCAxMTgzLjk0LDg4Ljk0MTQgMTI5MS4zLDIzOC44MzIgYyA1My40NSwtNDEuOTYxIDExOC44LC02NC45OTIgMTg2LjU2LC02NC45OTIgMTY3LjgzLDAgMzA0LjM4LDEzNi40OTIgMzA0LjM4LDMwNC4zMzIgMCwzNy4wNzggLTYuNjIsNzIuNjI5IC0xOS4wMywxMDYuMTI5IDE1Ny43OCw1Ni44NzkgMjY2LjI3LDIwOS4xMjkgMjY2LjI3LDM3OC4xNCIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDE2IgogICAgICAgICBzdHlsZT0iZmlsbDojZmFjZjA5O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDc5Ny44OTgsMTE1MC45MyA0NDQuMDcyLC0yMDIuNDUgNDQ4LjA1LDM5Mi41OCBjIDYuNDksMzIuMzkgOS42Niw2NC42NyA5LjY2LDk4LjQ2IDAsMjc2LjIzIC0yMjQuNjgsNTAwLjk1IC01MDAuOSw1MDAuOTUgLTE2NS4yNCwwIC0zMTkuMzcsLTgxLjM2IC00MTMuMDUzLC0yMTcuNzkgbCAtNzQuNTI0LC0zODYuNjQgODYuNjk1LC0xODUuMTEiIC8+PHBhdGgKICAgICAgICAgaWQ9InBhdGgxOCIKICAgICAgICAgc3R5bGU9ImZpbGw6IzQ5YzFhZTtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIKICAgICAgICAgZD0ibSAzMzguMjIzLDY4MC42NzIgYyAtNi40ODksLTMyLjM4MyAtOS44MDksLTY1Ljk4MSAtOS44MDksLTk5Ljk3MyAwLC0yNzYuOTI5IDIyNS4zMzYsLTUwMi4yNTc2IDUwMi4zMTMsLTUwMi4yNTc2IDE2Ni41OTMsMCAzMjEuNDczLDgyLjExNzYgNDE1LjAxMywyMTkuOTQ5NiBsIDczLjk3LDM4NS4zNDcgLTk4LjcyLDE4OC42MjEgTCA3NzUuMTU2LDEwNzUuNTcgMzM4LjIyMyw2ODAuNjcyIiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjAiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNlZjI5OWI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMzM1LjQxLDE0NDkuMTggMzA0LjMzMiwtNzEuODYgNjYuNjgsMzQ2LjAyIGMgLTQxLjU4NiwzMS43OCAtOTIuOTMsNDkuMTggLTE0NS43MzEsNDkuMTggLTEzMi4yNSwwIC0yMzkuODEyLC0xMDcuNjEgLTIzOS44MTIsLTIzOS44NyAwLC0yOS4yMSA0Ljg3OSwtNTcuMjIgMTQuNTMxLC04My40NyIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDIyIgogICAgICAgICBzdHlsZT0iZmlsbDojNGNhYmU0O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJNIDMwOC45OTIsMTM3Ni43IEMgMTczLjAyLDEzMzEuNjQgNzguNDgwNSwxMjAxLjMgNzguNDgwNSwxMDU3LjkzIDc4LjQ4MDUsOTE4LjM0IDE2NC44Miw3OTMuNjggMjk0LjQwNiw3NDQuMzUyIGwgNDI2Ljk4MSwzODUuOTM4IC03OC4zOTUsMTY3LjUxIC0zMzQsNzguOSIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDI0IgogICAgICAgICBzdHlsZT0iZmlsbDojODVjZTI2O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDEzMjMuOCwyOTguNDEgYyA0MS43NCwtMzIuMDkgOTIuODMsLTQ5LjU5IDE0NC45OCwtNDkuNTkgMTMyLjI1LDAgMjM5LjgxLDEwNy41NTkgMjM5LjgxLDIzOS44MjEgMCwyOS4xNiAtNC44OCw1Ny4xNjggLTE0LjUzLDgzLjQxOCBsIC0zMDQuMDgsNzEuMTYgLTY2LjE4LC0zNDQuODA5IiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjYiCiAgICAgICAgIHN0eWxlPSJmaWxsOiMzMTc3YTc7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMTM4NS42Nyw3MjIuOTMgMzM0Ljc2LC03OC4zMDEgYyAxMzYuMDIsNDQuOTYxIDIzMC41NiwxNzUuMzUxIDIzMC41NiwzMTguNzYyIDAsMTM5LjMzOSAtODYuNTQsMjYzLjg1OSAtMjE2LjM4LDMxMy4wMzkgbCAtNDM3Ljg0LC0zODMuNTkgODguOSwtMTY5LjkxIiAvPjwvZz48L2c+PC9zdmc+ ------------- +Default: `null` |`mode` |`string` @@ -1669,6 +1725,20 @@ Default: `","` *Returns:* `string` +[float] +[[k_fns]] +== K + +[float] +[[kibana_fn]] +=== `kibana` + +Gets kibana global context + +*Accepts:* `kibana_context`, `null` + +*Returns:* `kibana_context` + [float] [[l_fns]] == L @@ -1771,27 +1841,29 @@ Adds a column calculated as the result of other columns. Changes are made only w |=== |Argument |Type |Description -|`id` - -|`string`, `null` -|An optional id of the resulting column. When no id is provided, the id will be looked up from the existing column by the provided name argument. If no column with this name exists yet, a new column with this name and an identical id will be added to the table. - |_Unnamed_ *** Aliases: `column`, `name` |`string` |The name of the resulting column. Names are not required to be unique. +|`copyMetaFrom` +|`string`, `null` +|If set, the meta object from the specified column id is copied over to the specified target column. If the column doesn't exist it silently fails. + +Default: `null` + |`expression` *** Aliases: `exp`, `fn`, `function` |`boolean`, `number`, `string`, `null` -|A Canvas expression that is passed to each row as a single row `datatable`. - -|`copyMetaFrom` +|An expression that is executed on every row, provided with a single-row `datatable` context and returning the cell value. +|`id` |`string`, `null` -|If set, the meta object from the specified column id is copied over to the specified target column. Throws an exception if the column doesn't exist +|An optional id of the resulting column. When no id is provided, the id will be looked up from the existing column by the provided name argument. If no column with this name exists yet, a new column with this name and an identical id will be added to the table. + +Default: `null` |=== *Returns:* `datatable` @@ -1851,33 +1923,29 @@ Alias: `expression` |`string` |An evaluated `TinyMath` expression. See https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html. -|`onError` - +|`onError` |`string` -|In case the `TinyMath` evaluation fails or returns NaN, the return value is specified by onError. For example, `"null"`, `"zero"`, `"false"`, `"throw"`. When `"throw"`, it will throw an exception, terminating expression execution. - -Default: `"throw"` +|In case the `TinyMath` evaluation fails or returns NaN, the return value is specified by onError. When `'throw'`, it will throw an exception, terminating expression execution (default). |=== -*Returns:* `number` | `boolean` | `null` +*Returns:* Depends on your input and arguments [float] [[mathColumn_fn]] === `mathColumn` -Adds a column by evaluating `TinyMath` on each row. This function is optimized for math, so it performs better than the <> with a <>. +Adds a column by evaluating TinyMath on each row. This function is optimized for math, so it performs better than the mapColumn with a math + *Accepts:* `datatable` [cols="3*^<"] |=== |Argument |Type |Description -|id *** -|`string` -|id of the resulting column. Must be unique. +|_Unnamed_ *** -|name *** +Aliases: `column`, `name` |`string` |The name of the resulting column. Names are not required to be unique. @@ -1885,19 +1953,21 @@ Adds a column by evaluating `TinyMath` on each row. This function is optimized f Alias: `expression` |`string` -|A `TinyMath` expression evaluated on each row. See https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html. - -|`onError` +|An evaluated `TinyMath` expression. See https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html. -|`string` -|In case the `TinyMath` evaluation fails or returns NaN, the return value is specified by onError. For example, `"null"`, `"zero"`, `"false"`, `"throw"`. When `"throw"`, it will throw an exception, terminating expression execution. +|`copyMetaFrom` +|`string`, `null` +|If set, the meta object from the specified column id is copied over to the specified target column. If the column doesn't exist it silently fails. -Default: `"throw"` +Default: `null` -|`copyMetaFrom` +|`id` *** +|`string` +|id of the resulting column. Must be unique. -|`string`, `null` -|If set, the meta object from the specified column id is copied over to the specified target column. Throws an exception if the column doesn't exist +|`onError` +|`string` +|In case the `TinyMath` evaluation fails or returns NaN, the return value is specified by onError. When `'throw'`, it will throw an exception, terminating expression execution (default). |=== *Returns:* `datatable` @@ -1991,17 +2061,41 @@ Alias: `color` |`string` |The palette colors. Accepts an HTML color name, HEX, HSL, HSLA, RGB, or RGBA. +|`continuity` +|`string` +| + +Default: `"above"` + |`gradient` |`boolean` |Make a gradient palette where supported? Default: `false` +|`range` +|`string` +| + +Default: `"percent"` + +|`rangeMax` +|`number` +| + +|`rangeMin` +|`number` +| + |`reverse` |`boolean` |Reverse the palette? Default: `false` + +|`stop` † +|`number` +|The palette color stops. When used, it must be associated with each color. |=== *Returns:* `palette` @@ -2262,6 +2356,40 @@ Default: `20` [[r_fns]] == R +[float] +[[removeFilter_fn]] +=== `removeFilter` + +Removes filters from context + +*Accepts:* `kibana_context` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `group` +|`string` +|Removes only filters belonging to the provided group + +|`from` +|`string` +|Removes only filters owned by the provided id + +|`ungrouped` + +Aliases: `nogroup`, `nogroups` +|`boolean` +|Should filters without group be removed + +Default: `false` +|=== + +*Returns:* `kibana_context` + + [float] [[render_fn]] === `render` @@ -2316,14 +2444,10 @@ Default: `null` |`string`, `null` |The image to repeat. Provide an image asset as a `base64` data URL, or pass in a sub-expression. -Example value for the `image` argument, formatted as a `base64` data URL: -[source, url] ------------- -data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E ------------- +Default: `null` |`max` -|`number` +|`number`, `null` |The maximum number of times the image can repeat. Default: `1000` @@ -2396,11 +2520,7 @@ Default: `null` |`string`, `null` |The image to reveal. Provide an image asset as a `base64` data URL, or pass in a sub-expression. -Example value for the `image` argument, formatted as a `base64` data URL: -[source, url] ------------- -data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E ------------- +Default: `null` |`origin` |`string` @@ -2449,99 +2569,37 @@ Returns the number of rows. Pairs with <> to get the count of unique col == S [float] -[[savedLens_fn]] -=== `savedLens` - -Returns an embeddable for a saved Lens visualization object. - -*Accepts:* `any` - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|`id` -|`string` -|The ID of the saved Lens visualization object - -|`timerange` -|`timerange` -|The timerange of data that should be included - -|`title` -|`string` -|The title for the Lens visualization object -|=== - -*Returns:* `embeddable` - - -[float] -[[savedMap_fn]] -=== `savedMap` +[[selectFilter_fn]] +=== `selectFilter` -Returns an embeddable for a saved map object. +Selects filters from context -*Accepts:* `any` +*Accepts:* `kibana_context` [cols="3*^<"] |=== |Argument |Type |Description -|`center` -|`mapCenter` -|The center and zoom level the map should have - -|`hideLayer` † -|`string` -|The IDs of map layers that should be hidden +|_Unnamed_ † -|`id` +Alias: `group` |`string` -|The ID of the saved map object +|Select only filters belonging to the provided group -|`timerange` -|`timerange` -|The timerange of data that should be included - -|`title` +|`from` |`string` -|The title for the map -|=== - -*Returns:* `embeddable` - - -[float] -[[savedVisualization_fn]] -=== `savedVisualization` - -Returns an embeddable for a saved visualization object. - -*Accepts:* `any` - -[cols="3*^<"] -|=== -|Argument |Type |Description +|Select only filters owned by the provided id -|`colors` † -|`seriesStyle` -|Defines the color to use for a specific series +|`ungrouped` -|`hideLegend` +Aliases: `nogroup`, `nogroups` |`boolean` -|Specifies the option to hide the legend +|Should filters without group be included -|`id` -|`string` -|The ID of the saved visualization object - -|`timerange` -|`timerange` -|The timerange of data that should be included +Default: `false` |=== -*Returns:* `embeddable` +*Returns:* `kibana_context` [float] @@ -2641,7 +2699,7 @@ Default: `"black"` Default: `false` |=== -*Returns:* `shape` +*Returns:* Depends on your input and arguments [float] @@ -2676,7 +2734,7 @@ Default: `false` [[staticColumn_fn]] === `staticColumn` -Adds a column with the same static value in every row. See also <>, <>, and <>. +Adds a column with the same static value in every row. See also <>, <>, and <> *Accepts:* `datatable` @@ -2994,7 +3052,7 @@ Alias: `type` Returns a UI settings parameter value. -*Accepts:* `null` +*Accepts:* `any` [cols="3*^<"] |=== @@ -3002,18 +3060,17 @@ Returns a UI settings parameter value. |_Unnamed_ *** -Aliases: `parameter` +Alias: `parameter` |`string` |The parameter name. |`default` |`any` |A default value in case of the parameter is not set. - -Default: `null` |=== -*Returns:* `ui_setting` +*Returns:* Depends on your input and arguments + [float] [[urlparam_fn]] @@ -3080,13 +3137,13 @@ Updates the Kibana global context. |=== |Argument |Type |Description -|_Unnamed_ *** +|_Unnamed_ *** † Alias: `name` |`string` |Specify the name of the variable. -|`value` +|`value` † Alias: `val` |`any` diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index c79189c1423dc..2dd78be3c1012 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -384,6 +384,10 @@ The plugin exposes the static DefaultEditorController class to consume. |The cloud plugin adds Cloud-specific features to Kibana. +|{kib-repo}blob/{branch}/x-pack/plugins/cloud_security_posture/README.md[cloudSecurityPosture] +|Cloud Posture automates the identification and remediation of risks across cloud infrastructures + + |{kib-repo}blob/{branch}/x-pack/plugins/cross_cluster_replication/README.md[crossClusterReplication] |You can run a local cluster and simulate a remote cluster within a single Kibana directory. diff --git a/docs/discover/document-explorer.asciidoc b/docs/discover/document-explorer.asciidoc index 99447a2478b3a..de7b07aa4d784 100644 --- a/docs/discover/document-explorer.asciidoc +++ b/docs/discover/document-explorer.asciidoc @@ -6,8 +6,19 @@ beta::[] *Discover* has a *Document Explorer* with resizable columns, better data sorting and comparison, and a fullscreen view. -[role="screenshot"] -image::images/document-explorer.png[Document Explorer with improved look over classic view] +++++ + + +
+++++ To use the *Document Explorer* instead of the classic document table: diff --git a/docs/discover/images/document-explorer.png b/docs/discover/images/document-explorer.png deleted file mode 100644 index 75d2826869a1d..0000000000000 Binary files a/docs/discover/images/document-explorer.png and /dev/null differ diff --git a/docs/maps/images/gs_add_cloropeth_layer.png b/docs/maps/images/gs_add_cloropeth_layer.png index 42e00ccc5dd24..10774c69adbba 100644 Binary files a/docs/maps/images/gs_add_cloropeth_layer.png and b/docs/maps/images/gs_add_cloropeth_layer.png differ diff --git a/docs/maps/images/gs_add_es_document_layer.png b/docs/maps/images/gs_add_es_document_layer.png index d7616c4b11fe0..4656933552f26 100644 Binary files a/docs/maps/images/gs_add_es_document_layer.png and b/docs/maps/images/gs_add_es_document_layer.png differ diff --git a/docs/maps/images/gs_dashboard_with_map.png b/docs/maps/images/gs_dashboard_with_map.png index fdd4cc976d105..b7d4a7b63ed30 100644 Binary files a/docs/maps/images/gs_dashboard_with_map.png and b/docs/maps/images/gs_dashboard_with_map.png differ diff --git a/docs/maps/images/gs_dashboard_with_terms_filter.png b/docs/maps/images/gs_dashboard_with_terms_filter.png index ad88fe9db8179..1876cad733b26 100644 Binary files a/docs/maps/images/gs_dashboard_with_terms_filter.png and b/docs/maps/images/gs_dashboard_with_terms_filter.png differ diff --git a/docs/maps/images/sample_data_web_logs.png b/docs/maps/images/sample_data_web_logs.png index e4902c3e89610..76ff9c0d16221 100644 Binary files a/docs/maps/images/sample_data_web_logs.png and b/docs/maps/images/sample_data_web_logs.png differ diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc index 89d06fce60183..a85586fc43188 100644 --- a/docs/maps/maps-getting-started.asciidoc +++ b/docs/maps/maps-getting-started.asciidoc @@ -97,8 +97,6 @@ The layer is only visible when users zoom in. . Set **Data view** to **kibana_sample_data_logs**. -. Set **Scaling** to *Limits results to 10000.* - . Click **Add layer**. . In **Layer settings**, set: @@ -109,6 +107,8 @@ The layer is only visible when users zoom in. . Add a tooltip field and select **agent**, **bytes**, **clientip**, **host**, **machine.os**, **request**, **response**, and **timestamp**. +. In **Scaling**, set *Limits results to 10,000.* + . In **Layer style**, set **Fill color** to **#2200FF**. . Click **Save & close**. diff --git a/docs/maps/vector-layer.asciidoc b/docs/maps/vector-layer.asciidoc index f70e4d59796cc..cf6dd5334b07e 100644 --- a/docs/maps/vector-layer.asciidoc +++ b/docs/maps/vector-layer.asciidoc @@ -33,6 +33,10 @@ When a tile exceeds `index.max_result_window`, results exceeding `index.max_resu *EMS Boundaries*:: Administrative boundaries from https://www.elastic.co/elastic-maps-service[Elastic Maps Service]. +*ML Anomalies*:: Points and lines associated with anomalies. The {anomaly-job} +must use a `lat_long` function. Go to +{ml-docs}/geographic-anomalies.html[Detecting anomalous locations in geographic data] for an example. + *Point to point*:: Aggregated data paths between the source and destination. The index must contain at least 2 fields mapped as {ref}/geo-point.html[geo_point], source and destination. diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index 1b8d467713ab8..e7969191ee646 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -193,4 +193,11 @@ Specifies the default timeout for the all rule types tasks. The time is formatte For example, `20m`, `24h`, `7d`, `1w`. Default: `5m`. `xpack.alerting.cancelAlertsOnRuleTimeout`:: -Specifies whether to skip writing alerts and scheduling actions if rule execution is cancelled due to timeout. Default: `true`. This setting can be overridden by individual rule types. \ No newline at end of file +Specifies whether to skip writing alerts and scheduling actions if rule execution is cancelled due to timeout. Default: `true`. This setting can be overridden by individual rule types. + +`xpack.alerting.minimumScheduleInterval`:: +Specifies the minimum interval allowed for the all rules. This minimum is enforced for all rules created or updated after the introduction of this setting. The time is formatted as: ++ +`[s,m,h,d]` ++ +For example, `20m`, `24h`, `7d`. Default: `1m`. \ No newline at end of file diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc index d8bc26b7b3987..a328700ebeb5f 100644 --- a/docs/settings/monitoring-settings.asciidoc +++ b/docs/settings/monitoring-settings.asciidoc @@ -29,50 +29,47 @@ For more information, see [[monitoring-general-settings]] ==== General monitoring settings -[cols="2*<"] -|=== -| `monitoring.ui.ccs.enabled` - | Set to `true` (default) to enable {ref}/modules-cross-cluster-search.html[cross-cluster search] of your monitoring data. The {ref}/modules-remote-clusters.html#remote-cluster-settings[`remote_cluster_client`] role must exist on each node. - - -| `monitoring.ui.elasticsearch.hosts` - | Specifies the location of the {es} cluster where your monitoring data is stored. - By default, this is the same as <>. This setting enables - you to use a single {kib} instance to search and visualize data in your - production cluster as well as monitor data sent to a dedicated monitoring - cluster. - -| `monitoring.ui.elasticsearch.username` - | Specifies the username used by {kib} monitoring to establish a persistent connection - in {kib} to the {es} monitoring cluster and to verify licensing status on the {es} - monitoring cluster. + - + - Every other request performed by *{stack-monitor-app}* to the monitoring {es} - cluster uses the authenticated user's credentials, which must be the same on - both the {es} monitoring cluster and the {es} production cluster. + - + - If not set, {kib} uses the value of the <> setting. - -| `monitoring.ui.elasticsearch.password` - | Specifies the password used by {kib} monitoring to establish a persistent connection - in {kib} to the {es} monitoring cluster and to verify licensing status on the {es} - monitoring cluster. + - + - Every other request performed by *{stack-monitor-app}* to the monitoring {es} - cluster uses the authenticated user's credentials, which must be the same on - both the {es} monitoring cluster and the {es} production cluster. + - + - If not set, {kib} uses the value of the <> setting. - -| `monitoring.ui.elasticsearch.pingTimeout` - | Specifies the time in milliseconds to wait for {es} to respond to internal - health checks. By default, it matches the <> setting, - which has a default value of `30000`. - -| `monitoring.ui.elasticsearch.ssl` - | Shares the same configuration as <>. These settings configure encrypted communication between {kib} and the monitoring cluster. - -|=== +`monitoring.ui.ccs.enabled`:: +Set to `true` (default) to enable {ref}/modules-cross-cluster-search.html[cross-cluster search] of your monitoring data. The {ref}/modules-remote-clusters.html#remote-cluster-settings[`remote_cluster_client`] role must exist on each node. + + +`monitoring.ui.elasticsearch.hosts`:: +Specifies the location of the {es} cluster where your monitoring data is stored. ++ +By default, this is the same as <>. This setting enables +you to use a single {kib} instance to search and visualize data in your +production cluster as well as monitor data sent to a dedicated monitoring +cluster. + +`monitoring.ui.elasticsearch.username`:: +Specifies the username used by {kib} monitoring to establish a persistent connection +in {kib} to the {es} monitoring cluster and to verify licensing status on the {es} +monitoring cluster. ++ +Every other request performed by *{stack-monitor-app}* to the monitoring {es} +cluster uses the authenticated user's credentials, which must be the same on +both the {es} monitoring cluster and the {es} production cluster. ++ +If not set, {kib} uses the value of the <> setting. + +`monitoring.ui.elasticsearch.password`:: +Specifies the password used by {kib} monitoring to establish a persistent connection +in {kib} to the {es} monitoring cluster and to verify licensing status on the {es} +monitoring cluster. ++ +Every other request performed by *{stack-monitor-app}* to the monitoring {es} +cluster uses the authenticated user's credentials, which must be the same on +both the {es} monitoring cluster and the {es} production cluster. ++ +If not set, {kib} uses the value of the <> setting. + +`monitoring.ui.elasticsearch.pingTimeout`:: +Specifies the time in milliseconds to wait for {es} to respond to internal +health checks. By default, it matches the <> setting, +which has a default value of `30000`. + +`monitoring.ui.elasticsearch.ssl`:: +Shares the same configuration as <>. These settings configure encrypted communication between {kib} and the monitoring cluster. [float] [[monitoring-collection-settings]] @@ -80,18 +77,14 @@ For more information, see These settings control how data is collected from {kib}. -[cols="2*<"] -|=== -| `monitoring.kibana.collection.enabled` - | Set to `true` (default) to enable data collection from the {kib} NodeJS server - for {kib} dashboards to be featured in *{stack-monitor-app}*. +`monitoring.kibana.collection.enabled`:: +Set to `true` (default) to enable data collection from the {kib} NodeJS server +for {kib} dashboards to be featured in *{stack-monitor-app}*. -| `monitoring.kibana.collection.interval` {ess-icon} - | Specifies the number of milliseconds to wait in between data sampling on the - {kib} NodeJS server for the metrics that are displayed in the {kib} dashboards. - Defaults to `10000` (10 seconds). - -|=== +`monitoring.kibana.collection.interval` {ess-icon}:: +Specifies the number of milliseconds to wait in between data sampling on the +{kib} NodeJS server for the metrics that are displayed in the {kib} dashboards. +Defaults to `10000` (10 seconds). [float] [[monitoring-ui-settings]] @@ -102,36 +95,32 @@ However, the defaults work best in most circumstances. For more information about configuring {kib}, see {kibana-ref}/settings.html[Setting {kib} server properties]. -[cols="2*<"] -|=== -| `monitoring.ui.elasticsearch.logFetchCount` - | Specifies the number of log entries to display in *{stack-monitor-app}*. - Defaults to `10`. The maximum value is `50`. - -|[[monitoring-ui-enabled]] `monitoring.ui.enabled` - | Set to `false` to hide *{stack-monitor-app}*. The monitoring back-end - continues to run as an agent for sending {kib} stats to the monitoring - cluster. Defaults to `true`. - -| `monitoring.ui.logs.index` - | Specifies the name of the indices that are shown on the - <> page in *{stack-monitor-app}*. The default value - is `filebeat-*`. - -| `monitoring.ui.max_bucket_size` - | Specifies the number of term buckets to return out of the overall terms list when - performing terms aggregations to retrieve index and node metrics. For more - information about the `size` parameter, see - {ref}/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size[Terms Aggregation]. - Defaults to `10000`. - -| `monitoring.ui.min_interval_seconds` {ess-icon} - | Specifies the minimum number of seconds that a time bucket in a chart can - represent. Defaults to 10. If you modify the - `monitoring.ui.collection.interval` in `elasticsearch.yml`, use the same - value in this setting. - -|=== +`monitoring.ui.elasticsearch.logFetchCount`:: +Specifies the number of log entries to display in *{stack-monitor-app}*. +Defaults to `10`. The maximum value is `50`. + +[[monitoring-ui-enabled]] `monitoring.ui.enabled`:: +Set to `false` to hide *{stack-monitor-app}*. The monitoring back-end +continues to run as an agent for sending {kib} stats to the monitoring +cluster. Defaults to `true`. + +`monitoring.ui.logs.index`:: +Specifies the name of the indices that are shown on the +<> page in *{stack-monitor-app}*. The default value +is `filebeat-*`. + +`monitoring.ui.max_bucket_size`:: +Specifies the number of term buckets to return out of the overall terms list when +performing terms aggregations to retrieve index and node metrics. For more +information about the `size` parameter, see +{ref}/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size[Terms Aggregation]. +Defaults to `10000`. + +`monitoring.ui.min_interval_seconds` {ess-icon}:: +Specifies the minimum number of seconds that a time bucket in a chart can +represent. Defaults to 10. If you modify the +`monitoring.ui.collection.interval` in `elasticsearch.yml`, use the same +value in this setting. [float] [[monitoring-ui-cgroup-settings]] @@ -142,20 +131,16 @@ better decisions about your container performance, rather than guessing based on the overall machine performance. If you are not running your applications in a container, then Cgroup statistics are not useful. -[cols="2*<"] -|=== -| `monitoring.ui.container.elasticsearch.enabled` {ess-icon} - | For {es} clusters that are running in containers, this setting changes the - *Node Listing* to display the CPU utilization based on the reported Cgroup - statistics. It also adds the calculated Cgroup CPU utilization to the - *Node Overview* page instead of the overall operating system's CPU - utilization. Defaults to `false`. - -| `monitoring.ui.container.logstash.enabled` - | For {ls} nodes that are running in containers, this setting - changes the {ls} *Node Listing* to display the CPU utilization - based on the reported Cgroup statistics. It also adds the - calculated Cgroup CPU utilization to the {ls} node detail - pages instead of the overall operating system’s CPU utilization. Defaults to `false`. - -|=== +`monitoring.ui.container.elasticsearch.enabled` {ess-icon}:: +For {es} clusters that are running in containers, this setting changes the +*Node Listing* to display the CPU utilization based on the reported Cgroup +statistics. It also adds the calculated Cgroup CPU utilization to the +*Node Overview* page instead of the overall operating system's CPU +utilization. Defaults to `false`. + +`monitoring.ui.container.logstash.enabled`:: +For {ls} nodes that are running in containers, this setting +changes the {ls} *Node Listing* to display the CPU utilization +based on the reported Cgroup statistics. It also adds the +calculated Cgroup CPU utilization to the {ls} node detail +pages instead of the overall operating system’s CPU utilization. Defaults to `false`. diff --git a/nav-kibana-dev.docnav.json b/nav-kibana-dev.docnav.json index 7a1e9ea323ed8..a86772d3ef27f 100644 --- a/nav-kibana-dev.docnav.json +++ b/nav-kibana-dev.docnav.json @@ -67,6 +67,7 @@ { "category": "Contributors Newsletters", "items": [ + { "id": "kibFebruary2022ContributorNewsletter" }, { "id": "kibJanuary2022ContributorNewsletter" }, { "id": "kibDecember2021ContributorNewsletter" }, { "id": "kibNovember2021ContributorNewsletter" }, diff --git a/package.json b/package.json index 72309e07bde77..fdb358c25fb83 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace", "@elastic/charts": "43.1.1", "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", - "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.1.0-canary.2", + "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.1.0-canary.3", "@elastic/ems-client": "8.0.0", "@elastic/eui": "48.1.1", "@elastic/filesaver": "1.1.2", @@ -218,7 +218,7 @@ "constate": "^1.3.2", "content-disposition": "0.5.3", "copy-to-clipboard": "^3.0.8", - "core-js": "^3.21.0", + "core-js": "^3.21.1", "cronstrue": "^1.51.0", "cytoscape": "^3.10.0", "cytoscape-dagre": "^2.2.2", @@ -680,7 +680,7 @@ "@types/redux-actions": "^2.6.1", "@types/redux-logger": "^3.0.8", "@types/seedrandom": ">=2.0.0 <4.0.0", - "@types/selenium-webdriver": "^4.0.16", + "@types/selenium-webdriver": "^4.0.18", "@types/semver": "^7", "@types/set-value": "^2.0.0", "@types/sinon": "^7.0.13", @@ -733,11 +733,11 @@ "babel-plugin-require-context-hook": "^1.0.0", "babel-plugin-styled-components": "^2.0.2", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", - "backport": "7.0.1", + "backport": "^7.3.1", "callsites": "^3.1.0", "chai": "3.5.0", "chance": "1.0.18", - "chromedriver": "^97.0.2", + "chromedriver": "^98.0.0", "clean-webpack-plugin": "^3.0.0", "cmd-shim": "^2.1.0", "compression-webpack-plugin": "^4.0.0", diff --git a/packages/elastic-apm-synthtrace/BUILD.bazel b/packages/elastic-apm-synthtrace/BUILD.bazel index 7fb188de435b6..09406644f44b2 100644 --- a/packages/elastic-apm-synthtrace/BUILD.bazel +++ b/packages/elastic-apm-synthtrace/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "elastic-apm-synthtrace" PKG_REQUIRE_NAME = "@elastic/apm-synthtrace" -TYPES_PKG_REQUIRE_NAME = "@types/elastic__apm-synthtrace" SOURCE_FILES = glob( [ @@ -67,11 +66,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", validate = False, ) @@ -103,7 +100,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/elastic-apm-synthtrace/tsconfig.json b/packages/elastic-apm-synthtrace/tsconfig.json index 6ae9c20b4387b..9d9a6ecc6b2b6 100644 --- a/packages/elastic-apm-synthtrace/tsconfig.json +++ b/packages/elastic-apm-synthtrace/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "./src", - "sourceMap": true, - "sourceRoot": "../../../../packages/elastic-apm-synthtrace/src", "types": ["node", "jest"] }, "include": ["./src/**/*.ts"] diff --git a/packages/elastic-datemath/BUILD.bazel b/packages/elastic-datemath/BUILD.bazel index b4ed018fe9d04..1ee7f8582cb7e 100644 --- a/packages/elastic-datemath/BUILD.bazel +++ b/packages/elastic-datemath/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "ts_project", "pkg_npm", "p PKG_BASE_NAME = "elastic-datemath" PKG_REQUIRE_NAME = "@elastic/datemath" -TYPES_PKG_REQUIRE_NAME = "@types/elastic__datemath" SOURCE_FILES = glob([ "src/index.ts", @@ -50,10 +49,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig" ) @@ -85,7 +82,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/elastic-datemath/tsconfig.json b/packages/elastic-datemath/tsconfig.json index 02465bebe519a..3f81ea4e68516 100644 --- a/packages/elastic-datemath/tsconfig.json +++ b/packages/elastic-datemath/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/elastic-datemath/src", "types": [ "node" ] diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel index c674f9ae8e00f..583d81ce847bd 100644 --- a/packages/kbn-ace/BUILD.bazel +++ b/packages/kbn-ace/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-ace" PKG_REQUIRE_NAME = "@kbn/ace" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__ace" SOURCE_FILES = glob( [ @@ -68,10 +67,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -103,7 +100,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ace/tsconfig.json b/packages/kbn-ace/tsconfig.json index 4a132efa09118..0fd9a15b5dbf8 100644 --- a/packages/kbn-ace/tsconfig.json +++ b/packages/kbn-ace/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-ace/src", "stripInternal": true, "types": ["node"] }, diff --git a/packages/kbn-alerts/BUILD.bazel b/packages/kbn-alerts/BUILD.bazel index a6e5f167735c0..e6ebdaa202701 100644 --- a/packages/kbn-alerts/BUILD.bazel +++ b/packages/kbn-alerts/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-alerts" PKG_REQUIRE_NAME = "@kbn/alerts" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__alerts" SOURCE_FILES = glob( [ @@ -74,11 +73,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -109,7 +106,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-alerts/tsconfig.json b/packages/kbn-alerts/tsconfig.json index ac523fb77a9e1..dfe59c663d3e1 100644 --- a/packages/kbn-alerts/tsconfig.json +++ b/packages/kbn-alerts/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-alerts/src", "types": ["jest", "node"] }, "include": ["src/**/*"], diff --git a/packages/kbn-analytics/BUILD.bazel b/packages/kbn-analytics/BUILD.bazel index 94e65b2e35ba3..d144ab186a6a1 100644 --- a/packages/kbn-analytics/BUILD.bazel +++ b/packages/kbn-analytics/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-analytics" PKG_REQUIRE_NAME = "@kbn/analytics" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__analytics" SOURCE_FILES = glob( [ @@ -71,11 +70,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -106,7 +103,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-analytics/tsconfig.json b/packages/kbn-analytics/tsconfig.json index dfae54ad91c8e..de4301e2a2ac0 100644 --- a/packages/kbn-analytics/tsconfig.json +++ b/packages/kbn-analytics/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "isolatedModules": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../../packages/kbn-analytics/src", "stripInternal": true, "types": [ "node" diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index a18a5e973d3a0..bcdbefb132aa6 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-apm-config-loader" PKG_REQUIRE_NAME = "@kbn/apm-config-loader" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__apm-config-loader" SOURCE_FILES = glob( [ @@ -66,10 +65,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -101,7 +98,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-config-loader/tsconfig.json b/packages/kbn-apm-config-loader/tsconfig.json index 2f6da800d9dd2..7d2597d318b31 100644 --- a/packages/kbn-apm-config-loader/tsconfig.json +++ b/packages/kbn-apm-config-loader/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "./src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-apm-config-loader/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-apm-utils/BUILD.bazel b/packages/kbn-apm-utils/BUILD.bazel index c8ad4d1a09625..9ca9009bb7186 100644 --- a/packages/kbn-apm-utils/BUILD.bazel +++ b/packages/kbn-apm-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-apm-utils" PKG_REQUIRE_NAME = "@kbn/apm-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__apm-utils" SOURCE_FILES = glob([ "src/index.ts", @@ -51,10 +50,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -86,7 +83,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-apm-utils/tsconfig.json b/packages/kbn-apm-utils/tsconfig.json index d7056cda6d71a..9c8c443436ce5 100644 --- a/packages/kbn-apm-utils/tsconfig.json +++ b/packages/kbn-apm-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-apm-utils/src", "types": [ "node" ] diff --git a/packages/kbn-cli-dev-mode/BUILD.bazel b/packages/kbn-cli-dev-mode/BUILD.bazel index 133474a3aefa6..4b45e34b7e9fa 100644 --- a/packages/kbn-cli-dev-mode/BUILD.bazel +++ b/packages/kbn-cli-dev-mode/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-cli-dev-mode" PKG_REQUIRE_NAME = "@kbn/cli-dev-mode" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__cli-dev-mode" SOURCE_FILES = glob( [ @@ -93,11 +92,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -128,7 +125,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-cli-dev-mode/tsconfig.json b/packages/kbn-cli-dev-mode/tsconfig.json index 6ce2e21b84674..4ba84d786cb4b 100644 --- a/packages/kbn-cli-dev-mode/tsconfig.json +++ b/packages/kbn-cli-dev-mode/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "./src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-cli-dev-mode/src", "types": [ "jest", "node" diff --git a/packages/kbn-config-schema/BUILD.bazel b/packages/kbn-config-schema/BUILD.bazel index ed6082527bab9..e496aa31b49d3 100644 --- a/packages/kbn-config-schema/BUILD.bazel +++ b/packages/kbn-config-schema/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-config-schema" PKG_REQUIRE_NAME = "@kbn/config-schema" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__config-schema" SOURCE_FILES = glob([ "src/**/*.ts", @@ -62,10 +61,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -97,7 +94,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config-schema/tsconfig.json b/packages/kbn-config-schema/tsconfig.json index 79b652daf7ec1..e1125366bc390 100644 --- a/packages/kbn-config-schema/tsconfig.json +++ b/packages/kbn-config-schema/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-config-schema/src", "stripInternal": true, "types": [ "jest", diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index 0577014768d4c..e242cf5c92622 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-config" PKG_REQUIRE_NAME = "@kbn/config" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__config" SOURCE_FILES = glob( [ @@ -83,10 +82,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -118,7 +115,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-config/tsconfig.json b/packages/kbn-config/tsconfig.json index 0971923a11a0f..a684de9502b5e 100644 --- a/packages/kbn-config/tsconfig.json +++ b/packages/kbn-config/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-config/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel index f71c8b866fd5d..de8c97ed3b713 100644 --- a/packages/kbn-crypto/BUILD.bazel +++ b/packages/kbn-crypto/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-crypto" PKG_REQUIRE_NAME = "@kbn/crypto" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__crypto" SOURCE_FILES = glob( [ @@ -29,7 +28,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:build", "@npm//node-forge", ] @@ -62,10 +61,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -97,7 +94,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-crypto/tsconfig.json b/packages/kbn-crypto/tsconfig.json index 0863fc3f530de..272363e976ba1 100644 --- a/packages/kbn-crypto/tsconfig.json +++ b/packages/kbn-crypto/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-crypto/src", "types": [ "jest", "node" diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel index 65e0957fe5d90..7be527c65a06c 100644 --- a/packages/kbn-dev-utils/BUILD.bazel +++ b/packages/kbn-dev-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-dev-utils" PKG_REQUIRE_NAME = "@kbn/dev-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__dev-utils" SOURCE_FILES = glob( [ @@ -114,10 +113,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -149,7 +146,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-dev-utils/tsconfig.json b/packages/kbn-dev-utils/tsconfig.json index 3c22642edfaa1..a8cfc2cceb08b 100644 --- a/packages/kbn-dev-utils/tsconfig.json +++ b/packages/kbn-dev-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-dev-utils/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-doc-links/BUILD.bazel b/packages/kbn-doc-links/BUILD.bazel index b4ae92aa8050b..13b68935c4326 100644 --- a/packages/kbn-doc-links/BUILD.bazel +++ b/packages/kbn-doc-links/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-doc-links" PKG_REQUIRE_NAME = "@kbn/doc-links" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__doc-links" SOURCE_FILES = glob( [ @@ -61,10 +60,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -96,7 +93,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 5f4c07ee6067c..d73760b280d49 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -544,6 +544,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { lowercase: `${ELASTICSEARCH_DOCS}lowercase-processor.html`, pipeline: `${ELASTICSEARCH_DOCS}pipeline-processor.html`, pipelines: `${ELASTICSEARCH_DOCS}ingest.html`, + csvPipelines: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${DOC_LINK_VERSION}/ecs-converting.html`, pipelineFailure: `${ELASTICSEARCH_DOCS}ingest.html#handling-pipeline-failures`, processors: `${ELASTICSEARCH_DOCS}processors.html`, remove: `${ELASTICSEARCH_DOCS}remove-processor.html`, diff --git a/packages/kbn-doc-links/tsconfig.json b/packages/kbn-doc-links/tsconfig.json index e2178f72072e9..a684de9502b5e 100644 --- a/packages/kbn-doc-links/tsconfig.json +++ b/packages/kbn-doc-links/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-doc-links/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-docs-utils/BUILD.bazel b/packages/kbn-docs-utils/BUILD.bazel index ad6b6687b7e1a..30baa9dccb7f7 100644 --- a/packages/kbn-docs-utils/BUILD.bazel +++ b/packages/kbn-docs-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-docs-utils" PKG_REQUIRE_NAME = "@kbn/docs-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__docs-utils" SOURCE_FILES = glob( [ @@ -67,10 +66,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -102,7 +99,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-docs-utils/tsconfig.json b/packages/kbn-docs-utils/tsconfig.json index fa20d6f4be398..9a68b2e81940c 100644 --- a/packages/kbn-docs-utils/tsconfig.json +++ b/packages/kbn-docs-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-docs-utils/src", "types": [ "jest", "node" diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel index fed3f248c0995..70bda4c67106f 100644 --- a/packages/kbn-es-archiver/BUILD.bazel +++ b/packages/kbn-es-archiver/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-es-archiver" PKG_REQUIRE_NAME = "@kbn/es-archiver" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__es-archiver" SOURCE_FILES = glob( [ @@ -80,10 +79,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -115,7 +112,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-archiver/tsconfig.json b/packages/kbn-es-archiver/tsconfig.json index 15c846f052b47..92bc23ab6616b 100644 --- a/packages/kbn-es-archiver/tsconfig.json +++ b/packages/kbn-es-archiver/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-es-archiver/src", "types": [ "jest", "node" diff --git a/packages/kbn-es-query/BUILD.bazel b/packages/kbn-es-query/BUILD.bazel index 84ee5584ceabe..c7d8ad33cf7f6 100644 --- a/packages/kbn-es-query/BUILD.bazel +++ b/packages/kbn-es-query/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-es-query" PKG_REQUIRE_NAME = "@kbn/es-query" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__es-query" SOURCE_FILES = glob( [ @@ -94,10 +93,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -129,7 +126,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-query/tsconfig.json b/packages/kbn-es-query/tsconfig.json index 5b1f3be263138..4b2faade0d50a 100644 --- a/packages/kbn-es-query/tsconfig.json +++ b/packages/kbn-es-query/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-es-query/src", "types": [ "jest", "node" diff --git a/packages/kbn-es/src/cli_commands/archive.js b/packages/kbn-es/src/cli_commands/archive.js index c92ed98ce03fc..96ffc1fec34c2 100644 --- a/packages/kbn-es/src/cli_commands/archive.js +++ b/packages/kbn-es/src/cli_commands/archive.js @@ -10,6 +10,7 @@ const dedent = require('dedent'); const getopts = require('getopts'); const { Cluster } = require('../cluster'); const { createCliError } = require('../errors'); +const { parseTimeoutToMs } = require('../utils'); exports.description = 'Install and run from an Elasticsearch tar'; @@ -27,6 +28,8 @@ exports.help = (defaults = {}) => { --password.[user] Sets password for native realm user [default: ${password}] --ssl Sets up SSL on Elasticsearch -E Additional key=value settings to pass to Elasticsearch + --skip-ready-check Disable the ready check, + --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m Example: @@ -41,8 +44,13 @@ exports.run = async (defaults = {}) => { basePath: 'base-path', installPath: 'install-path', esArgs: 'E', + skipReadyCheck: 'skip-ready-check', + readyTimeout: 'ready-timeout', }, + string: ['ready-timeout'], + boolean: ['skip-ready-check'], + default: defaults, }); @@ -54,5 +62,8 @@ exports.run = async (defaults = {}) => { } const { installPath } = await cluster.installArchive(path, options); - await cluster.run(installPath, options); + await cluster.run(installPath, { + ...options, + readyTimeout: parseTimeoutToMs(options.readyTimeout), + }); }; diff --git a/packages/kbn-es/src/cli_commands/snapshot.js b/packages/kbn-es/src/cli_commands/snapshot.js index b89f1f8214813..1c902796a0a0c 100644 --- a/packages/kbn-es/src/cli_commands/snapshot.js +++ b/packages/kbn-es/src/cli_commands/snapshot.js @@ -10,6 +10,7 @@ const dedent = require('dedent'); const getopts = require('getopts'); import { ToolingLog, getTimeReporter } from '@kbn/dev-utils'; const { Cluster } = require('../cluster'); +const { parseTimeoutToMs } = require('../utils'); exports.description = 'Downloads and run from a nightly snapshot'; @@ -30,6 +31,8 @@ exports.help = (defaults = {}) => { --download-only Download the snapshot but don't actually start it --ssl Sets up SSL on Elasticsearch --use-cached Skips cache verification and use cached ES snapshot. + --skip-ready-check Disable the ready check, + --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m Example: @@ -53,11 +56,12 @@ exports.run = async (defaults = {}) => { dataArchive: 'data-archive', esArgs: 'E', useCached: 'use-cached', + skipReadyCheck: 'skip-ready-check', + readyTimeout: 'ready-timeout', }, - string: ['version'], - - boolean: ['download-only', 'use-cached'], + string: ['version', 'ready-timeout'], + boolean: ['download-only', 'use-cached', 'skip-ready-check'], default: defaults, }); @@ -82,6 +86,7 @@ exports.run = async (defaults = {}) => { reportTime, startTime: runStartTime, ...options, + readyTimeout: parseTimeoutToMs(options.readyTimeout), }); } }; diff --git a/packages/kbn-es/src/cli_commands/source.js b/packages/kbn-es/src/cli_commands/source.js index 5a4192ae7703c..c16e89e2c7f32 100644 --- a/packages/kbn-es/src/cli_commands/source.js +++ b/packages/kbn-es/src/cli_commands/source.js @@ -9,6 +9,7 @@ const dedent = require('dedent'); const getopts = require('getopts'); const { Cluster } = require('../cluster'); +const { parseTimeoutToMs } = require('../utils'); exports.description = 'Build and run from source'; @@ -27,6 +28,8 @@ exports.help = (defaults = {}) => { --password.[user] Sets password for native realm user [default: ${password}] --ssl Sets up SSL on Elasticsearch -E Additional key=value settings to pass to Elasticsearch + --skip-ready-check Disable the ready check, + --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m Example: @@ -42,9 +45,14 @@ exports.run = async (defaults = {}) => { installPath: 'install-path', sourcePath: 'source-path', dataArchive: 'data-archive', + skipReadyCheck: 'skip-ready-check', + readyTimeout: 'ready-timeout', esArgs: 'E', }, + string: ['ready-timeout'], + boolean: ['skip-ready-check'], + default: defaults, }); @@ -55,5 +63,8 @@ exports.run = async (defaults = {}) => { await cluster.extractDataDirectory(installPath, options.dataArchive); } - await cluster.run(installPath, options); + await cluster.run(installPath, { + ...options, + readyTimeout: parseTimeoutToMs(options.readyTimeout), + }); }; diff --git a/packages/kbn-es/src/cluster.js b/packages/kbn-es/src/cluster.js index 630a5e6567887..22ff9ae3c0cde 100644 --- a/packages/kbn-es/src/cluster.js +++ b/packages/kbn-es/src/cluster.js @@ -6,20 +6,29 @@ * Side Public License, v 1. */ -const fs = require('fs'); -const util = require('util'); +const fsp = require('fs/promises'); const execa = require('execa'); const chalk = require('chalk'); const path = require('path'); +const { Client } = require('@elastic/elasticsearch'); const { downloadSnapshot, installSnapshot, installSource, installArchive } = require('./install'); const { ES_BIN } = require('./paths'); -const { log: defaultLog, parseEsLog, extractConfigFiles, NativeRealm } = require('./utils'); +const { + log: defaultLog, + parseEsLog, + extractConfigFiles, + NativeRealm, + parseTimeoutToMs, +} = require('./utils'); const { createCliError } = require('./errors'); const { promisify } = require('util'); const treeKillAsync = promisify(require('tree-kill')); const { parseSettings, SettingsFilter } = require('./settings'); const { CA_CERT_PATH, ES_NOPASSWORD_P12_PATH, extract } = require('@kbn/dev-utils'); -const readFile = util.promisify(fs.readFile); + +const DEFAULT_READY_TIMEOUT = parseTimeoutToMs('1m'); + +/** @typedef {import('./cluster_exec_options').EsClusterExecOptions} ExecOptions */ // listen to data on stream until map returns anything but undefined const first = (stream, map) => @@ -38,7 +47,6 @@ exports.Cluster = class Cluster { constructor({ log = defaultLog, ssl = false } = {}) { this._log = log.withType('@kbn/es Cluster'); this._ssl = ssl; - this._caCertPromise = ssl ? readFile(CA_CERT_PATH) : undefined; } /** @@ -157,10 +165,8 @@ exports.Cluster = class Cluster { * Starts ES and returns resolved promise once started * * @param {String} installPath - * @param {Object} options - * @property {Array} options.esArgs - * @property {String} options.password - super user password used to bootstrap - * @returns {Promise} + * @param {ExecOptions} options + * @returns {Promise} */ async start(installPath, options = {}) { this._exec(installPath, options); @@ -173,7 +179,7 @@ exports.Cluster = class Cluster { return true; } }), - this._nativeRealmSetup, + this._setupPromise, ]), // await the outcome of the process in case it exits before starting @@ -187,15 +193,14 @@ exports.Cluster = class Cluster { * Starts Elasticsearch and waits for Elasticsearch to exit * * @param {String} installPath - * @param {Object} options - * @property {Array} options.esArgs - * @returns {Promise} + * @param {ExecOptions} options + * @returns {Promise} */ async run(installPath, options = {}) { this._exec(installPath, options); // log native realm setup errors so they aren't uncaught - this._nativeRealmSetup.catch((error) => { + this._setupPromise.catch((error) => { this._log.error(error); this.stop(); }); @@ -233,14 +238,17 @@ exports.Cluster = class Cluster { * * @private * @param {String} installPath - * @param {Object} options - * @property {string|Array} options.esArgs - * @property {string} options.esJavaOpts - * @property {Boolean} options.skipNativeRealmSetup - * @return {undefined} + * @param {ExecOptions} opts */ _exec(installPath, opts = {}) { - const { skipNativeRealmSetup = false, reportTime = () => {}, startTime, ...options } = opts; + const { + skipNativeRealmSetup = false, + reportTime = () => {}, + startTime, + skipReadyCheck, + readyTimeout, + ...options + } = opts; if (this._process || this._outcome) { throw new Error('ES has already been started'); @@ -252,6 +260,8 @@ exports.Cluster = class Cluster { const esArgs = [ 'action.destructive_requires_name=true', 'ingest.geoip.downloader.enabled=false', + 'search.check_ccs_compatibility=true', + 'cluster.routing.allocation.disk.threshold_enabled=false', ].concat(options.esArgs || []); // Add to esArgs if ssl is enabled @@ -274,7 +284,7 @@ exports.Cluster = class Cluster { [] ); - this._log.debug('%s %s', ES_BIN, args.join(' ')); + this._log.info('%s %s', ES_BIN, args.join(' ')); let esJavaOpts = `${options.esJavaOpts || ''} ${process.env.ES_JAVA_OPTS || ''}`; @@ -287,7 +297,7 @@ exports.Cluster = class Cluster { esJavaOpts += ' -Xms1536m -Xmx1536m'; } - this._log.debug('ES_JAVA_OPTS: %s', esJavaOpts.trim()); + this._log.info('ES_JAVA_OPTS: %s', esJavaOpts.trim()); this._process = execa(ES_BIN, args, { cwd: installPath, @@ -300,30 +310,49 @@ exports.Cluster = class Cluster { stdio: ['ignore', 'pipe', 'pipe'], }); - // parse log output to find http port - const httpPort = first(this._process.stdout, (data) => { - const match = data.toString('utf8').match(/HttpServer.+publish_address {[0-9.]+:([0-9]+)/); + this._setupPromise = Promise.all([ + // parse log output to find http port + first(this._process.stdout, (data) => { + const match = data.toString('utf8').match(/HttpServer.+publish_address {[0-9.]+:([0-9]+)/); - if (match) { - return match[1]; + if (match) { + return match[1]; + } + }), + + // load the CA cert from disk if necessary + this._ssl ? fsp.readFile(CA_CERT_PATH) : null, + ]).then(async ([port, caCert]) => { + const client = new Client({ + node: `${caCert ? 'https:' : 'http:'}//localhost:${port}`, + auth: { + username: 'elastic', + password: options.password, + }, + tls: caCert + ? { + ca: caCert, + rejectUnauthorized: true, + } + : undefined, + }); + + if (!skipReadyCheck) { + await this._waitForClusterReady(client, readyTimeout); } - }); - // once the http port is available setup the native realm - this._nativeRealmSetup = httpPort.then(async (port) => { - if (skipNativeRealmSetup) { - return; + // once the cluster is ready setup the native realm + if (!skipNativeRealmSetup) { + const nativeRealm = new NativeRealm({ + log: this._log, + elasticPassword: options.password, + client, + }); + + await nativeRealm.setPasswords(options); } - const caCert = await this._caCertPromise; - const nativeRealm = new NativeRealm({ - port, - caCert, - log: this._log, - elasticPassword: options.password, - ssl: this._ssl, - }); - await nativeRealm.setPasswords(options); + this._log.success('kbn/es setup complete'); }); let reportSent = false; @@ -366,4 +395,43 @@ exports.Cluster = class Cluster { } }); } + + async _waitForClusterReady(client, readyTimeout = DEFAULT_READY_TIMEOUT) { + let attempt = 0; + const start = Date.now(); + + this._log.info('waiting for ES cluster to report a yellow or green status'); + + while (true) { + attempt += 1; + + try { + const resp = await client.cluster.health(); + if (resp.status !== 'red') { + return; + } + + throw new Error(`not ready, cluster health is ${resp.status}`); + } catch (error) { + const timeSinceStart = Date.now() - start; + if (timeSinceStart > readyTimeout) { + const sec = readyTimeout / 1000; + throw new Error(`ES cluster failed to come online with the ${sec} second timeout`); + } + + if (error.message.startsWith('not ready,')) { + if (timeSinceStart > 10_000) { + this._log.warning(error.message); + } + } else { + this._log.warning( + `waiting for ES cluster to come online, attempt ${attempt} failed with: ${error.message}` + ); + } + + const waitSec = attempt * 1.5; + await new Promise((resolve) => setTimeout(resolve, waitSec * 1000)); + } + } + } }; diff --git a/packages/kbn-es/src/cluster_exec_options.ts b/packages/kbn-es/src/cluster_exec_options.ts new file mode 100644 index 0000000000000..8ef3b23cd8c51 --- /dev/null +++ b/packages/kbn-es/src/cluster_exec_options.ts @@ -0,0 +1,18 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export interface EsClusterExecOptions { + skipNativeRealmSetup?: boolean; + reportTime?: (...args: any[]) => void; + startTime?: number; + esArgs?: string[]; + esJavaOpts?: string; + password?: string; + skipReadyCheck?: boolean; + readyTimeout?: number; +} diff --git a/packages/kbn-es/src/integration_tests/cluster.test.js b/packages/kbn-es/src/integration_tests/cluster.test.js index c4b1512331483..271942158dc94 100644 --- a/packages/kbn-es/src/integration_tests/cluster.test.js +++ b/packages/kbn-es/src/integration_tests/cluster.test.js @@ -309,6 +309,8 @@ describe('#start(installPath)', () => { Array [ "action.destructive_requires_name=true", "ingest.geoip.downloader.enabled=false", + "search.check_ccs_compatibility=true", + "cluster.routing.allocation.disk.threshold_enabled=false", ], undefined, Object { @@ -387,6 +389,8 @@ describe('#run()', () => { Array [ "action.destructive_requires_name=true", "ingest.geoip.downloader.enabled=false", + "search.check_ccs_compatibility=true", + "cluster.routing.allocation.disk.threshold_enabled=false", ], undefined, Object { diff --git a/packages/kbn-es/src/utils/index.ts b/packages/kbn-es/src/utils/index.ts index 4b4ae1bc05259..4e75d1d81f6fb 100644 --- a/packages/kbn-es/src/utils/index.ts +++ b/packages/kbn-es/src/utils/index.ts @@ -17,3 +17,4 @@ export { extractConfigFiles } from './extract_config_files'; export { NativeRealm, SYSTEM_INDICES_SUPERUSER } from './native_realm'; export { buildSnapshot } from './build_snapshot'; export { archiveForPlatform } from './build_snapshot'; +export * from './parse_timeout_to_ms'; diff --git a/packages/kbn-es/src/utils/native_realm.js b/packages/kbn-es/src/utils/native_realm.js index 52d6ae807777b..ae0ce05f4d6b7 100644 --- a/packages/kbn-es/src/utils/native_realm.js +++ b/packages/kbn-es/src/utils/native_realm.js @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -const { Client } = require('@elastic/elasticsearch'); const chalk = require('chalk'); const { log: defaultLog } = require('./log'); @@ -15,14 +14,9 @@ export const SYSTEM_INDICES_SUPERUSER = process.env.TEST_ES_SYSTEM_INDICES_USER || 'system_indices_superuser'; exports.NativeRealm = class NativeRealm { - constructor({ elasticPassword, port, log = defaultLog, ssl = false, caCert }) { - const auth = { username: 'elastic', password: elasticPassword }; - this._client = new Client( - ssl - ? { node: `https://localhost:${port}`, tls: { ca: caCert, rejectUnauthorized: true }, auth } - : { node: `http://localhost:${port}`, auth } - ); + constructor({ elasticPassword, log = defaultLog, client }) { this._elasticPassword = elasticPassword; + this._client = client; this._log = log; } @@ -53,24 +47,14 @@ exports.NativeRealm = class NativeRealm { }); } - async clusterReady() { - return await this._autoRetry({ maxAttempts: 10 }, async () => { - const { status } = await this._client.cluster.health(); - if (status === 'red') { - throw new Error(`not ready, cluster health is ${status}`); - } - }); - } - async setPasswords(options) { - await this.clusterReady(); - if (!(await this.isSecurityEnabled())) { this._log.info('security is not enabled, unable to set native realm passwords'); return; } const reservedUsers = await this.getReservedUsers(); + this._log.info(`Set up ${reservedUsers.length} ES users`); await Promise.all([ ...reservedUsers.map(async (user) => { await this.setPassword(user, options[`password.${user}`]); @@ -108,7 +92,7 @@ exports.NativeRealm = class NativeRealm { } async _autoRetry(opts, fn) { - const { attempt = 1, maxAttempts = 3, sleep = 1000 } = opts; + const { attempt = 1, maxAttempts = 3 } = opts; try { return await fn(attempt); @@ -119,7 +103,7 @@ exports.NativeRealm = class NativeRealm { const sec = 1.5 * attempt; this._log.warning(`assuming ES isn't initialized completely, trying again in ${sec} seconds`); - await new Promise((resolve) => setTimeout(resolve, sleep)); + await new Promise((resolve) => setTimeout(resolve, sec * 1000)); const nextOpts = { ...opts, diff --git a/packages/kbn-es/src/utils/native_realm.test.js b/packages/kbn-es/src/utils/native_realm.test.js index a567c15e743af..d3eaf6bd97b72 100644 --- a/packages/kbn-es/src/utils/native_realm.test.js +++ b/packages/kbn-es/src/utils/native_realm.test.js @@ -7,12 +7,7 @@ */ const { NativeRealm } = require('./native_realm'); - -jest.genMockFromModule('@elastic/elasticsearch'); -jest.mock('@elastic/elasticsearch'); - const { ToolingLog } = require('@kbn/dev-utils'); -const { Client } = require('@elastic/elasticsearch'); const mockClient = { xpack: { @@ -28,13 +23,12 @@ const mockClient = { putUser: jest.fn(), }, }; -Client.mockImplementation(() => mockClient); const log = new ToolingLog(); let nativeRealm; beforeEach(() => { - nativeRealm = new NativeRealm({ elasticPassword: 'changeme', port: '9200', log }); + nativeRealm = new NativeRealm({ elasticPassword: 'changeme', client: mockClient, log }); }); afterAll(() => { diff --git a/packages/kbn-es/src/utils/parse_timeout_to_ms.test.ts b/packages/kbn-es/src/utils/parse_timeout_to_ms.test.ts new file mode 100644 index 0000000000000..fba387cad278b --- /dev/null +++ b/packages/kbn-es/src/utils/parse_timeout_to_ms.test.ts @@ -0,0 +1,37 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { parseTimeoutToMs } from './parse_timeout_to_ms'; + +it('handles empty values', () => { + expect(parseTimeoutToMs(undefined)).toMatchInlineSnapshot(`undefined`); + expect(parseTimeoutToMs('')).toMatchInlineSnapshot(`undefined`); +}); +it('returns numbers', () => { + expect(parseTimeoutToMs(10)).toMatchInlineSnapshot(`10`); +}); +it('parses seconds', () => { + expect(parseTimeoutToMs('10')).toMatchInlineSnapshot(`10000`); +}); +it('parses minutes', () => { + expect(parseTimeoutToMs('10m')).toMatchInlineSnapshot(`600000`); +}); +it('throws for invalid values', () => { + expect(() => parseTimeoutToMs(true)).toThrowErrorMatchingInlineSnapshot( + `"[true] is not a valid timeout value"` + ); + expect(() => parseTimeoutToMs([true])).toThrowErrorMatchingInlineSnapshot( + `"[[ true ]] is not a valid timeout value"` + ); + expect(() => parseTimeoutToMs(['true'])).toThrowErrorMatchingInlineSnapshot( + `"[[ 'true' ]] is not a valid timeout value"` + ); + expect(() => parseTimeoutToMs(NaN)).toThrowErrorMatchingInlineSnapshot( + `"[NaN] is not a valid timeout value"` + ); +}); diff --git a/packages/kbn-es/src/utils/parse_timeout_to_ms.ts b/packages/kbn-es/src/utils/parse_timeout_to_ms.ts new file mode 100644 index 0000000000000..c8272bdfeee51 --- /dev/null +++ b/packages/kbn-es/src/utils/parse_timeout_to_ms.ts @@ -0,0 +1,43 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { inspect } from 'util'; + +function parseInt(n: string) { + const number = Number.parseInt(n, 10); + if (Number.isNaN(number)) { + throw new Error(`invalid number [${n}]`); + } + return number; +} + +/** + * Parse a timeout value to milliseconds. Supports undefined, a number, an + * empty string, a string representing a number of minutes eg 1m, or a string + * representing a number of seconds eg 60. All other values throw an error + */ +export function parseTimeoutToMs(seconds: any): number | undefined { + if (seconds === undefined || seconds === '') { + return undefined; + } + + if (typeof seconds === 'number' && !Number.isNaN(seconds)) { + return seconds; + } + + if (typeof seconds !== 'string') { + throw new Error(`[${inspect(seconds)}] is not a valid timeout value`); + } + + if (seconds.endsWith('m')) { + const m = parseInt(seconds.slice(0, -1)); + return m * 60 * 1000; + } + + return parseInt(seconds) * 1000; +} diff --git a/packages/kbn-field-types/BUILD.bazel b/packages/kbn-field-types/BUILD.bazel index 0398d4d9b9ba6..77a4acaedb235 100644 --- a/packages/kbn-field-types/BUILD.bazel +++ b/packages/kbn-field-types/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-field-types" PKG_REQUIRE_NAME = "@kbn/field-types" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__field-types" SOURCE_FILES = glob( [ @@ -64,10 +63,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -99,7 +96,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-field-types/tsconfig.json b/packages/kbn-field-types/tsconfig.json index 150854076bbf8..f4dd1662f832f 100644 --- a/packages/kbn-field-types/tsconfig.json +++ b/packages/kbn-field-types/tsconfig.json @@ -3,11 +3,8 @@ "compilerOptions": { "outDir": "./target_types", "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-field-types/src" }, "include": ["src/**/*"] } diff --git a/packages/kbn-i18n-react/BUILD.bazel b/packages/kbn-i18n-react/BUILD.bazel index 505afabfa860d..0ba7335390380 100644 --- a/packages/kbn-i18n-react/BUILD.bazel +++ b/packages/kbn-i18n-react/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-i18n-react" PKG_REQUIRE_NAME = "@kbn/i18n-react" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n-react" SOURCE_FILES = glob( [ @@ -74,10 +73,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -109,7 +106,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n-react/tsconfig.json b/packages/kbn-i18n-react/tsconfig.json index d2707938041d2..5f0c08bace6d3 100644 --- a/packages/kbn-i18n-react/tsconfig.json +++ b/packages/kbn-i18n-react/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../../packages/kbn-i18n-react/src", "types": [ "jest", "node" diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 385bdafb7c8ee..07b2c0b4d773a 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-i18n" PKG_REQUIRE_NAME = "@kbn/i18n" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n" SOURCE_FILES = glob( [ @@ -75,10 +74,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -110,7 +107,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n/tsconfig.json b/packages/kbn-i18n/tsconfig.json index 2ac0b081b76dd..0fd24d62281b6 100644 --- a/packages/kbn-i18n/tsconfig.json +++ b/packages/kbn-i18n/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../../packages/kbn-i18n/src", "types": [ "jest", "node" diff --git a/packages/kbn-interpreter/BUILD.bazel b/packages/kbn-interpreter/BUILD.bazel index fd19413116f8d..d390ccbc2ebde 100644 --- a/packages/kbn-interpreter/BUILD.bazel +++ b/packages/kbn-interpreter/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-interpreter" PKG_REQUIRE_NAME = "@kbn/interpreter" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__interpreter" SOURCE_FILES = glob( [ @@ -74,10 +73,8 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -109,7 +106,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-interpreter/tsconfig.json b/packages/kbn-interpreter/tsconfig.json index 60f8c76cf8809..de30741c59a60 100644 --- a/packages/kbn-interpreter/tsconfig.json +++ b/packages/kbn-interpreter/tsconfig.json @@ -3,12 +3,9 @@ "compilerOptions": { "allowJs": true, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-interpreter/src", "stripInternal": true, "types": [ "jest", diff --git a/packages/kbn-io-ts-utils/BUILD.bazel b/packages/kbn-io-ts-utils/BUILD.bazel index 5ecfc0acc55e8..aa0116b81efe6 100644 --- a/packages/kbn-io-ts-utils/BUILD.bazel +++ b/packages/kbn-io-ts-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-io-ts-utils" PKG_REQUIRE_NAME = "@kbn/io-ts-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__io-ts-utils" SOURCE_FILES = glob( [ @@ -65,10 +64,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -100,7 +97,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index 72d1479621345..1998f132ffd24 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-io-ts-utils/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-logging-mocks/BUILD.bazel b/packages/kbn-logging-mocks/BUILD.bazel index 74fb9c2651e5d..90a2046444291 100644 --- a/packages/kbn-logging-mocks/BUILD.bazel +++ b/packages/kbn-logging-mocks/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-logging-mocks" PKG_REQUIRE_NAME = "@kbn/logging-mocks" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__logging-mocks" SOURCE_FILES = glob( [ @@ -57,10 +56,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -92,7 +89,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-logging-mocks/tsconfig.json b/packages/kbn-logging-mocks/tsconfig.json index ce53e016c2830..ee25c507e7f56 100644 --- a/packages/kbn-logging-mocks/tsconfig.json +++ b/packages/kbn-logging-mocks/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-logging-mocks/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-logging/BUILD.bazel b/packages/kbn-logging/BUILD.bazel index 09ff3f0d83b2d..ec25b5cd3ae88 100644 --- a/packages/kbn-logging/BUILD.bazel +++ b/packages/kbn-logging/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-logging" PKG_REQUIRE_NAME = "@kbn/logging" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__logging" SOURCE_FILES = glob( [ @@ -58,10 +57,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -93,7 +90,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-logging/tsconfig.json b/packages/kbn-logging/tsconfig.json index a6fb0f2f73187..ee25c507e7f56 100644 --- a/packages/kbn-logging/tsconfig.json +++ b/packages/kbn-logging/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-logging/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-mapbox-gl/BUILD.bazel b/packages/kbn-mapbox-gl/BUILD.bazel index b09b783a0aebf..89cbeb4c431ae 100644 --- a/packages/kbn-mapbox-gl/BUILD.bazel +++ b/packages/kbn-mapbox-gl/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-mapbox-gl" PKG_REQUIRE_NAME = "@kbn/mapbox-gl" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__mapbox-gl" SOURCE_FILES = glob( [ @@ -61,10 +60,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -96,7 +93,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-mapbox-gl/tsconfig.json b/packages/kbn-mapbox-gl/tsconfig.json index e935276e91762..ee063bd30933e 100644 --- a/packages/kbn-mapbox-gl/tsconfig.json +++ b/packages/kbn-mapbox-gl/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-mapbox-gl/src", "types": [] }, "include": [ diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index c72c46f8ed202..c615196f5c182 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-monaco" PKG_REQUIRE_NAME = "@kbn/monaco" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__monaco" SOURCE_FILES = glob( [ @@ -96,10 +95,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -131,7 +128,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-monaco/tsconfig.json b/packages/kbn-monaco/tsconfig.json index 959051b17b782..e55d786c41bc3 100644 --- a/packages/kbn-monaco/tsconfig.json +++ b/packages/kbn-monaco/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-monaco/src", "types": [ "jest", "node" diff --git a/packages/kbn-optimizer/BUILD.bazel b/packages/kbn-optimizer/BUILD.bazel index 9486f309bd0f3..680ca0e58b8eb 100644 --- a/packages/kbn-optimizer/BUILD.bazel +++ b/packages/kbn-optimizer/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-optimizer" PKG_REQUIRE_NAME = "@kbn/optimizer" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__optimizer" SOURCE_FILES = glob( [ @@ -119,10 +118,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -154,7 +151,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 79308c43bf0aa..3a999272c3a4d 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -121,3 +121,4 @@ pageLoadAssetSize: expressionPartitionVis: 26338 sharedUX: 16225 ux: 20784 + cloudSecurityPosture: 19109 diff --git a/packages/kbn-optimizer/tsconfig.json b/packages/kbn-optimizer/tsconfig.json index 5fbd02106e777..72de52e593cf7 100644 --- a/packages/kbn-optimizer/tsconfig.json +++ b/packages/kbn-optimizer/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "./src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-optimizer/src", "types": [ "jest", "node" diff --git a/packages/kbn-plugin-generator/BUILD.bazel b/packages/kbn-plugin-generator/BUILD.bazel index 0578842a7509b..3e1565e86fe0d 100644 --- a/packages/kbn-plugin-generator/BUILD.bazel +++ b/packages/kbn-plugin-generator/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-plugin-generator" PKG_REQUIRE_NAME = "@kbn/plugin-generator" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__plugin-generator" SOURCE_FILES = glob( [ @@ -86,10 +85,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -121,7 +118,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-plugin-generator/tsconfig.json b/packages/kbn-plugin-generator/tsconfig.json index 5b666cf801da6..519de9b703140 100644 --- a/packages/kbn-plugin-generator/tsconfig.json +++ b/packages/kbn-plugin-generator/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-plugin-generator/src", "target": "ES2019", "types": [ "jest", diff --git a/packages/kbn-plugin-helpers/BUILD.bazel b/packages/kbn-plugin-helpers/BUILD.bazel index 7112c497f6ff8..cda9dce927e35 100644 --- a/packages/kbn-plugin-helpers/BUILD.bazel +++ b/packages/kbn-plugin-helpers/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-plugin-helpers" PKG_REQUIRE_NAME = "@kbn/plugin-helpers" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__plugin-helpers" SOURCE_FILES = glob( [ @@ -79,10 +78,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -114,7 +111,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-plugin-helpers/tsconfig.json b/packages/kbn-plugin-helpers/tsconfig.json index 34f3ec5e67503..0bff4cdbb85e1 100644 --- a/packages/kbn-plugin-helpers/tsconfig.json +++ b/packages/kbn-plugin-helpers/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-plugin-helpers/src", "target": "ES2018", "types": [ "jest", diff --git a/packages/kbn-react-field/BUILD.bazel b/packages/kbn-react-field/BUILD.bazel index 36ab9d7f38c56..07ecbcb61db26 100644 --- a/packages/kbn-react-field/BUILD.bazel +++ b/packages/kbn-react-field/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-react-field" PKG_REQUIRE_NAME = "@kbn/react-field" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__react-field" SOURCE_FILES = glob( [ @@ -84,10 +83,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -119,7 +116,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-react-field/tsconfig.json b/packages/kbn-react-field/tsconfig.json index 4d37e1825c85a..f91c1f4c54d74 100644 --- a/packages/kbn-react-field/tsconfig.json +++ b/packages/kbn-react-field/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../../packages/kbn-react-field/src", "types": [ "jest", "node", diff --git a/packages/kbn-rule-data-utils/BUILD.bazel b/packages/kbn-rule-data-utils/BUILD.bazel index 1e71947566722..6477b558db9cb 100644 --- a/packages/kbn-rule-data-utils/BUILD.bazel +++ b/packages/kbn-rule-data-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-rule-data-utils" PKG_REQUIRE_NAME = "@kbn/rule-data-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__rule-data-utils" SOURCE_FILES = glob( [ @@ -60,11 +59,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, incremental = False, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -96,7 +93,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-rule-data-utils/tsconfig.json b/packages/kbn-rule-data-utils/tsconfig.json index be6095d187ef3..05947e9286a74 100644 --- a/packages/kbn-rule-data-utils/tsconfig.json +++ b/packages/kbn-rule-data-utils/tsconfig.json @@ -2,13 +2,10 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "incremental": false, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-rule-data-utils/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-securitysolution-autocomplete/BUILD.bazel b/packages/kbn-securitysolution-autocomplete/BUILD.bazel index bc29f400f4d5b..16aa28e79b45b 100644 --- a/packages/kbn-securitysolution-autocomplete/BUILD.bazel +++ b/packages/kbn-securitysolution-autocomplete/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-autocomplete" PKG_REQUIRE_NAME = "@kbn/securitysolution-autocomplete" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-autocomplete" SOURCE_FILES = glob( [ @@ -93,11 +92,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -128,7 +125,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-autocomplete/tsconfig.json b/packages/kbn-securitysolution-autocomplete/tsconfig.json index b2e24676cdbd4..dfe59c663d3e1 100644 --- a/packages/kbn-securitysolution-autocomplete/tsconfig.json +++ b/packages/kbn-securitysolution-autocomplete/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-autocomplete/src", "rootDir": "src", "types": ["jest", "node"] }, diff --git a/packages/kbn-securitysolution-es-utils/BUILD.bazel b/packages/kbn-securitysolution-es-utils/BUILD.bazel index ceb643246249e..e36409f464b3e 100644 --- a/packages/kbn-securitysolution-es-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-es-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-es-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-es-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-es-utils" SOURCE_FILES = glob( [ @@ -65,11 +64,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -100,7 +97,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-es-utils/tsconfig.json b/packages/kbn-securitysolution-es-utils/tsconfig.json index e5b1c99d3f598..305954d669b75 100644 --- a/packages/kbn-securitysolution-es-utils/tsconfig.json +++ b/packages/kbn-securitysolution-es-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-es-utils/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-hook-utils/BUILD.bazel b/packages/kbn-securitysolution-hook-utils/BUILD.bazel index 4f46992ad13d6..363d4f688783d 100644 --- a/packages/kbn-securitysolution-hook-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-hook-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-hook-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-hook-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-hook-utils" SOURCE_FILES = glob( [ @@ -72,11 +71,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -107,7 +104,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-hook-utils/tsconfig.json b/packages/kbn-securitysolution-hook-utils/tsconfig.json index 4782331e31c44..6a1981335d68e 100644 --- a/packages/kbn-securitysolution-hook-utils/tsconfig.json +++ b/packages/kbn-securitysolution-hook-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-hook-utils/src", "types": ["jest", "node"] }, "include": ["src/**/*"] diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel index 61cdb9cccd292..0a06de87e8303 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-io-ts-alerting-types" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-alerting-types" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-io-ts-alerting-types" SOURCE_FILES = glob( [ @@ -75,11 +74,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -110,7 +107,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json index 0e58572c1b82b..305954d669b75 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-io-ts-alerting-types/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel index 66e52c1f509b4..d4ba51713d7e3 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-io-ts-list-types" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-list-types" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-io-ts-list-types" SOURCE_FILES = glob( [ @@ -75,11 +74,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -110,7 +107,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts index 54c9ecfe40b92..2f59e868c354f 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts +++ b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts @@ -14,6 +14,7 @@ export const exceptionListType = t.keyof({ endpoint_trusted_apps: null, endpoint_events: null, endpoint_host_isolation_exceptions: null, + endpoint_blocklists: null, }); export const exceptionListTypeOrUndefined = t.union([exceptionListType, t.undefined]); export type ExceptionListType = t.TypeOf; @@ -24,4 +25,5 @@ export enum ExceptionListTypeEnum { ENDPOINT_TRUSTED_APPS = 'endpoint', ENDPOINT_EVENTS = 'endpoint_events', ENDPOINT_HOST_ISOLATION_EXCEPTIONS = 'endpoint_host_isolation_exceptions', + ENDPOINT_BLOCKLISTS = 'endpoint_blocklists', } diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts index 9bcb11917f7dc..c8145307153f4 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts +++ b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts @@ -86,7 +86,7 @@ describe('Lists', () => { const message = pipe(decoded, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}>"', + 'Invalid value "1" supplied to "Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}>"', ]); expect(message.schema).toEqual({}); }); @@ -117,8 +117,8 @@ describe('Lists', () => { const message = pipe(decoded, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}> | undefined)"', - 'Invalid value "[1]" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}> | undefined)"', + 'Invalid value "1" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}> | undefined)"', + 'Invalid value "[1]" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}> | undefined)"', ]); expect(message.schema).toEqual({}); }); diff --git a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json index ca0ea969f89d8..305954d669b75 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-io-ts-list-types/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel index a4f817ac55f09..794eab1635b73 100644 --- a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-io-ts-types" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-types" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-io-ts-types" SOURCE_FILES = glob( [ @@ -73,11 +72,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -108,7 +105,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-types/tsconfig.json index c640181145be8..305954d669b75 100644 --- a/packages/kbn-securitysolution-io-ts-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-types/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-io-ts-types/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel index 46afff1a6affb..0229acdb474e4 100644 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-io-ts-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-io-ts-utils" SOURCE_FILES = glob( [ @@ -76,11 +75,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -111,7 +108,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json index 7c71143083d4d..305954d669b75 100644 --- a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-io-ts-utils/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel index 587b564ab9192..c73b9b4ea7503 100644 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ b/packages/kbn-securitysolution-list-api/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-list-api" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-api" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-list-api" SOURCE_FILES = glob( [ @@ -75,11 +74,9 @@ ts_project( deps = TYPES_DEPS, args = ["--pretty"], declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -110,7 +107,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-api/tsconfig.json b/packages/kbn-securitysolution-list-api/tsconfig.json index d51cd3ac71d8d..305954d669b75 100644 --- a/packages/kbn-securitysolution-list-api/tsconfig.json +++ b/packages/kbn-securitysolution-list-api/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-list-api/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-list-constants/BUILD.bazel b/packages/kbn-securitysolution-list-constants/BUILD.bazel index 3802e3a581969..339743721bc84 100644 --- a/packages/kbn-securitysolution-list-constants/BUILD.bazel +++ b/packages/kbn-securitysolution-list-constants/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-list-constants" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-constants" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-list-constants" SOURCE_FILES = glob( [ @@ -63,11 +62,9 @@ ts_project( deps = TYPES_DEPS, args = ["--pretty"], declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -98,7 +95,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-constants/src/index.ts b/packages/kbn-securitysolution-list-constants/src/index.ts index f0e09ff7bb461..43fe3ac47f8df 100644 --- a/packages/kbn-securitysolution-list-constants/src/index.ts +++ b/packages/kbn-securitysolution-list-constants/src/index.ts @@ -76,3 +76,7 @@ export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME = 'Endpoint Security Host isolation exceptions List'; export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION = 'Endpoint Security Host isolation exceptions List'; + +export const ENDPOINT_BLOCKLISTS_LIST_ID = 'endpoint_blocklists'; +export const ENDPOINT_BLOCKLISTS_LIST_NAME = 'Endpoint Security Blocklists List'; +export const ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION = 'Endpoint Security Blocklists List'; diff --git a/packages/kbn-securitysolution-list-constants/tsconfig.json b/packages/kbn-securitysolution-list-constants/tsconfig.json index 8697cbd61580a..305954d669b75 100644 --- a/packages/kbn-securitysolution-list-constants/tsconfig.json +++ b/packages/kbn-securitysolution-list-constants/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-list-constants/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel index 7b3fc87b6f87e..d709a0ddfbb80 100644 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ b/packages/kbn-securitysolution-list-hooks/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-list-hooks" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-hooks" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-list-hooks" SOURCE_FILES = glob( [ @@ -83,11 +82,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -118,7 +115,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-hooks/tsconfig.json b/packages/kbn-securitysolution-list-hooks/tsconfig.json index 41ec03f2ebf35..305954d669b75 100644 --- a/packages/kbn-securitysolution-list-hooks/tsconfig.json +++ b/packages/kbn-securitysolution-list-hooks/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-list-hooks/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel index 87e546a1fff08..642e4a970aca2 100644 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-list-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-list-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-list-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-list-utils" SOURCE_FILES = glob( [ @@ -82,11 +81,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -118,7 +115,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-list-utils/tsconfig.json b/packages/kbn-securitysolution-list-utils/tsconfig.json index fa50bd7981214..305954d669b75 100644 --- a/packages/kbn-securitysolution-list-utils/tsconfig.json +++ b/packages/kbn-securitysolution-list-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-list-utils/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-rules/BUILD.bazel b/packages/kbn-securitysolution-rules/BUILD.bazel index 7158f759f4466..80a27a426fbb2 100644 --- a/packages/kbn-securitysolution-rules/BUILD.bazel +++ b/packages/kbn-securitysolution-rules/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-rules" PKG_REQUIRE_NAME = "@kbn/securitysolution-rules" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-rules" SOURCE_FILES = glob( [ @@ -63,11 +62,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -98,7 +95,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-rules/tsconfig.json b/packages/kbn-securitysolution-rules/tsconfig.json index 3895e13ad28ed..305954d669b75 100644 --- a/packages/kbn-securitysolution-rules/tsconfig.json +++ b/packages/kbn-securitysolution-rules/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-rules/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-t-grid/BUILD.bazel b/packages/kbn-securitysolution-t-grid/BUILD.bazel index e0898f90d7f87..6ee620199a6e6 100644 --- a/packages/kbn-securitysolution-t-grid/BUILD.bazel +++ b/packages/kbn-securitysolution-t-grid/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-t-grid" PKG_REQUIRE_NAME = "@kbn/securitysolution-t-grid" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-t-grid" SOURCE_FILES = glob( [ @@ -72,11 +71,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -107,7 +104,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-t-grid/tsconfig.json b/packages/kbn-securitysolution-t-grid/tsconfig.json index 3c701d149ab2e..305954d669b75 100644 --- a/packages/kbn-securitysolution-t-grid/tsconfig.json +++ b/packages/kbn-securitysolution-t-grid/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-t-grid/src", "types": [ "jest", "node" diff --git a/packages/kbn-securitysolution-utils/BUILD.bazel b/packages/kbn-securitysolution-utils/BUILD.bazel index d22e31daacd55..cfb6b722ea2e6 100644 --- a/packages/kbn-securitysolution-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-securitysolution-utils" PKG_REQUIRE_NAME = "@kbn/securitysolution-utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-utils" SOURCE_FILES = glob( [ @@ -61,11 +60,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -96,7 +93,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-securitysolution-utils/tsconfig.json b/packages/kbn-securitysolution-utils/tsconfig.json index 23fdf3178e174..305954d669b75 100644 --- a/packages/kbn-securitysolution-utils/tsconfig.json +++ b/packages/kbn-securitysolution-utils/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-securitysolution-utils/src", "types": [ "jest", "node" diff --git a/packages/kbn-server-http-tools/BUILD.bazel b/packages/kbn-server-http-tools/BUILD.bazel index e524078a8ba89..29ca48adc566e 100644 --- a/packages/kbn-server-http-tools/BUILD.bazel +++ b/packages/kbn-server-http-tools/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-server-http-tools" PKG_REQUIRE_NAME = "@kbn/server-http-tools" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__server-http-tools" SOURCE_FILES = glob( [ @@ -72,10 +71,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -107,7 +104,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-server-http-tools/tsconfig.json b/packages/kbn-server-http-tools/tsconfig.json index e378e41c3828b..c89835eada818 100644 --- a/packages/kbn-server-http-tools/tsconfig.json +++ b/packages/kbn-server-http-tools/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target/types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-server-http-tools/src", "types": [ "jest", "node" diff --git a/packages/kbn-server-route-repository/BUILD.bazel b/packages/kbn-server-route-repository/BUILD.bazel index a0e1cf41dcf8f..06c09260e2fa6 100644 --- a/packages/kbn-server-route-repository/BUILD.bazel +++ b/packages/kbn-server-route-repository/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-server-route-repository" PKG_REQUIRE_NAME = "@kbn/server-route-repository" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__server-route-repository" SOURCE_FILES = glob( [ @@ -68,10 +67,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -103,7 +100,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-server-route-repository/tsconfig.json b/packages/kbn-server-route-repository/tsconfig.json index 447a2084926c6..db908eacc6c35 100644 --- a/packages/kbn-server-route-repository/tsconfig.json +++ b/packages/kbn-server-route-repository/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-server-route-repository/src", "stripInternal": false, "types": [ "jest", diff --git a/packages/kbn-std/BUILD.bazel b/packages/kbn-std/BUILD.bazel index 1e45803dbdcf1..08cfa2a2a1308 100644 --- a/packages/kbn-std/BUILD.bazel +++ b/packages/kbn-std/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-std" PKG_REQUIRE_NAME = "@kbn/std" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__std" SOURCE_FILES = glob( [ @@ -67,10 +66,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -102,7 +99,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-std/tsconfig.json b/packages/kbn-std/tsconfig.json index 2674ca26e96d5..04d1a54cc3951 100644 --- a/packages/kbn-std/tsconfig.json +++ b/packages/kbn-std/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-std/src", "stripInternal": true, "types": [ "jest", diff --git a/packages/kbn-storybook/BUILD.bazel b/packages/kbn-storybook/BUILD.bazel index 686de744b656f..ed7b167a30078 100644 --- a/packages/kbn-storybook/BUILD.bazel +++ b/packages/kbn-storybook/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-storybook" PKG_REQUIRE_NAME = "@kbn/storybook" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__storybook" SOURCE_FILES = glob( [ @@ -93,11 +92,9 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -128,7 +125,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json index 0ccf3e78c8288..53e689b569e5e 100644 --- a/packages/kbn-storybook/tsconfig.json +++ b/packages/kbn-storybook/tsconfig.json @@ -2,14 +2,11 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "incremental": false, "outDir": "target_types", "rootDir": "src", "skipLibCheck": true, - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-storybook", "target": "es2015", "types": ["node"] }, diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel index 1f53e4b71ae21..50336dc44da00 100644 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ b/packages/kbn-telemetry-tools/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-telemetry-tools" PKG_REQUIRE_NAME = "@kbn/telemetry-tools" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__telemetry-tools" SOURCE_FILES = glob( [ @@ -71,10 +70,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -106,7 +103,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-telemetry-tools/tsconfig.json b/packages/kbn-telemetry-tools/tsconfig.json index 034d7c0c6e745..25e1d341ac07b 100644 --- a/packages/kbn-telemetry-tools/tsconfig.json +++ b/packages/kbn-telemetry-tools/tsconfig.json @@ -2,13 +2,10 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "isolatedModules": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-telemetry-tools/src", "types": [ "jest", "node" diff --git a/packages/kbn-test-jest-helpers/BUILD.bazel b/packages/kbn-test-jest-helpers/BUILD.bazel index c713e24592944..d910fab5295d5 100644 --- a/packages/kbn-test-jest-helpers/BUILD.bazel +++ b/packages/kbn-test-jest-helpers/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-test-jest-helpers" PKG_REQUIRE_NAME = "@kbn/test-jest-helpers" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__test-jest-helpers" SOURCE_FILES = glob( [ @@ -133,10 +132,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -168,7 +165,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-test-jest-helpers/tsconfig.json b/packages/kbn-test-jest-helpers/tsconfig.json index 7a1121c9e91f1..72d996c69e2da 100644 --- a/packages/kbn-test-jest-helpers/tsconfig.json +++ b/packages/kbn-test-jest-helpers/tsconfig.json @@ -2,13 +2,10 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "stripInternal": true, "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../../../packages/kbn-test-jest-helpers/src", "types": ["jest", "node"] }, "include": ["src/**/*"], diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index 233aeab6250b1..6732b08d8bc72 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-test" PKG_REQUIRE_NAME = "@kbn/test" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__test" SOURCE_FILES = glob( [ @@ -139,10 +138,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -174,7 +171,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-test/src/es/test_es_cluster.ts b/packages/kbn-test/src/es/test_es_cluster.ts index 388d578c9af57..6e4fc2fb14628 100644 --- a/packages/kbn-test/src/es/test_es_cluster.ts +++ b/packages/kbn-test/src/es/test_es_cluster.ts @@ -244,9 +244,10 @@ export function createTestEsCluster< esArgs: assignArgs(esArgs, overriddenArgs), esJavaOpts, // If we have multiple nodes, we shouldn't try setting up the native realm - // right away, or ES will complain as the cluster isn't ready. So we only + // right away or wait for ES to be green, the cluster isn't ready. So we only // set it up after the last node is started. skipNativeRealmSetup: this.nodes.length > 1 && i < this.nodes.length - 1, + skipReadyCheck: this.nodes.length > 1 && i < this.nodes.length - 1, }); }); } diff --git a/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts b/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts index f70123029e6c4..717f214211d95 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts @@ -228,8 +228,8 @@ export class KbnClientSavedObjects { await this.requester.request({ method: 'DELETE', path: options.space - ? uriencode`/s/${options.space}/api/saved_objects/${obj.type}/${obj.id}` - : uriencode`/api/saved_objects/${obj.type}/${obj.id}`, + ? uriencode`/s/${options.space}/api/saved_objects/${obj.type}/${obj.id}?force=true` + : uriencode`/api/saved_objects/${obj.type}/${obj.id}?force=true`, }); deleted++; } catch (error) { diff --git a/packages/kbn-test/tsconfig.json b/packages/kbn-test/tsconfig.json index 7ba83019b0075..aa9fb4f04135d 100644 --- a/packages/kbn-test/tsconfig.json +++ b/packages/kbn-test/tsconfig.json @@ -2,13 +2,10 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "stripInternal": true, "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../../../packages/kbn-test/src", "types": ["jest", "node"] }, "include": ["src/**/*", "index.d.ts"], diff --git a/packages/kbn-typed-react-router-config/BUILD.bazel b/packages/kbn-typed-react-router-config/BUILD.bazel index 62fd6adf5bb26..c2a5aa84dbb2d 100644 --- a/packages/kbn-typed-react-router-config/BUILD.bazel +++ b/packages/kbn-typed-react-router-config/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-typed-react-router-config" PKG_REQUIRE_NAME = "@kbn/typed-react-router-config" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__typed-react-router-config" SOURCE_FILES = glob( [ @@ -83,10 +82,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -118,7 +115,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-typed-react-router-config/src/create_router.test.tsx b/packages/kbn-typed-react-router-config/src/create_router.test.tsx index d29079f37ec12..e0582de320a96 100644 --- a/packages/kbn-typed-react-router-config/src/create_router.test.tsx +++ b/packages/kbn-typed-react-router-config/src/create_router.test.tsx @@ -196,7 +196,15 @@ describe('createRouter', () => { it('throws an error if the given path does not match any routes', () => { expect(() => { router.getParams('/service-map', history.location); - }).toThrowError('No matching route found for /service-map'); + }).toThrowError('/service-map does not match current path /'); + + expect(() => { + router.getParams('/services/{serviceName}', history.location); + }).toThrowError('/services/{serviceName} does not match current path /'); + + expect(() => { + router.getParams('/service-map', '/services/{serviceName}', history.location); + }).toThrowError('None of /service-map, /services/{serviceName} match current path /'); }); it('does not throw an error if the given path does not match any routes but is marked as optional', () => { @@ -248,7 +256,7 @@ describe('createRouter', () => { expect(() => { router.matchRoutes('/traces', history.location); - }).toThrowError('No matching route found for /traces'); + }).toThrowError('/traces does not match current path /service-map'); }); it('applies defaults', () => { diff --git a/packages/kbn-typed-react-router-config/src/create_router.ts b/packages/kbn-typed-react-router-config/src/create_router.ts index 494540005224a..f545fa8ed63e3 100644 --- a/packages/kbn-typed-react-router-config/src/create_router.ts +++ b/packages/kbn-typed-react-router-config/src/create_router.ts @@ -99,7 +99,15 @@ export function createRouter(routes: TRoutes): Router< if (optional) { return []; } - throw new Error(`No matching route found for ${paths}`); + + let errorMessage: string; + + if (paths.length === 1) { + errorMessage = `${paths[0]} does not match current path ${location.pathname}`; + } else { + errorMessage = `None of ${paths.join(', ')} match current path ${location.pathname}`; + } + throw new Error(errorMessage); } return matches.slice(0, matchIndex + 1).map((matchedRoute) => { diff --git a/packages/kbn-typed-react-router-config/tsconfig.json b/packages/kbn-typed-react-router-config/tsconfig.json index 8e17781119ee9..2619b0ff8f9d3 100644 --- a/packages/kbn-typed-react-router-config/tsconfig.json +++ b/packages/kbn-typed-react-router-config/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "isolatedModules": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../../packages/kbn-typed-react-router-config/src", "stripInternal": true, "types": [ "node", diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index 22d51e260bcc0..17bbb09bd36e3 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-ui-shared-deps-npm" PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-npm" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__ui-shared-deps-npm" SOURCE_FILES = glob( [ @@ -121,11 +120,9 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -174,7 +171,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-shared-deps-npm/tsconfig.json b/packages/kbn-ui-shared-deps-npm/tsconfig.json index 107d82aa59ee8..a8a821708d036 100644 --- a/packages/kbn-ui-shared-deps-npm/tsconfig.json +++ b/packages/kbn-ui-shared-deps-npm/tsconfig.json @@ -3,12 +3,9 @@ "compilerOptions": { "allowJs": true, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-ui-shared-deps-npm/src", "types": [ "node", ] diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 3617956b15c4a..295f6fa0594ed 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -5,7 +5,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-ui-shared-deps-src" PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-src" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__ui-shared-deps-src" SOURCE_FILES = glob( [ @@ -77,11 +76,9 @@ ts_project( deps = TYPES_DEPS, allow_js = True, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", root_dir = "src", - source_map = True, tsconfig = ":tsconfig", ) @@ -130,7 +127,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-shared-deps-src/tsconfig.json b/packages/kbn-ui-shared-deps-src/tsconfig.json index 521fb122e4659..a8a821708d036 100644 --- a/packages/kbn-ui-shared-deps-src/tsconfig.json +++ b/packages/kbn-ui-shared-deps-src/tsconfig.json @@ -3,12 +3,9 @@ "compilerOptions": { "allowJs": true, "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-ui-shared-deps-src/src", "types": [ "node", ] diff --git a/packages/kbn-ui-theme/BUILD.bazel b/packages/kbn-ui-theme/BUILD.bazel index 8e388efe23757..5a848ddcc838f 100644 --- a/packages/kbn-ui-theme/BUILD.bazel +++ b/packages/kbn-ui-theme/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-ui-theme" PKG_REQUIRE_NAME = "@kbn/ui-theme" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__ui-theme" SOURCE_FILES = glob( [ @@ -61,10 +60,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -96,7 +93,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-theme/tsconfig.json b/packages/kbn-ui-theme/tsconfig.json index e1c27e88f1c91..0fd9a15b5dbf8 100644 --- a/packages/kbn-ui-theme/tsconfig.json +++ b/packages/kbn-ui-theme/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-ui-theme/src", "stripInternal": true, "types": ["node"] }, diff --git a/packages/kbn-utility-types/BUILD.bazel b/packages/kbn-utility-types/BUILD.bazel index 159ab134684f8..c556751d7550e 100644 --- a/packages/kbn-utility-types/BUILD.bazel +++ b/packages/kbn-utility-types/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-utility-types" PKG_REQUIRE_NAME = "@kbn/utility-types" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__utility-types" SOURCE_FILES = glob([ "src/jest/index.ts", @@ -56,10 +55,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -91,7 +88,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utility-types/tsconfig.json b/packages/kbn-utility-types/tsconfig.json index 997bcf9e0c45b..1d7104a6fc254 100644 --- a/packages/kbn-utility-types/tsconfig.json +++ b/packages/kbn-utility-types/tsconfig.json @@ -2,12 +2,9 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "./target_types", "rootDir": "./src", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-utility-types", "stripInternal": true, "types": [ "jest", diff --git a/packages/kbn-utils/BUILD.bazel b/packages/kbn-utils/BUILD.bazel index 6ac23129a1d03..b60c60af43c25 100644 --- a/packages/kbn-utils/BUILD.bazel +++ b/packages/kbn-utils/BUILD.bazel @@ -4,7 +4,6 @@ load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", PKG_BASE_NAME = "kbn-utils" PKG_REQUIRE_NAME = "@kbn/utils" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__utils" SOURCE_FILES = glob( [ @@ -60,10 +59,8 @@ ts_project( srcs = SRCS, deps = TYPES_DEPS, declaration = True, - declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - source_map = True, root_dir = "src", tsconfig = ":tsconfig", ) @@ -95,7 +92,7 @@ pkg_npm_types( name = "npm_module_types", srcs = SRCS, deps = [":tsc_types"], - package_name = TYPES_PKG_REQUIRE_NAME, + package_name = PKG_REQUIRE_NAME, tsconfig = ":tsconfig", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-utils/tsconfig.json b/packages/kbn-utils/tsconfig.json index 85c26f42a695c..a2851d55c0a45 100644 --- a/packages/kbn-utils/tsconfig.json +++ b/packages/kbn-utils/tsconfig.json @@ -2,11 +2,8 @@ "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, - "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "sourceMap": true, - "sourceRoot": "../../../../packages/kbn-utils/src", "types": [ "jest", "node" diff --git a/renovate.json b/renovate.json index 95358af48a2cc..9b673a5a9ccf6 100644 --- a/renovate.json +++ b/renovate.json @@ -35,14 +35,14 @@ "matchPackageNames": ["@elastic/elasticsearch"], "reviewers": ["team:kibana-operations", "team:kibana-core"], "matchBaseBranches": ["main"], - "labels": ["release_note:skip", "backport:skip", "Team:Operations", "Team:Core", "v8.1.0"], + "labels": ["release_note:skip", "backport:skip", "Team:Operations", "Team:Core"], "enabled": true }, { "groupName": "@elastic/elasticsearch", "matchPackageNames": ["@elastic/elasticsearch"], "reviewers": ["team:kibana-operations", "team:kibana-core"], - "matchBaseBranches": ["7.16"], + "matchBaseBranches": ["8.1"], "labels": ["release_note:skip", "Team:Operations", "Team:Core", "backport:skip"], "enabled": true }, @@ -50,7 +50,7 @@ "groupName": "@elastic/elasticsearch", "matchPackageNames": ["@elastic/elasticsearch"], "reviewers": ["team:kibana-operations", "team:kibana-core"], - "matchBaseBranches": ["7.15"], + "matchBaseBranches": ["7.17"], "labels": ["release_note:skip", "Team:Operations", "Team:Core", "backport:skip"], "enabled": true }, diff --git a/scripts/functional_tests.js b/scripts/functional_tests.js index 6cfd1d57e9c96..972c682ab0d9f 100644 --- a/scripts/functional_tests.js +++ b/scripts/functional_tests.js @@ -9,6 +9,7 @@ require('../src/setup_node_env'); require('@kbn/test').runTestsCli([ require.resolve('../test/functional/config.js'), + require.resolve('../test/functional_ccs/config.js'), require.resolve('../test/plugin_functional/config.ts'), require.resolve('../test/ui_capabilities/newsfeed_err/config.ts'), require.resolve('../test/new_visualize_flow/config.ts'), diff --git a/src/core/server/status/log_plugins_status.test.ts b/src/core/server/status/log_plugins_status.test.ts new file mode 100644 index 0000000000000..e1be88fe1b188 --- /dev/null +++ b/src/core/server/status/log_plugins_status.test.ts @@ -0,0 +1,332 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { TestScheduler } from 'rxjs/testing'; +import { PluginName } from '../plugins'; +import { ServiceStatus, ServiceStatusLevel, ServiceStatusLevels } from './types'; +import { + getPluginsStatusChanges, + getPluginsStatusDiff, + getServiceLevelChangeMessage, +} from './log_plugins_status'; + +type ObsInputType = Record; + +const getTestScheduler = () => + new TestScheduler((actual, expected) => { + expect(actual).toEqual(expected); + }); + +const createServiceStatus = (level: ServiceStatusLevel): ServiceStatus => ({ + level, + summary: 'summary', +}); + +const createPluginsStatuses = ( + input: Record +): Record => { + return Object.entries(input).reduce((output, [name, level]) => { + output[name] = createServiceStatus(level); + return output; + }, {} as Record); +}; + +describe('getPluginsStatusChanges', () => { + it('does not emit on first plugins$ emission', () => { + getTestScheduler().run(({ expectObservable, hot }) => { + const statuses = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + }); + + const overall$ = hot('-a', { + a: statuses, + }); + const stop$ = hot(''); + const expected = '--'; + + expectObservable(getPluginsStatusChanges(overall$, stop$, 1)).toBe(expected); + }); + }); + + it('does not emit if statuses do not change', () => { + getTestScheduler().run(({ expectObservable, hot }) => { + const statuses = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + }); + + const overall$ = hot('-a-b', { + a: statuses, + b: statuses, + }); + const stop$ = hot(''); + const expected = '----'; + + expectObservable(getPluginsStatusChanges(overall$, stop$, 1)).toBe(expected); + }); + }); + + it('emits if any plugin status changes', () => { + getTestScheduler().run(({ expectObservable, hot }) => { + const statusesA = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + }); + const statusesB = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.available, + }); + + const overall$ = hot('-a-b', { + a: statusesA, + b: statusesB, + }); + const stop$ = hot(''); + const expected = '---a'; + + expectObservable(getPluginsStatusChanges(overall$, stop$, 1)).toBe(expected, { + a: [ + { + previousLevel: 'degraded', + nextLevel: 'available', + impactedServices: ['pluginB'], + }, + ], + }); + }); + }); + + it('emits everytime any plugin status changes', () => { + getTestScheduler().run(({ expectObservable, hot }) => { + const availableStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + }); + const degradedStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.degraded, + }); + + const overall$ = hot('-a-b-c-d', { + a: availableStatus, + b: degradedStatus, + c: degradedStatus, + d: availableStatus, + }); + const stop$ = hot(''); + const expected = '---a---b'; + + expectObservable(getPluginsStatusChanges(overall$, stop$, 1)).toBe(expected, { + a: [ + { + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA'], + }, + ], + b: [ + { + previousLevel: 'degraded', + nextLevel: 'available', + impactedServices: ['pluginA'], + }, + ], + }); + }); + }); + + it('throttle events', () => { + getTestScheduler().run(({ expectObservable, hot }) => { + const statusesA = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + }); + const statusesB = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.available, + }); + const statusesC = createPluginsStatuses({ + pluginA: ServiceStatusLevels.degraded, + pluginB: ServiceStatusLevels.available, + }); + + const overall$ = hot('-a-b--c', { + a: statusesA, + b: statusesB, + c: statusesC, + }); + const stop$ = hot(''); + const expected = '------a'; + + expectObservable(getPluginsStatusChanges(overall$, stop$, 5)).toBe(expected, { + a: [ + { + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA'], + }, + { + previousLevel: 'degraded', + nextLevel: 'available', + impactedServices: ['pluginB'], + }, + ], + }); + }); + }); + + it('stops emitting once `stop$` emits', () => { + getTestScheduler().run(({ expectObservable, hot }) => { + const statusesA = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + }); + const statusesB = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.available, + }); + const statusesC = createPluginsStatuses({ + pluginA: ServiceStatusLevels.degraded, + pluginB: ServiceStatusLevels.available, + }); + + const overall$ = hot('-a-b-c', { + a: statusesA, + b: statusesB, + c: statusesC, + }); + const stop$ = hot('----(s|)'); + const expected = '---a|'; + + expectObservable(getPluginsStatusChanges(overall$, stop$, 1)).toBe(expected, { + a: [ + { + previousLevel: 'degraded', + nextLevel: 'available', + impactedServices: ['pluginB'], + }, + ], + }); + }); + }); +}); + +describe('getPluginsStatusDiff', () => { + it('returns an empty list if level is the same for all plugins', () => { + const previousStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + pluginC: ServiceStatusLevels.unavailable, + }); + + const nextStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + pluginC: ServiceStatusLevels.unavailable, + }); + + const result = getPluginsStatusDiff(previousStatus, nextStatus); + + expect(result).toEqual([]); + }); + + it('returns an single entry if only one status changed', () => { + const previousStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + pluginC: ServiceStatusLevels.unavailable, + }); + + const nextStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.degraded, + pluginB: ServiceStatusLevels.degraded, + pluginC: ServiceStatusLevels.unavailable, + }); + + const result = getPluginsStatusDiff(previousStatus, nextStatus); + + expect(result).toEqual([ + { + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA'], + }, + ]); + }); + + it('groups plugins by previous and next level tuples', () => { + const previousStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.available, + pluginC: ServiceStatusLevels.unavailable, + }); + + const nextStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.degraded, + pluginB: ServiceStatusLevels.degraded, + pluginC: ServiceStatusLevels.unavailable, + }); + + const result = getPluginsStatusDiff(previousStatus, nextStatus); + + expect(result).toEqual([ + { + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA', 'pluginB'], + }, + ]); + }); + + it('returns one entry per previous and next level tuples', () => { + const previousStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.available, + pluginB: ServiceStatusLevels.degraded, + pluginC: ServiceStatusLevels.unavailable, + }); + + const nextStatus = createPluginsStatuses({ + pluginA: ServiceStatusLevels.degraded, + pluginB: ServiceStatusLevels.unavailable, + pluginC: ServiceStatusLevels.available, + }); + + const result = getPluginsStatusDiff(previousStatus, nextStatus); + + expect(result).toEqual([ + { + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA'], + }, + { + previousLevel: 'degraded', + nextLevel: 'unavailable', + impactedServices: ['pluginB'], + }, + { + previousLevel: 'unavailable', + nextLevel: 'available', + impactedServices: ['pluginC'], + }, + ]); + }); +}); + +describe('getServiceLevelChangeMessage', () => { + it('returns a human readable message about the change', () => { + expect( + getServiceLevelChangeMessage({ + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA', 'pluginB'], + }) + ).toMatchInlineSnapshot( + `"2 plugins changed status from 'available' to 'degraded': pluginA, pluginB"` + ); + }); +}); diff --git a/src/core/server/status/log_plugins_status.ts b/src/core/server/status/log_plugins_status.ts new file mode 100644 index 0000000000000..5b5d0d84efc4d --- /dev/null +++ b/src/core/server/status/log_plugins_status.ts @@ -0,0 +1,104 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { isDeepStrictEqual } from 'util'; +import { Observable, asyncScheduler } from 'rxjs'; +import { + distinctUntilChanged, + pairwise, + takeUntil, + map, + filter, + throttleTime, +} from 'rxjs/operators'; +import { PluginName } from '../plugins'; +import { ServiceStatus } from './types'; + +export type ServiceStatusWithName = ServiceStatus & { + name: PluginName; +}; + +export interface ServiceLevelChange { + previousLevel: string; + nextLevel: string; + impactedServices: string[]; +} + +export const getPluginsStatusChanges = ( + plugins$: Observable>, + stop$: Observable, + throttleDuration: number = 250 +): Observable => { + return plugins$.pipe( + takeUntil(stop$), + distinctUntilChanged((previous, next) => + isDeepStrictEqual(getStatusLevelMap(previous), getStatusLevelMap(next)) + ), + throttleTime(throttleDuration, asyncScheduler, { leading: true, trailing: true }), + pairwise(), + map(([oldStatus, newStatus]) => { + return getPluginsStatusDiff(oldStatus, newStatus); + }), + filter((statusChanges) => statusChanges.length > 0) + ); +}; + +const getStatusLevelMap = ( + plugins: Record +): Record => { + return Object.entries(plugins).reduce((levelMap, [key, value]) => { + levelMap[key] = value.level.toString(); + return levelMap; + }, {} as Record); +}; + +export const getPluginsStatusDiff = ( + previous: Record, + next: Record +): ServiceLevelChange[] => { + const statusChanges: Map = new Map(); + + Object.entries(next).forEach(([pluginName, nextStatus]) => { + const previousStatus = previous[pluginName]; + if (!previousStatus) { + return; + } + const previousLevel = statusLevel(previousStatus); + const nextLevel = statusLevel(nextStatus); + if (previousLevel === nextLevel) { + return; + } + const changeKey = statusChangeKey(previousLevel, nextLevel); + let statusChange = statusChanges.get(changeKey); + if (!statusChange) { + statusChange = { + previousLevel, + nextLevel, + impactedServices: [], + }; + statusChanges.set(changeKey, statusChange); + } + statusChange.impactedServices.push(pluginName); + }); + + return [...statusChanges.values()]; +}; + +export const getServiceLevelChangeMessage = ({ + impactedServices: services, + nextLevel: next, + previousLevel: previous, +}: ServiceLevelChange): string => { + return `${ + services.length + } plugins changed status from '${previous}' to '${next}': ${services.join(', ')}`; +}; + +const statusLevel = (status: ServiceStatus) => status.level.toString(); + +const statusChangeKey = (previous: string, next: string) => `${previous}:${next}`; diff --git a/src/core/server/status/plugins_status.ts b/src/core/server/status/plugins_status.ts index 719535133e7ab..c4e8e7e364248 100644 --- a/src/core/server/status/plugins_status.ts +++ b/src/core/server/status/plugins_status.ts @@ -30,6 +30,13 @@ interface Deps { export class PluginsStatusService { private readonly pluginStatuses = new Map>(); + private readonly derivedStatuses = new Map>(); + private readonly dependenciesStatuses = new Map< + PluginName, + Observable> + >(); + private allPluginsStatuses?: Observable>; + private readonly update$ = new BehaviorSubject(true); private readonly defaultInheritedStatus$: Observable; private newRegistrationsAllowed = true; @@ -59,7 +66,10 @@ export class PluginsStatusService { } public getAll$(): Observable> { - return this.getPluginStatuses$([...this.deps.pluginDependencies.keys()]); + if (!this.allPluginsStatuses) { + this.allPluginsStatuses = this.getPluginStatuses$([...this.deps.pluginDependencies.keys()]); + } + return this.allPluginsStatuses; } public getDependenciesStatus$(plugin: PluginName): Observable> { @@ -67,35 +77,46 @@ export class PluginsStatusService { if (!dependencies) { throw new Error(`Unknown plugin: ${plugin}`); } - - return this.getPluginStatuses$(dependencies).pipe( - // Prevent many emissions at once from dependency status resolution from making this too noisy - debounceTime(25) - ); + if (!this.dependenciesStatuses.has(plugin)) { + this.dependenciesStatuses.set( + plugin, + this.getPluginStatuses$(dependencies).pipe( + // Prevent many emissions at once from dependency status resolution from making this too noisy + debounceTime(25) + ) + ); + } + return this.dependenciesStatuses.get(plugin)!; } public getDerivedStatus$(plugin: PluginName): Observable { - return this.update$.pipe( - debounceTime(25), // Avoid calling the plugin's custom status logic for every plugin that depends on it. - switchMap(() => { - // Only go up the dependency tree if any of this plugin's dependencies have a custom status - // Helps eliminate memory overhead of creating thousands of Observables unnecessarily. - if (this.anyCustomStatuses(plugin)) { - return combineLatest([this.deps.core$, this.getDependenciesStatus$(plugin)]).pipe( - map(([coreStatus, pluginStatuses]) => { - return getSummaryStatus( - [...Object.entries(coreStatus), ...Object.entries(pluginStatuses)], - { - allAvailableSummary: `All dependencies are available`, - } + if (!this.derivedStatuses.has(plugin)) { + this.derivedStatuses.set( + plugin, + this.update$.pipe( + debounceTime(25), // Avoid calling the plugin's custom status logic for every plugin that depends on it. + switchMap(() => { + // Only go up the dependency tree if any of this plugin's dependencies have a custom status + // Helps eliminate memory overhead of creating thousands of Observables unnecessarily. + if (this.anyCustomStatuses(plugin)) { + return combineLatest([this.deps.core$, this.getDependenciesStatus$(plugin)]).pipe( + map(([coreStatus, pluginStatuses]) => { + return getSummaryStatus( + [...Object.entries(coreStatus), ...Object.entries(pluginStatuses)], + { + allAvailableSummary: `All dependencies are available`, + } + ); + }) ); - }) - ); - } else { - return this.defaultInheritedStatus$; - } - }) - ); + } else { + return this.defaultInheritedStatus$; + } + }) + ) + ); + } + return this.derivedStatuses.get(plugin)!; } private getPluginStatuses$(plugins: PluginName[]): Observable> { diff --git a/src/core/server/status/status_service.test.mocks.ts b/src/core/server/status/status_service.test.mocks.ts new file mode 100644 index 0000000000000..8b860d8355fc6 --- /dev/null +++ b/src/core/server/status/status_service.test.mocks.ts @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const getOverallStatusChangesMock = jest.fn(); +jest.doMock('./log_overall_status', () => ({ + getOverallStatusChanges: getOverallStatusChangesMock, +})); + +export const getPluginsStatusChangesMock = jest.fn(); +export const getServiceLevelChangeMessageMock = jest.fn(); +jest.doMock('./log_plugins_status', () => ({ + getPluginsStatusChanges: getPluginsStatusChangesMock, + getServiceLevelChangeMessage: getServiceLevelChangeMessageMock, +})); diff --git a/src/core/server/status/status_service.test.ts b/src/core/server/status/status_service.test.ts index dfd0ff9a7e103..0b6fbb601c40f 100644 --- a/src/core/server/status/status_service.test.ts +++ b/src/core/server/status/status_service.test.ts @@ -6,7 +6,13 @@ * Side Public License, v 1. */ -import { of, BehaviorSubject } from 'rxjs'; +import { + getOverallStatusChangesMock, + getPluginsStatusChangesMock, + getServiceLevelChangeMessageMock, +} from './status_service.test.mocks'; + +import { of, BehaviorSubject, Subject } from 'rxjs'; import { ServiceStatus, ServiceStatusLevels, CoreStatus } from './types'; import { StatusService } from './status_service'; @@ -19,14 +25,27 @@ import { mockRouter, RouterMock } from '../http/router/router.mock'; import { metricsServiceMock } from '../metrics/metrics_service.mock'; import { configServiceMock } from '../config/mocks'; import { coreUsageDataServiceMock } from '../core_usage_data/core_usage_data_service.mock'; +import { loggingSystemMock } from '../logging/logging_system.mock'; +import type { ServiceLevelChange } from './log_plugins_status'; expect.addSnapshotSerializer(ServiceStatusLevelSnapshotSerializer); describe('StatusService', () => { let service: StatusService; + let logger: ReturnType; beforeEach(() => { - service = new StatusService(mockCoreContext.create()); + logger = loggingSystemMock.create(); + service = new StatusService(mockCoreContext.create({ logger })); + + getOverallStatusChangesMock.mockReturnValue({ subscribe: jest.fn() }); + getPluginsStatusChangesMock.mockReturnValue({ subscribe: jest.fn() }); + }); + + afterEach(() => { + getOverallStatusChangesMock.mockReset(); + getPluginsStatusChangesMock.mockReset(); + getServiceLevelChangeMessageMock.mockReset(); }); const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); @@ -45,7 +64,7 @@ describe('StatusService', () => { }; type SetupDeps = Parameters[0]; - const setupDeps = (overrides: Partial): SetupDeps => { + const setupDeps = (overrides: Partial = {}): SetupDeps => { return { elasticsearch: { status$: of(available), @@ -536,4 +555,88 @@ describe('StatusService', () => { }); }); }); + + describe('start', () => { + it('calls getOverallStatusChanges and subscribe to the returned observable', async () => { + const mockSubscribe = jest.fn(); + getOverallStatusChangesMock.mockReturnValue({ + subscribe: mockSubscribe, + }); + + await service.setup(setupDeps()); + await service.start(); + + expect(getOverallStatusChangesMock).toHaveBeenCalledTimes(1); + expect(mockSubscribe).toHaveBeenCalledTimes(1); + }); + + it('logs a message everytime the getOverallStatusChangesMock observable emits', async () => { + const subject = new Subject(); + getOverallStatusChangesMock.mockReturnValue(subject); + + await service.setup(setupDeps()); + await service.start(); + + subject.next('some message'); + subject.next('another message'); + + const log = logger.get(); + + expect(log.info).toHaveBeenCalledTimes(2); + expect(log.info).toHaveBeenCalledWith('some message'); + expect(log.info).toHaveBeenCalledWith('another message'); + }); + + it('calls getPluginsStatusChanges and subscribe to the returned observable', async () => { + const mockSubscribe = jest.fn(); + getPluginsStatusChangesMock.mockReturnValue({ + subscribe: mockSubscribe, + }); + + await service.setup(setupDeps()); + await service.start(); + + expect(getPluginsStatusChangesMock).toHaveBeenCalledTimes(1); + expect(mockSubscribe).toHaveBeenCalledTimes(1); + }); + + it('logs messages everytime the getPluginsStatusChangesMock observable emits', async () => { + const subject = new Subject(); + getPluginsStatusChangesMock.mockReturnValue(subject); + + getServiceLevelChangeMessageMock.mockImplementation( + ({ + impactedServices: services, + nextLevel: next, + previousLevel: previous, + }: ServiceLevelChange) => { + return `${previous}-${next}-${services[0]}`; + } + ); + + await service.setup(setupDeps()); + await service.start(); + + subject.next([ + { + previousLevel: 'available', + nextLevel: 'degraded', + impactedServices: ['pluginA'], + }, + ]); + subject.next([ + { + previousLevel: 'degraded', + nextLevel: 'available', + impactedServices: ['pluginB'], + }, + ]); + + const log = logger.get(); + + expect(log.info).toHaveBeenCalledTimes(2); + expect(log.info).toHaveBeenCalledWith('available-degraded-pluginA'); + expect(log.info).toHaveBeenCalledWith('degraded-available-pluginB'); + }); + }); }); diff --git a/src/core/server/status/status_service.ts b/src/core/server/status/status_service.ts index 63a1b02d5b2e7..be64b2558acd2 100644 --- a/src/core/server/status/status_service.ts +++ b/src/core/server/status/status_service.ts @@ -27,6 +27,7 @@ import { ServiceStatus, CoreStatus, InternalStatusServiceSetup } from './types'; import { getSummaryStatus } from './get_summary_status'; import { PluginsStatusService } from './plugins_status'; import { getOverallStatusChanges } from './log_overall_status'; +import { getPluginsStatusChanges, getServiceLevelChangeMessage } from './log_plugins_status'; interface StatusLogMeta extends LogMeta { kibana: { status: ServiceStatus }; @@ -165,6 +166,12 @@ export class StatusService implements CoreService { getOverallStatusChanges(this.overall$, this.stop$).subscribe((message) => { this.logger.info(message); }); + + getPluginsStatusChanges(this.pluginsStatus.getAll$(), this.stop$).subscribe((statusChanges) => { + statusChanges.forEach((statusChange) => { + this.logger.info(getServiceLevelChangeMessage(statusChange)); + }); + }); } public stop() { diff --git a/src/dev/bazel/pkg_npm_types/pkg_npm_types.bzl b/src/dev/bazel/pkg_npm_types/pkg_npm_types.bzl index 4651e9264ef50..ed48228bc9587 100644 --- a/src/dev/bazel/pkg_npm_types/pkg_npm_types.bzl +++ b/src/dev/bazel/pkg_npm_types/pkg_npm_types.bzl @@ -33,6 +33,9 @@ def _collect_inputs_deps_and_transitive_types_deps(ctx): deps_files = depset(transitive = deps_files_depsets).to_list() return [deps_files, transitive_types_deps] +def _get_type_package_name(actualName): + return "@types/" + actualName.replace("@", "").replace("/", "__") + def _calculate_entrypoint_path(ctx): return _join(ctx.bin_dir.path, ctx.label.package, _get_types_outdir_name(ctx), ctx.attr.entrypoint_name) @@ -78,7 +81,7 @@ def _pkg_npm_types_impl(ctx): # gathering template args template_args = [ - "NAME", ctx.attr.package_name + "NAME", _get_type_package_name(ctx.attr.package_name) ] # layout api extractor arguments @@ -119,7 +122,7 @@ def _pkg_npm_types_impl(ctx): deps = transitive_types_deps, ), LinkablePackageInfo( - package_name = ctx.attr.package_name, + package_name = _get_type_package_name(ctx.attr.package_name), package_path = "", path = package_dir.path, files = package_dir_depset, diff --git a/src/plugins/controls/common/control_types/options_list/types.ts b/src/plugins/controls/common/control_types/options_list/types.ts index 9a6a96e861bed..5561b80b81153 100644 --- a/src/plugins/controls/common/control_types/options_list/types.ts +++ b/src/plugins/controls/common/control_types/options_list/types.ts @@ -6,6 +6,8 @@ * Side Public License, v 1. */ +import { BoolQuery } from '@kbn/es-query'; +import { FieldSpec } from '../../../../data_views/common'; import { ControlInput } from '../../types'; export const OPTIONS_LIST_CONTROL = 'optionsListControl'; @@ -18,3 +20,17 @@ export interface OptionsListEmbeddableInput extends ControlInput { singleSelect?: boolean; loading?: boolean; } + +export interface OptionsListResponse { + suggestions: string[]; + totalCardinality: number; + invalidSelections?: string[]; +} + +export interface OptionsListRequestBody { + filters?: Array<{ bool: BoolQuery }>; + selectedOptions?: string[]; + searchString?: string; + fieldSpec?: FieldSpec; + fieldName: string; +} diff --git a/src/plugins/controls/common/types.ts b/src/plugins/controls/common/types.ts index ad03bb642f798..d8cb073f64241 100644 --- a/src/plugins/controls/common/types.ts +++ b/src/plugins/controls/common/types.ts @@ -17,6 +17,7 @@ export interface ParentIgnoreSettings { ignoreFilters?: boolean; ignoreQuery?: boolean; ignoreTimerange?: boolean; + ignoreValidations?: boolean; } export type ControlInput = EmbeddableInput & { diff --git a/src/plugins/controls/public/__stories__/controls.stories.tsx b/src/plugins/controls/public/__stories__/controls.stories.tsx index ac181f2ab32dd..d75941c818e39 100644 --- a/src/plugins/controls/public/__stories__/controls.stories.tsx +++ b/src/plugins/controls/public/__stories__/controls.stories.tsx @@ -13,6 +13,7 @@ import uuid from 'uuid'; import { getFlightOptionsAsync, + getFlightSearchOptions, storybookFlightsDataView, } from '../../../presentation_util/public/mocks'; import { @@ -31,6 +32,9 @@ import { pluginServices, registry } from '../services/storybook'; import { replaceValueSuggestionMethod } from '../services/storybook/data'; import { injectStorybookDataView } from '../services/storybook/data_views'; import { populateStorybookControlFactories } from './storybook_control_factories'; +import { OptionsListRequest } from '../services/options_list'; +import { OptionsListResponse } from '../control_types/options_list/types'; +import { replaceOptionsListMethod } from '../services/storybook/options_list'; export default { title: 'Controls', @@ -41,6 +45,22 @@ export default { injectStorybookDataView(storybookFlightsDataView); replaceValueSuggestionMethod(getFlightOptionsAsync); +const storybookStubOptionsListRequest = async ( + request: OptionsListRequest, + abortSignal: AbortSignal +) => + new Promise((r) => + setTimeout( + () => + r({ + suggestions: getFlightSearchOptions(request.field.name, request.searchString), + totalCardinality: 100, + }), + 120 + ) + ); +replaceOptionsListMethod(storybookStubOptionsListRequest); + const ControlGroupStoryComponent: FC<{ panels?: ControlsPanels; edit?: boolean; diff --git a/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx b/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx index 65c93e42a472f..b420e026ac1d3 100644 --- a/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx +++ b/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx @@ -11,15 +11,8 @@ import { uniqBy } from 'lodash'; import ReactDOM from 'react-dom'; import deepEqual from 'fast-deep-equal'; import { Filter, uniqFilters } from '@kbn/es-query'; -import { EMPTY, merge, pipe, Subscription, concat } from 'rxjs'; -import { - distinctUntilChanged, - debounceTime, - catchError, - switchMap, - map, - take, -} from 'rxjs/operators'; +import { EMPTY, merge, pipe, Subscription } from 'rxjs'; +import { distinctUntilChanged, debounceTime, catchError, switchMap, map } from 'rxjs/operators'; import { ControlGroupInput, @@ -77,29 +70,34 @@ export class ControlGroupContainer extends Container< pluginServices.getServices().controls.getControlFactory, parent ); - const anyChildChangePipe = pipe( - map(() => this.getChildIds()), - distinctUntilChanged(deepEqual), - // children may change, so make sure we subscribe/unsubscribe with switchMap - switchMap((newChildIds: string[]) => - merge( - ...newChildIds.map((childId) => - this.getChild(childId) - .getOutput$() - // Embeddables often throw errors into their output streams. - .pipe(catchError(() => EMPTY)) + // when all children are ready start recalculating filters when any child's output changes + this.untilReady().then(() => { + this.recalculateOutput(); + + const anyChildChangePipe = pipe( + map(() => this.getChildIds()), + distinctUntilChanged(deepEqual), + + // children may change, so make sure we subscribe/unsubscribe with switchMap + switchMap((newChildIds: string[]) => + merge( + ...newChildIds.map((childId) => + this.getChild(childId) + .getOutput$() + // Embeddables often throw errors into their output streams. + .pipe(catchError(() => EMPTY)) + ) ) ) - ) - ); + ); - this.subscriptions.add( - concat( - merge(this.getOutput$(), this.getOutput$().pipe(anyChildChangePipe)).pipe(take(1)), // the first time filters are built, don't debounce so that initial filters are built immediately - merge(this.getOutput$(), this.getOutput$().pipe(anyChildChangePipe)).pipe(debounceTime(10)) - ).subscribe(this.recalculateOutput) - ); + this.subscriptions.add( + merge(this.getOutput$(), this.getOutput$().pipe(anyChildChangePipe)) + .pipe(debounceTime(10)) + .subscribe(this.recalculateOutput) + ); + }); } private recalculateOutput = () => { diff --git a/src/plugins/controls/public/control_types/options_list/options_list.scss b/src/plugins/controls/public/control_types/options_list/options_list.scss index 3ccd79ee48a6c..53ad3990cd371 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list.scss +++ b/src/plugins/controls/public/control_types/options_list/options_list.scss @@ -22,6 +22,32 @@ border-color: darken($euiColorLightestShade, 2%); } +.optionsList__popoverTitle { + display: flex; + align-items: center; + justify-content: space-between; +} + +.optionsList__filterInvalid { + color: $euiTextSubduedColor; + text-decoration: line-through; + margin-left: $euiSizeS; + font-weight: 300; +} + +.optionsList__ignoredBadge { + margin-left: $euiSizeS; +} + +.optionsList-control-ignored-selection-title { + padding-left: $euiSizeS; +} + +.optionsList__selectionInvalid { + text-decoration: line-through; + color: $euiTextSubduedColor; +} + .optionsList--filterBtnWrapper { height: 100%; } diff --git a/src/plugins/controls/public/control_types/options_list/options_list_component.tsx b/src/plugins/controls/public/control_types/options_list/options_list_component.tsx index 5547618349b94..3e3d950f532db 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list_component.tsx +++ b/src/plugins/controls/public/control_types/options_list/options_list_component.tsx @@ -10,7 +10,7 @@ import { EuiFilterButton, EuiFilterGroup, EuiPopover, useResizeObserver } from ' import React, { useCallback, useEffect, useMemo, useState, useRef } from 'react'; import { BehaviorSubject, Subject } from 'rxjs'; import classNames from 'classnames'; -import { debounce } from 'lodash'; +import { debounce, isEmpty } from 'lodash'; import { OptionsListStrings } from './options_list_strings'; import { optionsListReducers } from './options_list_reducers'; @@ -20,11 +20,16 @@ import { useReduxEmbeddableContext } from '../../../../presentation_util/public' import './options_list.scss'; import { useStateObservable } from '../../hooks/use_state_observable'; import { OptionsListEmbeddableInput } from './types'; +import { DataViewField } from '../../../../data_views/public'; -// Availableoptions and loading state is controled by the embeddable, but is not considered embeddable input. +// OptionsListComponentState is controlled by the embeddable, but is not considered embeddable input. export interface OptionsListComponentState { - availableOptions?: string[]; loading: boolean; + field?: DataViewField; + totalCardinality?: number; + availableOptions?: string[]; + invalidSelections?: string[]; + validSelections?: string[]; } export const OptionsListComponent = ({ @@ -52,10 +57,11 @@ export const OptionsListComponent = ({ ); // useStateObservable to get component state from Embeddable - const { availableOptions, loading } = useStateObservable( - componentStateSubject, - componentStateSubject.getValue() - ); + const { availableOptions, loading, invalidSelections, validSelections, totalCardinality, field } = + useStateObservable( + componentStateSubject, + componentStateSubject.getValue() + ); // debounce loading state so loading doesn't flash when user types const [buttonLoading, setButtonLoading] = useState(true); @@ -80,12 +86,24 @@ export const OptionsListComponent = ({ [typeaheadSubject] ); - const { selectedOptionsCount, selectedOptionsString } = useMemo(() => { + const { hasSelections, selectionDisplayNode, validSelectionsCount } = useMemo(() => { return { - selectedOptionsCount: selectedOptions?.length, - selectedOptionsString: selectedOptions?.join(OptionsListStrings.summary.getSeparator()), + hasSelections: !isEmpty(validSelections) || !isEmpty(invalidSelections), + validSelectionsCount: validSelections?.length, + selectionDisplayNode: ( + <> + {validSelections && ( + {validSelections?.join(OptionsListStrings.summary.getSeparator())} + )} + {invalidSelections && ( + + {invalidSelections.join(OptionsListStrings.summary.getSeparator())} + + )} + + ), }; - }, [selectedOptions]); + }, [validSelections, invalidSelections]); const button = (

@@ -94,17 +112,15 @@ export const OptionsListComponent = ({ isLoading={buttonLoading} className={classNames('optionsList--filterBtn', { 'optionsList--filterBtnSingle': controlStyle !== 'twoLine', - 'optionsList--filterBtnPlaceholder': !selectedOptionsCount, + 'optionsList--filterBtnPlaceholder': !hasSelections, })} data-test-subj={`optionsList-control-${id}`} onClick={() => setIsPopoverOpen((openState) => !openState)} isSelected={isPopoverOpen} - numActiveFilters={selectedOptionsCount} - hasActiveFilters={(selectedOptionsCount ?? 0) > 0} + numActiveFilters={validSelectionsCount} + hasActiveFilters={Boolean(validSelectionsCount)} > - {!selectedOptionsCount - ? OptionsListStrings.summary.getPlaceholder() - : selectedOptionsString} + {hasSelections ? selectionDisplayNode : OptionsListStrings.summary.getPlaceholder()}
); @@ -127,11 +143,14 @@ export const OptionsListComponent = ({ repositionOnScroll > diff --git a/src/plugins/controls/public/control_types/options_list/options_list_embeddable.tsx b/src/plugins/controls/public/control_types/options_list/options_list_embeddable.tsx index ce570fcbf769e..971fe98b52662 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list_embeddable.tsx +++ b/src/plugins/controls/public/control_types/options_list/options_list_embeddable.tsx @@ -8,47 +8,47 @@ import { Filter, - buildEsQuery, compareFilters, buildPhraseFilter, buildPhrasesFilter, + COMPARE_ALL_OPTIONS, } from '@kbn/es-query'; import React from 'react'; import ReactDOM from 'react-dom'; -import { isEqual } from 'lodash'; +import { isEmpty, isEqual } from 'lodash'; import deepEqual from 'fast-deep-equal'; import { merge, Subject, Subscription, BehaviorSubject } from 'rxjs'; import { tap, debounceTime, map, distinctUntilChanged, skip } from 'rxjs/operators'; import { OptionsListComponent, OptionsListComponentState } from './options_list_component'; -import { - withSuspense, - LazyReduxEmbeddableWrapper, - ReduxEmbeddableWrapperPropsWithChildren, -} from '../../../../presentation_util/public'; import { OptionsListEmbeddableInput, OPTIONS_LIST_CONTROL } from './types'; -import { ControlsDataViewsService } from '../../services/data_views'; +import { DataView, DataViewField } from '../../../../data_views/public'; import { Embeddable, IContainer } from '../../../../embeddable/public'; -import { ControlsDataService } from '../../services/data'; +import { ControlsDataViewsService } from '../../services/data_views'; import { optionsListReducers } from './options_list_reducers'; import { OptionsListStrings } from './options_list_strings'; -import { DataView } from '../../../../data_views/public'; import { ControlInput, ControlOutput } from '../..'; import { pluginServices } from '../../services'; +import { + withSuspense, + LazyReduxEmbeddableWrapper, + ReduxEmbeddableWrapperPropsWithChildren, +} from '../../../../presentation_util/public'; +import { ControlsOptionsListService } from '../../services/options_list'; const OptionsListReduxWrapper = withSuspense< ReduxEmbeddableWrapperPropsWithChildren >(LazyReduxEmbeddableWrapper); const diffDataFetchProps = ( - current?: OptionsListDataFetchProps, - last?: OptionsListDataFetchProps + last?: OptionsListDataFetchProps, + current?: OptionsListDataFetchProps ) => { if (!current || !last) return false; const { filters: currentFilters, ...currentWithoutFilters } = current; const { filters: lastFilters, ...lastWithoutFilters } = last; if (!deepEqual(currentWithoutFilters, lastWithoutFilters)) return false; - if (!compareFilters(lastFilters ?? [], currentFilters ?? [])) return false; + if (!compareFilters(lastFilters ?? [], currentFilters ?? [], COMPARE_ALL_OPTIONS)) return false; return true; }; @@ -60,9 +60,6 @@ interface OptionsListDataFetchProps { filters?: ControlInput['filters']; } -const fieldMissingError = (fieldName: string) => - new Error(`field ${fieldName} not found in index pattern`); - export class OptionsListEmbeddable extends Embeddable { public readonly type = OPTIONS_LIST_CONTROL; public deferEmbeddableLoad = true; @@ -71,17 +68,21 @@ export class OptionsListEmbeddable extends Embeddable = new Subject(); + private abortController?: AbortController; private dataView?: DataView; + private field?: DataViewField; private searchString = ''; // State to be passed down to component private componentState: OptionsListComponentState; private componentStateSubject$ = new BehaviorSubject({ + invalidSelections: [], + validSelections: [], loading: true, }); @@ -89,14 +90,28 @@ export class OptionsListEmbeddable extends Embeddable(); this.initialize(); } + private initialize = async () => { + const { selectedOptions: initialSelectedOptions } = this.getInput(); + if (!initialSelectedOptions) this.setInitializationFinished(); + this.runOptionsListQuery().then(async () => { + if (initialSelectedOptions) { + await this.buildFilter(); + this.setInitializationFinished(); + } + this.setupSubscriptions(); + }); + }; + private setupSubscriptions = () => { const dataFetchPipe = this.getInput$().pipe( map((newInput) => ({ @@ -111,7 +126,6 @@ export class OptionsListEmbeddable extends Embeddable(); const typeaheadPipe = this.typeaheadSubject.pipe( tap((newSearchString) => (this.searchString = newSearchString)), debounceTime(100) @@ -119,30 +133,78 @@ export class OptionsListEmbeddable extends Embeddable isEqual(a.selectedOptions, b.selectedOptions)), + debounceTime(100), + distinctUntilChanged((a, b) => isEqual(a.validSelections, b.validSelections)), skip(1) // skip the first input update because initial filters will be built by initialize. ) .subscribe(() => this.buildFilter()) ); + + /** + * when input selectedOptions changes, check all selectedOptions against the latest value of invalidSelections. + **/ + this.subscriptions.add( + this.getInput$() + .pipe(distinctUntilChanged((a, b) => isEqual(a.selectedOptions, b.selectedOptions))) + .subscribe(({ selectedOptions: newSelectedOptions }) => { + if (!newSelectedOptions || isEmpty(newSelectedOptions)) { + this.updateComponentState({ + validSelections: [], + invalidSelections: [], + }); + return; + } + const { invalidSelections } = this.componentStateSubject$.getValue(); + const newValidSelections: string[] = []; + const newInvalidSelections: string[] = []; + for (const selectedOption of newSelectedOptions) { + if (invalidSelections?.includes(selectedOption)) { + newInvalidSelections.push(selectedOption); + continue; + } + newValidSelections.push(selectedOption); + } + this.updateComponentState({ + validSelections: newValidSelections, + invalidSelections: newInvalidSelections, + }); + }) + ); }; - private getCurrentDataView = async (): Promise => { - const { dataViewId } = this.getInput(); - if (this.dataView && this.dataView.id === dataViewId) return this.dataView; - this.dataView = await this.dataViewsService.get(dataViewId); - if (this.dataView === undefined) { - this.onFatalError(new Error(OptionsListStrings.errors.getDataViewNotFoundError(dataViewId))); + private getCurrentDataViewAndField = async (): Promise<{ + dataView: DataView; + field: DataViewField; + }> => { + const { dataViewId, fieldName } = this.getInput(); + if (!this.dataView || this.dataView.id !== dataViewId) { + this.dataView = await this.dataViewsService.get(dataViewId); + if (this.dataView === undefined) { + this.onFatalError( + new Error(OptionsListStrings.errors.getDataViewNotFoundError(dataViewId)) + ); + } + this.updateOutput({ dataViews: [this.dataView] }); + } + + if (!this.field || this.field.name !== fieldName) { + this.field = this.dataView.getFieldByName(fieldName); + if (this.field === undefined) { + this.onFatalError(new Error(OptionsListStrings.errors.getDataViewNotFoundError(fieldName))); + } + this.updateComponentState({ field: this.field }); } - this.updateOutput({ dataViews: [this.dataView] }); - return this.dataView; + + return { dataView: this.dataView, field: this.field! }; }; private updateComponentState(changes: Partial) { @@ -153,62 +215,67 @@ export class OptionsListEmbeddable extends Embeddable { + private runOptionsListQuery = async () => { this.updateComponentState({ loading: true }); - const { ignoreParentSettings, filters, fieldName, query } = this.getInput(); - const dataView = await this.getCurrentDataView(); - const field = dataView.getFieldByName(fieldName); - - if (!field) throw fieldMissingError(fieldName); - - const boolFilter = [ - buildEsQuery( - dataView, - ignoreParentSettings?.ignoreQuery ? [] : query ?? [], - ignoreParentSettings?.ignoreFilters ? [] : filters ?? [] - ), - ]; - - // TODO Switch between `terms_agg` and `terms_enum` method depending on the value of ignoreParentSettings - // const method = Object.values(ignoreParentSettings || {}).includes(false) ? - - const newOptions = await this.dataService.autocomplete.getValueSuggestions({ - query: this.searchString, - indexPattern: dataView, - useTimeRange: !ignoreParentSettings?.ignoreTimerange, - method: 'terms_agg', // terms_agg method is required to use timeRange - boolFilter, - field, - }); - this.updateComponentState({ availableOptions: newOptions, loading: false }); - }; + const { dataView, field } = await this.getCurrentDataViewAndField(); + const { ignoreParentSettings, filters, query, selectedOptions, timeRange } = this.getInput(); + + if (this.abortController) this.abortController.abort(); + this.abortController = new AbortController(); + const { suggestions, invalidSelections, totalCardinality } = + await this.optionsListService.runOptionsListRequest( + { + field, + dataView, + selectedOptions, + searchString: this.searchString, + ...(ignoreParentSettings?.ignoreQuery ? {} : { query }), + ...(ignoreParentSettings?.ignoreFilters ? {} : { filters }), + ...(ignoreParentSettings?.ignoreTimerange ? {} : { timeRange }), + }, + this.abortController.signal + ); + + if (!selectedOptions || isEmpty(invalidSelections) || ignoreParentSettings?.ignoreValidations) { + this.updateComponentState({ + availableOptions: suggestions, + invalidSelections: undefined, + validSelections: selectedOptions, + totalCardinality, + loading: false, + }); + return; + } - private initialize = async () => { - const initialSelectedOptions = this.getInput().selectedOptions; - if (initialSelectedOptions) { - await this.getCurrentDataView(); - await this.buildFilter(); + const valid: string[] = []; + const invalid: string[] = []; + + for (const selectedOption of selectedOptions) { + if (invalidSelections?.includes(selectedOption)) invalid.push(selectedOption); + else valid.push(selectedOption); } - this.setInitializationFinished(); - this.setupSubscriptions(); + this.updateComponentState({ + availableOptions: suggestions, + invalidSelections: invalid, + validSelections: valid, + totalCardinality, + loading: false, + }); }; private buildFilter = async () => { - const { fieldName, selectedOptions } = this.getInput(); - if (!selectedOptions || selectedOptions.length === 0) { + const { validSelections } = this.componentState; + if (!validSelections || isEmpty(validSelections)) { this.updateOutput({ filters: [] }); return; } - const dataView = await this.getCurrentDataView(); - const field = dataView.getFieldByName(this.getInput().fieldName); - - if (!field) throw fieldMissingError(fieldName); + const { dataView, field } = await this.getCurrentDataViewAndField(); let newFilter: Filter; - if (selectedOptions.length === 1) { - newFilter = buildPhraseFilter(field, selectedOptions[0], dataView); + if (validSelections.length === 1) { + newFilter = buildPhraseFilter(field, validSelections[0], dataView); } else { - newFilter = buildPhrasesFilter(field, selectedOptions, dataView); + newFilter = buildPhrasesFilter(field, validSelections, dataView); } newFilter.meta.key = field?.name; @@ -216,11 +283,12 @@ export class OptionsListEmbeddable extends Embeddable { - this.fetchAvailableOptions(); + this.runOptionsListQuery(); }; public destroy = () => { super.destroy(); + this.abortController?.abort(); this.subscriptions.unsubscribe(); }; diff --git a/src/plugins/controls/public/control_types/options_list/options_list_popover_component.tsx b/src/plugins/controls/public/control_types/options_list/options_list_popover_component.tsx index 68284af6bb47d..ab83b868445a9 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list_popover_component.tsx +++ b/src/plugins/controls/public/control_types/options_list/options_list_popover_component.tsx @@ -14,28 +14,38 @@ import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, - EuiToolTip, EuiFormRow, + EuiToolTip, EuiSpacer, + EuiBadge, EuiIcon, + EuiTitle, } from '@elastic/eui'; +import { isEmpty } from 'lodash'; import { OptionsListEmbeddableInput } from './types'; import { OptionsListStrings } from './options_list_strings'; +import { DataViewField } from '../../../../data_views/public'; import { optionsListReducers } from './options_list_reducers'; import { OptionsListComponentState } from './options_list_component'; import { useReduxEmbeddableContext } from '../../../../presentation_util/public'; export const OptionsListPopover = ({ + field, loading, searchString, availableOptions, + totalCardinality, + invalidSelections, updateSearchString, width, }: { + field?: DataViewField; searchString: string; + totalCardinality?: number; width: number; loading: OptionsListComponentState['loading']; + invalidSelections?: string[]; updateSearchString: (newSearchString: string) => void; availableOptions: OptionsListComponentState['availableOptions']; }) => { @@ -49,64 +59,94 @@ export const OptionsListPopover = ({ const dispatch = useEmbeddableDispatch(); const { selectedOptions, singleSelect, title } = useEmbeddableSelector((state) => state); - // track selectedOptions in a set for more efficient lookup + // track selectedOptions and invalidSelections in sets for more efficient lookup const selectedOptionsSet = useMemo(() => new Set(selectedOptions), [selectedOptions]); + const invalidSelectionsSet = useMemo( + () => new Set(invalidSelections), + [invalidSelections] + ); + const [showOnlySelected, setShowOnlySelected] = useState(false); return ( <> {title} -
- - - - updateSearchString(event.target.value)} - value={searchString} - data-test-subj="optionsList-control-search-input" - /> - - - - dispatch(clearSelections({}))} - /> - - - - - setShowOnlySelected(!showOnlySelected)} + {field?.type !== 'boolean' && ( +
+ + + + updateSearchString(event.target.value)} + value={searchString} + data-test-subj="optionsList-control-search-input" + placeholder={ + totalCardinality + ? OptionsListStrings.popover.getTotalCardinalityPlaceholder(totalCardinality) + : undefined + } /> - - - - -
+
+ + {invalidSelections && invalidSelections.length > 0 && ( + + + {invalidSelections.length} + + + )} + + + + dispatch(clearSelections({}))} + /> + + + + + setShowOnlySelected(!showOnlySelected)} + /> + + +
+
+
+ )}
300 ? width : undefined }} className="optionsList__items" @@ -145,6 +185,32 @@ export const OptionsListPopover = ({
)} + + {!isEmpty(invalidSelections) && ( + <> + + + + + <> + {invalidSelections?.map((ignoredSelection, index) => ( + dispatch(deselectOption(ignoredSelection))} + > + {`${ignoredSelection}`} + + ))} + + + )} )} {showOnlySelected && ( @@ -152,9 +218,14 @@ export const OptionsListPopover = ({ {selectedOptions && selectedOptions.map((availableOption, index) => ( dispatch(deselectOption(availableOption))} + className={ + invalidSelectionsSet.has(availableOption) + ? 'optionsList__selectionInvalid' + : undefined + } > {`${availableOption}`} diff --git a/src/plugins/controls/public/control_types/options_list/options_list_reducers.ts b/src/plugins/controls/public/control_types/options_list/options_list_reducers.ts index 39f6281a11c6b..15f41380e0d72 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list_reducers.ts +++ b/src/plugins/controls/public/control_types/options_list/options_list_reducers.ts @@ -24,6 +24,20 @@ export const optionsListReducers = { state.selectedOptions = newSelections; } }, + deselectOptions: ( + state: WritableDraft, + action: PayloadAction + ) => { + for (const optionToDeselect of action.payload) { + if (!state.selectedOptions) return; + const itemIndex = state.selectedOptions.indexOf(optionToDeselect); + if (itemIndex !== -1) { + const newSelections = [...state.selectedOptions]; + newSelections.splice(itemIndex, 1); + state.selectedOptions = newSelections; + } + } + }, selectOption: ( state: WritableDraft, action: PayloadAction @@ -38,6 +52,6 @@ export const optionsListReducers = { state.selectedOptions = [action.payload]; }, clearSelections: (state: WritableDraft) => { - state.selectedOptions = []; + if (state.selectedOptions) state.selectedOptions = []; }, }; diff --git a/src/plugins/controls/public/control_types/options_list/options_list_strings.ts b/src/plugins/controls/public/control_types/options_list/options_list_strings.ts index 0a6e46c514d11..537697804dd5b 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list_strings.ts +++ b/src/plugins/controls/public/control_types/options_list/options_list_strings.ts @@ -44,11 +44,11 @@ export const OptionsListStrings = { popover: { getLoadingMessage: () => i18n.translate('controls.optionsList.popover.loading', { - defaultMessage: 'Loading filters', + defaultMessage: 'Loading options', }), getEmptyMessage: () => i18n.translate('controls.optionsList.popover.empty', { - defaultMessage: 'No filters found', + defaultMessage: 'No options found', }), getSelectionsEmptyMessage: () => i18n.translate('controls.optionsList.popover.selectionsEmpty', { @@ -66,6 +66,38 @@ export const OptionsListStrings = { i18n.translate('controls.optionsList.popover.clearAllSelectionsTitle', { defaultMessage: 'Clear selections', }), + getTotalCardinalityTooltip: (totalOptions: number) => + i18n.translate('controls.optionsList.popover.cardinalityTooltip', { + defaultMessage: '{totalOptions} available options.', + values: { totalOptions }, + }), + getTotalCardinalityPlaceholder: (totalOptions: number) => + i18n.translate('controls.optionsList.popover.cardinalityPlaceholder', { + defaultMessage: + 'Search {totalOptions} available {totalOptions, plural, one {option} other {options}}', + values: { totalOptions }, + }), + getInvalidSelectionsTitle: (invalidSelectionCount: number) => + i18n.translate('controls.optionsList.popover.invalidSelectionsTitle', { + defaultMessage: '{invalidSelectionCount} selected options ignored', + values: { invalidSelectionCount }, + }), + getInvalidSelectionsSectionTitle: (invalidSelectionCount: number) => + i18n.translate('controls.optionsList.popover.invalidSelectionsSectionTitle', { + defaultMessage: + 'Ignored {invalidSelectionCount, plural, one {selection} other {selections}}', + values: { invalidSelectionCount }, + }), + getInvalidSelectionsAriaLabel: () => + i18n.translate('controls.optionsList.popover.invalidSelectionsAriaLabel', { + defaultMessage: 'Deselect all ignored selections', + }), + getInvalidSelectionsTooltip: (selectedOptions: number) => + i18n.translate('controls.optionsList.popover.invalidSelectionsTooltip', { + defaultMessage: + '{selectedOptions} selected {selectedOptions, plural, one {option} other {options}} {selectedOptions, plural, one {is} other {are}} ignored because {selectedOptions, plural, one {it is} other {they are}} no longer in the data.', + values: { selectedOptions }, + }), }, errors: { getDataViewNotFoundError: (dataViewId: string) => @@ -73,5 +105,10 @@ export const OptionsListStrings = { defaultMessage: 'Could not locate data view: {dataViewId}', values: { dataViewId }, }), + getfieldNotFoundError: (fieldId: string) => + i18n.translate('controls.optionsList.errors.fieldNotFound', { + defaultMessage: 'Could not locate field: {fieldId}', + values: { fieldId }, + }), }, }; diff --git a/src/plugins/controls/public/plugin.ts b/src/plugins/controls/public/plugin.ts index c4ff865a05e47..0c81f4c826175 100644 --- a/src/plugins/controls/public/plugin.ts +++ b/src/plugins/controls/public/plugin.ts @@ -8,19 +8,21 @@ import { CoreSetup, CoreStart, Plugin } from '../../../core/public'; import { pluginServices } from './services'; -import { registry } from './services/kibana'; import { ControlsPluginSetup, ControlsPluginStart, ControlsPluginSetupDeps, ControlsPluginStartDeps, IEditableControlFactory, - ControlEditorProps, - ControlEmbeddable, ControlInput, } from './types'; -import { OptionsListEmbeddableFactory } from './control_types/options_list'; +import { + OptionsListEmbeddableFactory, + OptionsListEmbeddableInput, +} from './control_types/options_list'; import { ControlGroupContainerFactory, CONTROL_GROUP_TYPE, OPTIONS_LIST_CONTROL } from '.'; +import { controlsService } from './services/kibana/controls'; +import { EmbeddableFactory } from '../../embeddable/public'; export class ControlsPlugin implements @@ -31,63 +33,63 @@ export class ControlsPlugin ControlsPluginStartDeps > { - private inlineEditors: { - [key: string]: { - controlEditorComponent?: (props: ControlEditorProps) => JSX.Element; - presaveTransformFunction?: ( - newInput: Partial, - embeddable?: ControlEmbeddable - ) => Partial; - }; - } = {}; + private async startControlsKibanaServices( + coreStart: CoreStart, + startPlugins: ControlsPluginStartDeps + ) { + const { registry } = await import('./services/kibana'); + pluginServices.setRegistry(registry.start({ coreStart, startPlugins })); + } + + private transferEditorFunctions( + factoryDef: IEditableControlFactory, + factory: EmbeddableFactory + ) { + (factory as IEditableControlFactory).controlEditorComponent = + factoryDef.controlEditorComponent; + (factory as IEditableControlFactory).presaveTransformFunction = + factoryDef.presaveTransformFunction; + } public setup( _coreSetup: CoreSetup, _setupPlugins: ControlsPluginSetupDeps ): ControlsPluginSetup { - _coreSetup.getStartServices().then(([coreStart, deps]) => { - // register control group embeddable factory + const { registerControlType } = controlsService; + + // register control group embeddable factory + _coreSetup.getStartServices().then(([, deps]) => { embeddable.registerEmbeddableFactory( CONTROL_GROUP_TYPE, new ControlGroupContainerFactory(deps.embeddable) ); - }); + // Options List control factory setup + const optionsListFactoryDef = new OptionsListEmbeddableFactory(); + const optionsListFactory = embeddable.registerEmbeddableFactory( + OPTIONS_LIST_CONTROL, + optionsListFactoryDef + )(); + this.transferEditorFunctions( + optionsListFactoryDef, + optionsListFactory + ); + registerControlType(optionsListFactory); + }); const { embeddable } = _setupPlugins; - // create control type embeddable factories. - const optionsListFactory = new OptionsListEmbeddableFactory(); - const editableOptionsListFactory = optionsListFactory as IEditableControlFactory; - this.inlineEditors[OPTIONS_LIST_CONTROL] = { - controlEditorComponent: editableOptionsListFactory.controlEditorComponent, - presaveTransformFunction: editableOptionsListFactory.presaveTransformFunction, + return { + registerControlType, }; - embeddable.registerEmbeddableFactory(OPTIONS_LIST_CONTROL, optionsListFactory); - - return {}; } public start(coreStart: CoreStart, startPlugins: ControlsPluginStartDeps): ControlsPluginStart { - pluginServices.setRegistry(registry.start({ coreStart, startPlugins })); - const { controls: controlsService } = pluginServices.getServices(); - const { embeddable } = startPlugins; - - // register control types with controls service. - const optionsListFactory = embeddable.getEmbeddableFactory(OPTIONS_LIST_CONTROL); - // Temporarily pass along inline editors - inline editing should be made a first-class feature of embeddables - const editableOptionsListFactory = optionsListFactory as IEditableControlFactory; - const { - controlEditorComponent: optionsListControlEditor, - presaveTransformFunction: optionsListPresaveTransform, - } = this.inlineEditors[OPTIONS_LIST_CONTROL]; - editableOptionsListFactory.controlEditorComponent = optionsListControlEditor; - editableOptionsListFactory.presaveTransformFunction = optionsListPresaveTransform; - - if (optionsListFactory) controlsService.registerControlType(optionsListFactory); + this.startControlsKibanaServices(coreStart, startPlugins); + const { getControlFactory, getControlTypes } = controlsService; return { - ContextProvider: pluginServices.getContextProvider(), - controlsService, + getControlFactory, + getControlTypes, }; } diff --git a/src/plugins/controls/public/services/controls.ts b/src/plugins/controls/public/services/controls.ts index 83a3c8eec98d3..7ca396b267e14 100644 --- a/src/plugins/controls/public/services/controls.ts +++ b/src/plugins/controls/public/services/controls.ts @@ -26,29 +26,3 @@ export interface ControlsService { getControlTypes: () => string[]; } - -export const getCommonControlsService = () => { - const controlsFactoriesMap: ControlTypeRegistry = {}; - - const registerControlType = (factory: ControlFactory) => { - controlsFactoriesMap[factory.type] = factory; - }; - - const getControlFactory = < - I extends ControlInput = ControlInput, - O extends ControlOutput = ControlOutput, - E extends ControlEmbeddable = ControlEmbeddable - >( - type: string - ) => { - return controlsFactoriesMap[type] as EmbeddableFactory; - }; - - const getControlTypes = () => Object.keys(controlsFactoriesMap); - - return { - registerControlType, - getControlFactory, - getControlTypes, - }; -}; diff --git a/src/plugins/controls/public/services/data.ts b/src/plugins/controls/public/services/data.ts index 0a99317e29a26..f25b3f6a95801 100644 --- a/src/plugins/controls/public/services/data.ts +++ b/src/plugins/controls/public/services/data.ts @@ -10,4 +10,5 @@ import { DataPublicPluginStart } from '../../../data/public'; export interface ControlsDataService { autocomplete: DataPublicPluginStart['autocomplete']; + query: DataPublicPluginStart['query']; } diff --git a/src/plugins/controls/public/services/http.ts b/src/plugins/controls/public/services/http.ts new file mode 100644 index 0000000000000..1e3d7f92163bd --- /dev/null +++ b/src/plugins/controls/public/services/http.ts @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup } from '../../../../core/public'; + +export interface ControlsHTTPService { + fetch: CoreSetup['http']['fetch']; +} diff --git a/src/plugins/controls/public/services/index.ts b/src/plugins/controls/public/services/index.ts index 5730dbf68cefb..d1dcd9b158a0a 100644 --- a/src/plugins/controls/public/services/index.ts +++ b/src/plugins/controls/public/services/index.ts @@ -13,12 +13,19 @@ import { registry as stubRegistry } from './stub'; import { ControlsPluginStart } from '../types'; import { ControlsDataService } from './data'; import { ControlsService } from './controls'; +import { ControlsHTTPService } from './http'; +import { ControlsOptionsListService } from './options_list'; export interface ControlsServices { + // dependency services dataViews: ControlsDataViewsService; overlays: ControlsOverlaysService; data: ControlsDataService; + http: ControlsHTTPService; + + // controls plugin's own services controls: ControlsService; + optionsList: ControlsOptionsListService; } export const pluginServices = new PluginServices(); @@ -26,7 +33,7 @@ export const pluginServices = new PluginServices(); export const getStubPluginServices = (): ControlsPluginStart => { pluginServices.setRegistry(stubRegistry.start({})); return { - ContextProvider: pluginServices.getContextProvider(), - controlsService: pluginServices.getServices().controls, + getControlFactory: pluginServices.getServices().controls.getControlFactory, + getControlTypes: pluginServices.getServices().controls.getControlTypes, }; }; diff --git a/src/plugins/controls/public/services/kibana/controls.ts b/src/plugins/controls/public/services/kibana/controls.ts index 7c33ee8c33527..8b53c62ff0f4e 100644 --- a/src/plugins/controls/public/services/kibana/controls.ts +++ b/src/plugins/controls/public/services/kibana/controls.ts @@ -6,8 +6,29 @@ * Side Public License, v 1. */ +import { ControlEmbeddable, ControlFactory, ControlInput, ControlOutput } from '../..'; +import { EmbeddableFactory } from '../../../../embeddable/public'; import { PluginServiceFactory } from '../../../../presentation_util/public'; -import { getCommonControlsService, ControlsService } from '../controls'; +import { ControlsService, ControlTypeRegistry } from '../controls'; export type ControlsServiceFactory = PluginServiceFactory; -export const controlsServiceFactory = () => getCommonControlsService(); +export const controlsServiceFactory = () => controlsService; + +const controlsFactoriesMap: ControlTypeRegistry = {}; + +// export controls service directly for use in plugin setup lifecycle +export const controlsService: ControlsService = { + registerControlType: (factory: ControlFactory) => { + controlsFactoriesMap[factory.type] = factory; + }, + getControlFactory: < + I extends ControlInput = ControlInput, + O extends ControlOutput = ControlOutput, + E extends ControlEmbeddable = ControlEmbeddable + >( + type: string + ) => { + return controlsFactoriesMap[type] as EmbeddableFactory; + }, + getControlTypes: () => Object.keys(controlsFactoriesMap), +}; diff --git a/src/plugins/controls/public/services/kibana/data.ts b/src/plugins/controls/public/services/kibana/data.ts index 4b4b9ad8afd81..e411766fe0f34 100644 --- a/src/plugins/controls/public/services/kibana/data.ts +++ b/src/plugins/controls/public/services/kibana/data.ts @@ -17,9 +17,10 @@ export type DataServiceFactory = KibanaPluginServiceFactory< export const dataServiceFactory: DataServiceFactory = ({ startPlugins }) => { const { - data: { autocomplete }, + data: { query, autocomplete }, } = startPlugins; return { autocomplete, + query, }; }; diff --git a/src/plugins/controls/public/services/kibana/http.ts b/src/plugins/controls/public/services/kibana/http.ts new file mode 100644 index 0000000000000..2eda2e4bf3f8c --- /dev/null +++ b/src/plugins/controls/public/services/kibana/http.ts @@ -0,0 +1,25 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ControlsHTTPService } from '../http'; +import { ControlsPluginStartDeps } from '../../types'; +import { KibanaPluginServiceFactory } from '../../../../presentation_util/public'; + +export type HttpServiceFactory = KibanaPluginServiceFactory< + ControlsHTTPService, + ControlsPluginStartDeps +>; +export const httpServiceFactory: HttpServiceFactory = ({ coreStart }) => { + const { + http: { fetch }, + } = coreStart; + + return { + fetch, + }; +}; diff --git a/src/plugins/controls/public/services/kibana/index.ts b/src/plugins/controls/public/services/kibana/index.ts index 5f7f05705203e..f87bd744b3541 100644 --- a/src/plugins/controls/public/services/kibana/index.ts +++ b/src/plugins/controls/public/services/kibana/index.ts @@ -19,15 +19,20 @@ import { dataViewsServiceFactory } from './data_views'; import { controlsServiceFactory } from './controls'; import { overlaysServiceFactory } from './overlays'; import { dataServiceFactory } from './data'; +import { httpServiceFactory } from './http'; +import { optionsListServiceFactory } from './options_list'; export const providers: PluginServiceProviders< ControlsServices, KibanaPluginServiceParams > = { + http: new PluginServiceProvider(httpServiceFactory), data: new PluginServiceProvider(dataServiceFactory), overlays: new PluginServiceProvider(overlaysServiceFactory), - controls: new PluginServiceProvider(controlsServiceFactory), dataViews: new PluginServiceProvider(dataViewsServiceFactory), + + optionsList: new PluginServiceProvider(optionsListServiceFactory, ['data', 'http']), + controls: new PluginServiceProvider(controlsServiceFactory), }; export const registry = new PluginServiceRegistry< diff --git a/src/plugins/controls/public/services/kibana/options_list.ts b/src/plugins/controls/public/services/kibana/options_list.ts new file mode 100644 index 0000000000000..eb805ec4dbe02 --- /dev/null +++ b/src/plugins/controls/public/services/kibana/options_list.ts @@ -0,0 +1,113 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { memoize } from 'lodash'; +import dateMath from '@elastic/datemath'; +import { buildEsQuery } from '@kbn/es-query'; + +import { TimeRange } from '../../../../data/public'; +import { ControlsOptionsListService, OptionsListRequest } from '../options_list'; +import { + OptionsListRequestBody, + OptionsListResponse, +} from '../../control_types/options_list/types'; +import { KibanaPluginServiceFactory } from '../../../../presentation_util/public'; +import { ControlsPluginStartDeps } from '../../types'; +import { ControlsDataService } from '../data'; +import { ControlsHTTPService } from '../http'; + +class OptionsListService implements ControlsOptionsListService { + private data: ControlsDataService; + private http: ControlsHTTPService; + + constructor(requiredServices: OptionsListServiceRequiredServices) { + ({ data: this.data, http: this.http } = requiredServices); + } + + private getRoundedTimeRange = (timeRange: TimeRange) => ({ + from: dateMath.parse(timeRange.from)!.startOf('minute').toISOString(), + to: dateMath.parse(timeRange.to)!.endOf('minute').toISOString(), + }); + + private optionsListCacheResolver = (request: OptionsListRequest) => { + const { + query, + filters, + timeRange, + searchString, + selectedOptions, + field: { name: fieldName }, + dataView: { title: dataViewTitle }, + } = request; + return [ + ...(timeRange ? JSON.stringify(this.getRoundedTimeRange(timeRange)) : []), // round timeRange to the minute to avoid cache misses + Math.floor(Date.now() / 1000 / 60), // Only cache results for a minute in case data changes in ES index + selectedOptions?.join(','), + JSON.stringify(filters), + JSON.stringify(query), + dataViewTitle, + searchString, + fieldName, + ].join('|'); + }; + + private cachedOptionsListRequest = memoize( + async (request: OptionsListRequest, abortSignal: AbortSignal) => { + const index = request.dataView.title; + const requestBody = this.getRequestBody(request); + return await this.http.fetch( + `/api/kibana/controls/optionsList/${index}`, + { + body: JSON.stringify(requestBody), + signal: abortSignal, + method: 'POST', + } + ); + }, + this.optionsListCacheResolver + ); + + private getRequestBody = (request: OptionsListRequest): OptionsListRequestBody => { + const timeService = this.data.query.timefilter.timefilter; + const { query, filters, dataView, timeRange, field, ...passThroughProps } = request; + const timeFilter = timeRange ? timeService.createFilter(dataView, timeRange) : undefined; + const filtersToUse = [...(filters ?? []), ...(timeFilter ? [timeFilter] : [])]; + const esFilters = [buildEsQuery(dataView, query ?? [], filtersToUse ?? [])]; + return { + ...passThroughProps, + filters: esFilters, + fieldName: field.name, + fieldSpec: field.toSpec?.(), + }; + }; + + public runOptionsListRequest = async (request: OptionsListRequest, abortSignal: AbortSignal) => { + try { + return await this.cachedOptionsListRequest(request, abortSignal); + } catch (error) { + // Remove rejected results from memoize cache + this.cachedOptionsListRequest.cache.delete(this.optionsListCacheResolver(request)); + return {} as OptionsListResponse; + } + }; +} + +export interface OptionsListServiceRequiredServices { + data: ControlsDataService; + http: ControlsHTTPService; +} + +export type OptionsListServiceFactory = KibanaPluginServiceFactory< + ControlsOptionsListService, + ControlsPluginStartDeps, + OptionsListServiceRequiredServices +>; + +export const optionsListServiceFactory: OptionsListServiceFactory = (core, requiredServices) => { + return new OptionsListService(requiredServices); +}; diff --git a/src/plugins/controls/public/services/options_list.ts b/src/plugins/controls/public/services/options_list.ts new file mode 100644 index 0000000000000..479d1bee691bb --- /dev/null +++ b/src/plugins/controls/public/services/options_list.ts @@ -0,0 +1,31 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Filter, Query } from '@kbn/es-query'; + +import { TimeRange } from '../../../data/public'; +import { DataView, DataViewField } from '../../../data_views/public'; +import { OptionsListRequestBody, OptionsListResponse } from '../control_types/options_list/types'; + +export type OptionsListRequest = Omit< + OptionsListRequestBody, + 'filters' | 'fieldName' | 'fieldSpec' +> & { + timeRange?: TimeRange; + field: DataViewField; + dataView: DataView; + filters?: Filter[]; + query?: Query; +}; + +export interface ControlsOptionsListService { + runOptionsListRequest: ( + request: OptionsListRequest, + abortSignal: AbortSignal + ) => Promise; +} diff --git a/src/plugins/controls/public/services/storybook/data.ts b/src/plugins/controls/public/services/storybook/data.ts index 6d4942b358ac3..c26d7c0835295 100644 --- a/src/plugins/controls/public/services/storybook/data.ts +++ b/src/plugins/controls/public/services/storybook/data.ts @@ -22,4 +22,5 @@ export const dataServiceFactory: DataServiceFactory = () => ({ autocomplete: { getValueSuggestions: valueSuggestionMethod, } as unknown as DataPublicPluginStart['autocomplete'], + query: {} as unknown as DataPublicPluginStart['query'], }); diff --git a/src/plugins/controls/public/services/storybook/index.ts b/src/plugins/controls/public/services/storybook/index.ts index 36d8e7e78869d..4eabd6a1bb006 100644 --- a/src/plugins/controls/public/services/storybook/index.ts +++ b/src/plugins/controls/public/services/storybook/index.ts @@ -15,16 +15,22 @@ import { import { ControlsServices } from '..'; import { dataServiceFactory } from './data'; import { overlaysServiceFactory } from './overlays'; -import { controlsServiceFactory } from './controls'; import { dataViewsServiceFactory } from './data_views'; +import { httpServiceFactory } from '../stub/http'; + +import { optionsListServiceFactory } from './options_list'; +import { controlsServiceFactory } from '../stub/controls'; export type { ControlsServices } from '..'; export const providers: PluginServiceProviders = { dataViews: new PluginServiceProvider(dataViewsServiceFactory), + http: new PluginServiceProvider(httpServiceFactory), data: new PluginServiceProvider(dataServiceFactory), overlays: new PluginServiceProvider(overlaysServiceFactory), + controls: new PluginServiceProvider(controlsServiceFactory), + optionsList: new PluginServiceProvider(optionsListServiceFactory), }; export const pluginServices = new PluginServices(); diff --git a/src/plugins/controls/public/services/storybook/options_list.ts b/src/plugins/controls/public/services/storybook/options_list.ts new file mode 100644 index 0000000000000..ee604042a2064 --- /dev/null +++ b/src/plugins/controls/public/services/storybook/options_list.ts @@ -0,0 +1,35 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../../../../presentation_util/public'; +import { OptionsListResponse } from '../../control_types/options_list/types'; +import { ControlsOptionsListService, OptionsListRequest } from '../options_list'; + +export type OptionsListServiceFactory = PluginServiceFactory; + +let optionsListRequestMethod = async (request: OptionsListRequest, abortSignal: AbortSignal) => + new Promise((r) => + setTimeout( + () => + r({ + suggestions: [], + totalCardinality: 100, + }), + 120 + ) + ); + +export const replaceOptionsListMethod = ( + newMethod: (request: OptionsListRequest, abortSignal: AbortSignal) => Promise +) => (optionsListRequestMethod = newMethod); + +export const optionsListServiceFactory: OptionsListServiceFactory = () => { + return { + runOptionsListRequest: optionsListRequestMethod, + }; +}; diff --git a/src/plugins/controls/public/services/stub/controls.ts b/src/plugins/controls/public/services/stub/controls.ts index 7c33ee8c33527..0bc1ae9b9d305 100644 --- a/src/plugins/controls/public/services/stub/controls.ts +++ b/src/plugins/controls/public/services/stub/controls.ts @@ -6,8 +6,36 @@ * Side Public License, v 1. */ +import { ControlEmbeddable, ControlFactory, ControlInput, ControlOutput } from '../..'; +import { EmbeddableFactory } from '../../../../embeddable/public'; import { PluginServiceFactory } from '../../../../presentation_util/public'; -import { getCommonControlsService, ControlsService } from '../controls'; +import { ControlsService, ControlTypeRegistry } from '../controls'; export type ControlsServiceFactory = PluginServiceFactory; -export const controlsServiceFactory = () => getCommonControlsService(); +export const controlsServiceFactory = () => getStubControlsService(); + +export const getStubControlsService = () => { + const controlsFactoriesMap: ControlTypeRegistry = {}; + + const registerControlType = (factory: ControlFactory) => { + controlsFactoriesMap[factory.type] = factory; + }; + + const getControlFactory = < + I extends ControlInput = ControlInput, + O extends ControlOutput = ControlOutput, + E extends ControlEmbeddable = ControlEmbeddable + >( + type: string + ) => { + return controlsFactoriesMap[type] as EmbeddableFactory; + }; + + const getControlTypes = () => Object.keys(controlsFactoriesMap); + + return { + registerControlType, + getControlFactory, + getControlTypes, + }; +}; diff --git a/src/plugins/controls/public/services/storybook/controls.ts b/src/plugins/controls/public/services/stub/http.ts similarity index 59% rename from src/plugins/controls/public/services/storybook/controls.ts rename to src/plugins/controls/public/services/stub/http.ts index 7c33ee8c33527..d33083b0641fc 100644 --- a/src/plugins/controls/public/services/storybook/controls.ts +++ b/src/plugins/controls/public/services/stub/http.ts @@ -6,8 +6,12 @@ * Side Public License, v 1. */ +import { HttpResponse } from '../../../../../core/public'; import { PluginServiceFactory } from '../../../../presentation_util/public'; -import { getCommonControlsService, ControlsService } from '../controls'; +import { ControlsHTTPService } from '../http'; -export type ControlsServiceFactory = PluginServiceFactory; -export const controlsServiceFactory = () => getCommonControlsService(); +type HttpServiceFactory = PluginServiceFactory; + +export const httpServiceFactory: HttpServiceFactory = () => ({ + fetch: async () => ({} as unknown as HttpResponse), +}); diff --git a/src/plugins/controls/public/services/stub/index.ts b/src/plugins/controls/public/services/stub/index.ts index 6927aa65c12b8..ddb0a76057648 100644 --- a/src/plugins/controls/public/services/stub/index.ts +++ b/src/plugins/controls/public/services/stub/index.ts @@ -12,17 +12,22 @@ import { PluginServiceRegistry, } from '../../../../presentation_util/public'; import { ControlsServices } from '..'; +import { httpServiceFactory } from './http'; import { overlaysServiceFactory } from './overlays'; import { controlsServiceFactory } from './controls'; import { dataServiceFactory } from '../storybook/data'; import { dataViewsServiceFactory } from '../storybook/data_views'; +import { optionsListServiceFactory } from '../storybook/options_list'; export const providers: PluginServiceProviders = { + http: new PluginServiceProvider(httpServiceFactory), data: new PluginServiceProvider(dataServiceFactory), overlays: new PluginServiceProvider(overlaysServiceFactory), - controls: new PluginServiceProvider(controlsServiceFactory), dataViews: new PluginServiceProvider(dataViewsServiceFactory), + + controls: new PluginServiceProvider(controlsServiceFactory), + optionsList: new PluginServiceProvider(optionsListServiceFactory), }; export const registry = new PluginServiceRegistry(providers); diff --git a/src/plugins/controls/public/types.ts b/src/plugins/controls/public/types.ts index 70438baec756c..92d03c8dd42c0 100644 --- a/src/plugins/controls/public/types.ts +++ b/src/plugins/controls/public/types.ts @@ -54,13 +54,13 @@ export interface ControlEditorProps { /** * Plugin types */ - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ControlsPluginSetup {} +export interface ControlsPluginSetup { + registerControlType: ControlsService['registerControlType']; +} export interface ControlsPluginStart { - controlsService: ControlsService; - ContextProvider: React.FC; + getControlFactory: ControlsService['getControlFactory']; + getControlTypes: ControlsService['getControlTypes']; } export interface ControlsPluginSetupDeps { diff --git a/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts b/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts new file mode 100644 index 0000000000000..a2eab10cc77dc --- /dev/null +++ b/src/plugins/controls/server/control_types/options_list/options_list_suggestions_route.ts @@ -0,0 +1,197 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { get, isEmpty } from 'lodash'; +import { schema } from '@kbn/config-schema'; +import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; + +import { Observable } from 'rxjs'; + +import { + OptionsListRequestBody, + OptionsListResponse, +} from '../../../common/control_types/options_list/types'; +import { CoreSetup, ElasticsearchClient } from '../../../../../core/server'; +import { getKbnServerError, reportServerError } from '../../../../kibana_utils/server'; +import { PluginSetup as DataPluginSetup } from '../../../../data/server'; +import { FieldSpec, getFieldSubtypeNested } from '../../../../data_views/common'; + +export const setupOptionsListSuggestionsRoute = ( + { http }: CoreSetup, + getAutocompleteSettings: DataPluginSetup['autocomplete']['getAutocompleteSettings'] +) => { + const router = http.createRouter(); + + router.post( + { + path: '/api/kibana/controls/optionsList/{index}', + validate: { + params: schema.object( + { + index: schema.string(), + }, + { unknowns: 'allow' } + ), + body: schema.object( + { + fieldName: schema.string(), + filters: schema.maybe(schema.any()), + fieldSpec: schema.maybe(schema.any()), + searchString: schema.maybe(schema.string()), + selectedOptions: schema.maybe(schema.arrayOf(schema.string())), + }, + { unknowns: 'allow' } + ), + }, + }, + async (context, request, response) => { + try { + const suggestionRequest: OptionsListRequestBody = request.body; + const { index } = request.params; + const esClient = context.core.elasticsearch.client.asCurrentUser; + const suggestionsResponse = await getOptionsListSuggestions({ + abortedEvent$: request.events.aborted$, + request: suggestionRequest, + esClient, + index, + }); + return response.ok({ body: suggestionsResponse }); + } catch (e) { + const kbnErr = getKbnServerError(e); + return reportServerError(response, kbnErr); + } + } + ); + + const getOptionsListSuggestions = async ({ + abortedEvent$, + esClient, + request, + index, + }: { + request: OptionsListRequestBody; + abortedEvent$: Observable; + esClient: ElasticsearchClient; + index: string; + }): Promise => { + const abortController = new AbortController(); + abortedEvent$.subscribe(() => abortController.abort()); + + const { fieldName, searchString, selectedOptions, filters, fieldSpec } = request; + const body = getOptionsListBody(fieldName, fieldSpec, searchString, selectedOptions, filters); + + const rawEsResult = await esClient.search({ index, body }, { signal: abortController.signal }); + + // parse raw ES response into OptionsListSuggestionResponse + const totalCardinality = get(rawEsResult, 'aggregations.unique_terms.value'); + + const suggestions = get(rawEsResult, 'aggregations.suggestions.buckets')?.map( + (suggestion: { key: string; key_as_string: string }) => + fieldSpec?.type === 'string' ? suggestion.key : suggestion.key_as_string + ); + + const rawInvalidSuggestions = get(rawEsResult, 'aggregations.validation.buckets') as { + [key: string]: { doc_count: number }; + }; + const invalidSelections = + rawInvalidSuggestions && !isEmpty(rawInvalidSuggestions) + ? Object.entries(rawInvalidSuggestions) + ?.filter(([, value]) => value?.doc_count === 0) + ?.map(([key]) => key) + : undefined; + + return { + suggestions, + totalCardinality, + invalidSelections, + }; + }; + + const getOptionsListBody = ( + fieldName: string, + fieldSpec?: FieldSpec, + searchString?: string, + selectedOptions?: string[], + filters: estypes.QueryDslQueryContainer[] = [] + ) => { + // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html#_standard_operators + const getEscapedQuery = (q: string = '') => + q.replace(/[.?+*|{}[\]()"\\#@&<>~]/g, (match) => `\\${match}`); + + // Helps ensure that the regex is not evaluated eagerly against the terms dictionary + const executionHint = 'map' as const; + + // Suggestions + const shardSize = 10; + const suggestionsAgg = { + terms: { + field: fieldName, + // terms on boolean fields don't support include + ...(fieldSpec?.type !== 'boolean' && { + include: `${getEscapedQuery(searchString ?? '')}.*`, + }), + execution_hint: executionHint, + shard_size: shardSize, + }, + }; + + // Validation + const selectedOptionsFilters = selectedOptions?.reduce((acc, currentOption) => { + acc[currentOption] = { match: { [fieldName]: currentOption } }; + return acc; + }, {} as { [key: string]: { match: { [key: string]: string } } }); + + const validationAgg = + selectedOptionsFilters && !isEmpty(selectedOptionsFilters) + ? { + filters: { + filters: selectedOptionsFilters, + }, + } + : undefined; + + const { terminateAfter, timeout } = getAutocompleteSettings(); + + const body = { + size: 0, + timeout: `${timeout}ms`, + terminate_after: terminateAfter, + query: { + bool: { + filter: filters, + }, + }, + aggs: { + suggestions: suggestionsAgg, + ...(validationAgg ? { validation: validationAgg } : {}), + unique_terms: { + cardinality: { + field: fieldName, + }, + }, + }, + }; + + const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); + if (subTypeNested) { + return { + ...body, + aggs: { + nestedSuggestions: { + nested: { + path: subTypeNested.nested.path, + }, + aggs: body.aggs, + }, + }, + }; + } + + return body; + }; +}; diff --git a/src/plugins/controls/server/plugin.ts b/src/plugins/controls/server/plugin.ts index fa7b7970c7e64..261737f2775c4 100644 --- a/src/plugins/controls/server/plugin.ts +++ b/src/plugins/controls/server/plugin.ts @@ -7,21 +7,27 @@ */ import { CoreSetup, Plugin } from 'kibana/server'; + import { EmbeddableSetup } from '../../embeddable/server'; +import { PluginSetup as DataSetup } from '../../data/server'; +import { setupOptionsListSuggestionsRoute } from './control_types/options_list/options_list_suggestions_route'; import { controlGroupContainerPersistableStateServiceFactory } from './control_group/control_group_container_factory'; import { optionsListPersistableStateServiceFactory } from './control_types/options_list/options_list_embeddable_factory'; interface SetupDeps { embeddable: EmbeddableSetup; + data: DataSetup; } export class ControlsPlugin implements Plugin { - public setup(core: CoreSetup, plugins: SetupDeps) { - plugins.embeddable.registerEmbeddableFactory(optionsListPersistableStateServiceFactory()); + public setup(core: CoreSetup, { embeddable, data }: SetupDeps) { + embeddable.registerEmbeddableFactory(optionsListPersistableStateServiceFactory()); - plugins.embeddable.registerEmbeddableFactory( - controlGroupContainerPersistableStateServiceFactory(plugins.embeddable) + embeddable.registerEmbeddableFactory( + controlGroupContainerPersistableStateServiceFactory(embeddable) ); + + setupOptionsListSuggestionsRoute(core, data.autocomplete.getAutocompleteSettings); return {}; } diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx index 7be36a954d2f1..0ec7ad21bce33 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx @@ -85,11 +85,15 @@ export class DashboardContainerFactoryDefinition ControlGroupOutput, ControlGroupContainer >(CONTROL_GROUP_TYPE); + const { filters, query, timeRange, viewMode, controlGroupInput, id } = initialInput; const controlGroup = await controlsGroupFactory?.create({ + id: `control_group_${id ?? 'new_dashboard'}`, ...getDefaultDashboardControlGroupInput(), - ...(initialInput.controlGroupInput ?? {}), - viewMode: initialInput.viewMode, - id: `control_group_${initialInput.id ?? 'new_dashboard'}`, + ...(controlGroupInput ?? {}), + timeRange, + viewMode, + filters, + query, }); const { DashboardContainer: DashboardContainerEmbeddable } = await import( './dashboard_container' diff --git a/src/plugins/dashboard/public/application/lib/dashboard_control_group.ts b/src/plugins/dashboard/public/application/lib/dashboard_control_group.ts index 0d1eb3537377f..054c7e49dfc55 100644 --- a/src/plugins/dashboard/public/application/lib/dashboard_control_group.ts +++ b/src/plugins/dashboard/public/application/lib/dashboard_control_group.ts @@ -74,10 +74,11 @@ export const syncDashboardControlGroup = async ({ }) ); + const compareAllFilters = (a?: Filter[], b?: Filter[]) => + compareFilters(a ?? [], b ?? [], COMPARE_ALL_OPTIONS); + const dashboardRefetchDiff: DiffChecks = { - filters: (a, b) => - compareFilters((a as Filter[]) ?? [], (b as Filter[]) ?? [], COMPARE_ALL_OPTIONS), - lastReloadRequestTime: deepEqual, + filters: (a, b) => compareAllFilters(a as Filter[], b as Filter[]), timeRange: deepEqual, query: deepEqual, viewMode: deepEqual, @@ -130,7 +131,14 @@ export const syncDashboardControlGroup = async ({ subscriptions.add( controlGroup .getOutput$() - .subscribe(() => dashboardContainer.updateInput({ lastReloadRequestTime: Date.now() })) + .pipe( + distinctUntilChanged(({ filters: filtersA }, { filters: filtersB }) => + compareAllFilters(filtersA, filtersB) + ) + ) + .subscribe(() => { + dashboardContainer.updateInput({ lastReloadRequestTime: Date.now() }); + }) ); return { diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts index a339ec4f8405f..541724549011e 100644 --- a/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts @@ -78,6 +78,11 @@ export const syncDashboardContainerInput = ( ) .subscribe(() => { applyStateChangesToContainer({ ...syncDashboardContainerProps, force: forceRefresh }); + + // If this dashboard has a control group, reload the control group when the refresh button is manually pressed. + if (forceRefresh && dashboardContainer.controlGroup) { + dashboardContainer.controlGroup.reload(); + } forceRefresh = false; }) ); diff --git a/src/plugins/data/common/datatable_utilities/datatable_utilities_service.test.ts b/src/plugins/data/common/datatable_utilities/datatable_utilities_service.test.ts new file mode 100644 index 0000000000000..d626bc2226543 --- /dev/null +++ b/src/plugins/data/common/datatable_utilities/datatable_utilities_service.test.ts @@ -0,0 +1,123 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createStubDataView } from 'src/plugins/data_views/common/mocks'; +import type { DataViewsContract } from 'src/plugins/data_views/common'; +import type { DatatableColumn } from 'src/plugins/expressions/common'; +import { FieldFormat } from 'src/plugins/field_formats/common'; +import { fieldFormatsMock } from 'src/plugins/field_formats/common/mocks'; +import type { AggsCommonStart } from '../search'; +import { DatatableUtilitiesService } from './datatable_utilities_service'; + +describe('DatatableUtilitiesService', () => { + let aggs: jest.Mocked; + let dataViews: jest.Mocked; + let datatableUtilitiesService: DatatableUtilitiesService; + + beforeEach(() => { + aggs = { + createAggConfigs: jest.fn(), + types: { get: jest.fn() }, + } as unknown as typeof aggs; + dataViews = { + get: jest.fn(), + } as unknown as typeof dataViews; + + datatableUtilitiesService = new DatatableUtilitiesService(aggs, dataViews, fieldFormatsMock); + }); + + describe('clearField', () => { + it('should delete the field reference', () => { + const column = { meta: { field: 'foo' } } as DatatableColumn; + + datatableUtilitiesService.clearField(column); + + expect(column).not.toHaveProperty('meta.field'); + }); + }); + + describe('clearFieldFormat', () => { + it('should remove field format', () => { + const column = { meta: { params: { id: 'number' } } } as DatatableColumn; + datatableUtilitiesService.clearFieldFormat(column); + + expect(column).not.toHaveProperty('meta.params'); + }); + }); + + describe('getDataView', () => { + it('should return a data view instance', async () => { + const column = { meta: { index: 'index' } } as DatatableColumn; + const dataView = {} as ReturnType; + dataViews.get.mockReturnValue(dataView); + + await expect(datatableUtilitiesService.getDataView(column)).resolves.toBe(dataView); + expect(dataViews.get).toHaveBeenCalledWith('index'); + }); + + it('should return undefined when there is no index metadata', async () => { + const column = { meta: {} } as DatatableColumn; + + await expect(datatableUtilitiesService.getDataView(column)).resolves.toBeUndefined(); + expect(dataViews.get).not.toHaveBeenCalled(); + }); + }); + + describe('getField', () => { + it('should return a data view field instance', async () => { + const column = { meta: { field: 'field', index: 'index' } } as DatatableColumn; + const dataView = createStubDataView({ spec: {} }); + const field = {}; + spyOn(datatableUtilitiesService, 'getDataView').and.returnValue(dataView); + spyOn(dataView, 'getFieldByName').and.returnValue(field); + + await expect(datatableUtilitiesService.getField(column)).resolves.toBe(field); + expect(dataView.getFieldByName).toHaveBeenCalledWith('field'); + }); + + it('should return undefined when there is no field metadata', async () => { + const column = { meta: {} } as DatatableColumn; + + await expect(datatableUtilitiesService.getField(column)).resolves.toBeUndefined(); + }); + }); + + describe('getFieldFormat', () => { + it('should deserialize field format', () => { + const column = { meta: { params: { id: 'number' } } } as DatatableColumn; + const fieldFormat = datatableUtilitiesService.getFieldFormat(column); + + expect(fieldFormat).toBeInstanceOf(FieldFormat); + }); + }); + + describe('getInterval', () => { + it('should return a histogram interval', () => { + const column = { + meta: { sourceParams: { params: { interval: '1d' } } }, + } as unknown as DatatableColumn; + + expect(datatableUtilitiesService.getInterval(column)).toBe('1d'); + }); + }); + + describe('setFieldFormat', () => { + it('should set new field format', () => { + const column = { meta: {} } as DatatableColumn; + const fieldFormat = fieldFormatsMock.deserialize({ id: 'number' }); + datatableUtilitiesService.setFieldFormat(column, fieldFormat); + + expect(column.meta.params).toEqual( + expect.objectContaining({ + id: expect.anything(), + params: undefined, + }) + ); + }); + }); +}); diff --git a/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts b/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts new file mode 100644 index 0000000000000..cf4e65f31cce3 --- /dev/null +++ b/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts @@ -0,0 +1,93 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { DataView, DataViewsContract, DataViewField } from 'src/plugins/data_views/common'; +import type { DatatableColumn } from 'src/plugins/expressions/common'; +import type { FieldFormatsStartCommon, FieldFormat } from 'src/plugins/field_formats/common'; +import type { AggsCommonStart, AggConfig, CreateAggConfigParams, IAggType } from '../search'; + +export class DatatableUtilitiesService { + constructor( + private aggs: AggsCommonStart, + private dataViews: DataViewsContract, + private fieldFormats: FieldFormatsStartCommon + ) { + this.getAggConfig = this.getAggConfig.bind(this); + this.getDataView = this.getDataView.bind(this); + this.getField = this.getField.bind(this); + this.isFilterable = this.isFilterable.bind(this); + } + + clearField(column: DatatableColumn): void { + delete column.meta.field; + } + + clearFieldFormat(column: DatatableColumn): void { + delete column.meta.params; + } + + async getAggConfig(column: DatatableColumn): Promise { + const dataView = await this.getDataView(column); + + if (!dataView) { + return; + } + + const { aggs } = await this.aggs.createAggConfigs( + dataView, + column.meta.sourceParams && [column.meta.sourceParams as CreateAggConfigParams] + ); + + return aggs[0]; + } + + async getDataView(column: DatatableColumn): Promise { + if (!column.meta.index) { + return; + } + + return this.dataViews.get(column.meta.index); + } + + async getField(column: DatatableColumn): Promise { + if (!column.meta.field) { + return; + } + + const dataView = await this.getDataView(column); + if (!dataView) { + return; + } + + return dataView.getFieldByName(column.meta.field); + } + + getFieldFormat(column: DatatableColumn): FieldFormat | undefined { + return this.fieldFormats.deserialize(column.meta.params); + } + + getInterval(column: DatatableColumn): string | undefined { + const params = column.meta.sourceParams?.params as { interval: string } | undefined; + + return params?.interval; + } + + isFilterable(column: DatatableColumn): boolean { + if (column.meta.source !== 'esaggs') { + return false; + } + + const aggType = this.aggs.types.get(column.meta.sourceParams?.type as string) as IAggType; + + return Boolean(aggType.createFilter); + } + + setFieldFormat(column: DatatableColumn, fieldFormat: FieldFormat): void { + column.meta.params = fieldFormat.toJSON(); + } +} diff --git a/src/plugins/data/common/datatable_utilities/index.ts b/src/plugins/data/common/datatable_utilities/index.ts new file mode 100644 index 0000000000000..34df78137510a --- /dev/null +++ b/src/plugins/data/common/datatable_utilities/index.ts @@ -0,0 +1,9 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './datatable_utilities_service'; diff --git a/src/plugins/data/common/datatable_utilities/mock.ts b/src/plugins/data/common/datatable_utilities/mock.ts new file mode 100644 index 0000000000000..4266e501f2ca2 --- /dev/null +++ b/src/plugins/data/common/datatable_utilities/mock.ts @@ -0,0 +1,22 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { DatatableUtilitiesService } from './datatable_utilities_service'; + +export function createDatatableUtilitiesMock(): jest.Mocked { + return { + clearField: jest.fn(), + clearFieldFormat: jest.fn(), + getAggConfig: jest.fn(), + getDataView: jest.fn(), + getField: jest.fn(), + getFieldFormat: jest.fn(), + isFilterable: jest.fn(), + setFieldFormat: jest.fn(), + } as unknown as jest.Mocked; +} diff --git a/src/plugins/data/common/index.ts b/src/plugins/data/common/index.ts index 7bb4b78850dcd..a793050eb6556 100644 --- a/src/plugins/data/common/index.ts +++ b/src/plugins/data/common/index.ts @@ -10,6 +10,7 @@ /* eslint-disable @kbn/eslint/no_export_all */ export * from './constants'; +export * from './datatable_utilities'; export * from './es_query'; export * from './kbn_field_types'; export * from './query'; diff --git a/src/plugins/data/common/mocks.ts b/src/plugins/data/common/mocks.ts index c656d9d21346e..cf7d6bef6a4e8 100644 --- a/src/plugins/data/common/mocks.ts +++ b/src/plugins/data/common/mocks.ts @@ -7,3 +7,4 @@ */ export * from '../../data_views/common/fields/fields.mocks'; +export * from './datatable_utilities/mock'; diff --git a/src/plugins/data/common/search/aggs/aggs_service.test.ts b/src/plugins/data/common/search/aggs/aggs_service.test.ts index 998b8bf286b52..b7237c7b80134 100644 --- a/src/plugins/data/common/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/common/search/aggs/aggs_service.test.ts @@ -206,11 +206,10 @@ describe('Aggs service', () => { describe('start()', () => { test('exposes proper contract', () => { const start = service.start(startDeps); - expect(Object.keys(start).length).toBe(4); + expect(Object.keys(start).length).toBe(3); expect(start).toHaveProperty('calculateAutoTimeExpression'); expect(start).toHaveProperty('createAggConfigs'); expect(start).toHaveProperty('types'); - expect(start).toHaveProperty('datatableUtilities'); }); test('types registry returns uninitialized type providers', () => { diff --git a/src/plugins/data/common/search/aggs/aggs_service.ts b/src/plugins/data/common/search/aggs/aggs_service.ts index 58f65bb0cab44..6fe7eef5b87b4 100644 --- a/src/plugins/data/common/search/aggs/aggs_service.ts +++ b/src/plugins/data/common/search/aggs/aggs_service.ts @@ -17,7 +17,6 @@ import { getCalculateAutoTimeExpression, } from './'; import { AggsCommonSetup, AggsCommonStart } from './types'; -import { getDatatableColumnUtilities } from './utils/datatable_column_meta'; /** @internal */ export const aggsRequiredUiSettings = [ @@ -67,11 +66,7 @@ export class AggsCommonService { }; } - public start({ - getConfig, - getIndexPattern, - isDefaultTimezone, - }: AggsCommonStartDependencies): AggsCommonStart { + public start({ getConfig }: AggsCommonStartDependencies): AggsCommonStart { const aggTypesStart = this.aggTypesRegistry.start(); const calculateAutoTimeExpression = getCalculateAutoTimeExpression(getConfig); @@ -86,11 +81,6 @@ export class AggsCommonService { return { calculateAutoTimeExpression, - datatableUtilities: getDatatableColumnUtilities({ - getIndexPattern, - createAggConfigs, - aggTypesStart, - }), createAggConfigs, types: aggTypesStart, }; diff --git a/src/plugins/data/common/search/aggs/types.ts b/src/plugins/data/common/search/aggs/types.ts index 34d773b0ba518..cf9a6123b14c8 100644 --- a/src/plugins/data/common/search/aggs/types.ts +++ b/src/plugins/data/common/search/aggs/types.ts @@ -7,7 +7,6 @@ */ import { Assign } from '@kbn/utility-types'; -import { DatatableColumn } from 'src/plugins/expressions'; import { IndexPattern } from '../..'; import { aggAvg, @@ -88,7 +87,6 @@ import { CreateAggConfigParams, getCalculateAutoTimeExpression, METRIC_TYPES, - AggConfig, aggFilteredMetric, aggSinglePercentile, } from './'; @@ -111,11 +109,6 @@ export interface AggsCommonSetup { export interface AggsCommonStart { calculateAutoTimeExpression: ReturnType; - datatableUtilities: { - getIndexPattern: (column: DatatableColumn) => Promise; - getAggConfig: (column: DatatableColumn) => Promise; - isFilterable: (column: DatatableColumn) => boolean; - }; createAggConfigs: ( indexPattern: IndexPattern, configStates?: CreateAggConfigParams[] diff --git a/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts b/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts deleted file mode 100644 index 0e3ff69fac1d1..0000000000000 --- a/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { DatatableColumn } from 'src/plugins/expressions/common'; -import { IndexPattern } from '../../..'; -import { AggConfigs, CreateAggConfigParams } from '../agg_configs'; -import { AggTypesRegistryStart } from '../agg_types_registry'; -import { IAggType } from '../agg_type'; - -export interface MetaByColumnDeps { - getIndexPattern: (id: string) => Promise; - createAggConfigs: ( - indexPattern: IndexPattern, - configStates?: CreateAggConfigParams[] - ) => InstanceType; - aggTypesStart: AggTypesRegistryStart; -} - -export const getDatatableColumnUtilities = (deps: MetaByColumnDeps) => { - const { getIndexPattern, createAggConfigs, aggTypesStart } = deps; - - const getIndexPatternFromDatatableColumn = async (column: DatatableColumn) => { - if (!column.meta.index) return; - - return await getIndexPattern(column.meta.index); - }; - - const getAggConfigFromDatatableColumn = async (column: DatatableColumn) => { - const indexPattern = await getIndexPatternFromDatatableColumn(column); - - if (!indexPattern) return; - - const aggConfigs = await createAggConfigs(indexPattern, [column.meta.sourceParams as any]); - return aggConfigs.aggs[0]; - }; - - const isFilterableAggDatatableColumn = (column: DatatableColumn) => { - if (column.meta.source !== 'esaggs') { - return false; - } - const aggType = (aggTypesStart.get(column.meta.sourceParams?.type as string) as any)( - {} - ) as IAggType; - return Boolean(aggType.createFilter); - }; - - return { - getIndexPattern: getIndexPatternFromDatatableColumn, - getAggConfig: getAggConfigFromDatatableColumn, - isFilterable: isFilterableAggDatatableColumn, - }; -}; diff --git a/src/plugins/data/public/mocks.ts b/src/plugins/data/public/mocks.ts index 53600a1f44469..630a29a8a7854 100644 --- a/src/plugins/data/public/mocks.ts +++ b/src/plugins/data/public/mocks.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { createDatatableUtilitiesMock } from '../common/mocks'; import { DataPlugin, DataViewsContract } from '.'; import { fieldFormatsServiceMock } from '../../field_formats/public/mocks'; import { searchServiceMock } from './search/mocks'; @@ -58,6 +59,7 @@ const createStartContract = (): Start => { createFiltersFromRangeSelectAction: jest.fn(), }, autocomplete: autocompleteStartMock, + datatableUtilities: createDatatableUtilitiesMock(), search: searchServiceMock.createStartContract(), fieldFormats: fieldFormatsServiceMock.createStartContract(), query: queryStartMock, diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 7d19c1eb3ac19..50795b4416247 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -42,7 +42,7 @@ import { APPLY_FILTER_TRIGGER, applyFilterTrigger } from './triggers'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { getTableViewDescription } from './utils/table_inspector_view'; import { NowProvider, NowProviderInternalContract } from './now_provider'; -import { getAggsFormats } from '../common'; +import { getAggsFormats, DatatableUtilitiesService } from '../common'; export class DataPublicPlugin implements @@ -108,7 +108,7 @@ export class DataPublicPlugin uiActions: startServices().plugins.uiActions, uiSettings: startServices().core.uiSettings, fieldFormats: startServices().self.fieldFormats, - isFilterable: startServices().self.search.aggs.datatableUtilities.isFilterable, + isFilterable: startServices().self.datatableUtilities.isFilterable, })) ); @@ -166,12 +166,14 @@ export class DataPublicPlugin uiActions.getAction(ACTION_GLOBAL_APPLY_FILTER) ); + const datatableUtilities = new DatatableUtilitiesService(search.aggs, dataViews, fieldFormats); const dataServices = { actions: { createFiltersFromValueClickAction, createFiltersFromRangeSelectAction, }, autocomplete: this.autocomplete.start(), + datatableUtilities, fieldFormats, indexPatterns: dataViews, dataViews, diff --git a/src/plugins/data/public/search/aggs/aggs_service.test.ts b/src/plugins/data/public/search/aggs/aggs_service.test.ts index b0e6e0327e654..101c2c909c7e1 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.test.ts @@ -79,11 +79,10 @@ describe('AggsService - public', () => { describe('start()', () => { test('exposes proper contract', () => { const start = service.start(startDeps); - expect(Object.keys(start).length).toBe(4); + expect(Object.keys(start).length).toBe(3); expect(start).toHaveProperty('calculateAutoTimeExpression'); expect(start).toHaveProperty('createAggConfigs'); expect(start).toHaveProperty('types'); - expect(start).toHaveProperty('datatableUtilities'); }); test('types registry returns initialized agg types', () => { diff --git a/src/plugins/data/public/search/aggs/aggs_service.ts b/src/plugins/data/public/search/aggs/aggs_service.ts index 4907c3bcbad26..99930a95831ea 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.ts @@ -91,13 +91,11 @@ export class AggsService { public start({ fieldFormats, uiSettings, indexPatterns }: AggsStartDependencies): AggsStart { const isDefaultTimezone = () => uiSettings.isDefault('dateFormat:tz'); - const { calculateAutoTimeExpression, datatableUtilities, types } = this.aggsCommonService.start( - { - getConfig: this.getConfig!, - getIndexPattern: indexPatterns.get, - isDefaultTimezone, - } - ); + const { calculateAutoTimeExpression, types } = this.aggsCommonService.start({ + getConfig: this.getConfig!, + getIndexPattern: indexPatterns.get, + isDefaultTimezone, + }); const aggTypesDependencies: AggTypesDependencies = { calculateBounds: this.calculateBounds, @@ -137,7 +135,6 @@ export class AggsService { return { calculateAutoTimeExpression, - datatableUtilities, createAggConfigs: (indexPattern, configStates = []) => { return new AggConfigs(indexPattern, configStates, { typesRegistry }); }, diff --git a/src/plugins/data/public/search/aggs/mocks.ts b/src/plugins/data/public/search/aggs/mocks.ts index fb50058f08348..c45d024384ba6 100644 --- a/src/plugins/data/public/search/aggs/mocks.ts +++ b/src/plugins/data/public/search/aggs/mocks.ts @@ -56,11 +56,6 @@ export const searchAggsSetupMock = (): AggsSetup => ({ export const searchAggsStartMock = (): AggsStart => ({ calculateAutoTimeExpression: getCalculateAutoTimeExpression(getConfig), - datatableUtilities: { - isFilterable: jest.fn(), - getAggConfig: jest.fn(), - getIndexPattern: jest.fn(), - }, createAggConfigs: jest.fn().mockImplementation((indexPattern, configStates = [], schemas) => { return new AggConfigs(indexPattern, configStates, { typesRegistry: mockAggTypesRegistry(), diff --git a/src/plugins/data/public/types.ts b/src/plugins/data/public/types.ts index e2e7c6b222b90..bfc35b8f39c51 100644 --- a/src/plugins/data/public/types.ts +++ b/src/plugins/data/public/types.ts @@ -14,6 +14,7 @@ import { ExpressionsSetup } from 'src/plugins/expressions/public'; import { DataViewsPublicPluginStart } from 'src/plugins/data_views/public'; import { UiActionsSetup, UiActionsStart } from 'src/plugins/ui_actions/public'; import { FieldFormatsSetup, FieldFormatsStart } from 'src/plugins/field_formats/public'; +import { DatatableUtilitiesService } from '../common'; import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; import { createFiltersFromRangeSelectAction, createFiltersFromValueClickAction } from './actions'; import type { ISearchSetup, ISearchStart } from './search'; @@ -83,6 +84,12 @@ export interface DataPublicPluginStart { * {@link DataViewsContract} */ dataViews: DataViewsContract; + + /** + * Datatable type utility functions. + */ + datatableUtilities: DatatableUtilitiesService; + /** * index patterns service * {@link DataViewsContract} diff --git a/src/plugins/data/server/autocomplete/autocomplete_service.ts b/src/plugins/data/server/autocomplete/autocomplete_service.ts index ef718af2ab397..071acc13c8117 100644 --- a/src/plugins/data/server/autocomplete/autocomplete_service.ts +++ b/src/plugins/data/server/autocomplete/autocomplete_service.ts @@ -6,22 +6,37 @@ * Side Public License, v 1. */ +import moment from 'moment'; import { CoreSetup, Plugin, PluginInitializerContext } from 'kibana/server'; import { registerRoutes } from './routes'; import { ConfigSchema } from '../../config'; export class AutocompleteService implements Plugin { private valueSuggestionsEnabled: boolean = true; + private autocompleteSettings: ConfigSchema['autocomplete']['valueSuggestions']; constructor(private initializerContext: PluginInitializerContext) { initializerContext.config.create().subscribe((configUpdate) => { this.valueSuggestionsEnabled = configUpdate.autocomplete.valueSuggestions.enabled; + this.autocompleteSettings = configUpdate.autocomplete.valueSuggestions; }); + this.autocompleteSettings = + this.initializerContext.config.get().autocomplete.valueSuggestions; } public setup(core: CoreSetup) { if (this.valueSuggestionsEnabled) registerRoutes(core, this.initializerContext.config.create()); + const { terminateAfter, timeout } = this.autocompleteSettings; + return { + getAutocompleteSettings: () => ({ + terminateAfter: moment.duration(terminateAfter).asMilliseconds(), + timeout: moment.duration(timeout).asMilliseconds(), + }), + }; } public start() {} } + +/** @public **/ +export type AutocompleteSetup = ReturnType; diff --git a/src/plugins/data/server/autocomplete/index.ts b/src/plugins/data/server/autocomplete/index.ts index 8dde502200b16..e822b27549635 100644 --- a/src/plugins/data/server/autocomplete/index.ts +++ b/src/plugins/data/server/autocomplete/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { AutocompleteService } from './autocomplete_service'; +export { AutocompleteService, type AutocompleteSetup } from './autocomplete_service'; diff --git a/src/plugins/data/server/datatable_utilities/datatable_utilities_service.ts b/src/plugins/data/server/datatable_utilities/datatable_utilities_service.ts new file mode 100644 index 0000000000000..3909003cd4d2c --- /dev/null +++ b/src/plugins/data/server/datatable_utilities/datatable_utilities_service.ts @@ -0,0 +1,43 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { + ElasticsearchClient, + SavedObjectsClientContract, + UiSettingsServiceStart, +} from 'src/core/server'; +import type { FieldFormatsStart } from 'src/plugins/field_formats/server'; +import type { IndexPatternsServiceStart } from 'src/plugins/data_views/server'; +import { DatatableUtilitiesService as DatatableUtilitiesServiceCommon } from '../../common'; +import type { AggsStart } from '../search'; + +export class DatatableUtilitiesService { + constructor( + private aggs: AggsStart, + private dataViews: IndexPatternsServiceStart, + private fieldFormats: FieldFormatsStart, + private uiSettings: UiSettingsServiceStart + ) { + this.asScopedToClient = this.asScopedToClient.bind(this); + } + + async asScopedToClient( + savedObjectsClient: SavedObjectsClientContract, + elasticsearchClient: ElasticsearchClient + ): Promise { + const aggs = await this.aggs.asScopedToClient(savedObjectsClient, elasticsearchClient); + const dataViews = await this.dataViews.dataViewsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + const uiSettings = this.uiSettings.asScopedToClient(savedObjectsClient); + const fieldFormats = await this.fieldFormats.fieldFormatServiceFactory(uiSettings); + + return new DatatableUtilitiesServiceCommon(aggs, dataViews, fieldFormats); + } +} diff --git a/src/plugins/data/server/datatable_utilities/index.ts b/src/plugins/data/server/datatable_utilities/index.ts new file mode 100644 index 0000000000000..34df78137510a --- /dev/null +++ b/src/plugins/data/server/datatable_utilities/index.ts @@ -0,0 +1,9 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './datatable_utilities_service'; diff --git a/src/plugins/data/server/datatable_utilities/mock.ts b/src/plugins/data/server/datatable_utilities/mock.ts new file mode 100644 index 0000000000000..9ec069fda7ab0 --- /dev/null +++ b/src/plugins/data/server/datatable_utilities/mock.ts @@ -0,0 +1,16 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createDatatableUtilitiesMock as createDatatableUtilitiesCommonMock } from '../../common/mocks'; +import type { DatatableUtilitiesService } from './datatable_utilities_service'; + +export function createDatatableUtilitiesMock(): jest.Mocked { + return { + asScopedToClient: jest.fn(createDatatableUtilitiesCommonMock), + } as unknown as jest.Mocked; +} diff --git a/src/plugins/data/server/mocks.ts b/src/plugins/data/server/mocks.ts index c766dc5e5765c..355e809888bd4 100644 --- a/src/plugins/data/server/mocks.ts +++ b/src/plugins/data/server/mocks.ts @@ -16,11 +16,18 @@ import { createFieldFormatsStartMock, } from '../../field_formats/server/mocks'; import { createIndexPatternsStartMock } from './data_views/mocks'; +import { createDatatableUtilitiesMock } from './datatable_utilities/mock'; import { DataRequestHandlerContext } from './search'; +import { AutocompleteSetup } from './autocomplete'; + +const autocompleteSetupMock: jest.Mocked = { + getAutocompleteSettings: jest.fn(), +}; function createSetupContract() { return { search: createSearchSetupMock(), + autocomplete: autocompleteSetupMock, /** * @deprecated - use directly from "fieldFormats" plugin instead */ @@ -36,6 +43,7 @@ function createStartContract() { */ fieldFormats: createFieldFormatsStartMock(), indexPatterns: createIndexPatternsStartMock(), + datatableUtilities: createDatatableUtilitiesMock(), }; } diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index ea6a7bc3446e3..9d5b3792da566 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -11,6 +11,7 @@ import { ExpressionsServerSetup } from 'src/plugins/expressions/server'; import { BfetchServerSetup } from 'src/plugins/bfetch/server'; import { PluginStart as DataViewsServerPluginStart } from 'src/plugins/data_views/server'; import { ConfigSchema } from '../config'; +import { DatatableUtilitiesService } from './datatable_utilities'; import type { ISearchSetup, ISearchStart, SearchEnhancements } from './search'; import { SearchService } from './search/search_service'; import { QueryService } from './query/query_service'; @@ -21,12 +22,14 @@ import { AutocompleteService } from './autocomplete'; import { FieldFormatsSetup, FieldFormatsStart } from '../../field_formats/server'; import { getUiSettings } from './ui_settings'; import { QuerySetup } from './query'; +import { AutocompleteSetup } from './autocomplete/autocomplete_service'; interface DataEnhancements { search: SearchEnhancements; } export interface DataPluginSetup { + autocomplete: AutocompleteSetup; search: ISearchSetup; query: QuerySetup; /** @@ -46,6 +49,11 @@ export interface DataPluginStart { */ fieldFormats: FieldFormatsStart; indexPatterns: DataViewsServerPluginStart; + + /** + * Datatable type utility functions. + */ + datatableUtilities: DatatableUtilitiesService; } export interface DataPluginSetupDependencies { @@ -91,7 +99,6 @@ export class DataServerPlugin ) { this.scriptsService.setup(core); const querySetup = this.queryService.setup(core); - this.autocompleteService.setup(core); this.kqlTelemetryService.setup(core, { usageCollection }); core.uiSettings.register(getUiSettings(core.docLinks)); @@ -103,6 +110,7 @@ export class DataServerPlugin }); return { + autocomplete: this.autocompleteService.setup(core), __enhance: (enhancements: DataEnhancements) => { searchSetup.__enhance(enhancements.search); }, @@ -113,10 +121,19 @@ export class DataServerPlugin } public start(core: CoreStart, { fieldFormats, dataViews }: DataPluginStartDependencies) { + const search = this.searchService.start(core, { fieldFormats, indexPatterns: dataViews }); + const datatableUtilities = new DatatableUtilitiesService( + search.aggs, + dataViews, + fieldFormats, + core.uiSettings + ); + return { + datatableUtilities, + search, fieldFormats, indexPatterns: dataViews, - search: this.searchService.start(core, { fieldFormats, indexPatterns: dataViews }), }; } diff --git a/src/plugins/data/server/search/aggs/aggs_service.ts b/src/plugins/data/server/search/aggs/aggs_service.ts index e65c6d4134970..808c0e9cc8499 100644 --- a/src/plugins/data/server/search/aggs/aggs_service.ts +++ b/src/plugins/data/server/search/aggs/aggs_service.ts @@ -72,17 +72,13 @@ export class AggsService { }; const isDefaultTimezone = () => getConfig('dateFormat:tz') === 'Browser'; - const { calculateAutoTimeExpression, datatableUtilities, types } = - this.aggsCommonService.start({ - getConfig, - getIndexPattern: ( - await indexPatterns.indexPatternsServiceFactory( - savedObjectsClient, - elasticsearchClient - ) - ).get, - isDefaultTimezone, - }); + const { calculateAutoTimeExpression, types } = this.aggsCommonService.start({ + getConfig, + getIndexPattern: ( + await indexPatterns.indexPatternsServiceFactory(savedObjectsClient, elasticsearchClient) + ).get, + isDefaultTimezone, + }); const aggTypesDependencies: AggTypesDependencies = { calculateBounds: this.calculateBounds, @@ -118,7 +114,6 @@ export class AggsService { return { calculateAutoTimeExpression, - datatableUtilities, createAggConfigs: (indexPattern, configStates = []) => { return new AggConfigs(indexPattern, configStates, { typesRegistry }); }, diff --git a/src/plugins/data/server/search/aggs/mocks.ts b/src/plugins/data/server/search/aggs/mocks.ts index 3644a3c13c48d..301bc3e5e1240 100644 --- a/src/plugins/data/server/search/aggs/mocks.ts +++ b/src/plugins/data/server/search/aggs/mocks.ts @@ -58,11 +58,6 @@ export const searchAggsSetupMock = (): AggsSetup => ({ const commonStartMock = (): AggsCommonStart => ({ calculateAutoTimeExpression: getCalculateAutoTimeExpression(getConfig), - datatableUtilities: { - getIndexPattern: jest.fn(), - getAggConfig: jest.fn(), - isFilterable: jest.fn(), - }, createAggConfigs: jest.fn().mockImplementation((indexPattern, configStates = [], schemas) => { return new AggConfigs(indexPattern, configStates, { typesRegistry: mockAggTypesRegistry(), diff --git a/src/plugins/data_view_field_editor/public/components/field_editor/form_schema.ts b/src/plugins/data_view_field_editor/public/components/field_editor/form_schema.ts index 7a15dce3af019..8d49702b48154 100644 --- a/src/plugins/data_view_field_editor/public/components/field_editor/form_schema.ts +++ b/src/plugins/data_view_field_editor/public/components/field_editor/form_schema.ts @@ -8,17 +8,8 @@ import { i18n } from '@kbn/i18n'; import { EuiComboBoxOptionOption } from '@elastic/eui'; -import type { Subscription } from 'rxjs'; -import { first } from 'rxjs/operators'; -import { PainlessLang } from '@kbn/monaco'; -import { - fieldValidators, - FieldConfig, - RuntimeType, - ValidationFunc, - ValidationCancelablePromise, -} from '../../shared_imports'; +import { fieldValidators, FieldConfig, RuntimeType, ValidationFunc } from '../../shared_imports'; import type { Context } from '../preview'; import { RUNTIME_FIELD_OPTIONS } from './constants'; @@ -32,42 +23,6 @@ const i18nTexts = { ), }; -// Validate the painless **syntax** (no need to make an HTTP request) -const painlessSyntaxValidator = () => { - let isValidatingSub: Subscription; - - return (() => { - const promise: ValidationCancelablePromise<'ERR_PAINLESS_SYNTAX'> = new Promise((resolve) => { - isValidatingSub = PainlessLang.validation$() - .pipe( - first(({ isValidating }) => { - return isValidating === false; - }) - ) - .subscribe(({ errors }) => { - const editorHasSyntaxErrors = errors.length > 0; - - if (editorHasSyntaxErrors) { - return resolve({ - message: i18nTexts.invalidScriptErrorMessage, - code: 'ERR_PAINLESS_SYNTAX', - }); - } - - resolve(undefined); - }); - }); - - promise.cancel = () => { - if (isValidatingSub) { - isValidatingSub.unsubscribe(); - } - }; - - return promise; - }) as ValidationFunc; -}; - // Validate the painless **script** const painlessScriptValidator: ValidationFunc = async ({ customData: { provider } }) => { const previewError = (await provider()) as Context['error']; @@ -131,10 +86,6 @@ export const schema = { ) ), }, - { - validator: painlessSyntaxValidator(), - isAsync: true, - }, { validator: painlessScriptValidator, isAsync: true, diff --git a/src/plugins/data_view_management/kibana.json b/src/plugins/data_view_management/kibana.json index 29f305d0ad17a..a8a0f694bd179 100644 --- a/src/plugins/data_view_management/kibana.json +++ b/src/plugins/data_view_management/kibana.json @@ -5,6 +5,7 @@ "ui": true, "requiredPlugins": ["management", "data", "urlForwarding", "dataViewFieldEditor", "dataViewEditor", "dataViews", "fieldFormats"], "requiredBundles": ["kibanaReact", "kibanaUtils"], + "optionalPlugins": ["spaces"], "owner": { "name": "App Services", "githubTeam": "kibana-app-services" diff --git a/src/plugins/data_view_management/public/components/__snapshots__/utils.test.ts.snap b/src/plugins/data_view_management/public/components/__snapshots__/utils.test.ts.snap index 3a25a78472b50..dece379001643 100644 --- a/src/plugins/data_view_management/public/components/__snapshots__/utils.test.ts.snap +++ b/src/plugins/data_view_management/public/components/__snapshots__/utils.test.ts.snap @@ -5,6 +5,7 @@ Array [ Object { "default": true, "id": "test", + "namespaces": undefined, "sort": "0test name", "tags": Array [ Object { @@ -17,6 +18,7 @@ Array [ Object { "default": false, "id": "test1", + "namespaces": undefined, "sort": "1test name 1", "tags": Array [], "title": "test name 1", diff --git a/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx index 5d5ef260a088c..86193f50b2fe2 100644 --- a/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx @@ -17,11 +17,12 @@ import { EuiText, EuiLink, EuiCallOut, + EuiCode, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { DataView, DataViewField } from '../../../../../plugins/data_views/public'; -import { useKibana } from '../../../../../plugins/kibana_react/public'; +import { useKibana, toMountPoint } from '../../../../../plugins/kibana_react/public'; import { IndexPatternManagmentContext } from '../../types'; import { Tabs } from './tabs'; import { IndexHeader } from './index_header'; @@ -50,7 +51,7 @@ const confirmModalOptionsDelete = { defaultMessage: 'Delete', }), title: i18n.translate('indexPatternManagement.editDataView.deleteHeader', { - defaultMessage: 'Delete data view?', + defaultMessage: 'Delete data view', }), }; @@ -110,11 +111,26 @@ export const EditIndexPattern = withRouter( } } - overlays.openConfirm('', confirmModalOptionsDelete).then((isConfirmed) => { - if (isConfirmed) { - doRemove(); - } - }); + const warning = + indexPattern.namespaces.length > 1 ? ( + {indexPattern.title}, + }} + /> + ) : ( + '' + ); + + overlays + .openConfirm(toMountPoint(
{warning}
), confirmModalOptionsDelete) + .then((isConfirmed) => { + if (isConfirmed) { + doRemove(); + } + }); }; const timeFilterHeader = i18n.translate( diff --git a/src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx b/src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx index 965fcdb6d8818..583a8255c02ab 100644 --- a/src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx +++ b/src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx @@ -18,13 +18,15 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps, withRouter, useLocation } from 'react-router-dom'; -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { reactRouterNavigate, useKibana } from '../../../../../plugins/kibana_react/public'; import { IndexPatternManagmentContext } from '../../types'; import { IndexPatternTableItem } from '../types'; import { getIndexPatterns } from '../utils'; import { getListBreadcrumbs } from '../breadcrumbs'; +import { SpacesList } from './spaces_list'; +import type { SpacesContextProps } from '../../../../../../x-pack/plugins/spaces/public'; const pagination = { initialPageSize: 10, @@ -38,15 +40,6 @@ const sorting = { }, }; -const search = { - box: { - incremental: true, - schema: { - fields: { title: { type: 'string' } }, - }, - }, -}; - const title = i18n.translate('indexPatternManagement.dataViewTable.title', { defaultMessage: 'Data Views', }); @@ -69,6 +62,8 @@ interface Props extends RouteComponentProps { showCreateDialog?: boolean; } +const getEmptyFunctionComponent: React.FC = ({ children }) => <>{children}; + export const IndexPatternTable = ({ history, canSave, @@ -81,20 +76,45 @@ export const IndexPatternTable = ({ chrome, dataViews, IndexPatternEditor, + spaces, } = useKibana().services; + const [query, setQuery] = useState(''); const [indexPatterns, setIndexPatterns] = useState([]); const [isLoadingIndexPatterns, setIsLoadingIndexPatterns] = useState(true); const [showCreateDialog, setShowCreateDialog] = useState(showCreateDialogProp); + const handleOnChange = ({ queryText, error }: { queryText: string; error: unknown }) => { + if (!error) { + setQuery(queryText); + } + }; + + const search = { + query, + onChange: handleOnChange, + box: { + incremental: true, + schema: { + fields: { title: { type: 'string' } }, + }, + }, + }; + + const loadDataViews = useCallback(async () => { + setIsLoadingIndexPatterns(true); + const gettedIndexPatterns: IndexPatternTableItem[] = await getIndexPatterns( + uiSettings.get('defaultIndex'), + dataViews + ); + setIndexPatterns(gettedIndexPatterns); + setIsLoadingIndexPatterns(false); + return gettedIndexPatterns; + }, [dataViews, uiSettings]); + setBreadcrumbs(getListBreadcrumbs()); useEffect(() => { (async function () { - const gettedIndexPatterns: IndexPatternTableItem[] = await getIndexPatterns( - uiSettings.get('defaultIndex'), - dataViews - ); - setIndexPatterns(gettedIndexPatterns); - setIsLoadingIndexPatterns(false); + const gettedIndexPatterns = await loadDataViews(); if ( gettedIndexPatterns.length === 0 || !(await dataViews.hasUserDataView().catch(() => false)) @@ -102,52 +122,64 @@ export const IndexPatternTable = ({ setShowCreateDialog(true); } })(); - }, [indexPatternManagementStart, uiSettings, dataViews]); + }, [indexPatternManagementStart, uiSettings, dataViews, loadDataViews]); chrome.docTitle.change(title); const isRollup = new URLSearchParams(useLocation().search).get('type') === 'rollup'; + const ContextWrapper = useMemo( + () => (spaces ? spaces.ui.components.getSpacesContextProvider : getEmptyFunctionComponent), + [spaces] + ); + const columns = [ { field: 'title', name: i18n.translate('indexPatternManagement.dataViewTable.nameColumn', { defaultMessage: 'Name', }), - render: ( - name: string, - index: { - id: string; - tags?: Array<{ - key: string; - name: string; - }>; - } - ) => ( + render: (name: string, dataView: IndexPatternTableItem) => ( <> - + {name} - {index.id && index.id.indexOf(securitySolution) === 0 && ( + {dataView?.id?.indexOf(securitySolution) === 0 && ( {securityDataView} )} - {index.tags && - index.tags.map(({ key: tagKey, name: tagName }) => ( - - {tagName} - - ))} + {dataView?.tags?.map(({ key: tagKey, name: tagName }) => ( + + {tagName} + + ))} ), dataType: 'string' as const, sortable: ({ sort }: { sort: string }) => sort, }, + { + field: 'namespaces', + name: 'spaces', + render: (name: string, dataView: IndexPatternTableItem) => { + return spaces ? ( + + ) : ( + <> + ); + }, + }, ]; const createButton = canSave ? ( @@ -197,17 +229,18 @@ export const IndexPatternTable = ({ /> - - + + + {displayIndexPatternEditor} ); diff --git a/src/plugins/data_view_management/public/components/index_pattern_table/spaces_list.tsx b/src/plugins/data_view_management/public/components/index_pattern_table/spaces_list.tsx new file mode 100644 index 0000000000000..c17e174ef1dda --- /dev/null +++ b/src/plugins/data_view_management/public/components/index_pattern_table/spaces_list.tsx @@ -0,0 +1,65 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC, useState } from 'react'; + +import { EuiButtonEmpty } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import type { + SpacesPluginStart, + ShareToSpaceFlyoutProps, +} from '../../../../../../x-pack/plugins/spaces/public'; +import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../../../../data_views/public'; + +interface Props { + spacesApi: SpacesPluginStart; + spaceIds: string[]; + id: string; + title: string; + refresh(): void; +} + +const noun = i18n.translate('indexPatternManagement.indexPatternTable.savedObjectName', { + defaultMessage: 'data view', +}); + +export const SpacesList: FC = ({ spacesApi, spaceIds, id, title, refresh }) => { + const [showFlyout, setShowFlyout] = useState(false); + + function onClose() { + setShowFlyout(false); + refresh(); + } + + const LazySpaceList = spacesApi.ui.components.getSpaceList; + const LazyShareToSpaceFlyout = spacesApi.ui.components.getShareToSpaceFlyout; + + const shareToSpaceFlyoutProps: ShareToSpaceFlyoutProps = { + savedObjectTarget: { + type: DATA_VIEW_SAVED_OBJECT_TYPE, + namespaces: spaceIds, + id, + title, + noun, + }, + onClose, + }; + + return ( + <> + setShowFlyout(true)} + style={{ height: 'auto' }} + data-test-subj="manageSpacesButton" + > + + + {showFlyout && } + + ); +}; diff --git a/src/plugins/data_view_management/public/components/types.ts b/src/plugins/data_view_management/public/components/types.ts index 3ead700732b91..07ff0c7c16052 100644 --- a/src/plugins/data_view_management/public/components/types.ts +++ b/src/plugins/data_view_management/public/components/types.ts @@ -16,6 +16,7 @@ export interface IndexPatternTableItem { id: string; title: string; default: boolean; - tag?: string[]; + tags?: Array<{ key: string; name: string }>; sort: string; + namespaces?: string[]; } diff --git a/src/plugins/data_view_management/public/components/utils.ts b/src/plugins/data_view_management/public/components/utils.ts index 3024c172ac441..1fccc8c694e31 100644 --- a/src/plugins/data_view_management/public/components/utils.ts +++ b/src/plugins/data_view_management/public/components/utils.ts @@ -32,18 +32,16 @@ const isRollup = (indexPatternType: string = '') => { return indexPatternType === 'rollup'; }; -export async function getIndexPatterns( - defaultIndex: string, - indexPatternsService: DataViewsContract -) { - const existingIndexPatterns = await indexPatternsService.getIdsWithTitle(true); +export async function getIndexPatterns(defaultIndex: string, dataViewsService: DataViewsContract) { + const existingIndexPatterns = await dataViewsService.getIdsWithTitle(true); const indexPatternsListItems = existingIndexPatterns.map((idxPattern) => { - const { id, title } = idxPattern; + const { id, title, namespaces } = idxPattern; const isDefault = defaultIndex === id; const tags = getTags(idxPattern, isDefault); return { id, + namespaces, title, default: isDefault, tags, diff --git a/src/plugins/data_view_management/public/management_app/mount_management_section.tsx b/src/plugins/data_view_management/public/management_app/mount_management_section.tsx index e4978acbc9d17..1b5ae606bb19b 100644 --- a/src/plugins/data_view_management/public/management_app/mount_management_section.tsx +++ b/src/plugins/data_view_management/public/management_app/mount_management_section.tsx @@ -40,7 +40,7 @@ export async function mountManagementSection( ) { const [ { chrome, uiSettings, notifications, overlays, http, docLinks, theme }, - { data, dataViewFieldEditor, dataViewEditor, dataViews, fieldFormats }, + { data, dataViewFieldEditor, dataViewEditor, dataViews, fieldFormats, spaces }, indexPatternManagementStart, ] = await getStartServices(); const canSave = dataViews.getCanSaveSync(); @@ -64,6 +64,7 @@ export async function mountManagementSection( fieldFormatEditors: dataViewFieldEditor.fieldFormatEditors, IndexPatternEditor: dataViewEditor.IndexPatternEditorComponent, fieldFormats, + spaces, }; ReactDOM.render( diff --git a/src/plugins/data_view_management/public/plugin.ts b/src/plugins/data_view_management/public/plugin.ts index a0c25479ce3e2..84686dd666f9a 100644 --- a/src/plugins/data_view_management/public/plugin.ts +++ b/src/plugins/data_view_management/public/plugin.ts @@ -16,6 +16,7 @@ import { ManagementSetup } from '../../management/public'; import { IndexPatternFieldEditorStart } from '../../data_view_field_editor/public'; import { DataViewEditorStart } from '../../data_view_editor/public'; import { DataViewsPublicPluginStart } from '../../data_views/public'; +import { SpacesPluginStart } from '../../../../x-pack/plugins/spaces/public'; export interface IndexPatternManagementSetupDependencies { management: ManagementSetup; @@ -28,6 +29,7 @@ export interface IndexPatternManagementStartDependencies { dataViewEditor: DataViewEditorStart; dataViews: DataViewsPublicPluginStart; fieldFormats: FieldFormatsStart; + spaces?: SpacesPluginStart; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/src/plugins/data_view_management/public/types.ts b/src/plugins/data_view_management/public/types.ts index f0a79416892ef..257d07cd478db 100644 --- a/src/plugins/data_view_management/public/types.ts +++ b/src/plugins/data_view_management/public/types.ts @@ -22,6 +22,7 @@ import { IndexPatternFieldEditorStart } from '../../data_view_field_editor/publi import { DataViewEditorStart } from '../../data_view_editor/public'; import { DataViewsPublicPluginStart } from '../../data_views/public'; import { FieldFormatsStart } from '../../field_formats/public'; +import { SpacesPluginStart } from '../../../../x-pack/plugins/spaces/public'; export interface IndexPatternManagmentContext { chrome: ChromeStart; @@ -38,6 +39,7 @@ export interface IndexPatternManagmentContext { fieldFormatEditors: IndexPatternFieldEditorStart['fieldFormatEditors']; IndexPatternEditor: DataViewEditorStart['IndexPatternEditorComponent']; fieldFormats: FieldFormatsStart; + spaces?: SpacesPluginStart; } export type IndexPatternManagmentContextValue = diff --git a/src/plugins/data_view_management/tsconfig.json b/src/plugins/data_view_management/tsconfig.json index bde927aaf732b..9710111bcfde2 100644 --- a/src/plugins/data_view_management/tsconfig.json +++ b/src/plugins/data_view_management/tsconfig.json @@ -20,5 +20,6 @@ { "path": "../es_ui_shared/tsconfig.json" }, { "path": "../data_view_field_editor/tsconfig.json" }, { "path": "../data_view_editor/tsconfig.json" }, + { "path": "../../../x-pack/plugins/spaces/tsconfig.json" } ] } diff --git a/src/plugins/data_views/common/data_views/__snapshots__/data_views.test.ts.snap b/src/plugins/data_views/common/data_views/__snapshots__/data_views.test.ts.snap index 50bc27b15922a..09784f9de6a37 100644 --- a/src/plugins/data_views/common/data_views/__snapshots__/data_views.test.ts.snap +++ b/src/plugins/data_views/common/data_views/__snapshots__/data_views.test.ts.snap @@ -40,6 +40,7 @@ Object { }, "fields": Object {}, "id": "id", + "namespaces": undefined, "runtimeFieldMap": Object { "aRuntimeField": Object { "script": Object { diff --git a/src/plugins/data_views/common/data_views/data_view.ts b/src/plugins/data_views/common/data_views/data_view.ts index 5f3ee24109027..4349fc11bced5 100644 --- a/src/plugins/data_views/common/data_views/data_view.ts +++ b/src/plugins/data_views/common/data_views/data_view.ts @@ -76,6 +76,7 @@ export class DataView implements IIndexPattern { */ public version: string | undefined; public sourceFilters?: SourceFilter[]; + public namespaces: string[]; private originalSavedObjectBody: SavedObjectBody = {}; private shortDotsEnable: boolean = false; private fieldFormats: FieldFormatsStartCommon; @@ -113,6 +114,7 @@ export class DataView implements IIndexPattern { this.fieldAttrs = spec.fieldAttrs || {}; this.allowNoIndex = spec.allowNoIndex || false; this.runtimeFieldMap = spec.runtimeFieldMap || {}; + this.namespaces = spec.namespaces || []; } /** diff --git a/src/plugins/data_views/common/data_views/data_views.ts b/src/plugins/data_views/common/data_views/data_views.ts index e93673bfa3ec5..2e31ed793c3db 100644 --- a/src/plugins/data_views/common/data_views/data_views.ts +++ b/src/plugins/data_views/common/data_views/data_views.ts @@ -48,6 +48,7 @@ export type IndexPatternListSavedObjectAttrs = Pick< export interface DataViewListItem { id: string; + namespaces?: string[]; title: string; type?: string; typeMeta?: TypeMeta; @@ -176,6 +177,7 @@ export class DataViewsService { } return this.savedObjectsCache.map((obj) => ({ id: obj?.id, + namespaces: obj?.namespaces, title: obj?.attributes?.title, type: obj?.attributes?.type, typeMeta: obj?.attributes?.typeMeta && JSON.parse(obj?.attributes?.typeMeta), @@ -374,6 +376,7 @@ export class DataViewsService { const { id, version, + namespaces, attributes: { title, timeFieldName, @@ -400,6 +403,7 @@ export class DataViewsService { return { id, version, + namespaces, title, timeFieldName, sourceFilters: parsedSourceFilters, diff --git a/src/plugins/data_views/common/types.ts b/src/plugins/data_views/common/types.ts index cd0fad414813e..8a1f7265296ff 100644 --- a/src/plugins/data_views/common/types.ts +++ b/src/plugins/data_views/common/types.ts @@ -283,6 +283,7 @@ export interface DataViewSpec { runtimeFieldMap?: Record; fieldAttrs?: FieldAttrs; allowNoIndex?: boolean; + namespaces?: string[]; } export interface SourceFilter { diff --git a/src/plugins/data_views/public/index.ts b/src/plugins/data_views/public/index.ts index fb926fe5f6316..2a9f1201cc854 100644 --- a/src/plugins/data_views/public/index.ts +++ b/src/plugins/data_views/public/index.ts @@ -17,7 +17,13 @@ export { onRedirectNoIndexPattern } from './data_views'; export type { IIndexPatternFieldList, TypeMeta, RuntimeType } from '../common'; export type { DataViewSpec } from '../common'; -export { IndexPatternField, DataViewField, DataViewType, META_FIELDS } from '../common'; +export { + IndexPatternField, + DataViewField, + DataViewType, + META_FIELDS, + DATA_VIEW_SAVED_OBJECT_TYPE, +} from '../common'; export type { IndexPatternsContract } from './data_views'; export type { DataViewListItem } from './data_views'; diff --git a/src/plugins/data_views/public/saved_objects_client_wrapper.ts b/src/plugins/data_views/public/saved_objects_client_wrapper.ts index beaae6ac3fc21..a5bc83546e3bb 100644 --- a/src/plugins/data_views/public/saved_objects_client_wrapper.ts +++ b/src/plugins/data_views/public/saved_objects_client_wrapper.ts @@ -54,6 +54,6 @@ export class SavedObjectsClientPublicToCommon implements SavedObjectsClientCommo return simpleSavedObjectToSavedObject(response); } delete(type: string, id: string) { - return this.savedObjectClient.delete(type, id); + return this.savedObjectClient.delete(type, id, { force: true }); } } diff --git a/src/plugins/data_views/server/saved_objects/data_views.ts b/src/plugins/data_views/server/saved_objects/data_views.ts index ca7592732c3ee..972b8f5d6752a 100644 --- a/src/plugins/data_views/server/saved_objects/data_views.ts +++ b/src/plugins/data_views/server/saved_objects/data_views.ts @@ -13,7 +13,7 @@ import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../../common'; export const dataViewSavedObjectType: SavedObjectsType = { name: DATA_VIEW_SAVED_OBJECT_TYPE, hidden: false, - namespaceType: 'multiple-isolated', + namespaceType: 'multiple', convertToMultiNamespaceTypeVersion: '8.0.0', management: { displayName: 'Data view', diff --git a/src/plugins/data_views/server/saved_objects_client_wrapper.ts b/src/plugins/data_views/server/saved_objects_client_wrapper.ts index dc7163c405d4f..e00eb9e3375a8 100644 --- a/src/plugins/data_views/server/saved_objects_client_wrapper.ts +++ b/src/plugins/data_views/server/saved_objects_client_wrapper.ts @@ -42,6 +42,6 @@ export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommo return await this.savedObjectClient.create(type, attributes, options); } delete(type: string, id: string) { - return this.savedObjectClient.delete(type, id); + return this.savedObjectClient.delete(type, id, { force: true }); } } diff --git a/src/plugins/discover/public/application/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap b/src/plugins/discover/public/application/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap index 059c247c38c2e..a08b8f4022745 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap +++ b/src/plugins/discover/public/application/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap @@ -654,6 +654,7 @@ exports[`Discover DataView Management renders correctly 1`] = ` "_type", "_source", ], + "namespaces": Array [], "originalSavedObjectBody": Object {}, "resetOriginalSavedObjectBody": [Function], "runtimeFieldMap": Object {}, diff --git a/src/plugins/discover/public/components/discover_grid/copy_column_name_button.test.tsx b/src/plugins/discover/public/components/discover_grid/copy_column_name_button.test.tsx new file mode 100644 index 0000000000000..66bfefe32f6a0 --- /dev/null +++ b/src/plugins/discover/public/components/discover_grid/copy_column_name_button.test.tsx @@ -0,0 +1,49 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { buildCopyColumnNameButton } from './copy_column_name_button'; +import { EuiButton } from '@elastic/eui'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; + +const execCommandMock = (global.document.execCommand = jest.fn()); +const warn = jest.spyOn(console, 'warn').mockImplementation(() => {}); + +describe('Copy to clipboard button', () => { + it('should copy to clipboard on click', () => { + const { label, iconType, onClick } = buildCopyColumnNameButton('test-field-name'); + execCommandMock.mockImplementationOnce(() => true); + + const wrapper = mountWithIntl( + + {label} + + ); + + wrapper.find(EuiButton).simulate('click'); + + expect(execCommandMock).toHaveBeenCalledWith('copy'); + expect(warn).not.toHaveBeenCalled(); + }); + + it('should not copy to clipboard on click', () => { + const { label, iconType, onClick } = buildCopyColumnNameButton('test-field-name'); + execCommandMock.mockImplementationOnce(() => false); + + const wrapper = mountWithIntl( + + {label} + + ); + + wrapper.find(EuiButton).simulate('click'); + + expect(execCommandMock).toHaveBeenCalledWith('copy'); + expect(warn).toHaveBeenCalledWith('Unable to copy to clipboard.'); + }); +}); diff --git a/src/plugins/discover/public/components/discover_grid/copy_column_name_button.tsx b/src/plugins/discover/public/components/discover_grid/copy_column_name_button.tsx new file mode 100644 index 0000000000000..e3f972ff3df26 --- /dev/null +++ b/src/plugins/discover/public/components/discover_grid/copy_column_name_button.tsx @@ -0,0 +1,28 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { copyToClipboard, EuiListGroupItemProps } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +export function buildCopyColumnNameButton(columnName: string) { + const copyToClipBoardButton: EuiListGroupItemProps = { + size: 'xs', + label: ( + + ), + iconType: 'copyClipboard', + iconProps: { size: 'm' }, + onClick: () => copyToClipboard(columnName), + }; + + return copyToClipBoardButton; +} diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_columns.test.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_columns.test.tsx index ef3e954d41cfc..a9116e616946f 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_columns.test.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_columns.test.tsx @@ -24,6 +24,21 @@ describe('Discover grid columns', function () { Array [ Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": Object { "iconType": "cross", "label": "Remove column", @@ -39,6 +54,21 @@ describe('Discover grid columns', function () { }, Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": Object { "iconType": "cross", "label": "Remove column", @@ -68,6 +98,21 @@ describe('Discover grid columns', function () { Array [ Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": false, "showMoveLeft": false, "showMoveRight": false, @@ -83,6 +128,21 @@ describe('Discover grid columns', function () { }, Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": false, "showMoveLeft": false, "showMoveRight": false, @@ -109,6 +169,21 @@ describe('Discover grid columns', function () { Array [ Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": false, "showMoveLeft": true, "showMoveRight": true, @@ -138,6 +213,21 @@ describe('Discover grid columns', function () { }, Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": Object { "iconType": "cross", "label": "Remove column", @@ -156,6 +246,21 @@ describe('Discover grid columns', function () { }, Object { "actions": Object { + "additional": Array [ + Object { + "iconProps": Object { + "size": "m", + }, + "iconType": "copyClipboard", + "label": , + "onClick": [Function], + "size": "xs", + }, + ], "showHide": Object { "iconType": "cross", "label": "Remove column", diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx index 5e4ec7a4f9629..2aee9ae2229c7 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx @@ -16,6 +16,7 @@ import { buildCellActions } from './discover_grid_cell_actions'; import { getSchemaByKbnType } from './discover_grid_schema'; import { SelectButton } from './discover_grid_document_selection'; import { defaultTimeColumnWidth } from './constants'; +import { buildCopyColumnNameButton } from './copy_column_name_button'; export function getLeadControlColumns() { return [ @@ -80,6 +81,7 @@ export function buildEuiGridColumn( }, showMoveLeft: !defaultColumns, showMoveRight: !defaultColumns, + additional: columnName === '_source' ? undefined : [buildCopyColumnNameButton(columnName)], }, cellActions: indexPatternField ? buildCellActions(indexPatternField) : [], }; diff --git a/src/plugins/expressions/common/expression_functions/specs/clog.ts b/src/plugins/expressions/common/expression_functions/specs/clog.ts index a523d7505648f..6936b704b878e 100644 --- a/src/plugins/expressions/common/expression_functions/specs/clog.ts +++ b/src/plugins/expressions/common/expression_functions/specs/clog.ts @@ -13,7 +13,7 @@ export type ExpressionFunctionClog = ExpressionFunctionDefinition<'clog', unknow export const clog: ExpressionFunctionClog = { name: 'clog', args: {}, - help: 'Outputs the context to the console', + help: 'Outputs the _input_ in the console. This function is for debug purposes', fn: (input: unknown) => { // eslint-disable-next-line no-console console.log(input); diff --git a/src/plugins/expressions/common/expression_functions/specs/math_column.ts b/src/plugins/expressions/common/expression_functions/specs/math_column.ts index fe6049b49c969..ae6cc8b755fe1 100644 --- a/src/plugins/expressions/common/expression_functions/specs/math_column.ts +++ b/src/plugins/expressions/common/expression_functions/specs/math_column.ts @@ -28,12 +28,11 @@ export const mathColumn: ExpressionFunctionDefinition< inputTypes: ['datatable'], help: i18n.translate('expressions.functions.mathColumnHelpText', { defaultMessage: - 'Adds a column calculated as the result of other columns. ' + - 'Changes are made only when you provide arguments.' + - 'See also {alterColumnFn} and {staticColumnFn}.', + 'Adds a column by evaluating {tinymath} on each row. ' + + 'This function is optimized for math and performs better than using a math expression in {mapColumnFn}.', values: { - alterColumnFn: '`alterColumn`', - staticColumnFn: '`staticColumn`', + mapColumnFn: '`mapColumn`', + tinymath: '`TinyMath`', }, }), args: { diff --git a/src/plugins/saved_objects_management/public/services/column_service.test.ts b/src/plugins/saved_objects_management/public/services/column_service.test.ts index 581a55fa0066d..5676cfaa81285 100644 --- a/src/plugins/saved_objects_management/public/services/column_service.test.ts +++ b/src/plugins/saved_objects_management/public/services/column_service.test.ts @@ -7,7 +7,7 @@ */ import { spacesPluginMock } from '../../../../../x-pack/plugins/spaces/public/mocks'; -// import { ShareToSpaceSavedObjectsManagementColumn } from './columns'; +import { ShareToSpaceSavedObjectsManagementColumn } from './columns'; import { SavedObjectsManagementColumnService, SavedObjectsManagementColumnServiceSetup, @@ -45,7 +45,7 @@ describe('SavedObjectsManagementColumnRegistry', () => { const start = service.start(spacesPluginMock.createStartContract()); expect(start.getAll()).toEqual([ column, - // expect.any(ShareToSpaceSavedObjectsManagementColumn), + expect.any(ShareToSpaceSavedObjectsManagementColumn), ]); }); diff --git a/src/plugins/saved_objects_management/public/services/column_service.ts b/src/plugins/saved_objects_management/public/services/column_service.ts index 74c06a3d33218..8189fc7d07f83 100644 --- a/src/plugins/saved_objects_management/public/services/column_service.ts +++ b/src/plugins/saved_objects_management/public/services/column_service.ts @@ -7,7 +7,7 @@ */ import type { SpacesApi } from '../../../../../x-pack/plugins/spaces/public'; -// import { ShareToSpaceSavedObjectsManagementColumn } from './columns'; +import { ShareToSpaceSavedObjectsManagementColumn } from './columns'; import { SavedObjectsManagementColumn } from './types'; export interface SavedObjectsManagementColumnServiceSetup { @@ -53,5 +53,5 @@ function registerSpacesApiColumns( spacesApi: SpacesApi ) { // Note: this column is hidden for now because no saved objects are shareable. It should be uncommented when at least one saved object type is multi-namespace. - // service.setup().register(new ShareToSpaceSavedObjectsManagementColumn(spacesApi.ui)); + service.setup().register(new ShareToSpaceSavedObjectsManagementColumn(spacesApi.ui)); } diff --git a/src/plugins/shared_ux/kibana.json b/src/plugins/shared_ux/kibana.json index 44aeeb9cf80fc..308a252f70b54 100755 --- a/src/plugins/shared_ux/kibana.json +++ b/src/plugins/shared_ux/kibana.json @@ -9,6 +9,6 @@ "description": "A plugin providing components and services for shared user experiences in Kibana.", "server": true, "ui": true, - "requiredPlugins": [], + "requiredPlugins": ["dataViewEditor", "dataViews"], "optionalPlugins": [] } diff --git a/src/plugins/shared_ux/public/components/empty_state/assets/data_view_illustration.tsx b/src/plugins/shared_ux/public/components/empty_state/assets/data_view_illustration.tsx new file mode 100644 index 0000000000000..8a889a9267dee --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/assets/data_view_illustration.tsx @@ -0,0 +1,552 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { useEuiTheme } from '@elastic/eui'; +import { css } from '@emotion/css'; + +export const DataViewIllustration = () => { + const { euiTheme } = useEuiTheme(); + const { colors } = euiTheme; + + const dataViewIllustrationVerticalStripes = css` + fill: ${colors.fullShade}; + `; + + const dataViewIllustrationDots = css` + fill: ${colors.lightShade}; + `; + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/src/plugins/shared_ux/public/components/empty_state/assets/index.tsx b/src/plugins/shared_ux/public/components/empty_state/assets/index.tsx new file mode 100644 index 0000000000000..c234cdf40055b --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/assets/index.tsx @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { EuiLoadingSpinner } from '@elastic/eui'; + +import { withSuspense } from '../../utility'; + +export const LazyDataViewIllustration = React.lazy(() => + import('../assets/data_view_illustration').then(({ DataViewIllustration }) => ({ + default: DataViewIllustration, + })) +); + +export const DataViewIllustration = withSuspense( + LazyDataViewIllustration, + +); diff --git a/src/plugins/shared_ux/public/components/empty_state/index.tsx b/src/plugins/shared_ux/public/components/empty_state/index.tsx new file mode 100644 index 0000000000000..fc05199aae207 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/index.tsx @@ -0,0 +1,9 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { NoDataViews } from './no_data_views'; diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/__snapshots__/documentation_link.test.tsx.snap b/src/plugins/shared_ux/public/components/empty_state/no_data_views/__snapshots__/documentation_link.test.tsx.snap new file mode 100644 index 0000000000000..5526b78bceb73 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/__snapshots__/documentation_link.test.tsx.snap @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` is rendered correctly 1`] = ` +
+ +
+ +
+
+   +
+ + + +
+
+`; diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/documentation_link.test.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/documentation_link.test.tsx new file mode 100644 index 0000000000000..fd963dfaa8e1c --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/documentation_link.test.tsx @@ -0,0 +1,28 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { EuiLink, EuiTitle } from '@elastic/eui'; +import { shallowWithIntl } from '@kbn/test-jest-helpers'; + +import { DocumentationLink } from './documentation_link'; + +describe('', () => { + test('is rendered correctly', () => { + const component = shallowWithIntl(); + expect(component).toMatchSnapshot(); + + expect(component.find('dl').length).toBe(1); + expect(component.find(EuiTitle).length).toBe(1); + expect(component.find(EuiLink).length).toBe(1); + + const link = component.find(EuiLink).at(0); + expect(link.prop('href')).toBe('dummy'); + }); +}); diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/documentation_link.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/documentation_link.tsx new file mode 100644 index 0000000000000..4ac07899fef5f --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/documentation_link.tsx @@ -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 + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiLink, EuiTitle } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +interface Props { + href: string; +} + +export function DocumentationLink({ href }: Props) { + return ( +
+ +
+ +
+
+   +
+ + + +
+
+ ); +} diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/index.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/index.tsx new file mode 100644 index 0000000000000..fc05199aae207 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/index.tsx @@ -0,0 +1,9 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { NoDataViews } from './no_data_views'; diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.component.test.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.component.test.tsx new file mode 100644 index 0000000000000..1d8028d4889a0 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.component.test.tsx @@ -0,0 +1,53 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { EuiButton, EuiPanel } from '@elastic/eui'; +import { NoDataViews } from './no_data_views.component'; +import { DocumentationLink } from './documentation_link'; + +describe('', () => { + test('is rendered correctly', () => { + const component = mountWithIntl( + + ); + expect(component.find(EuiPanel).length).toBe(1); + expect(component.find(EuiButton).length).toBe(1); + expect(component.find(DocumentationLink).length).toBe(1); + }); + + test('does not render button if canCreateNewDataViews is false', () => { + const component = mountWithIntl(); + + expect(component.find(EuiButton).length).toBe(0); + }); + + test('does not documentation link if linkToDocumentation is not provided', () => { + const component = mountWithIntl( + + ); + + expect(component.find(DocumentationLink).length).toBe(0); + }); + + test('onClickCreate', () => { + const onClickCreate = jest.fn(); + const component = mountWithIntl( + + ); + + component.find('button').simulate('click'); + + expect(onClickCreate).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.component.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.component.tsx new file mode 100644 index 0000000000000..bfab91ef03b26 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.component.tsx @@ -0,0 +1,90 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { css } from '@emotion/react'; + +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { EuiButton, EuiEmptyPrompt, EuiEmptyPromptProps } from '@elastic/eui'; + +import { DataViewIllustration } from '../assets'; +import { DocumentationLink } from './documentation_link'; + +export interface Props { + canCreateNewDataView: boolean; + onClickCreate?: () => void; + dataViewsDocLink?: string; + emptyPromptColor?: EuiEmptyPromptProps['color']; +} + +const createDataViewText = i18n.translate('sharedUX.noDataViewsPage.addDataViewText', { + defaultMessage: 'Create Data View', +}); + +// Using raw value because it is content dependent +const MAX_WIDTH = 830; + +/** + * A presentational component that is shown in cases when there are no data views created yet. + */ +export const NoDataViews = ({ + onClickCreate, + canCreateNewDataView, + dataViewsDocLink, + emptyPromptColor = 'plain', +}: Props) => { + const createNewButton = canCreateNewDataView && ( + + {createDataViewText} + + ); + + return ( + } + title={ +

+ +
+ +

+ } + body={ +

+ +

+ } + actions={createNewButton} + footer={dataViewsDocLink && } + /> + ); +}; diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.mdx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.mdx new file mode 100644 index 0000000000000..ef8812c565a9f --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.mdx @@ -0,0 +1,14 @@ +**id:** sharedUX/Components/NoDataViewsPage +**slug:** /shared-ux/components/no-data-views-page +**title:** No Data Views Page +**summary:** A page to be displayed when there is data in Elasticsearch, but no data views +**tags:** ['shared-ux', 'component'] +**date:** 2022-02-09 + +--- + +When there is data in Elasticsearch, but there haven't been any data views created yet, we want to display an appropriate message to the user and facilitate creation of data views (if appropriate permissions are in place). + +The pure component, `no_data_views.component.tsx`, is a pre-configured **EuiEmptyPrompt**. + +The connected component, `no_data_views.tsx`, uses services from the `shared_ux` plugin to open Data View Editor. You must wrap your plugin app in the `ServicesContext` provided by the start contract of the `shared_ux` plugin to use it. diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.stories.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.stories.tsx new file mode 100644 index 0000000000000..3f9ae1958cad7 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.stories.tsx @@ -0,0 +1,52 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React from 'react'; +import { action } from '@storybook/addon-actions'; + +import { docLinksServiceFactory } from '../../../services/storybook/doc_links'; + +import { NoDataViews as NoDataViewsComponent, Props } from './no_data_views.component'; +import { NoDataViews } from './no_data_views'; + +import mdx from './no_data_views.mdx'; + +export default { + title: 'No Data Views', + description: 'A component to display when there are no user-created data views available.', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +export const ConnectedComponent = () => { + return ( + + ); +}; + +type Params = Pick; + +export const PureComponent = (params: Params) => { + return ; +}; + +PureComponent.argTypes = { + canCreateNewDataView: { + control: 'boolean', + defaultValue: true, + }, + dataViewsDocLink: { + options: [docLinksServiceFactory().dataViewsDocsLink, undefined], + control: { type: 'radio' }, + }, +}; diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.test.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.test.tsx new file mode 100644 index 0000000000000..650d78fa64a03 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.test.tsx @@ -0,0 +1,48 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { ReactWrapper } from 'enzyme'; + +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { EuiButton } from '@elastic/eui'; + +import { ServicesProvider, SharedUXServices } from '../../../services'; +import { servicesFactory } from '../../../services/mocks'; +import { NoDataViews } from './no_data_views'; + +describe('', () => { + let services: SharedUXServices; + let mount: (element: JSX.Element) => ReactWrapper; + + beforeEach(() => { + services = servicesFactory(); + mount = (element: JSX.Element) => + mountWithIntl({element}); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + test('on dataView created', () => { + const component = mount( + + ); + + expect(services.editors.openDataViewEditor).not.toHaveBeenCalled(); + component.find(EuiButton).simulate('click'); + + component.unmount(); + + expect(services.editors.openDataViewEditor).toHaveBeenCalled(); + }); +}); diff --git a/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.tsx b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.tsx new file mode 100644 index 0000000000000..01494d2c8a5b3 --- /dev/null +++ b/src/plugins/shared_ux/public/components/empty_state/no_data_views/no_data_views.tsx @@ -0,0 +1,72 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useCallback, useEffect, useRef } from 'react'; + +import { DataView } from '../../../../../data_views/public'; +import { useEditors, usePermissions } from '../../../services'; +import type { SharedUXEditorsService } from '../../../services/editors'; + +import { NoDataViews as NoDataViewsComponent } from './no_data_views.component'; + +export interface Props { + onDataViewCreated: (dataView: DataView) => void; + dataViewsDocLink: string; +} + +type CloseDataViewEditorFn = ReturnType; + +/** + * A service-enabled component that provides Kibana-specific functionality to the `NoDataViews` + * component. + * + * Use of this component requires both the `EuiTheme` context as well as either a configured Shared UX + * `ServicesProvider` or the `ServicesContext` provided by the Shared UX public plugin contract. + * + * See shared-ux/public/services for information. + */ +export const NoDataViews = ({ onDataViewCreated, dataViewsDocLink }: Props) => { + const { canCreateNewDataView } = usePermissions(); + const { openDataViewEditor } = useEditors(); + const closeDataViewEditor = useRef(); + + useEffect(() => { + const cleanup = () => { + if (closeDataViewEditor?.current) { + closeDataViewEditor?.current(); + } + }; + + return () => { + // Make sure to close the editor when unmounting + cleanup(); + }; + }, []); + + const setDataViewEditorRef = useCallback((ref: CloseDataViewEditorFn) => { + closeDataViewEditor.current = ref; + }, []); + + const onClickCreate = useCallback(() => { + if (!canCreateNewDataView) { + return; + } + + const ref = openDataViewEditor({ + onSave: (dataView) => { + onDataViewCreated(dataView); + }, + }); + + if (setDataViewEditorRef) { + setDataViewEditorRef(ref); + } + }, [canCreateNewDataView, openDataViewEditor, setDataViewEditorRef, onDataViewCreated]); + + return ; +}; diff --git a/src/plugins/shared_ux/public/components/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap b/src/plugins/shared_ux/public/components/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap index abf76f9da48ce..d2609e6b3c7a6 100644 --- a/src/plugins/shared_ux/public/components/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap +++ b/src/plugins/shared_ux/public/components/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap @@ -2,6 +2,21 @@ exports[` is rendered 1`] = ` * a predefined fallback and error boundary. */ export const ExitFullScreenButton = withSuspense(LazyExitFullScreenButton); + +/** + * The Lazily-loaded `NoDataViews` component. Consumers should use `React.Suspennse` or the + * `withSuspense` HOC to load this component. + */ +export const LazyNoDataViewsPage = React.lazy(() => + import('./empty_state/no_data_views').then(({ NoDataViews }) => ({ + default: NoDataViews, + })) +); + +/** + * A `NoDataViewsPage` component that is wrapped by the `withSuspense` HOC. This component can + * be used directly by consumers and will load the `LazyNoDataViewsPage` component lazily with + * a predefined fallback and error boundary. + */ +export const NoDataViewsPage = withSuspense(LazyNoDataViewsPage); diff --git a/src/plugins/shared_ux/public/index.ts b/src/plugins/shared_ux/public/index.ts index e6a2f925c5120..a196a60db847b 100755 --- a/src/plugins/shared_ux/public/index.ts +++ b/src/plugins/shared_ux/public/index.ts @@ -17,3 +17,4 @@ export function plugin() { export type { SharedUXPluginSetup, SharedUXPluginStart } from './types'; export { ExitFullScreenButton, LazyExitFullScreenButton } from './components'; +export { NoDataViewsPage, LazyNoDataViewsPage } from './components'; diff --git a/src/plugins/shared_ux/public/services/doc_links.ts b/src/plugins/shared_ux/public/services/doc_links.ts new file mode 100644 index 0000000000000..3c6d23bd33ae4 --- /dev/null +++ b/src/plugins/shared_ux/public/services/doc_links.ts @@ -0,0 +1,10 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +export interface SharedUXDocLinksService { + dataViewsDocsLink: string; +} diff --git a/src/plugins/shared_ux/public/services/editors.ts b/src/plugins/shared_ux/public/services/editors.ts new file mode 100644 index 0000000000000..176b22a6006e1 --- /dev/null +++ b/src/plugins/shared_ux/public/services/editors.ts @@ -0,0 +1,15 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { DataView } from '../../../data_views/common'; + +export interface SharedUxDataViewEditorProps { + onSave: (dataView: DataView) => void; +} +export interface SharedUXEditorsService { + openDataViewEditor: (options: SharedUxDataViewEditorProps) => () => void; +} diff --git a/src/plugins/shared_ux/public/services/index.tsx b/src/plugins/shared_ux/public/services/index.tsx index 0677f3ef0ca84..bdca90c725858 100644 --- a/src/plugins/shared_ux/public/services/index.tsx +++ b/src/plugins/shared_ux/public/services/index.tsx @@ -9,6 +9,9 @@ import React, { FC, createContext, useContext } from 'react'; import { SharedUXPlatformService } from './platform'; import { servicesFactory } from './stub'; +import { SharedUXUserPermissionsService } from './permissions'; +import { SharedUXEditorsService } from './editors'; +import { SharedUXDocLinksService } from './doc_links'; /** * A collection of services utilized by SharedUX. This serves as a thin @@ -20,6 +23,9 @@ import { servicesFactory } from './stub'; */ export interface SharedUXServices { platform: SharedUXPlatformService; + permissions: SharedUXUserPermissionsService; + editors: SharedUXEditorsService; + docLinks: SharedUXDocLinksService; } // The React Context used to provide the services to the SharedUX components. @@ -48,3 +54,9 @@ export function useServices() { * React hook for accessing the pre-wired `SharedUXPlatformService`. */ export const usePlatformService = () => useServices().platform; + +export const usePermissions = () => useServices().permissions; + +export const useEditors = () => useServices().editors; + +export const useDocLinks = () => useServices().docLinks; diff --git a/src/plugins/shared_ux/public/services/kibana/doc_links.ts b/src/plugins/shared_ux/public/services/kibana/doc_links.ts new file mode 100644 index 0000000000000..eb25114a188a2 --- /dev/null +++ b/src/plugins/shared_ux/public/services/kibana/doc_links.ts @@ -0,0 +1,23 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaPluginServiceFactory } from '../types'; +import { SharedUXPluginStartDeps } from '../../types'; +import { SharedUXDocLinksService } from '../doc_links'; + +export type DocLinksServiceFactory = KibanaPluginServiceFactory< + SharedUXDocLinksService, + SharedUXPluginStartDeps +>; + +/** + * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. + */ +export const docLinksServiceFactory: DocLinksServiceFactory = ({ coreStart }) => ({ + dataViewsDocsLink: coreStart.docLinks.links.indexPatterns?.introduction, +}); diff --git a/src/plugins/shared_ux/public/services/kibana/editors.ts b/src/plugins/shared_ux/public/services/kibana/editors.ts new file mode 100644 index 0000000000000..0f8082d7d00e2 --- /dev/null +++ b/src/plugins/shared_ux/public/services/kibana/editors.ts @@ -0,0 +1,23 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaPluginServiceFactory } from '../types'; +import { SharedUXEditorsService } from '../editors'; +import { SharedUXPluginStartDeps } from '../../types'; + +export type EditorsServiceFactory = KibanaPluginServiceFactory< + SharedUXEditorsService, + SharedUXPluginStartDeps +>; + +/** + * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. + */ +export const editorsServiceFactory: EditorsServiceFactory = ({ startPlugins }) => ({ + openDataViewEditor: startPlugins.dataViewEditor.openEditor, +}); diff --git a/src/plugins/shared_ux/public/services/kibana/index.ts b/src/plugins/shared_ux/public/services/kibana/index.ts index f7c4cd7b2c56d..506176cffbc45 100644 --- a/src/plugins/shared_ux/public/services/kibana/index.ts +++ b/src/plugins/shared_ux/public/services/kibana/index.ts @@ -10,6 +10,9 @@ import type { SharedUXServices } from '..'; import type { SharedUXPluginStartDeps } from '../../types'; import type { KibanaPluginServiceFactory } from '../types'; import { platformServiceFactory } from './platform'; +import { userPermissionsServiceFactory } from './permissions'; +import { editorsServiceFactory } from './editors'; +import { docLinksServiceFactory } from './doc_links'; /** * A factory function for creating a Kibana-based implementation of `SharedUXServices`. @@ -19,4 +22,7 @@ export const servicesFactory: KibanaPluginServiceFactory< SharedUXPluginStartDeps > = (params) => ({ platform: platformServiceFactory(params), + permissions: userPermissionsServiceFactory(params), + editors: editorsServiceFactory(params), + docLinks: docLinksServiceFactory(params), }); diff --git a/src/plugins/shared_ux/public/services/kibana/permissions.ts b/src/plugins/shared_ux/public/services/kibana/permissions.ts new file mode 100644 index 0000000000000..caaeccdccbccd --- /dev/null +++ b/src/plugins/shared_ux/public/services/kibana/permissions.ts @@ -0,0 +1,23 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaPluginServiceFactory } from '../types'; +import { SharedUXPluginStartDeps } from '../../types'; +import { SharedUXUserPermissionsService } from '../permissions'; + +export type UserPermissionsServiceFactory = KibanaPluginServiceFactory< + SharedUXUserPermissionsService, + SharedUXPluginStartDeps +>; + +/** + * A factory function for creating a Kibana-based implementation of `SharedUXPermissionsService`. + */ +export const userPermissionsServiceFactory: UserPermissionsServiceFactory = ({ startPlugins }) => ({ + canCreateNewDataView: startPlugins.dataViewEditor.userPermissions.editDataView(), +}); diff --git a/src/plugins/shared_ux/public/services/mocks/doc_links.mock.ts b/src/plugins/shared_ux/public/services/mocks/doc_links.mock.ts new file mode 100644 index 0000000000000..28cfa14c50d28 --- /dev/null +++ b/src/plugins/shared_ux/public/services/mocks/doc_links.mock.ts @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXDocLinksService } from '../doc_links'; + +export type MockDockLinksServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a Jest-based implementation of `SharedUXDocLinksService`. + */ +export const docLinksServiceFactory: MockDockLinksServiceFactory = () => ({ + dataViewsDocsLink: 'dummy link', +}); diff --git a/src/plugins/shared_ux/public/services/mocks/editors.mock.ts b/src/plugins/shared_ux/public/services/mocks/editors.mock.ts new file mode 100644 index 0000000000000..28a89d5326d62 --- /dev/null +++ b/src/plugins/shared_ux/public/services/mocks/editors.mock.ts @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXEditorsService } from '../editors'; + +export type MockEditorsServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a Jest-based implementation of `SharedUXEditorsService`. + */ +export const editorsServiceFactory: MockEditorsServiceFactory = () => ({ + openDataViewEditor: jest.fn(), +}); diff --git a/src/plugins/shared_ux/public/services/mocks/index.ts b/src/plugins/shared_ux/public/services/mocks/index.ts index 14d38a484e53b..9fce633c52539 100644 --- a/src/plugins/shared_ux/public/services/mocks/index.ts +++ b/src/plugins/shared_ux/public/services/mocks/index.ts @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ +import { docLinksServiceFactory } from './doc_links.mock'; export type { MockPlatformServiceFactory } from './platform.mock'; export { platformServiceFactory } from './platform.mock'; @@ -12,10 +13,15 @@ export { platformServiceFactory } from './platform.mock'; import type { SharedUXServices } from '../.'; import { PluginServiceFactory } from '../types'; import { platformServiceFactory } from './platform.mock'; +import { userPermissionsServiceFactory } from './permissions.mock'; +import { editorsServiceFactory } from './editors.mock'; /** * A factory function for creating a Jest-based implementation of `SharedUXServices`. */ export const servicesFactory: PluginServiceFactory = () => ({ platform: platformServiceFactory(), + permissions: userPermissionsServiceFactory(), + editors: editorsServiceFactory(), + docLinks: docLinksServiceFactory(), }); diff --git a/src/plugins/shared_ux/public/services/mocks/permissions.mock.ts b/src/plugins/shared_ux/public/services/mocks/permissions.mock.ts new file mode 100644 index 0000000000000..ff65d2393248a --- /dev/null +++ b/src/plugins/shared_ux/public/services/mocks/permissions.mock.ts @@ -0,0 +1,20 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXUserPermissionsService } from '../permissions'; + +export type MockUserPermissionsServiceFactory = + PluginServiceFactory; + +/** + * A factory function for creating a Jest-based implementation of `SharedUXUserPermissionsService`. + */ +export const userPermissionsServiceFactory: MockUserPermissionsServiceFactory = () => ({ + canCreateNewDataView: true, +}); diff --git a/src/plugins/shared_ux/public/services/permissions.ts b/src/plugins/shared_ux/public/services/permissions.ts new file mode 100644 index 0000000000000..009f497e35706 --- /dev/null +++ b/src/plugins/shared_ux/public/services/permissions.ts @@ -0,0 +1,11 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export interface SharedUXUserPermissionsService { + canCreateNewDataView: boolean; +} diff --git a/src/plugins/shared_ux/public/services/storybook/doc_links.ts b/src/plugins/shared_ux/public/services/storybook/doc_links.ts new file mode 100644 index 0000000000000..548d504336108 --- /dev/null +++ b/src/plugins/shared_ux/public/services/storybook/doc_links.ts @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXDocLinksService } from '../doc_links'; + +export type SharedUXDockLinksServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a Jest-based implementation of `SharedUXDocLinksService`. + */ +export const docLinksServiceFactory: SharedUXDockLinksServiceFactory = () => ({ + dataViewsDocsLink: 'https://www.elastic.co/guide/en/kibana/master/data-views.html', +}); diff --git a/src/plugins/shared_ux/public/services/storybook/editors.ts b/src/plugins/shared_ux/public/services/storybook/editors.ts new file mode 100644 index 0000000000000..248699d5beb95 --- /dev/null +++ b/src/plugins/shared_ux/public/services/storybook/editors.ts @@ -0,0 +1,22 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { action } from '@storybook/addon-actions'; +import { PluginServiceFactory } from '../types'; +import { SharedUxDataViewEditorProps, SharedUXEditorsService } from '../editors'; + +export type SharedUXEditorsServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a storybook implementation of `SharedUXEditorsService`. + */ +export const editorsServiceFactory: SharedUXEditorsServiceFactory = () => ({ + openDataViewEditor: action('openEditor') as SharedUXEditorsService['openDataViewEditor'] as ( + options: SharedUxDataViewEditorProps + ) => () => void, +}); diff --git a/src/plugins/shared_ux/public/services/storybook/index.ts b/src/plugins/shared_ux/public/services/storybook/index.ts index 8ea03317e53a2..c915b1a463365 100644 --- a/src/plugins/shared_ux/public/services/storybook/index.ts +++ b/src/plugins/shared_ux/public/services/storybook/index.ts @@ -9,10 +9,16 @@ import type { SharedUXServices } from '../.'; import { PluginServiceFactory } from '../types'; import { platformServiceFactory } from './platform'; +import { editorsServiceFactory } from './editors'; +import { userPermissionsServiceFactory } from './permissions'; +import { docLinksServiceFactory } from './doc_links'; /** * A factory function for creating a Storybook-based implementation of `SharedUXServices`. */ export const servicesFactory: PluginServiceFactory = (params) => ({ platform: platformServiceFactory(params), + permissions: userPermissionsServiceFactory(), + editors: editorsServiceFactory(), + docLinks: docLinksServiceFactory(), }); diff --git a/src/plugins/shared_ux/public/services/storybook/permissions.ts b/src/plugins/shared_ux/public/services/storybook/permissions.ts new file mode 100644 index 0000000000000..c7110fccf7eea --- /dev/null +++ b/src/plugins/shared_ux/public/services/storybook/permissions.ts @@ -0,0 +1,20 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXUserPermissionsService } from '../permissions'; + +export type SharedUXUserPermissionsServiceFactory = + PluginServiceFactory; + +/** + * A factory function for creating a storybook implementation of `SharedUXUserPermissionsService`. + */ +export const userPermissionsServiceFactory: SharedUXUserPermissionsServiceFactory = () => ({ + canCreateNewDataView: true, +}); diff --git a/src/plugins/shared_ux/public/services/stub/doc_links.ts b/src/plugins/shared_ux/public/services/stub/doc_links.ts new file mode 100644 index 0000000000000..424a24c578539 --- /dev/null +++ b/src/plugins/shared_ux/public/services/stub/doc_links.ts @@ -0,0 +1,19 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXDocLinksService } from '../doc_links'; + +export type DockLinksServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a Jest-based implementation of `SharedUXDocLinksService`. + */ +export const docLinksServiceFactory: DockLinksServiceFactory = () => ({ + dataViewsDocsLink: 'docs', +}); diff --git a/src/plugins/shared_ux/public/services/stub/editors.ts b/src/plugins/shared_ux/public/services/stub/editors.ts new file mode 100644 index 0000000000000..03fea5e6c98b5 --- /dev/null +++ b/src/plugins/shared_ux/public/services/stub/editors.ts @@ -0,0 +1,22 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXEditorsService } from '../editors'; + +/** + * A factory function for creating a simple stubbed implementation of `SharedUXEditorsService`. + */ +export type EditorsServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a simple stubbed implementation of `SharedUXEditorsService`. + */ +export const editorsServiceFactory: EditorsServiceFactory = () => ({ + openDataViewEditor: () => () => {}, +}); diff --git a/src/plugins/shared_ux/public/services/stub/index.ts b/src/plugins/shared_ux/public/services/stub/index.ts index 8a5afe8cdcafb..9e4fa8f03133a 100644 --- a/src/plugins/shared_ux/public/services/stub/index.ts +++ b/src/plugins/shared_ux/public/services/stub/index.ts @@ -9,10 +9,16 @@ import type { SharedUXServices } from '../.'; import { PluginServiceFactory } from '../types'; import { platformServiceFactory } from './platform'; +import { userPermissionsServiceFactory } from './permissions'; +import { editorsServiceFactory } from './editors'; +import { docLinksServiceFactory } from './doc_links'; /** * A factory function for creating a simple stubbed implemetation of `SharedUXServices`. */ export const servicesFactory: PluginServiceFactory = () => ({ platform: platformServiceFactory(), + permissions: userPermissionsServiceFactory(), + editors: editorsServiceFactory(), + docLinks: docLinksServiceFactory(), }); diff --git a/src/plugins/shared_ux/public/services/stub/permissions.ts b/src/plugins/shared_ux/public/services/stub/permissions.ts new file mode 100644 index 0000000000000..c51abf41e2842 --- /dev/null +++ b/src/plugins/shared_ux/public/services/stub/permissions.ts @@ -0,0 +1,22 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '../types'; +import { SharedUXUserPermissionsService } from '../permissions'; + +/** + * A factory function for creating a simple stubbed implementation of `SharedUXUserPermissionsService`. + */ +export type UserPermissionsServiceFactory = PluginServiceFactory; + +/** + * A factory function for creating a simple stubbed implementation of `SharedUXUserPermissionsService`. + */ +export const userPermissionsServiceFactory: UserPermissionsServiceFactory = () => ({ + canCreateNewDataView: true, +}); diff --git a/src/plugins/shared_ux/public/types/index.ts b/src/plugins/shared_ux/public/types/index.ts index 767dbf1aa10a4..38f91815f2e7b 100644 --- a/src/plugins/shared_ux/public/types/index.ts +++ b/src/plugins/shared_ux/public/types/index.ts @@ -9,6 +9,7 @@ /* eslint-disable @typescript-eslint/no-empty-interface */ import { FC } from 'react'; +import { DataViewEditorStart } from 'src/plugins/data_view_editor/public'; /** @internal */ export interface SharedUXPluginSetup {} @@ -28,4 +29,6 @@ export interface SharedUXPluginStart { export interface SharedUXPluginSetupDeps {} /** @internal */ -export interface SharedUXPluginStartDeps {} +export interface SharedUXPluginStartDeps { + dataViewEditor: DataViewEditorStart; +} diff --git a/src/plugins/shared_ux/tsconfig.json b/src/plugins/shared_ux/tsconfig.json index 6717616c8f2f3..069fe1d069b4a 100644 --- a/src/plugins/shared_ux/tsconfig.json +++ b/src/plugins/shared_ux/tsconfig.json @@ -17,5 +17,11 @@ { "path": "../../core/tsconfig.json" }, + { + "path": "../data_view_editor/tsconfig.json" + }, + { + "path": "../data_views/tsconfig.json" + } ] } diff --git a/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx index adaf87bfccd78..597d1a10dd051 100644 --- a/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx +++ b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx @@ -83,11 +83,17 @@ function TimelionExpressionInput({ value, setValue }: TimelionExpressionInputPro ); useEffect(() => { + const abortController = new AbortController(); if (kibana.services.http) { - kibana.services.http.get('../api/timelion/functions').then((data) => { - functionList.current = data; - }); + kibana.services.http + .get('../api/timelion/functions', { signal: abortController.signal }) + .then((data) => { + functionList.current = data; + }); } + return () => { + abortController.abort(); + }; }, [kibana.services.http]); return ( diff --git a/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts index b613379d4d7c4..a8807cfe87b8a 100644 --- a/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts +++ b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts @@ -54,7 +54,10 @@ export function getTimelionRequestHandler({ uiSettings, http, timefilter, -}: TimelionVisDependencies) { + expressionAbortSignal, +}: TimelionVisDependencies & { + expressionAbortSignal: AbortSignal; +}) { const timezone = getTimezone(uiSettings); return async function ({ @@ -74,6 +77,12 @@ export function getTimelionRequestHandler({ }): Promise { const dataSearch = getDataSearch(); const expression = visParams.expression; + const abortController = new AbortController(); + const expressionAbortHandler = function () { + abortController.abort(); + }; + + expressionAbortSignal.addEventListener('abort', expressionAbortHandler); if (!expression) { throw new Error( @@ -98,9 +107,7 @@ export function getTimelionRequestHandler({ const untrackSearch = dataSearch.session.isCurrentSession(searchSessionId) && dataSearch.session.trackSearch({ - abort: () => { - // TODO: support search cancellations - }, + abort: () => abortController.abort(), }); try { @@ -124,6 +131,7 @@ export function getTimelionRequestHandler({ }), }), context: executionContext, + signal: abortController.signal, }); } catch (e) { if (e && e.body) { @@ -142,6 +150,7 @@ export function getTimelionRequestHandler({ // call `untrack` if this search still belongs to current session untrackSearch(); } + expressionAbortSignal.removeEventListener('abort', expressionAbortHandler); } }; } diff --git a/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts b/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts index adf6c58f1cfc8..4bb195312f3b7 100644 --- a/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts +++ b/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts @@ -18,7 +18,7 @@ import { KibanaContext, Query, TimeRange } from '../../../data/public'; type Input = KibanaContext | null; type Output = Promise>; export interface TimelionRenderValue { - visData: TimelionSuccessResponse; + visData?: TimelionSuccessResponse; visType: 'timelion'; visParams: TimelionVisParams; } @@ -65,10 +65,12 @@ export const getTimelionVisualizationConfig = ( required: false, }, }, - async fn(input, args, { getSearchSessionId, getExecutionContext, variables }) { + async fn( + input, + args, + { getSearchSessionId, getExecutionContext, variables, abortSignal: expressionAbortSignal } + ) { const { getTimelionRequestHandler } = await import('./async_services'); - const timelionRequestHandler = getTimelionRequestHandler(dependencies); - const visParams = { expression: args.expression, interval: args.interval, @@ -77,17 +79,25 @@ export const getTimelionVisualizationConfig = ( (variables?.embeddableTitle as string) ?? getExecutionContext?.()?.description, }; + let visData: TimelionRenderValue['visData']; + + if (!expressionAbortSignal.aborted) { + const timelionRequestHandler = getTimelionRequestHandler({ + ...dependencies, + expressionAbortSignal, + }); - const response = await timelionRequestHandler({ - timeRange: get(input, 'timeRange') as TimeRange, - query: get(input, 'query') as Query, - filters: get(input, 'filters') as Filter[], - visParams, - searchSessionId: getSearchSessionId(), - executionContext: getExecutionContext(), - }); + visData = await timelionRequestHandler({ + timeRange: get(input, 'timeRange') as TimeRange, + query: get(input, 'query') as Query, + filters: get(input, 'filters') as Filter[], + visParams, + searchSessionId: getSearchSessionId(), + executionContext: getExecutionContext(), + }); - response.visType = TIMELION_VIS_NAME; + visData.visType = TIMELION_VIS_NAME; + } return { type: 'render', @@ -95,7 +105,7 @@ export const getTimelionVisualizationConfig = ( value: { visParams, visType: TIMELION_VIS_NAME, - visData: response, + visData, }, }; }, diff --git a/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx index 3552f6097d466..e865c3c8d7fb2 100644 --- a/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx +++ b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx @@ -33,7 +33,7 @@ export const getTimelionVisRenderer: ( unmountComponentAtNode(domNode); }); - const [seriesList] = visData.sheet; + const seriesList = visData?.sheet[0]; const showNoResult = !seriesList || !seriesList.list.length; const VisComponent = deps.uiSettings.get(UI_SETTINGS.LEGACY_CHARTS_LIBRARY, false) @@ -62,13 +62,15 @@ export const getTimelionVisRenderer: ( - + {seriesList && ( + + )} , diff --git a/src/plugins/vis_types/timelion/server/series_functions/es/es.test.js b/src/plugins/vis_types/timelion/server/series_functions/es/es.test.js index 9c0dac6f6975a..6f718a6ec8e16 100644 --- a/src/plugins/vis_types/timelion/server/series_functions/es/es.test.js +++ b/src/plugins/vis_types/timelion/server/series_functions/es/es.test.js @@ -28,6 +28,12 @@ describe('es', () => { getIndexPatternsService: () => ({ find: async () => [], }), + request: { + events: { + aborted$: of(), + }, + body: {}, + }, }; } @@ -46,9 +52,11 @@ describe('es', () => { }); test('should call data search with sessionId, isRestore and isStored', async () => { + const baseTlConfig = stubRequestAndServer({ rawResponse: esResponse }); tlConfig = { - ...stubRequestAndServer({ rawResponse: esResponse }), + ...baseTlConfig, request: { + ...baseTlConfig.request, body: { searchSession: { sessionId: '1', diff --git a/src/plugins/vis_types/timelion/server/series_functions/es/index.js b/src/plugins/vis_types/timelion/server/series_functions/es/index.js index d613818d7c3e3..a86ee64f00568 100644 --- a/src/plugins/vis_types/timelion/server/series_functions/es/index.js +++ b/src/plugins/vis_types/timelion/server/series_functions/es/index.js @@ -12,6 +12,12 @@ import Datasource from '../../lib/classes/datasource'; import buildRequest from './lib/build_request'; import toSeriesList from './lib/agg_response_to_series_list'; +function getRequestAbortedSignal(aborted$) { + const controller = new AbortController(); + aborted$.subscribe(() => controller.abort()); + return controller.signal; +} + export default new Datasource('es', { hideFitArg: true, args: [ @@ -107,13 +113,17 @@ export default new Datasource('es', { const body = buildRequest(config, tlConfig, scriptFields, runtimeFields, esShardTimeout); + // User may abort the request without waiting for the results + // we need to handle this scenario by aborting underlying server requests + const abortSignal = getRequestAbortedSignal(tlConfig.request.events.aborted$); + const resp = await tlConfig.context.search .search( body, { ...tlConfig.request?.body.searchSession, }, - tlConfig.context + { ...tlConfig.context, abortSignal } ) .toPromise(); diff --git a/src/plugins/vis_types/timeseries/server/ui_settings.ts b/src/plugins/vis_types/timeseries/server/ui_settings.ts index c64d5771479b6..3d30482dec916 100644 --- a/src/plugins/vis_types/timeseries/server/ui_settings.ts +++ b/src/plugins/vis_types/timeseries/server/ui_settings.ts @@ -32,7 +32,7 @@ export const getUiSettings: () => Record = () => ({ requiresPageReload: true, description: i18n.translate('visTypeTimeseries.advancedSettings.allowStringIndicesText', { defaultMessage: - 'Enables you to use index patterns and Elasticsearch indices in TSVB visualizations.', + 'Enables you to query Elasticsearch indices in TSVB visualizations.', }), schema: schema.boolean(), }, diff --git a/src/plugins/visualizations/common/expression_functions/vis_dimension.ts b/src/plugins/visualizations/common/expression_functions/vis_dimension.ts index 254f3ac5b68e8..bd5694cb69a03 100644 --- a/src/plugins/visualizations/common/expression_functions/vis_dimension.ts +++ b/src/plugins/visualizations/common/expression_functions/vis_dimension.ts @@ -27,7 +27,7 @@ export type ExpressionValueVisDimension = ExpressionValueBoxed< accessor: number | DatatableColumn; format: { id?: string; - params: Record; + params?: Record; }; } >; @@ -54,14 +54,12 @@ export const visDimension = (): ExpressionFunctionDefinition< }, format: { types: ['string'], - default: 'string', help: i18n.translate('visualizations.function.visDimension.format.help', { defaultMessage: 'Format', }), }, formatParams: { types: ['string'], - default: '"{}"', help: i18n.translate('visualizations.function.visDimension.formatParams.help', { defaultMessage: 'Format params', }), @@ -69,13 +67,22 @@ export const visDimension = (): ExpressionFunctionDefinition< }, fn: (input, args) => { const accessor = findAccessorOrFail(args.accessor, input.columns); + const column = typeof accessor === 'number' ? input.columns[accessor] : accessor; + const columnFormat = column.meta.params; + // if a user hasn't specified the format of the column and its format is not specified at the table columns, + // then the default format id ('string') should be used + const format = + args.format || args.formatParams || !columnFormat + ? { + id: args.format || 'string', + params: JSON.parse(args.formatParams || '{}'), + } + : columnFormat; + return { type: 'vis_dimension', accessor, - format: { - id: args.format, - params: JSON.parse(args.formatParams!), - }, + format, }; }, }); diff --git a/src/plugins/visualizations/kibana.json b/src/plugins/visualizations/kibana.json index c7fd9c977bc2e..79b04f132077b 100644 --- a/src/plugins/visualizations/kibana.json +++ b/src/plugins/visualizations/kibana.json @@ -12,9 +12,10 @@ "embeddable", "inspector", "savedObjects", + "screenshotMode", "presentationUtil" ], - "optionalPlugins": [ "home", "share", "usageCollection", "spaces", "savedObjectsTaggingOss"], + "optionalPlugins": ["home", "share", "usageCollection", "spaces", "savedObjectsTaggingOss"], "requiredBundles": ["kibanaUtils", "discover", "kibanaReact", "home"], "extraPublicDirs": ["common/constants", "common/utils", "common/expression_functions"], "owner": { diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.test.ts b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.test.ts new file mode 100644 index 0000000000000..814a5996af638 --- /dev/null +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.test.ts @@ -0,0 +1,241 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { EmbeddableStateWithType } from 'src/plugins/embeddable/common'; +import { VisualizeEmbeddableFactory, VisualizeInput } from '.'; +import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; + +describe('visualize_embeddable_factory', () => { + const factory = new VisualizeEmbeddableFactory({} as VisualizeEmbeddableFactoryDeps); + test('extract saved search references for search source state and not store them in state', () => { + const { state, references } = factory.extract({ + savedVis: { + type: 'area', + params: {}, + uiState: {}, + data: { + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + ], + searchSource: { + query: { + query: '', + language: 'kuery', + }, + filter: [], + }, + savedSearchId: '123', + }, + }, + enhancements: {}, + type: 'visualization', + } as unknown as EmbeddableStateWithType); + expect(references).toEqual([ + { + type: 'search', + name: 'search_0', + id: '123', + }, + ]); + expect((state as unknown as VisualizeInput).savedVis?.data.savedSearchId).toBeUndefined(); + }); + + test('extract data view references for search source state and not store them in state', () => { + const { state, references } = factory.extract({ + savedVis: { + type: 'area', + params: {}, + uiState: {}, + data: { + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + ], + searchSource: { + query: { + query: '', + language: 'kuery', + }, + index: '123', + filter: [], + }, + }, + }, + enhancements: {}, + type: 'visualization', + } as unknown as EmbeddableStateWithType); + expect(references).toEqual([ + { + type: 'index-pattern', + name: ( + (state as unknown as VisualizeInput).savedVis?.data.searchSource as { + indexRefName: string; + } + ).indexRefName, + id: '123', + }, + ]); + expect((state as unknown as VisualizeInput).savedVis?.data.searchSource.index).toBeUndefined(); + }); + + test('inject data view references into search source state', () => { + const embeddedState = factory.inject( + { + savedVis: { + type: 'area', + params: {}, + uiState: {}, + data: { + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + ], + searchSource: { + query: { + query: '', + language: 'kuery', + }, + indexRefName: 'x', + filter: [], + }, + }, + }, + enhancements: {}, + type: 'visualization', + } as unknown as EmbeddableStateWithType, + [{ name: 'x', id: '123', type: 'index-pattern' }] + ) as VisualizeInput; + expect(embeddedState.savedVis!.data.searchSource.index).toBe('123'); + expect( + (embeddedState.savedVis!.data.searchSource as { indexRefName: string }).indexRefName + ).toBe(undefined); + }); + + test('inject data view reference into search source state even if it is in injected state already', () => { + const embeddedState = factory.inject( + { + savedVis: { + type: 'area', + params: {}, + uiState: {}, + data: { + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + ], + searchSource: { + query: { + query: '', + language: 'kuery', + }, + index: '456', + filter: [], + }, + }, + }, + enhancements: {}, + type: 'visualization', + } as unknown as EmbeddableStateWithType, + [{ name: 'kibanaSavedObjectMeta.searchSourceJSON.index', id: '123', type: 'index-pattern' }] + ) as VisualizeInput; + expect(embeddedState.savedVis!.data.searchSource.index).toBe('123'); + expect( + (embeddedState.savedVis!.data.searchSource as { indexRefName: string }).indexRefName + ).toBe(undefined); + }); + + test('inject search reference into search source state', () => { + const embeddedState = factory.inject( + { + savedVis: { + type: 'area', + params: {}, + uiState: {}, + data: { + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + ], + searchSource: { + query: { + query: '', + language: 'kuery', + }, + filter: [], + }, + }, + }, + enhancements: {}, + type: 'visualization', + } as unknown as EmbeddableStateWithType, + [{ name: 'search_0', id: '123', type: 'search' }] + ); + expect((embeddedState as VisualizeInput).savedVis!.data.savedSearchId).toBe('123'); + }); + + test('inject search reference into search source state even if it is injected already', () => { + const embeddedState = factory.inject( + { + savedVis: { + type: 'area', + params: {}, + uiState: {}, + data: { + aggs: [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + ], + searchSource: { + query: { + query: '', + language: 'kuery', + }, + filter: [], + }, + savedSearchId: '789', + }, + }, + enhancements: {}, + type: 'visualization', + } as unknown as EmbeddableStateWithType, + [{ name: 'search_0', id: '123', type: 'search' }] + ); + expect((embeddedState as VisualizeInput).savedVis!.data.savedSearchId).toBe('123'); + }); +}); diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx index 2868950867ad5..2760b64472a5e 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx @@ -11,7 +11,11 @@ import { first } from 'rxjs/operators'; import type { SavedObjectMetaData, OnSaveProps } from 'src/plugins/saved_objects/public'; import type { EmbeddableStateWithType } from 'src/plugins/embeddable/common'; -import { extractSearchSourceReferences } from '../../../data/public'; +import { + injectSearchSourceReferences, + extractSearchSourceReferences, + SerializedSearchSourceFields, +} from '../../../data/public'; import type { SavedObjectAttributes, SavedObjectReference } from '../../../../core/public'; import { @@ -288,7 +292,7 @@ export class VisualizeEmbeddableFactory } public inject(_state: EmbeddableStateWithType, references: SavedObjectReference[]) { - const state = _state as unknown as VisualizeInput; + let state = _state as unknown as VisualizeInput; const { type, params } = state.savedVis ?? {}; @@ -297,21 +301,40 @@ export class VisualizeEmbeddableFactory injectTimeSeriesReferences(type, params, references); } - return _state; + if (state.savedVis?.data.searchSource) { + let extractedSearchSource = state.savedVis?.data + .searchSource as SerializedSearchSourceFields & { + indexRefName: string; + }; + if (!('indexRefName' in state.savedVis.data.searchSource)) { + // due to a bug in 8.0, some visualizations were saved with an injected state - re-extract in that case and inject the upstream references because they might have changed + extractedSearchSource = extractSearchSourceReferences( + extractedSearchSource + )[0] as SerializedSearchSourceFields & { + indexRefName: string; + }; + } + const injectedSearchSource = injectSearchSourceReferences(extractedSearchSource, references); + state = { + ...state, + savedVis: { + ...state.savedVis, + data: { + ...state.savedVis.data, + searchSource: injectedSearchSource, + savedSearchId: references.find((r) => r.name === 'search_0')?.id, + }, + }, + }; + } + + return state as EmbeddableStateWithType; } public extract(_state: EmbeddableStateWithType) { - const state = _state as unknown as VisualizeInput; + let state = _state as unknown as VisualizeInput; const references = []; - if (state.savedVis?.data.searchSource) { - const [, searchSourceReferences] = extractSearchSourceReferences( - state.savedVis.data.searchSource - ); - - references.push(...searchSourceReferences); - } - if (state.savedVis?.data.savedSearchId) { references.push({ name: 'search_0', @@ -320,6 +343,25 @@ export class VisualizeEmbeddableFactory }); } + if (state.savedVis?.data.searchSource) { + const [extractedSearchSource, searchSourceReferences] = extractSearchSourceReferences( + state.savedVis.data.searchSource + ); + + references.push(...searchSourceReferences); + state = { + ...state, + savedVis: { + ...state.savedVis, + data: { + ...state.savedVis.data, + searchSource: extractedSearchSource, + savedSearchId: undefined, + }, + }, + }; + } + const { type, params } = state.savedVis ?? {}; if (type && params) { @@ -327,6 +369,6 @@ export class VisualizeEmbeddableFactory extractTimeSeriesReferences(type, params, references, `metrics_${state.id}`); } - return { state: _state, references }; + return { state: state as EmbeddableStateWithType, references }; } } diff --git a/src/plugins/visualizations/public/mocks.ts b/src/plugins/visualizations/public/mocks.ts index 0fc142aeead63..69a7c61e68893 100644 --- a/src/plugins/visualizations/public/mocks.ts +++ b/src/plugins/visualizations/public/mocks.ts @@ -23,6 +23,7 @@ import { urlForwardingPluginMock } from '../../../plugins/url_forwarding/public/ import { navigationPluginMock } from '../../../plugins/navigation/public/mocks'; import { presentationUtilPluginMock } from '../../../plugins/presentation_util/public/mocks'; import { savedObjectTaggingOssPluginMock } from '../../saved_objects_tagging_oss/public/mocks'; +import { screenshotModePluginMock } from '../../screenshot_mode/public/mocks'; const createSetupContract = (): VisualizationsSetup => ({ createBaseVisualization: jest.fn(), @@ -68,6 +69,7 @@ const createInstance = async () => { navigation: navigationPluginMock.createStartContract(), presentationUtil: presentationUtilPluginMock.createStartContract(coreMock.createStart()), urlForwarding: urlForwardingPluginMock.createStartContract(), + screenshotMode: screenshotModePluginMock.createStartContract(), }); return { diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index c8c4d57543a02..92bcf1dfe6a96 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -86,6 +86,7 @@ import type { SharePluginSetup, SharePluginStart } from '../../share/public'; import type { UrlForwardingSetup, UrlForwardingStart } from '../../url_forwarding/public'; import type { PresentationUtilPluginStart } from '../../presentation_util/public'; import type { UsageCollectionStart } from '../../usage_collection/public'; +import type { ScreenshotModePluginStart } from '../../screenshot_mode/public'; import type { HomePublicPluginSetup } from '../../home/public'; import type { SpacesPluginStart } from '../../../../x-pack/plugins/spaces/public'; @@ -130,6 +131,7 @@ export interface VisualizationsStartDeps { share?: SharePluginStart; urlForwarding: UrlForwardingStart; usageCollection?: UsageCollectionStart; + screenshotMode: ScreenshotModePluginStart; } /** @@ -289,6 +291,11 @@ export class VisualizationsPlugin params.element.classList.add('visAppWrapper'); const { renderApp } = await import('./visualize_app'); + if (pluginsStart.screenshotMode.isScreenshotMode()) { + params.element.classList.add('visEditorScreenshotModeActive'); + // @ts-expect-error TS error, cannot find type declaration for scss + await import('./visualize_screenshot_mode.scss'); + } const unmount = renderApp(params, services); return () => { data.search.session.clear(); diff --git a/src/plugins/visualizations/public/visualize_screenshot_mode.scss b/src/plugins/visualizations/public/visualize_screenshot_mode.scss new file mode 100644 index 0000000000000..b0a8bb35835bd --- /dev/null +++ b/src/plugins/visualizations/public/visualize_screenshot_mode.scss @@ -0,0 +1,60 @@ +/* hide unusable controls */ +/* TODO: This is the legacy way of hiding chrome elements. Rather use chrome.setIsVisible */ +kbn-top-nav, +filter-bar, +.kbnTopNavMenu__wrapper, +::-webkit-scrollbar, +.euiNavDrawer { + display: none !important; +} + +/* hide unusable controls +* !important is required to override resizable panel inline display */ +.visEditorScreenshotModeActive .visEditor__content .visEditor--default > :not(.visEditor__visualization__wrapper) { + display: none !important; +} + +/** THIS IS FOR TSVB UNTIL REFACTOR **/ +.visEditorScreenshotModeActive .tvbEditorVisualization { + position: static !important; +} +.visEditorScreenshotModeActive .visualize .tvbVisTimeSeries__legendToggle { + /* all non-content rows in interface */ + display: none; +} + +.visEditorScreenshotModeActive .tvbEditor--hideForReporting { + /* all non-content rows in interface */ + display: none; +} +/** END TSVB BAD BAD HACKS **/ + +/* remove left padding from visualizations so that map lines up with .leaflet-container and +* setting the position to be fixed and to take up the entire screen, because some zoom levels/viewports +* are triggering the media breakpoints that cause the .visEditor__canvas to take up more room than the viewport */ + +.visEditorScreenshotModeActive .visEditor .visEditor__canvas { + padding-left: 0; + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +/** + * Visualization tweaks + */ + +/* hide unusable controls */ +.visEditorScreenshotModeActive .visualize .visLegend__toggle, +.visEditorScreenshotModeActive .visualize .kbnAggTable__controls, +.visEditorScreenshotModeActive .visualize .leaflet-container .leaflet-top.leaflet-left, +.visEditorScreenshotModeActive .visualize paginate-controls /* page numbers */ { + display: none; +} + +/* Ensure the min-height of the small breakpoint isn't used */ +.visEditorScreenshotModeActive .vis-editor visualization { + min-height: 0 !important; +} diff --git a/test/api_integration/apis/saved_objects_management/find.ts b/test/api_integration/apis/saved_objects_management/find.ts index d877a62eedc82..1f73fcc34d97d 100644 --- a/test/api_integration/apis/saved_objects_management/find.ts +++ b/test/api_integration/apis/saved_objects_management/find.ts @@ -249,7 +249,7 @@ export default function ({ getService }: FtrProviderContext) { path: '/app/management/kibana/dataViews/dataView/8963ca30-3224-11e8-a572-ffca06da1357', uiCapabilitiesPath: 'management.kibana.indexPatterns', }, - namespaceType: 'multiple-isolated', + namespaceType: 'multiple', }); })); }); diff --git a/test/api_integration/apis/saved_objects_management/relationships.ts b/test/api_integration/apis/saved_objects_management/relationships.ts index cc14ce0c76068..d609938a0d50f 100644 --- a/test/api_integration/apis/saved_objects_management/relationships.ts +++ b/test/api_integration/apis/saved_objects_management/relationships.ts @@ -91,7 +91,7 @@ export default function ({ getService }: FtrProviderContext) { path: '/app/management/kibana/dataViews/dataView/8963ca30-3224-11e8-a572-ffca06da1357', uiCapabilitiesPath: 'management.kibana.indexPatterns', }, - namespaceType: 'multiple-isolated', + namespaceType: 'multiple', hiddenType: false, }, }, @@ -132,7 +132,7 @@ export default function ({ getService }: FtrProviderContext) { path: '/app/management/kibana/dataViews/dataView/8963ca30-3224-11e8-a572-ffca06da1357', uiCapabilitiesPath: 'management.kibana.indexPatterns', }, - namespaceType: 'multiple-isolated', + namespaceType: 'multiple', hiddenType: false, }, relationship: 'child', diff --git a/test/functional/apps/console/_autocomplete.ts b/test/functional/apps/console/_autocomplete.ts new file mode 100644 index 0000000000000..1ba4bcaa76b36 --- /dev/null +++ b/test/functional/apps/console/_autocomplete.ts @@ -0,0 +1,64 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const log = getService('log'); + const PageObjects = getPageObjects(['common', 'console']); + + // Failing: See https://github.com/elastic/kibana/issues/126421 + describe.skip('console autocomplete feature', function describeIndexTests() { + this.tags('includeFirefox'); + before(async () => { + log.debug('navigateTo console'); + await PageObjects.common.navigateToApp('console'); + // Ensure that the text area can be interacted with + await PageObjects.console.dismissTutorial(); + }); + + it('should provide basic auto-complete functionality', async () => { + await PageObjects.console.enterRequest(); + await PageObjects.console.promptAutocomplete(); + expect(PageObjects.console.isAutocompleteVisible()).to.be.eql(true); + }); + + // FLAKY: https://github.com/elastic/kibana/issues/126414 + describe.skip('with a missing comma in query', () => { + const LINE_NUMBER = 4; + beforeEach(async () => { + await PageObjects.console.clearTextArea(); + await PageObjects.console.enterRequest(); + }); + it('should add a comma after previous non empty line', async () => { + await PageObjects.console.enterText(`{\n\t"query": {\n\t\t"match": {}`); + await PageObjects.console.pressEnter(); + await PageObjects.console.pressEnter(); + await PageObjects.console.pressEnter(); + await PageObjects.console.promptAutocomplete(); + await PageObjects.console.pressEnter(); + + const text = await PageObjects.console.getVisibleTextAt(LINE_NUMBER); + const lastChar = text.charAt(text.length - 1); + expect(lastChar).to.be.eql(','); + }); + + it('should add a comma after the triple quoted strings', async () => { + await PageObjects.console.enterText(`{\n\t"query": {\n\t\t"term": """some data"""`); + await PageObjects.console.pressEnter(); + await PageObjects.console.promptAutocomplete(); + await PageObjects.console.pressEnter(); + + const text = await PageObjects.console.getVisibleTextAt(LINE_NUMBER); + const lastChar = text.charAt(text.length - 1); + expect(lastChar).to.be.eql(','); + }); + }); + }); +} diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index 12d3663ebecbb..1913a38d7573e 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -27,8 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'console']); const toasts = getService('toasts'); - // FLAKY: https://github.com/elastic/kibana/issues/124104 - describe.skip('console app', function describeIndexTests() { + describe('console app', function describeIndexTests() { this.tags('includeFirefox'); before(async () => { log.debug('navigateTo console'); @@ -82,37 +81,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(initialSize.width).to.be.greaterThan(afterSize.width); }); - it('should provide basic auto-complete functionality', async () => { - // Ensure that the text area can be interacted with - await PageObjects.console.dismissTutorial(); - expect(await PageObjects.console.hasAutocompleter()).to.be(false); - await PageObjects.console.enterRequest(); - await PageObjects.console.promptAutocomplete(); - await retry.waitFor('autocomplete to be visible', () => - PageObjects.console.hasAutocompleter() - ); - }); - - it('should add comma after previous non empty line on autocomplete', async () => { - const LINE_NUMBER = 4; - - await PageObjects.console.dismissTutorial(); - await PageObjects.console.clearTextArea(); - await PageObjects.console.enterRequest(); - - await PageObjects.console.enterText(`{\n\t"query": {\n\t\t"match": {}`); - await PageObjects.console.pressEnter(); - await PageObjects.console.pressEnter(); - await PageObjects.console.pressEnter(); - await PageObjects.console.promptAutocomplete(); - await PageObjects.console.pressEnter(); - - const textOfPreviousNonEmptyLine = await PageObjects.console.getVisibleTextAt(LINE_NUMBER); - log.debug(textOfPreviousNonEmptyLine); - const lastChar = textOfPreviousNonEmptyLine.charAt(textOfPreviousNonEmptyLine.length - 1); - expect(lastChar).to.be.equal(','); - }); - describe('with a data URI in the load_from query', () => { it('loads the data from the URI', async () => { await PageObjects.common.navigateToApp('console', { diff --git a/test/functional/apps/console/index.js b/test/functional/apps/console/index.js index 55f9dffdedb06..7a1fb578b4e4a 100644 --- a/test/functional/apps/console/index.js +++ b/test/functional/apps/console/index.js @@ -9,8 +9,7 @@ export default function ({ getService, loadTestFile }) { const browser = getService('browser'); - // FLAKY: https://github.com/elastic/kibana/issues/123556 - describe.skip('console app', function () { + describe('console app', function () { this.tags('ciGroup1'); before(async function () { @@ -18,5 +17,6 @@ export default function ({ getService, loadTestFile }) { }); loadTestFile(require.resolve('./_console')); + loadTestFile(require.resolve('./_autocomplete')); }); } diff --git a/test/functional/apps/dashboard/dashboard_controls_integration.ts b/test/functional/apps/dashboard/dashboard_controls_integration.ts index 4843e4e9b1b5c..5ede80bf8eb8a 100644 --- a/test/functional/apps/dashboard/dashboard_controls_integration.ts +++ b/test/functional/apps/dashboard/dashboard_controls_integration.ts @@ -105,6 +105,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('Interact with options list on dashboard', async () => { + let controlId: string; before(async () => { await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie'); @@ -113,105 +114,221 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { fieldName: 'sound.keyword', title: 'Animal Sounds', }); + + controlId = (await dashboardControls.getAllControlIds())[0]; }); - it('Shows available options in options list', async () => { - const controlIds = await dashboardControls.getAllControlIds(); - await dashboardControls.optionsListOpenPopover(controlIds[0]); - await retry.try(async () => { - expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(8); + describe('Apply dashboard query and filters to controls', async () => { + it('Applies dashboard query to options list control', async () => { + await queryBar.setQuery('isDog : true '); + await queryBar.submitQuery(); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); + + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(5); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'ruff', + 'bark', + 'grrr', + 'bow ow ow', + 'grr', + ]); + }); + + await queryBar.setQuery(''); + await queryBar.submitQuery(); }); - await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - }); - it('Can search options list for available options', async () => { - const controlIds = await dashboardControls.getAllControlIds(); - await dashboardControls.optionsListOpenPopover(controlIds[0]); - await dashboardControls.optionsListPopoverSearchForOption('meo'); - await retry.try(async () => { - expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); - expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql(['meow']); - }); - await dashboardControls.optionsListPopoverClearSearch(); - await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - }); + it('Applies dashboard filters to options list control', async () => { + await filterBar.addFilter('sound.keyword', 'is one of', ['bark', 'bow ow ow', 'ruff']); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); - it('Applies dashboard query to options list control', async () => { - await queryBar.setQuery('isDog : true '); - await queryBar.submitQuery(); - await dashboard.waitForRenderComplete(); - await header.waitUntilLoadingHasFinished(); + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(3); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'ruff', + 'bark', + 'bow ow ow', + ]); + }); + }); - const controlIds = await dashboardControls.getAllControlIds(); - await dashboardControls.optionsListOpenPopover(controlIds[0]); - await retry.try(async () => { - expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(5); - expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ - 'ruff', - 'bark', - 'grrr', - 'bow ow ow', - 'grr', - ]); - }); - - await queryBar.setQuery(''); - await queryBar.submitQuery(); - }); + it('Does not apply disabled dashboard filters to options list control', async () => { + await filterBar.toggleFilterEnabled('sound.keyword'); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); - it('Applies dashboard filters to options list control', async () => { - await filterBar.addFilter('sound.keyword', 'is one of', ['bark', 'bow ow ow', 'ruff']); - await dashboard.waitForRenderComplete(); - await header.waitUntilLoadingHasFinished(); + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(8); + }); - const controlIds = await dashboardControls.getAllControlIds(); - await dashboardControls.optionsListOpenPopover(controlIds[0]); - await retry.try(async () => { - expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(3); - expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ - 'ruff', - 'bark', - 'bow ow ow', - ]); + await filterBar.toggleFilterEnabled('sound.keyword'); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); }); - await filterBar.removeAllFilters(); - }); + it('Negated filters apply to options control', async () => { + await filterBar.toggleFilterNegated('sound.keyword'); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); - it('Can select multiple available options', async () => { - const controlIds = await dashboardControls.getAllControlIds(); - await dashboardControls.optionsListOpenPopover(controlIds[0]); - await dashboardControls.optionsListPopoverSelectOption('hiss'); - await dashboardControls.optionsListPopoverSelectOption('grr'); - await dashboardControls.optionsListEnsurePopoverIsClosed(controlIds[0]); - }); + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(5); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'hiss', + 'grrr', + 'meow', + 'growl', + 'grr', + ]); + }); + }); - it('Selected options appear in control', async () => { - const controlIds = await dashboardControls.getAllControlIds(); - const selectionString = await dashboardControls.optionsListGetSelectionsString( - controlIds[0] - ); - expect(selectionString).to.be('hiss, grr'); + after(async () => { + await filterBar.removeAllFilters(); + }); }); - it('Applies options list control options to dashboard', async () => { - await retry.try(async () => { + describe('Selections made in control apply to dashboard', async () => { + it('Shows available options in options list', async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(8); + }); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + }); + + it('Can search options list for available options', async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSearchForOption('meo'); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'meow', + ]); + }); + await dashboardControls.optionsListPopoverClearSearch(); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + }); + + it('Can select multiple available options', async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSelectOption('hiss'); + await dashboardControls.optionsListPopoverSelectOption('grr'); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + }); + + it('Selected options appear in control', async () => { + const selectionString = await dashboardControls.optionsListGetSelectionsString(controlId); + expect(selectionString).to.be('hiss, grr'); + }); + + it('Applies options list control options to dashboard', async () => { + await retry.try(async () => { + expect(await pieChart.getPieSliceCount()).to.be(2); + }); + }); + + it('Applies options list control options to dashboard by default on open', async () => { + await dashboard.gotoDashboardLandingPage(); + await header.waitUntilLoadingHasFinished(); + await dashboard.clickUnsavedChangesContinueEditing('New Dashboard'); + await header.waitUntilLoadingHasFinished(); expect(await pieChart.getPieSliceCount()).to.be(2); + + const selectionString = await dashboardControls.optionsListGetSelectionsString(controlId); + expect(selectionString).to.be('hiss, grr'); + }); + + after(async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverClearSelections(); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); }); }); - it('Applies options list control options to dashboard by default on open', async () => { - await dashboard.gotoDashboardLandingPage(); - await header.waitUntilLoadingHasFinished(); - await dashboard.clickUnsavedChangesContinueEditing('New Dashboard'); - await header.waitUntilLoadingHasFinished(); - expect(await pieChart.getPieSliceCount()).to.be(2); + describe('Options List validation', async () => { + before(async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSelectOption('meow'); + await dashboardControls.optionsListPopoverSelectOption('bark'); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + }); - const controlIds = await dashboardControls.getAllControlIds(); - const selectionString = await dashboardControls.optionsListGetSelectionsString( - controlIds[0] - ); - expect(selectionString).to.be('hiss, grr'); + it('Can mark selections invalid with Query', async () => { + await queryBar.setQuery('isDog : false '); + await queryBar.submitQuery(); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); + + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(4); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'hiss', + 'meow', + 'growl', + 'grr', + 'Ignored selection', + 'bark', + ]); + }); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + // only valid selections are applied as filters. + expect(await pieChart.getPieSliceCount()).to.be(1); + }); + + it('can make invalid selections valid again if the parent filter changes', async () => { + await queryBar.setQuery(''); + await queryBar.submitQuery(); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); + + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(8); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'hiss', + 'ruff', + 'bark', + 'grrr', + 'meow', + 'growl', + 'grr', + 'bow ow ow', + ]); + }); + + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + expect(await pieChart.getPieSliceCount()).to.be(2); + }); + + it('Can mark multiple selections invalid with Filter', async () => { + await filterBar.addFilter('sound.keyword', 'is', ['hiss']); + await dashboard.waitForRenderComplete(); + await header.waitUntilLoadingHasFinished(); + + await dashboardControls.optionsListOpenPopover(controlId); + await retry.try(async () => { + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + expect(await dashboardControls.optionsListPopoverGetAvailableOptions()).to.eql([ + 'hiss', + 'Ignored selections', + 'meow', + 'bark', + ]); + }); + + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + // only valid selections are applied as filters. + expect(await pieChart.getPieSliceCount()).to.be(1); + }); }); }); }); diff --git a/test/functional/apps/management/_index_pattern_create_delete.js b/test/functional/apps/management/_index_pattern_create_delete.js index a07141a073d64..4c9f5a5210ac6 100644 --- a/test/functional/apps/management/_index_pattern_create_delete.js +++ b/test/functional/apps/management/_index_pattern_create_delete.js @@ -118,7 +118,7 @@ export default function ({ getService, getPageObjects }) { describe('index pattern deletion', function indexDelete() { before(function () { - const expectedAlertText = 'Delete data view?'; + const expectedAlertText = 'Delete data view'; return PageObjects.settings.removeIndexPattern().then(function (alertText) { expect(alertText).to.be(expectedAlertText); }); diff --git a/test/functional/config.js b/test/functional/config.js index 09eccc863a0e5..389f432641acf 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -201,6 +201,21 @@ export default async function ({ readConfigFile }) { kibana: [], }, + version_test: { + elasticsearch: { + cluster: [], + indices: [ + { + names: ['version-test'], + privileges: ['read', 'view_index_metadata', 'manage', 'create_index', 'index'], + field_security: { grant: ['*'], except: [] }, + }, + ], + run_as: [], + }, + kibana: [], + }, + kibana_sample_read: { elasticsearch: { cluster: [], diff --git a/test/functional/fixtures/kbn_archiver/date_nested_ccs.json b/test/functional/fixtures/kbn_archiver/date_nested_ccs.json new file mode 100644 index 0000000000000..933b21d920c00 --- /dev/null +++ b/test/functional/fixtures/kbn_archiver/date_nested_ccs.json @@ -0,0 +1,15 @@ +{ + "attributes": { + "fields": "[]", + "timeFieldName": "nested.timestamp", + "title": "remote:date-nested" + }, + "coreMigrationVersion": "8.2.0", + "id": "remote:date-nested", + "migrationVersion": { + "index-pattern": "8.0.0" + }, + "references": [], + "type": "index-pattern", + "version": "WzIyLDFd" +} diff --git a/test/functional/fixtures/kbn_archiver/discover_ccs.json b/test/functional/fixtures/kbn_archiver/discover_ccs.json new file mode 100644 index 0000000000000..d53aa1bc759af --- /dev/null +++ b/test/functional/fixtures/kbn_archiver/discover_ccs.json @@ -0,0 +1,51 @@ +{ + "attributes": { + "fieldAttrs": "{\"referer\":{\"customLabel\":\"Referer custom\"}}", + "fields": "[{\"name\":\"@message\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"@message.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"@message\"}}},{\"name\":\"@tags\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"@tags.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"@tags\"}}},{\"name\":\"@timestamp\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"_id\",\"type\":\"string\",\"esTypes\":[\"_id\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"esTypes\":[\"_index\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"esTypes\":[\"_source\"],\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"agent\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"agent\"}}},{\"name\":\"bytes\",\"type\":\"number\",\"esTypes\":[\"long\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"extension\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"extension.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"extension\"}}},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"esTypes\":[\"geo_point\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"headings\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"headings.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"headings\"}}},{\"name\":\"host\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"host\"}}},{\"name\":\"id\",\"type\":\"number\",\"esTypes\":[\"integer\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"index\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"index\"}}},{\"name\":\"ip\",\"type\":\"ip\",\"esTypes\":[\"ip\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"links\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"links\"}}},{\"name\":\"machine.os\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"machine.os\"}}},{\"name\":\"machine.ram\",\"type\":\"number\",\"esTypes\":[\"long\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"memory\",\"type\":\"number\",\"esTypes\":[\"double\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"meta.char\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"esTypes\":[\"integer\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"nestedField.child\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"nested\":{\"path\":\"nestedField\"}}},{\"name\":\"phpmemory\",\"type\":\"number\",\"esTypes\":[\"long\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"referer\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.article:section\"}}},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.article:tag\"}}},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:description\"}}},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:image\"}}},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:image:height\"}}},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:image:width\"}}},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:site_name\"}}},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:title\"}}},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:type\"}}},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.og:url\"}}},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:card\"}}},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:description\"}}},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:image\"}}},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:site\"}}},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.twitter:title\"}}},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"relatedContent.url\"}}},{\"name\":\"request\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"request.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"request\"}}},{\"name\":\"response\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"response.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"response\"}}},{\"name\":\"spaces\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"spaces.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"spaces\"}}},{\"name\":\"type\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"url\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"url.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"url\"}}},{\"name\":\"utc_time\",\"type\":\"date\",\"esTypes\":[\"date\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"xss\",\"type\":\"string\",\"esTypes\":[\"text\"],\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"esTypes\":[\"keyword\"],\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"multi\":{\"parent\":\"xss\"}}}]", + "timeFieldName": "@timestamp", + "title": "remote:logstash-*" + }, + "coreMigrationVersion": "8.0.0", + "id": "remote:logstash-*", + "migrationVersion": { + "index-pattern": "7.11.0" + }, + "references": [], + "type": "index-pattern", + "version": "WzQsMl0=" +} + +{ + "attributes": { + "columns": [ + "_source" + ], + "description": "A Saved Search Description", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"highlightAll\":true,\"filter\":[],\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort": [ + [ + "@timestamp", + "desc" + ] + ], + "title": "A Saved Search", + "version": 1 + }, + "coreMigrationVersion": "8.0.0", + "id": "ab12e3c0-f231-11e6-9486-733b1ac9221a", + "migrationVersion": { + "search": "7.9.3" + }, + "references": [ + { + "id": "remote:logstash-*", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "type": "search", + "version": "WzUsMl0=" +} diff --git a/test/functional/page_objects/console_page.ts b/test/functional/page_objects/console_page.ts index 4fdc47756e710..e6450480bbb02 100644 --- a/test/functional/page_objects/console_page.ts +++ b/test/functional/page_objects/console_page.ts @@ -87,14 +87,15 @@ export class ConsolePageObject extends FtrService { const textArea = await this.testSubjects.find('console-textarea'); // There should be autocomplete for this on all license levels await textArea.pressKeys([Key.CONTROL, Key.SPACE]); + await this.retry.waitFor('autocomplete to be visible', () => this.isAutocompleteVisible()); } - public async hasAutocompleter(): Promise { - try { - return Boolean(await this.find.byCssSelector('.ace_autocomplete')); - } catch (e) { - return false; - } + public async isAutocompleteVisible() { + const element = await this.find.byCssSelector('.ace_autocomplete'); + if (!element) return false; + + const attribute = await element.getAttribute('style'); + return !attribute.includes('display: none;'); } public async enterRequest(request: string = '\nGET _search') { @@ -104,8 +105,8 @@ export class ConsolePageObject extends FtrService { } public async enterText(text: string) { - const textArea = await this.getEditorTextArea(); - await textArea.pressKeys(text); + const textArea = await this.testSubjects.find('console-textarea'); + await textArea.type(text); } private async getEditorTextArea() { @@ -138,9 +139,16 @@ export class ConsolePageObject extends FtrService { } public async clearTextArea() { - const textArea = await this.getEditorTextArea(); - await this.retry.try(async () => { + await this.retry.waitForWithTimeout('text area is cleared', 20000, async () => { + const textArea = await this.testSubjects.find('console-textarea'); + await textArea.clickMouseButton(); await textArea.clearValueWithKeyboard(); + + const editor = await this.getEditor(); + const lines = await editor.findAllByClassName('ace_line_group'); + // there should be only one empty line after clearing the textarea + const text = await lines[lines.length - 1].getVisibleText(); + return lines.length === 1 && text.trim() === ''; }); } } diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index 5d189506c314d..ec4d03041df89 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -87,6 +87,12 @@ export class FilterBarService extends FtrService { await this.header.awaitGlobalLoadingIndicatorHidden(); } + public async toggleFilterNegated(key: string): Promise { + await this.testSubjects.click(`~filter & ~filter-key-${key}`); + await this.testSubjects.click(`negateFilter`); + await this.header.awaitGlobalLoadingIndicatorHidden(); + } + public async isFilterPinned(key: string): Promise { const filter = await this.testSubjects.find(`~filter & ~filter-key-${key}`); return (await filter.getAttribute('data-test-subj')).includes('filter-pinned'); diff --git a/test/functional_ccs/apps/discover/_data_view_ccs.ts b/test/functional_ccs/apps/discover/_data_view_ccs.ts new file mode 100644 index 0000000000000..91d9cb2faf681 --- /dev/null +++ b/test/functional_ccs/apps/discover/_data_view_ccs.ts @@ -0,0 +1,62 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from './ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const retry = getService('retry'); + const testSubjects = getService('testSubjects'); + const kibanaServer = getService('kibanaServer'); + const esArchiver = getService('esArchiver'); + + const security = getService('security'); + const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']); + + const createDataView = async (dataViewName: string) => { + await PageObjects.discover.clickIndexPatternActions(); + await PageObjects.discover.clickCreateNewDataView(); + await testSubjects.setValue('createIndexPatternNameInput', dataViewName, { + clearWithKeyboard: true, + typeCharByChar: true, + }); + await testSubjects.click('saveIndexPatternButton'); + }; + + describe('discover integration with data view editor', function describeIndexTests() { + before(async function () { + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.savedObjects.clean({ types: ['saved-search', 'index-pattern'] }); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await PageObjects.common.navigateToApp('discover'); + }); + + after(async () => { + await security.testUser.restoreDefaults(); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.savedObjects.clean({ types: ['saved-search', 'index-pattern'] }); + }); + + it('use ccs to create a new data view', async function () { + const dataViewToCreate = 'remote:logstash'; + await createDataView(dataViewToCreate); + await PageObjects.header.waitUntilLoadingHasFinished(); + await retry.waitForWithTimeout( + 'data view selector to include a newly created dataview', + 5000, + async () => { + const dataViewTitle = await PageObjects.discover.getCurrentlySelectedDataView(); + // data view editor will add wildcard symbol by default + // so we need to include it in our original title when comparing + return dataViewTitle === `${dataViewToCreate}*`; + } + ); + }); + }); +} diff --git a/test/functional_ccs/apps/discover/_saved_queries_ccs.ts b/test/functional_ccs/apps/discover/_saved_queries_ccs.ts new file mode 100644 index 0000000000000..325f279ff28ab --- /dev/null +++ b/test/functional_ccs/apps/discover/_saved_queries_ccs.ts @@ -0,0 +1,221 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; + +import { FtrProviderContext } from './ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const retry = getService('retry'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); + const browser = getService('browser'); + const filterBar = getService('filterBar'); + const queryBar = getService('queryBar'); + const savedQueryManagementComponent = getService('savedQueryManagementComponent'); + const testSubjects = getService('testSubjects'); + const defaultSettings = { + defaultIndex: 'logstash-*', + }; + + const setUpQueriesWithFilters = async () => { + // set up a query with filters and a time filter + log.debug('set up a query with filters to save'); + const from = 'Sep 20, 2015 @ 08:00:00.000'; + const to = 'Sep 21, 2015 @ 08:00:00.000'; + await PageObjects.common.setTime({ from, to }); + await PageObjects.common.navigateToApp('discover'); + await filterBar.addFilter('extension.raw', 'is one of', 'jpg'); + await queryBar.setQuery('response:200'); + }; + + describe('saved queries saved objects', function describeIndexTests() { + before(async function () { + log.debug('load kibana index with default index pattern'); + await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); + + await kibanaServer.importExport.load( + 'test/functional/fixtures/kbn_archiver/discover_ccs.json' + ); + await kibanaServer.importExport.load( + 'test/functional/fixtures/kbn_archiver/date_nested_ccs.json' + ); + await esArchiver.load('test/functional/fixtures/es_archiver/date_nested'); + await esArchiver.load('test/functional/fixtures/es_archiver/logstash_functional'); + + await kibanaServer.uiSettings.replace(defaultSettings); + log.debug('discover'); + await PageObjects.common.navigateToApp('discover'); + await PageObjects.timePicker.setDefaultAbsoluteRange(); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover_ccs'); + await kibanaServer.importExport.unload( + 'test/functional/fixtures/kbn_archiver/date_nested_ccs' + ); + await esArchiver.unload('test/functional/fixtures/es_archiver/date_nested'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await PageObjects.common.unsetTime(); + }); + + describe('saved query selection', () => { + before(async () => await setUpQueriesWithFilters()); + + it(`should unselect saved query when navigating to a 'new'`, async function () { + await savedQueryManagementComponent.saveNewQuery( + 'test-unselect-saved-query', + 'mock', + true, + true + ); + + await queryBar.submitQuery(); + + expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); + expect(await queryBar.getQueryString()).to.eql('response:200'); + + await PageObjects.discover.clickNewSearchButton(); + + expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(false); + expect(await queryBar.getQueryString()).to.eql(''); + + await PageObjects.discover.selectIndexPattern('remote:date-nested'); + + expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(false); + expect(await queryBar.getQueryString()).to.eql(''); + + await PageObjects.discover.selectIndexPattern('remote:logstash-*'); + + expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(false); + expect(await queryBar.getQueryString()).to.eql(''); + + // reset state + await savedQueryManagementComponent.deleteSavedQuery('test-unselect-saved-query'); + }); + }); + + describe('saved query management component functionality', function () { + before(async () => await setUpQueriesWithFilters()); + + it('should show the saved query management component when there are no saved queries', async () => { + await savedQueryManagementComponent.openSavedQueryManagementComponent(); + const descriptionText = await testSubjects.getVisibleText('saved-query-management-popover'); + expect(descriptionText).to.eql( + 'Saved Queries\nThere are no saved queries. Save query text and filters that you want to use again.\nSave current query' + ); + }); + + it('should allow a query to be saved via the saved objects management component', async () => { + await savedQueryManagementComponent.saveNewQuery( + 'OkResponse', + '200 responses for .jpg over 24 hours', + true, + true + ); + await savedQueryManagementComponent.savedQueryExistOrFail('OkResponse'); + await savedQueryManagementComponent.savedQueryTextExist('response:200'); + }); + + it('reinstates filters and the time filter when a saved query has filters and a time filter included', async () => { + await PageObjects.timePicker.setDefaultAbsoluteRange(); + await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes(); + expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); + expect(timePickerValues.start).to.not.eql(PageObjects.timePicker.defaultStartTime); + expect(timePickerValues.end).to.not.eql(PageObjects.timePicker.defaultEndTime); + }); + + it('preserves the currently loaded query when the page is reloaded', async () => { + await browser.refresh(); + const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes(); + expect(await filterBar.hasFilter('extension.raw', 'jpg')).to.be(true); + expect(timePickerValues.start).to.not.eql(PageObjects.timePicker.defaultStartTime); + expect(timePickerValues.end).to.not.eql(PageObjects.timePicker.defaultEndTime); + await retry.waitFor( + 'the right hit count', + async () => (await PageObjects.discover.getHitCount()) === '2,792' + ); + expect(await savedQueryManagementComponent.getCurrentlyLoadedQueryID()).to.be('OkResponse'); + }); + + it('allows saving changes to a currently loaded query via the saved query management component', async () => { + await queryBar.setQuery('response:404'); + await savedQueryManagementComponent.updateCurrentlyLoadedQuery('OkResponse', false, false); + await savedQueryManagementComponent.savedQueryExistOrFail('OkResponse'); + await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); + expect(await queryBar.getQueryString()).to.eql(''); + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + expect(await queryBar.getQueryString()).to.eql('response:404'); + }); + + it('allows saving the currently loaded query as a new query', async () => { + await savedQueryManagementComponent.saveCurrentlyLoadedAsNewQuery( + 'OkResponseCopy', + '200 responses', + false, + false + ); + await savedQueryManagementComponent.savedQueryExistOrFail('OkResponseCopy'); + }); + + it('allows deleting the currently loaded saved query in the saved query management component and clears the query', async () => { + await savedQueryManagementComponent.deleteSavedQuery('OkResponseCopy'); + await savedQueryManagementComponent.savedQueryMissingOrFail('OkResponseCopy'); + expect(await queryBar.getQueryString()).to.eql(''); + }); + + it('does not allow saving a query with a non-unique name', async () => { + // this check allows this test to run stand alone, also should fix occacional flakiness + const savedQueryExists = await savedQueryManagementComponent.savedQueryExist('OkResponse'); + if (!savedQueryExists) { + await savedQueryManagementComponent.saveNewQuery( + 'OkResponse', + '200 responses for .jpg over 24 hours', + true, + true + ); + await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); + } + await savedQueryManagementComponent.saveNewQueryWithNameError('OkResponse'); + }); + + it('resets any changes to a loaded query on reloading the same saved query', async () => { + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + await queryBar.setQuery('response:503'); + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + expect(await queryBar.getQueryString()).to.eql('response:404'); + }); + + it('allows clearing the currently loaded saved query', async () => { + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); + expect(await queryBar.getQueryString()).to.eql(''); + }); + + it('allows clearing if non default language was remembered in localstorage', async () => { + await queryBar.switchQueryLanguage('lucene'); + await PageObjects.common.navigateToApp('discover'); // makes sure discovered is reloaded without any state in url + await queryBar.expectQueryLanguageOrFail('lucene'); // make sure lucene is remembered after refresh (comes from localstorage) + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + await queryBar.expectQueryLanguageOrFail('kql'); + await savedQueryManagementComponent.clearCurrentlyLoadedQuery(); + await queryBar.expectQueryLanguageOrFail('lucene'); + }); + + it('changing language removes saved query', async () => { + await savedQueryManagementComponent.loadSavedQuery('OkResponse'); + await queryBar.switchQueryLanguage('lucene'); + expect(await queryBar.getQueryString()).to.eql(''); + }); + }); + }); +} diff --git a/test/functional_ccs/apps/discover/ftr_provider_context.d.ts b/test/functional_ccs/apps/discover/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..ea232d23463e6 --- /dev/null +++ b/test/functional_ccs/apps/discover/ftr_provider_context.d.ts @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { GenericFtrProviderContext } from '@kbn/test'; +import { services } from '../../../functional/services'; +import { pageObjects } from '../../../functional/page_objects'; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/test/functional_ccs/apps/discover/index.ts b/test/functional_ccs/apps/discover/index.ts new file mode 100644 index 0000000000000..629423b1b75aa --- /dev/null +++ b/test/functional_ccs/apps/discover/index.ts @@ -0,0 +1,43 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from './ftr_provider_context'; + +export default function ({ getService, loadTestFile }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const browser = getService('browser'); + const esClient = getService('es'); + + describe('discover app css', function () { + this.tags('ciGroup6'); + + before(async function () { + await esClient.cluster.putSettings({ + persistent: { + cluster: { + remote: { + remote: { + skip_unavailable: 'true', + seeds: ['localhost:9300'], + }, + }, + }, + }, + }); + return browser.setWindowSize(1300, 800); + }); + + after(function unloadMakelogs() { + // Make sure to clean up the cluster setting from the before above. + return esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + }); + + loadTestFile(require.resolve('./_data_view_ccs')); + loadTestFile(require.resolve('./_saved_queries_ccs')); + }); +} diff --git a/test/functional_ccs/config.js b/test/functional_ccs/config.js new file mode 100644 index 0000000000000..4cd8875798372 --- /dev/null +++ b/test/functional_ccs/config.js @@ -0,0 +1,25 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { services } from '../functional/services'; + +export default async function ({ readConfigFile }) { + const functionalConfig = await readConfigFile(require.resolve('../functional/config')); + + return { + ...functionalConfig.getAll(), + + testFiles: [require.resolve('./apps/discover')], + + services, + + junit: { + reportName: 'Kibana CCS Tests', + }, + }; +} diff --git a/test/interpreter_functional/snapshots/baseline/combined_test3.json b/test/interpreter_functional/snapshots/baseline/combined_test3.json index aefe875ff248c..dc39ecfc53594 100644 --- a/test/interpreter_functional/snapshots/baseline/combined_test3.json +++ b/test/interpreter_functional/snapshots/baseline/combined_test3.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/final_output_test.json b/test/interpreter_functional/snapshots/baseline/final_output_test.json index aefe875ff248c..dc39ecfc53594 100644 --- a/test/interpreter_functional/snapshots/baseline/final_output_test.json +++ b/test/interpreter_functional/snapshots/baseline/final_output_test.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/metric_all_data.json b/test/interpreter_functional/snapshots/baseline/metric_all_data.json index c146b8ca6e39d..a26b85daee932 100644 --- a/test/interpreter_functional/snapshots/baseline/metric_all_data.json +++ b/test/interpreter_functional/snapshots/baseline/metric_all_data.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":2,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":2,"format":{"id":"bytes","params":null},"type":"vis_dimension"},"metrics":[{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/metric_empty_data.json b/test/interpreter_functional/snapshots/baseline/metric_empty_data.json index 84ea37086d00c..0917ecc8f9b2e 100644 --- a/test/interpreter_functional/snapshots/baseline/metric_empty_data.json +++ b/test/interpreter_functional/snapshots/baseline/metric_empty_data.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/metric_multi_metric_data.json b/test/interpreter_functional/snapshots/baseline/metric_multi_metric_data.json index de55a313fde43..44bc7717db04f 100644 --- a/test/interpreter_functional/snapshots/baseline/metric_multi_metric_data.json +++ b/test/interpreter_functional/snapshots/baseline/metric_multi_metric_data.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/metric_percentage_mode.json b/test/interpreter_functional/snapshots/baseline/metric_percentage_mode.json index aacb5a1d38eaf..99604aa377475 100644 --- a/test/interpreter_functional/snapshots/baseline/metric_percentage_mode.json +++ b/test/interpreter_functional/snapshots/baseline/metric_percentage_mode.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":{"colors":["rgb(0,0,0,0)","rgb(100, 100, 100)"],"continuity":"none","gradient":false,"range":"number","rangeMax":10000,"rangeMin":0,"stops":[0,10000]},"percentageMode":true,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":{"colors":["rgb(0,0,0,0)","rgb(100, 100, 100)"],"continuity":"none","gradient":false,"range":"number","rangeMax":10000,"rangeMin":0,"stops":[0,10000]},"percentageMode":true,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/metric_single_metric_data.json b/test/interpreter_functional/snapshots/baseline/metric_single_metric_data.json index 91d78e9942f1a..63c91a3cc749d 100644 --- a/test/interpreter_functional/snapshots/baseline/metric_single_metric_data.json +++ b/test/interpreter_functional/snapshots/baseline/metric_single_metric_data.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/partial_test_1.json b/test/interpreter_functional/snapshots/baseline/partial_test_1.json index 9e6888a319c38..e8a847b43de3b 100644 --- a/test/interpreter_functional/snapshots/baseline/partial_test_1.json +++ b/test/interpreter_functional/snapshots/baseline/partial_test_1.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/partial_test_2.json b/test/interpreter_functional/snapshots/baseline/partial_test_2.json index aefe875ff248c..dc39ecfc53594 100644 --- a/test/interpreter_functional/snapshots/baseline/partial_test_2.json +++ b/test/interpreter_functional/snapshots/baseline/partial_test_2.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/step_output_test3.json b/test/interpreter_functional/snapshots/baseline/step_output_test3.json index aefe875ff248c..dc39ecfc53594 100644 --- a/test/interpreter_functional/snapshots/baseline/step_output_test3.json +++ b/test/interpreter_functional/snapshots/baseline/step_output_test3.json @@ -1 +1 @@ -{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +{"as":"metricVis","type":"render","value":{"visConfig":{"dimensions":{"bucket":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"metrics":[{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"}]},"metric":{"autoScale":null,"colorFullBackground":false,"labels":{"position":"bottom","show":true,"style":{"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:24px;line-height:1","spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"24px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}},"metricColorMode":"None","palette":null,"percentageMode":false,"style":{"bgColor":false,"css":"font-family:'Open Sans', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:center;font-size:60px;line-height:1","labelColor":false,"spec":{"fontFamily":"'Open Sans', Helvetica, Arial, sans-serif","fontSize":"60px","fontStyle":"normal","fontWeight":"normal","lineHeight":"1","textAlign":"center","textDecoration":"none"},"type":"style"}}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json index 775839764b410..518eb529e70f4 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_all_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json index 70c7ea6d7827b..7417545550cd8 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"ariaLabel":null,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"ariaLabel":null,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json b/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json index dc251faaee827..986e6d19e91f3 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_fontsize.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"maxFontSize":40,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":20,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json index 89df8d2f4146b..cf0aa1162c23f 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_metric_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_options.json b/test/interpreter_functional/snapshots/baseline/tagcloud_options.json index 7bd4ff7dedfa0..357ac0fc76784 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_options.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_options.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"hasPrecisionError":false,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"ariaLabel":null,"bucket":{"accessor":1,"format":{"id":"number"},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"type":"vis_dimension"},"minFontSize":18,"orientation":"multiple","palette":{"name":"custom","params":{"colors":["#882E72","#B178A6","#D6C1DE","#1965B0","#5289C7","#7BAFDE","#4EB265","#90C987","#CAE0AB","#F7EE55","#F6C141","#F1932D","#E8601C","#DC050C"],"continuity":"above","gradient":false,"range":"percent","rangeMax":null,"rangeMin":0,"stops":[]},"type":"palette"},"scale":"log","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 71ff1032819ff..c48041c1e1883 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -10,6 +10,7 @@ "xpack.canvas": "plugins/canvas", "xpack.cases": "plugins/cases", "xpack.cloud": "plugins/cloud", + "xpack.csp": "plugins/cloud_security_posture", "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.discover": "plugins/discover_enhanced", "xpack.crossClusterReplication": "plugins/cross_cluster_replication", diff --git a/x-pack/examples/alerting_example/kibana.json b/x-pack/examples/alerting_example/kibana.json index 13117713a9a7e..dabf932b5e68d 100644 --- a/x-pack/examples/alerting_example/kibana.json +++ b/x-pack/examples/alerting_example/kibana.json @@ -3,8 +3,8 @@ "version": "0.0.1", "kibanaVersion": "kibana", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "server": true, "ui": true, diff --git a/x-pack/examples/testing_embedded_lens/public/app.tsx b/x-pack/examples/testing_embedded_lens/public/app.tsx index 91c2ce5995c15..ba6e1f8ebcbe9 100644 --- a/x-pack/examples/testing_embedded_lens/public/app.tsx +++ b/x-pack/examples/testing_embedded_lens/public/app.tsx @@ -372,6 +372,7 @@ export const App = (props: { plugins: StartDependencies; defaultDataView: DataView; stateHelpers: Awaited>; + preloadedVisualization: TypedLensByValueInput['attributes']; }) => { const [isLoading, setIsLoading] = useState(false); const [isSaveModalVisible, setIsSaveModalVisible] = useState(false); @@ -380,7 +381,11 @@ export const App = (props: { const [enableTriggers, toggleTriggers] = useState(false); const [loadedCharts, addChartConfiguration] = useState< Array<{ id: string; attributes: TypedLensByValueInput['attributes'] }> - >([]); + >( + props.preloadedVisualization + ? [{ id: 'from_lens', attributes: props.preloadedVisualization }] + : [] + ); const [hasParsingError, setErrorFlag] = useState(false); const [hasParsingErrorDebounced, setErrorDebounced] = useState(hasParsingError); const LensComponent = props.plugins.lens.EmbeddableComponent; @@ -414,8 +419,11 @@ export const App = (props: { // eslint-disable-next-line react-hooks/exhaustive-deps const charts = useMemo(() => [...defaultCharts, ...loadedCharts], [loadedCharts]); - // eslint-disable-next-line react-hooks/exhaustive-deps - const initialAttributes = useMemo(() => JSON.stringify(charts[0].attributes, null, 2), []); + const initialAttributes = useMemo( + () => JSON.stringify(props.preloadedVisualization ?? charts[0].attributes, null, 2), + // eslint-disable-next-line react-hooks/exhaustive-deps + [] + ); const currentSO = useRef(initialAttributes); const [currentValid, saveValidSO] = useState(initialAttributes); diff --git a/x-pack/examples/testing_embedded_lens/public/mount.tsx b/x-pack/examples/testing_embedded_lens/public/mount.tsx index 50727871a3545..f3739ac9a481d 100644 --- a/x-pack/examples/testing_embedded_lens/public/mount.tsx +++ b/x-pack/examples/testing_embedded_lens/public/mount.tsx @@ -11,26 +11,30 @@ import { EuiCallOut } from '@elastic/eui'; import type { CoreSetup, AppMountParameters } from 'kibana/public'; import type { StartDependencies } from './plugin'; +import type { TypedLensByValueInput } from '../../../plugins/lens/public'; export const mount = (coreSetup: CoreSetup) => - async ({ element }: AppMountParameters) => { + async ({ element, history }: AppMountParameters) => { const [core, plugins] = await coreSetup.getStartServices(); const { App } = await import('./app'); + const preloadedVisualizationAttributes = history.location + ?.state as TypedLensByValueInput['attributes']; - const defaultDataView = await plugins.data.indexPatterns.getDefault(); + const dataView = await plugins.data.indexPatterns.getDefault(); const stateHelpers = await plugins.lens.stateHelperApi(); const i18nCore = core.i18n; const reactElement = ( - {defaultDataView ? ( + {dataView ? ( ) : ( { - public setup( - core: CoreSetup, - { developerExamples, lens, discover }: SetupDependencies - ) { + public setup(core: CoreSetup, { developerExamples, lens }: SetupDependencies) { core.application.register({ id: 'third_party_lens_navigation_prompt', title: 'Third party Lens navigation prompt', @@ -123,7 +118,7 @@ export class EmbeddedLensExamplePlugin appId: 'third_party_lens_navigation_prompt', title: 'Third party Lens navigation prompt', description: - 'Add custom menu entries to the Lens editor, like the "Go to discover" link in this example.', + 'Add custom menu entries to the Lens editor, like the "Debug in Playground" link in this example.', image, links: [ { @@ -136,33 +131,54 @@ export class EmbeddedLensExamplePlugin ], }); - if (!discover.locator) return; - lens.registerTopNavMenuEntryGenerator(({ datasourceStates, query, filters }) => { - if (!datasourceStates.indexpattern.state) return; + lens.registerTopNavMenuEntryGenerator( + ({ visualizationId, visualizationState, datasourceStates, query, filters }) => { + if (!datasourceStates.indexpattern.state || !visualizationState) return; - return { - label: 'Go to discover', - iconType: 'discoverApp', - run: async () => { - const [, { data }] = await core.getStartServices(); - const firstLayer = Object.values( - (datasourceStates.indexpattern.state as IndexPatternPersistedState).layers - )[0] as PersistedIndexPatternLayer & { indexPatternId: string }; - discover.locator!.navigate({ - indexPatternId: firstLayer.indexPatternId, - timeRange: data.query.timefilter.timefilter.getTime(), - filters, - query, - columns: firstLayer.columnOrder - .map((columnId) => { - const column = firstLayer.columns[columnId]; - if ('sourceField' in column) return column.sourceField; - }) - .filter(Boolean) as string[], - }); - }, - }; - }); + return { + label: 'Debug in Playground', + iconType: 'wrench', + run: async () => { + const [coreStart] = await core.getStartServices(); + const datasourceState = datasourceStates.indexpattern + .state as IndexPatternPersistedState; + const layersIds = Object.keys(datasourceState.layers); + const layers = Object.values(datasourceState.layers) as Array< + PersistedIndexPatternLayer & { indexPatternId: string } + >; + const serializedFilters = JSON.parse(JSON.stringify(filters)); + coreStart.application.navigateToApp('testing_embedded_lens', { + state: { + visualizationType: visualizationId, + title: 'Lens visualization', + references: [ + { + id: layers[0].indexPatternId, + name: 'indexpattern-datasource-current-indexpattern', + type: 'index-pattern', + }, + ...layers.map(({ indexPatternId }, i) => ({ + id: indexPatternId, + name: `indexpattern-datasource-layer-${layersIds[i]}`, + type: 'index-pattern', + })), + ], + state: { + datasourceStates: { + indexpattern: { + layers: datasourceState.layers, + }, + }, + visualization: visualizationState, + filters: serializedFilters, + query, + }, + }, + }); + }, + }; + } + ); } public start() {} diff --git a/x-pack/plugins/actions/kibana.json b/x-pack/plugins/actions/kibana.json index aa3a9f3f6c34c..4e928fafc4d50 100644 --- a/x-pack/plugins/actions/kibana.json +++ b/x-pack/plugins/actions/kibana.json @@ -1,8 +1,8 @@ { "id": "actions", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "server": true, "version": "8.0.0", diff --git a/x-pack/plugins/actions/server/preconfigured_connectors/alert_history_es_index/create_alert_history_index_template.ts b/x-pack/plugins/actions/server/preconfigured_connectors/alert_history_es_index/create_alert_history_index_template.ts index bf3c4ff18e570..0a1c5037e7f8a 100644 --- a/x-pack/plugins/actions/server/preconfigured_connectors/alert_history_es_index/create_alert_history_index_template.ts +++ b/x-pack/plugins/actions/server/preconfigured_connectors/alert_history_es_index/create_alert_history_index_template.ts @@ -53,7 +53,6 @@ async function createIndexTemplate({ await client.indices.putIndexTemplate({ name: templateName, body: template, - // @ts-expect-error doesn't exist in @elastic/elasticsearch create: true, }); } catch (err) { diff --git a/x-pack/plugins/alerting/README.md b/x-pack/plugins/alerting/README.md index 8fdfe77776b4e..a18c62047a0de 100644 --- a/x-pack/plugins/alerting/README.md +++ b/x-pack/plugins/alerting/README.md @@ -100,7 +100,6 @@ The following table describes the properties of the `options` object. |useSavedObjectReferences.injectReferences|(Optional) When developing a rule type, you can choose to implement hooks for injecting saved object references into rule parameters. This hook will be invoked when a rule is retrieved (get or find). Implementing this hook is optional, but if an inject hook is implemented, an extract hook must also be implemented.|Function |isExportable|Whether the rule type is exportable from the Saved Objects Management UI.|boolean| |defaultScheduleInterval|The default interval that will show up in the UI when creating a rule of this rule type.|boolean| -|minimumScheduleInterval|The minimum interval that will be allowed for all rules of this rule type.|boolean| |doesSetRecoveryContext|Whether the rule type will set context variables for recovered alerts. Defaults to `false`. If this is set to true, context variables are made available for the recovery action group and executors will be provided with the ability to set recovery context.|boolean| ### Executor diff --git a/x-pack/plugins/alerting/common/parse_duration.test.ts b/x-pack/plugins/alerting/common/parse_duration.test.ts index e68a3f479f228..c661eab2691fe 100644 --- a/x-pack/plugins/alerting/common/parse_duration.test.ts +++ b/x-pack/plugins/alerting/common/parse_duration.test.ts @@ -44,24 +44,84 @@ test('throws error when suffix is missing', () => { ); }); +test('formats single second', () => { + const result = formatDuration('1s'); + expect(result).toEqual('1 sec'); +}); + +test('formats single second with full unit', () => { + const result = formatDuration('1s', true); + expect(result).toEqual('1 second'); +}); + test('formats seconds', () => { const result = formatDuration('10s'); expect(result).toEqual('10 sec'); }); +test('formats seconds with full unit', () => { + const result = formatDuration('10s', true); + expect(result).toEqual('10 seconds'); +}); + +test('formats single minute', () => { + const result = formatDuration('1m'); + expect(result).toEqual('1 min'); +}); + +test('formats single minute with full unit', () => { + const result = formatDuration('1m', true); + expect(result).toEqual('1 minute'); +}); + test('formats minutes', () => { const result = formatDuration('10m'); expect(result).toEqual('10 min'); }); +test('formats minutes with full unit', () => { + const result = formatDuration('10m', true); + expect(result).toEqual('10 minutes'); +}); + +test('formats single hour', () => { + const result = formatDuration('1h'); + expect(result).toEqual('1 hr'); +}); + +test('formats single hour with full unit', () => { + const result = formatDuration('1h', true); + expect(result).toEqual('1 hour'); +}); + test('formats hours', () => { const result = formatDuration('10h'); expect(result).toEqual('10 hr'); }); +test('formats hours with full unit', () => { + const result = formatDuration('10h', true); + expect(result).toEqual('10 hours'); +}); + +test('formats single day', () => { + const result = formatDuration('1d'); + expect(result).toEqual('1 day'); +}); + +test('formats single day with full unit', () => { + const result = formatDuration('1d', true); + expect(result).toEqual('1 day'); +}); + test('formats days', () => { const result = formatDuration('10d'); - expect(result).toEqual('10 day'); + expect(result).toEqual('10 days'); +}); + +test('formats days with full unit', () => { + const result = formatDuration('10d', true); + expect(result).toEqual('10 days'); }); test('format throws error when the format is invalid', () => { diff --git a/x-pack/plugins/alerting/common/parse_duration.ts b/x-pack/plugins/alerting/common/parse_duration.ts index af4f1d2c14099..3040b601fd64b 100644 --- a/x-pack/plugins/alerting/common/parse_duration.ts +++ b/x-pack/plugins/alerting/common/parse_duration.ts @@ -27,16 +27,16 @@ export function parseDuration(duration: string): number { ); } -export function formatDuration(duration: string): string { +export function formatDuration(duration: string, fullUnit?: boolean): string { const parsed = parseInt(duration, 10); if (isSeconds(duration)) { - return `${parsed} sec`; + return `${parsed} ${fullUnit ? (parsed > 1 ? 'seconds' : 'second') : 'sec'}`; } else if (isMinutes(duration)) { - return `${parsed} min`; + return `${parsed} ${fullUnit ? (parsed > 1 ? 'minutes' : 'minute') : 'min'}`; } else if (isHours(duration)) { - return `${parsed} hr`; + return `${parsed} ${fullUnit ? (parsed > 1 ? 'hours' : 'hour') : 'hr'}`; } else if (isDays(duration)) { - return `${parsed} day`; + return `${parsed} ${parsed > 1 ? 'days' : 'day'}`; } throw new Error( `Invalid duration "${duration}". Durations must be of the form {number}x. Example: 5s, 5m, 5h or 5d"` diff --git a/x-pack/plugins/alerting/common/rule_task_instance.ts b/x-pack/plugins/alerting/common/rule_task_instance.ts index 59ed9097f1675..32437338b9c13 100644 --- a/x-pack/plugins/alerting/common/rule_task_instance.ts +++ b/x-pack/plugins/alerting/common/rule_task_instance.ts @@ -8,6 +8,7 @@ import * as t from 'io-ts'; import { rawAlertInstance } from './alert_instance'; import { DateFromString } from './date_from_string'; +import { IntervalSchedule, RuleMonitoring } from './alert'; const actionSchema = t.partial({ group: t.string, @@ -44,3 +45,9 @@ export const ruleParamsSchema = t.intersection([ }), ]); export type RuleTaskParams = t.TypeOf; + +export interface RuleExecutionRunResult { + state: RuleExecutionState; + monitoring: RuleMonitoring | undefined; + schedule: IntervalSchedule | undefined; +} diff --git a/x-pack/plugins/alerting/common/rule_type.ts b/x-pack/plugins/alerting/common/rule_type.ts index eb24e29f552b9..e98a641ba91fd 100644 --- a/x-pack/plugins/alerting/common/rule_type.ts +++ b/x-pack/plugins/alerting/common/rule_type.ts @@ -36,7 +36,6 @@ export interface RuleType< isExportable: boolean; ruleTaskTimeout?: string; defaultScheduleInterval?: string; - minimumScheduleInterval?: string; doesSetRecoveryContext?: boolean; enabledInLicense: boolean; authorizedConsumers: Record; diff --git a/x-pack/plugins/alerting/kibana.json b/x-pack/plugins/alerting/kibana.json index 82d8de0daf14a..90db7885de812 100644 --- a/x-pack/plugins/alerting/kibana.json +++ b/x-pack/plugins/alerting/kibana.json @@ -3,8 +3,8 @@ "server": true, "ui": true, "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "8.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/plugins/alerting/server/config.test.ts b/x-pack/plugins/alerting/server/config.test.ts index a96612beac412..3e3b2569dac2f 100644 --- a/x-pack/plugins/alerting/server/config.test.ts +++ b/x-pack/plugins/alerting/server/config.test.ts @@ -22,6 +22,7 @@ describe('config validation', () => { "removalDelay": "1h", }, "maxEphemeralActionsPerAlert": 10, + "minimumScheduleInterval": "1m", } `); }); diff --git a/x-pack/plugins/alerting/server/config.ts b/x-pack/plugins/alerting/server/config.ts index 8b1b664534379..9da15273850c4 100644 --- a/x-pack/plugins/alerting/server/config.ts +++ b/x-pack/plugins/alerting/server/config.ts @@ -22,6 +22,8 @@ export const configSchema = schema.object({ }), defaultRuleTaskTimeout: schema.string({ validate: validateDurationSchema, defaultValue: '5m' }), cancelAlertsOnRuleTimeout: schema.boolean({ defaultValue: true }), + minimumScheduleInterval: schema.string({ validate: validateDurationSchema, defaultValue: '1m' }), }); -export type AlertsConfig = TypeOf; +export type AlertingConfig = TypeOf; +export type PublicAlertingConfig = Pick; diff --git a/x-pack/plugins/alerting/server/health/task.ts b/x-pack/plugins/alerting/server/health/task.ts index 8d69cbe565136..889dafdfa02a1 100644 --- a/x-pack/plugins/alerting/server/health/task.ts +++ b/x-pack/plugins/alerting/server/health/task.ts @@ -11,7 +11,7 @@ import { TaskManagerSetupContract, TaskManagerStartContract, } from '../../../task_manager/server'; -import { AlertsConfig } from '../config'; +import { AlertingConfig } from '../config'; import { AlertingPluginsStart } from '../plugin'; import { HealthStatus } from '../types'; import { getAlertingHealthStatus } from './get_health'; @@ -30,11 +30,11 @@ export function initializeAlertingHealth( export async function scheduleAlertingHealthCheck( logger: Logger, - config: Promise, + config: AlertingConfig, taskManager: TaskManagerStartContract ) { try { - const interval = (await config).healthCheck.interval; + const interval = config.healthCheck.interval; await taskManager.ensureScheduled({ id: HEALTH_TASK_ID, taskType: HEALTH_TASK_TYPE, diff --git a/x-pack/plugins/alerting/server/index.ts b/x-pack/plugins/alerting/server/index.ts index 63e8df5488895..46f0b7e284164 100644 --- a/x-pack/plugins/alerting/server/index.ts +++ b/x-pack/plugins/alerting/server/index.ts @@ -35,6 +35,7 @@ export type { FindResult } from './rules_client'; export type { PublicAlert as Alert } from './alert'; export { parseDuration } from './lib'; export { getEsErrorMessage } from './lib/errors'; +export type { PublicAlertingConfig } from './config'; export type { IAbortableEsClient, IAbortableClusterClient, diff --git a/x-pack/plugins/alerting/server/invalidate_pending_api_keys/task.ts b/x-pack/plugins/alerting/server/invalidate_pending_api_keys/task.ts index f17ed8bc90aa0..8b3c6716b1cd3 100644 --- a/x-pack/plugins/alerting/server/invalidate_pending_api_keys/task.ts +++ b/x-pack/plugins/alerting/server/invalidate_pending_api_keys/task.ts @@ -20,7 +20,7 @@ import { TaskManagerStartContract, } from '../../../task_manager/server'; import { InvalidateAPIKeyResult } from '../rules_client'; -import { AlertsConfig } from '../config'; +import { AlertingConfig } from '../config'; import { timePeriodBeforeDate } from '../lib/get_cadence'; import { AlertingPluginsStart } from '../plugin'; import { InvalidatePendingApiKey } from '../types'; @@ -52,17 +52,17 @@ export function initializeApiKeyInvalidator( logger: Logger, coreStartServices: Promise<[CoreStart, AlertingPluginsStart, unknown]>, taskManager: TaskManagerSetupContract, - config: Promise + config: AlertingConfig ) { registerApiKeyInvalidatorTaskDefinition(logger, coreStartServices, taskManager, config); } export async function scheduleApiKeyInvalidatorTask( logger: Logger, - config: Promise, + config: AlertingConfig, taskManager: TaskManagerStartContract ) { - const interval = (await config).invalidateApiKeysTask.interval; + const interval = config.invalidateApiKeysTask.interval; try { await taskManager.ensureScheduled({ id: TASK_ID, @@ -82,7 +82,7 @@ function registerApiKeyInvalidatorTaskDefinition( logger: Logger, coreStartServices: Promise<[CoreStart, AlertingPluginsStart, unknown]>, taskManager: TaskManagerSetupContract, - config: Promise + config: AlertingConfig ) { taskManager.registerTaskDefinitions({ [TASK_TYPE]: { @@ -113,14 +113,13 @@ function getFakeKibanaRequest(basePath: string) { function taskRunner( logger: Logger, coreStartServices: Promise<[CoreStart, AlertingPluginsStart, unknown]>, - config: Promise + config: AlertingConfig ) { return ({ taskInstance }: RunContext) => { const { state } = taskInstance; return { async run() { let totalInvalidated = 0; - const configResult = await config; try { const [{ savedObjects, http }, { encryptedSavedObjects, security }] = await coreStartServices; @@ -134,7 +133,7 @@ function taskRunner( const encryptedSavedObjectsClient = encryptedSavedObjects.getClient({ includedHiddenTypes: ['api_key_pending_invalidation'], }); - const configuredDelay = configResult.invalidateApiKeysTask.removalDelay; + const configuredDelay = config.invalidateApiKeysTask.removalDelay; const delay = timePeriodBeforeDate(new Date(), configuredDelay).toISOString(); let hasApiKeysPendingInvalidation = true; @@ -165,7 +164,7 @@ function taskRunner( total_invalidated: totalInvalidated, }, schedule: { - interval: configResult.invalidateApiKeysTask.interval, + interval: config.invalidateApiKeysTask.interval, }, }; } catch (e) { @@ -176,7 +175,7 @@ function taskRunner( total_invalidated: totalInvalidated, }, schedule: { - interval: configResult.invalidateApiKeysTask.interval, + interval: config.invalidateApiKeysTask.interval, }, }; } diff --git a/x-pack/plugins/alerting/server/mocks.ts b/x-pack/plugins/alerting/server/mocks.ts index f7872ba797856..d58630e18cd4d 100644 --- a/x-pack/plugins/alerting/server/mocks.ts +++ b/x-pack/plugins/alerting/server/mocks.ts @@ -20,6 +20,7 @@ const createSetupMock = () => { const mock: jest.Mocked = { registerType: jest.fn(), getSecurityHealth: jest.fn(), + getConfig: jest.fn(), }; return mock; }; diff --git a/x-pack/plugins/alerting/server/plugin.test.ts b/x-pack/plugins/alerting/server/plugin.test.ts index 3716ecfcc1260..7bf559ecde844 100644 --- a/x-pack/plugins/alerting/server/plugin.test.ts +++ b/x-pack/plugins/alerting/server/plugin.test.ts @@ -15,7 +15,7 @@ import { eventLogServiceMock } from '../../event_log/server/event_log_service.mo import { KibanaRequest } from 'kibana/server'; import { featuresPluginMock } from '../../features/server/mocks'; import { KibanaFeature } from '../../features/server'; -import { AlertsConfig } from './config'; +import { AlertingConfig } from './config'; import { RuleType } from './types'; import { eventLogMock } from '../../event_log/server/mocks'; import { actionsMock } from '../../actions/server/mocks'; @@ -29,7 +29,7 @@ describe('Alerting Plugin', () => { beforeEach(() => jest.clearAllMocks()); it('should log warning when Encrypted Saved Objects plugin is missing encryption key', async () => { - const context = coreMock.createPluginInitializerContext({ + const context = coreMock.createPluginInitializerContext({ healthCheck: { interval: '5m', }, @@ -40,6 +40,7 @@ describe('Alerting Plugin', () => { maxEphemeralActionsPerAlert: 10, defaultRuleTaskTimeout: '5m', cancelAlertsOnRuleTimeout: true, + minimumScheduleInterval: '1m', }); plugin = new AlertingPlugin(context); @@ -64,7 +65,7 @@ describe('Alerting Plugin', () => { }); it('should create usage counter if usageCollection plugin is defined', async () => { - const context = coreMock.createPluginInitializerContext({ + const context = coreMock.createPluginInitializerContext({ healthCheck: { interval: '5m', }, @@ -75,6 +76,7 @@ describe('Alerting Plugin', () => { maxEphemeralActionsPerAlert: 10, defaultRuleTaskTimeout: '5m', cancelAlertsOnRuleTimeout: true, + minimumScheduleInterval: '1m', }); plugin = new AlertingPlugin(context); @@ -97,6 +99,35 @@ describe('Alerting Plugin', () => { expect(usageCollectionSetup.registerCollector).toHaveBeenCalled(); }); + it(`exposes configured minimumScheduleInterval()`, async () => { + const context = coreMock.createPluginInitializerContext({ + healthCheck: { + interval: '5m', + }, + invalidateApiKeysTask: { + interval: '5m', + removalDelay: '1h', + }, + maxEphemeralActionsPerAlert: 100, + defaultRuleTaskTimeout: '5m', + cancelAlertsOnRuleTimeout: true, + minimumScheduleInterval: '1m', + }); + plugin = new AlertingPlugin(context); + + const encryptedSavedObjectsSetup = encryptedSavedObjectsMock.createSetup(); + const setupContract = plugin.setup(coreMock.createSetup(), { + licensing: licensingMock.createSetup(), + encryptedSavedObjects: encryptedSavedObjectsSetup, + taskManager: taskManagerMock.createSetup(), + eventLog: eventLogServiceMock.create(), + actions: actionsMock.createSetup(), + statusService: statusServiceMock.createSetupContract(), + }); + + expect(setupContract.getConfig()).toEqual({ minimumScheduleInterval: '1m' }); + }); + describe('registerType()', () => { let setup: PluginSetupContract; const sampleRuleType: RuleType = { @@ -190,7 +221,7 @@ describe('Alerting Plugin', () => { describe('start()', () => { describe('getRulesClientWithRequest()', () => { it('throws error when encryptedSavedObjects plugin is missing encryption key', async () => { - const context = coreMock.createPluginInitializerContext({ + const context = coreMock.createPluginInitializerContext({ healthCheck: { interval: '5m', }, @@ -201,6 +232,7 @@ describe('Alerting Plugin', () => { maxEphemeralActionsPerAlert: 10, defaultRuleTaskTimeout: '5m', cancelAlertsOnRuleTimeout: true, + minimumScheduleInterval: '1m', }); const plugin = new AlertingPlugin(context); @@ -232,7 +264,7 @@ describe('Alerting Plugin', () => { }); it(`doesn't throw error when encryptedSavedObjects plugin has encryption key`, async () => { - const context = coreMock.createPluginInitializerContext({ + const context = coreMock.createPluginInitializerContext({ healthCheck: { interval: '5m', }, @@ -243,6 +275,7 @@ describe('Alerting Plugin', () => { maxEphemeralActionsPerAlert: 10, defaultRuleTaskTimeout: '5m', cancelAlertsOnRuleTimeout: true, + minimumScheduleInterval: '1m', }); const plugin = new AlertingPlugin(context); @@ -288,7 +321,7 @@ describe('Alerting Plugin', () => { }); test(`exposes getAlertingAuthorizationWithRequest()`, async () => { - const context = coreMock.createPluginInitializerContext({ + const context = coreMock.createPluginInitializerContext({ healthCheck: { interval: '5m', }, @@ -299,6 +332,7 @@ describe('Alerting Plugin', () => { maxEphemeralActionsPerAlert: 100, defaultRuleTaskTimeout: '5m', cancelAlertsOnRuleTimeout: true, + minimumScheduleInterval: '1m', }); const plugin = new AlertingPlugin(context); diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index b68ee6f436d6f..760aa6e0050a9 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -6,7 +6,6 @@ */ import type { PublicMethodsOf } from '@kbn/utility-types'; -import { first } from 'rxjs/operators'; import { BehaviorSubject } from 'rxjs'; import { UsageCollectionSetup, UsageCounter } from 'src/plugins/usage_collection/server'; import { SecurityPluginSetup, SecurityPluginStart } from '../../security/server'; @@ -58,7 +57,7 @@ import { scheduleApiKeyInvalidatorTask, } from './invalidate_pending_api_keys/task'; import { scheduleAlertingHealthCheck, initializeAlertingHealth } from './health'; -import { AlertsConfig } from './config'; +import { AlertingConfig, PublicAlertingConfig } from './config'; import { getHealth } from './health/get_health'; import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; import { AlertingAuthorization } from './authorization'; @@ -99,6 +98,7 @@ export interface PluginSetupContract { > ): void; getSecurityHealth: () => Promise; + getConfig: () => PublicAlertingConfig; } export interface PluginStartContract { @@ -136,7 +136,7 @@ export interface AlertingPluginsStart { } export class AlertingPlugin { - private readonly config: Promise; + private readonly config: AlertingConfig; private readonly logger: Logger; private ruleTypeRegistry?: RuleTypeRegistry; private readonly taskRunnerFactory: TaskRunnerFactory; @@ -153,7 +153,7 @@ export class AlertingPlugin { private usageCounter: UsageCounter | undefined; constructor(initializerContext: PluginInitializerContext) { - this.config = initializerContext.config.create().pipe(first()).toPromise(); + this.config = initializerContext.config.get(); this.logger = initializerContext.logger.get(); this.taskRunnerFactory = new TaskRunnerFactory(); this.rulesClientFactory = new RulesClientFactory(); @@ -201,6 +201,7 @@ export class AlertingPlugin { taskRunnerFactory: this.taskRunnerFactory, licenseState: this.licenseState, licensing: plugins.licensing, + minimumScheduleInterval: this.config.minimumScheduleInterval, }); this.ruleTypeRegistry = ruleTypeRegistry; @@ -286,13 +287,12 @@ export class AlertingPlugin { throw new Error(`"${ruleType.minimumLicenseRequired}" is not a valid license type`); } - alertingConfig.then((config) => { - ruleType.ruleTaskTimeout = ruleType.ruleTaskTimeout ?? config.defaultRuleTaskTimeout; - ruleType.cancelAlertsOnRuleTimeout = - ruleType.cancelAlertsOnRuleTimeout ?? config.cancelAlertsOnRuleTimeout; - ruleType.doesSetRecoveryContext = ruleType.doesSetRecoveryContext ?? false; - ruleTypeRegistry.register(ruleType); - }); + ruleType.ruleTaskTimeout = + ruleType.ruleTaskTimeout ?? alertingConfig.defaultRuleTaskTimeout; + ruleType.cancelAlertsOnRuleTimeout = + ruleType.cancelAlertsOnRuleTimeout ?? alertingConfig.cancelAlertsOnRuleTimeout; + ruleType.doesSetRecoveryContext = ruleType.doesSetRecoveryContext ?? false; + ruleTypeRegistry.register(ruleType); }, getSecurityHealth: async () => { return await getSecurityHealth( @@ -304,6 +304,11 @@ export class AlertingPlugin { } ); }, + getConfig: () => { + return { + minimumScheduleInterval: alertingConfig.minimumScheduleInterval, + }; + }, }; } @@ -360,6 +365,7 @@ export class AlertingPlugin { kibanaVersion: this.kibanaVersion, authorization: alertingAuthorizationClientFactory, eventLogger: this.eventLogger, + minimumScheduleInterval: this.config.minimumScheduleInterval, }); const getRulesClientWithRequest = (request: KibanaRequest) => { @@ -375,26 +381,24 @@ export class AlertingPlugin { return alertingAuthorizationClientFactory!.create(request); }; - this.config.then((config) => { - taskRunnerFactory.initialize({ - logger, - savedObjects: core.savedObjects, - elasticsearch: core.elasticsearch, - getRulesClientWithRequest, - spaceIdToNamespace, - actionsPlugin: plugins.actions, - encryptedSavedObjectsClient, - basePathService: core.http.basePath, - eventLogger: this.eventLogger!, - internalSavedObjectsRepository: core.savedObjects.createInternalRepository(['alert']), - executionContext: core.executionContext, - ruleTypeRegistry: this.ruleTypeRegistry!, - kibanaBaseUrl: this.kibanaBaseUrl, - supportsEphemeralTasks: plugins.taskManager.supportsEphemeralTasks(), - maxEphemeralActionsPerRule: config.maxEphemeralActionsPerAlert, - cancelAlertsOnRuleTimeout: config.cancelAlertsOnRuleTimeout, - usageCounter: this.usageCounter, - }); + taskRunnerFactory.initialize({ + logger, + savedObjects: core.savedObjects, + elasticsearch: core.elasticsearch, + getRulesClientWithRequest, + spaceIdToNamespace, + actionsPlugin: plugins.actions, + encryptedSavedObjectsClient, + basePathService: core.http.basePath, + eventLogger: this.eventLogger!, + internalSavedObjectsRepository: core.savedObjects.createInternalRepository(['alert']), + executionContext: core.executionContext, + ruleTypeRegistry: this.ruleTypeRegistry!, + kibanaBaseUrl: this.kibanaBaseUrl, + supportsEphemeralTasks: plugins.taskManager.supportsEphemeralTasks(), + maxEphemeralActionsPerRule: this.config.maxEphemeralActionsPerAlert, + cancelAlertsOnRuleTimeout: this.config.cancelAlertsOnRuleTimeout, + usageCounter: this.usageCounter, }); this.eventLogService!.registerSavedObjectProvider('alert', (request) => { diff --git a/x-pack/plugins/alerting/server/routes/legacy/health.test.ts b/x-pack/plugins/alerting/server/routes/legacy/health.test.ts index 7f0d6c7649123..c5371f6fcb5e7 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/health.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/health.test.ts @@ -52,7 +52,6 @@ const ruleTypes = [ }, producer: 'test', enabledInLicense: true, - minimumScheduleInterval: '1m', defaultScheduleInterval: '10m', } as RegistryAlertTypeWithAuth, ]; diff --git a/x-pack/plugins/alerting/server/routes/rule_types.test.ts b/x-pack/plugins/alerting/server/routes/rule_types.test.ts index 752f729fb8e38..880db9b9e9886 100644 --- a/x-pack/plugins/alerting/server/routes/rule_types.test.ts +++ b/x-pack/plugins/alerting/server/routes/rule_types.test.ts @@ -58,7 +58,6 @@ describe('ruleTypesRoute', () => { }, producer: 'test', enabledInLicense: true, - minimumScheduleInterval: '1m', defaultScheduleInterval: '10m', doesSetRecoveryContext: false, } as RegistryAlertTypeWithAuth, @@ -77,7 +76,6 @@ describe('ruleTypesRoute', () => { default_schedule_interval: '10m', does_set_recovery_context: false, minimum_license_required: 'basic', - minimum_schedule_interval: '1m', is_exportable: true, rule_task_timeout: '10m', recovery_action_group: RecoveredActionGroup, @@ -116,7 +114,6 @@ describe('ruleTypesRoute', () => { "id": "1", "is_exportable": true, "minimum_license_required": "basic", - "minimum_schedule_interval": "1m", "name": "name", "producer": "test", "recovery_action_group": Object { diff --git a/x-pack/plugins/alerting/server/routes/rule_types.ts b/x-pack/plugins/alerting/server/routes/rule_types.ts index 7b2a0c63be198..0427fffab04d1 100644 --- a/x-pack/plugins/alerting/server/routes/rule_types.ts +++ b/x-pack/plugins/alerting/server/routes/rule_types.ts @@ -23,7 +23,6 @@ const rewriteBodyRes: RewriteResponseCase = (result ruleTaskTimeout, actionVariables, authorizedConsumers, - minimumScheduleInterval, defaultScheduleInterval, doesSetRecoveryContext, ...rest @@ -38,7 +37,6 @@ const rewriteBodyRes: RewriteResponseCase = (result rule_task_timeout: ruleTaskTimeout, action_variables: actionVariables, authorized_consumers: authorizedConsumers, - minimum_schedule_interval: minimumScheduleInterval, default_schedule_interval: defaultScheduleInterval, does_set_recovery_context: doesSetRecoveryContext, }) diff --git a/x-pack/plugins/alerting/server/rule_type_registry.test.ts b/x-pack/plugins/alerting/server/rule_type_registry.test.ts index 8ba2847486bca..9efbcff691108 100644 --- a/x-pack/plugins/alerting/server/rule_type_registry.test.ts +++ b/x-pack/plugins/alerting/server/rule_type_registry.test.ts @@ -25,6 +25,7 @@ beforeEach(() => { taskRunnerFactory: new TaskRunnerFactory(), licenseState: mockedLicenseState, licensing: licensingMock.createSetup(), + minimumScheduleInterval: '1m', }; }); @@ -165,7 +166,7 @@ describe('register()', () => { ); }); - test('throws if minimumScheduleInterval isnt valid', () => { + test('throws if defaultScheduleInterval is less than configured minimumScheduleInterval', () => { const ruleType: RuleType = { id: '123', name: 'Test', @@ -175,19 +176,18 @@ describe('register()', () => { name: 'Default', }, ], + defaultActionGroupId: 'default', minimumLicenseRequired: 'basic', isExportable: true, executor: jest.fn(), producer: 'alerts', - minimumScheduleInterval: 'foobar', + defaultScheduleInterval: '10s', }; const registry = new RuleTypeRegistry(ruleTypeRegistryParams); expect(() => registry.register(ruleType)).toThrowError( - new Error( - `Rule type \"123\" has invalid minimum interval: string is not a valid duration: foobar.` - ) + new Error(`Rule type \"123\" cannot specify a default interval less than 1m.`) ); }); @@ -526,7 +526,6 @@ describe('list()', () => { "id": "test", "isExportable": true, "minimumLicenseRequired": "basic", - "minimumScheduleInterval": undefined, "name": "Test", "producer": "alerts", "recoveryActionGroup": Object { diff --git a/x-pack/plugins/alerting/server/rule_type_registry.ts b/x-pack/plugins/alerting/server/rule_type_registry.ts index 6673fb630ef59..9e7bca9e94876 100644 --- a/x-pack/plugins/alerting/server/rule_type_registry.ts +++ b/x-pack/plugins/alerting/server/rule_type_registry.ts @@ -26,6 +26,7 @@ import { RecoveredActionGroupId, ActionGroup, validateDurationSchema, + parseDuration, } from '../common'; import { ILicenseState } from './lib/license_state'; import { getRuleTypeFeatureUsageName } from './lib/get_rule_type_feature_usage_name'; @@ -35,6 +36,7 @@ export interface ConstructorOptions { taskRunnerFactory: TaskRunnerFactory; licenseState: ILicenseState; licensing: LicensingPluginSetup; + minimumScheduleInterval: string; } export interface RegistryRuleType @@ -49,7 +51,6 @@ export interface RegistryRuleType | 'minimumLicenseRequired' | 'isExportable' | 'ruleTaskTimeout' - | 'minimumScheduleInterval' | 'defaultScheduleInterval' | 'doesSetRecoveryContext' > { @@ -129,13 +130,21 @@ export class RuleTypeRegistry { private readonly ruleTypes: Map = new Map(); private readonly taskRunnerFactory: TaskRunnerFactory; private readonly licenseState: ILicenseState; + private readonly minimumScheduleInterval: string; private readonly licensing: LicensingPluginSetup; - constructor({ taskManager, taskRunnerFactory, licenseState, licensing }: ConstructorOptions) { + constructor({ + taskManager, + taskRunnerFactory, + licenseState, + licensing, + minimumScheduleInterval, + }: ConstructorOptions) { this.taskManager = taskManager; this.taskRunnerFactory = taskRunnerFactory; this.licenseState = licenseState; this.licensing = licensing; + this.minimumScheduleInterval = minimumScheduleInterval; } public has(id: string) { @@ -209,20 +218,19 @@ export class RuleTypeRegistry { ) ); } - } - // validate minimumScheduleInterval here - if (ruleType.minimumScheduleInterval) { - const invalidMinimumTimeout = validateDurationSchema(ruleType.minimumScheduleInterval); - if (invalidMinimumTimeout) { + const defaultIntervalInMs = parseDuration(ruleType.defaultScheduleInterval); + const minimumIntervalInMs = parseDuration(this.minimumScheduleInterval); + if (defaultIntervalInMs < minimumIntervalInMs) { throw new Error( i18n.translate( - 'xpack.alerting.ruleTypeRegistry.register.invalidMinimumTimeoutRuleTypeError', + 'xpack.alerting.ruleTypeRegistry.register.defaultTimeoutTooShortRuleTypeError', { - defaultMessage: 'Rule type "{id}" has invalid minimum interval: {errorMessage}.', + defaultMessage: + 'Rule type "{id}" cannot specify a default interval less than {minimumInterval}.', values: { id: ruleType.id, - errorMessage: invalidMinimumTimeout, + minimumInterval: this.minimumScheduleInterval, }, } ) @@ -330,7 +338,6 @@ export class RuleTypeRegistry { minimumLicenseRequired, isExportable, ruleTaskTimeout, - minimumScheduleInterval, defaultScheduleInterval, doesSetRecoveryContext, }, @@ -345,7 +352,6 @@ export class RuleTypeRegistry { minimumLicenseRequired, isExportable, ruleTaskTimeout, - minimumScheduleInterval, defaultScheduleInterval, doesSetRecoveryContext, enabledInLicense: !!this.licenseState.getLicenseCheckForRuleType( diff --git a/x-pack/plugins/alerting/server/rules_client/rules_client.ts b/x-pack/plugins/alerting/server/rules_client/rules_client.ts index 72ef2dba89ce7..6d3ffc822a626 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -120,6 +120,7 @@ export interface ConstructorOptions { authorization: AlertingAuthorization; actionsAuthorization: ActionsAuthorization; ruleTypeRegistry: RuleTypeRegistry; + minimumScheduleInterval: string; encryptedSavedObjectsClient: EncryptedSavedObjectsClient; spaceId?: string; namespace?: string; @@ -240,6 +241,8 @@ export class RulesClient { private readonly unsecuredSavedObjectsClient: SavedObjectsClientContract; private readonly authorization: AlertingAuthorization; private readonly ruleTypeRegistry: RuleTypeRegistry; + private readonly minimumScheduleInterval: string; + private readonly minimumScheduleIntervalInMs: number; private readonly createAPIKey: (name: string) => Promise; private readonly getActionsClient: () => Promise; private readonly actionsAuthorization: ActionsAuthorization; @@ -252,6 +255,7 @@ export class RulesClient { constructor({ ruleTypeRegistry, + minimumScheduleInterval, unsecuredSavedObjectsClient, authorization, taskManager, @@ -274,6 +278,8 @@ export class RulesClient { this.namespace = namespace; this.taskManager = taskManager; this.ruleTypeRegistry = ruleTypeRegistry; + this.minimumScheduleInterval = minimumScheduleInterval; + this.minimumScheduleIntervalInMs = parseDuration(minimumScheduleInterval); this.unsecuredSavedObjectsClient = unsecuredSavedObjectsClient; this.authorization = authorization; this.createAPIKey = createAPIKey; @@ -329,15 +335,12 @@ export class RulesClient { await this.validateActions(ruleType, data.actions); - // Validate intervals, if configured - if (ruleType.minimumScheduleInterval) { - const intervalInMs = parseDuration(data.schedule.interval); - const minimumScheduleIntervalInMs = parseDuration(ruleType.minimumScheduleInterval); - if (intervalInMs < minimumScheduleIntervalInMs) { - throw Boom.badRequest( - `Error updating rule: the interval is less than the minimum interval of ${ruleType.minimumScheduleInterval}` - ); - } + // Validate that schedule interval is not less than configured minimum + const intervalInMs = parseDuration(data.schedule.interval); + if (intervalInMs < this.minimumScheduleIntervalInMs) { + throw Boom.badRequest( + `Error creating rule: the interval is less than the allowed minimum interval of ${this.minimumScheduleInterval}` + ); } // Extract saved object references for this rule @@ -984,15 +987,12 @@ export class RulesClient { const validatedAlertTypeParams = validateRuleTypeParams(data.params, ruleType.validate?.params); await this.validateActions(ruleType, data.actions); - // Validate intervals, if configured - if (ruleType.minimumScheduleInterval) { - const intervalInMs = parseDuration(data.schedule.interval); - const minimumScheduleIntervalInMs = parseDuration(ruleType.minimumScheduleInterval); - if (intervalInMs < minimumScheduleIntervalInMs) { - throw Boom.badRequest( - `Error updating rule: the interval is less than the minimum interval of ${ruleType.minimumScheduleInterval}` - ); - } + // Validate that schedule interval is not less than configured minimum + const intervalInMs = parseDuration(data.schedule.interval); + if (intervalInMs < this.minimumScheduleIntervalInMs) { + throw Boom.badRequest( + `Error updating rule: the interval is less than the allowed minimum interval of ${this.minimumScheduleInterval}` + ); } // Extract saved object references for this rule diff --git a/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts index fc38d540e0274..3a11bbc53bcd3 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/aggregate.test.ts @@ -33,6 +33,7 @@ const rulesClientParams: jest.Mocked = { taskManager, ruleTypeRegistry, unsecuredSavedObjectsClient, + minimumScheduleInterval: '1m', authorization: authorization as unknown as AlertingAuthorization, actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts index 1485d8b639159..6ccc640dcc135 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts @@ -52,6 +52,7 @@ const rulesClientParams: jest.Mocked = { getEventLogClient: jest.fn(), kibanaVersion, auditLogger, + minimumScheduleInterval: '1m', }; beforeEach(() => { @@ -70,7 +71,7 @@ function getMockData(overwrites: Record = {}): CreateOptions<{ tags: ['foo'], alertTypeId: '123', consumer: 'bar', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, throttle: null, notifyWhen: null, params: { @@ -141,7 +142,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -284,7 +285,7 @@ describe('create()', () => { const createdAttributes = { ...data, alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -365,7 +366,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -423,7 +424,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "tags": Array [ "foo", @@ -455,7 +456,7 @@ describe('create()', () => { "spaceId": "default", }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scope": Array [ "alerting", @@ -486,7 +487,7 @@ describe('create()', () => { const createdAttributes = { ...data, alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -545,7 +546,7 @@ describe('create()', () => { ...data, legacyId: '123', alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -624,7 +625,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "tags": Array [ "foo", @@ -700,7 +701,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -798,7 +799,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -889,7 +890,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -982,7 +983,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -1037,7 +1038,7 @@ describe('create()', () => { name: 'abc', notifyWhen: 'onActiveAlert', params: { bar: true }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, tags: ['foo'], throttle: null, updatedAt: '2019-02-12T21:01:22.479Z', @@ -1164,7 +1165,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, parameterThatIsSavedObjectRef: 'soRef_0', @@ -1234,7 +1235,7 @@ describe('create()', () => { name: 'abc', notifyWhen: 'onActiveAlert', params: { bar: true, parameterThatIsSavedObjectRef: 'soRef_0' }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, tags: ['foo'], throttle: null, updatedAt: '2019-02-12T21:01:22.479Z', @@ -1277,7 +1278,7 @@ describe('create()', () => { "parameterThatIsSavedObjectId": "9", }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -1330,7 +1331,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, parameterThatIsSavedObjectRef: 'action_0', @@ -1400,7 +1401,7 @@ describe('create()', () => { name: 'abc', notifyWhen: 'onActiveAlert', params: { bar: true, parameterThatIsSavedObjectRef: 'action_0' }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, tags: ['foo'], throttle: null, updatedAt: '2019-02-12T21:01:22.479Z', @@ -1443,7 +1444,7 @@ describe('create()', () => { "parameterThatIsSavedObjectId": "8", }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -1495,7 +1496,7 @@ describe('create()', () => { const createdAttributes = { ...data, alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1556,7 +1557,7 @@ describe('create()', () => { meta: { versionApiKeyLastmodified: kibanaVersion, }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, throttle: '10m', notifyWhen: 'onActionGroupChange', muteAll: false, @@ -1606,7 +1607,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -1624,7 +1625,7 @@ describe('create()', () => { const createdAttributes = { ...data, alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1685,7 +1686,7 @@ describe('create()', () => { meta: { versionApiKeyLastmodified: kibanaVersion, }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, throttle: '10m', notifyWhen: 'onThrottleInterval', muteAll: false, @@ -1735,7 +1736,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -1753,7 +1754,7 @@ describe('create()', () => { const createdAttributes = { ...data, alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1814,7 +1815,7 @@ describe('create()', () => { meta: { versionApiKeyLastmodified: kibanaVersion, }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, throttle: null, notifyWhen: 'onActiveAlert', muteAll: false, @@ -1864,7 +1865,7 @@ describe('create()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -1953,7 +1954,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1999,7 +2000,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -2043,7 +2044,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -2099,7 +2100,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -2166,7 +2167,7 @@ describe('create()', () => { meta: { versionApiKeyLastmodified: kibanaVersion, }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, throttle: null, notifyWhen: 'onActiveAlert', muteAll: false, @@ -2199,7 +2200,7 @@ describe('create()', () => { type: 'alert', attributes: { alertTypeId: '123', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -2266,7 +2267,7 @@ describe('create()', () => { meta: { versionApiKeyLastmodified: kibanaVersion, }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, throttle: null, notifyWhen: 'onActiveAlert', muteAll: false, @@ -2340,7 +2341,7 @@ describe('create()', () => { expect(taskManager.schedule).not.toHaveBeenCalled(); }); - test('throws error when updating with an interval less than the minimum configured one', async () => { + test('throws error when creating with an interval less than the minimum configured one', async () => { ruleTypeRegistry.get.mockImplementation(() => ({ id: '123', name: 'Test', @@ -2351,16 +2352,15 @@ describe('create()', () => { isExportable: true, async executor() {}, producer: 'alerts', - minimumScheduleInterval: '5m', useSavedObjectReferences: { extractReferences: jest.fn(), injectReferences: jest.fn(), }, })); - const data = getMockData({ schedule: { interval: '1m' } }); + const data = getMockData({ schedule: { interval: '1s' } }); await expect(rulesClient.create({ data })).rejects.toThrowErrorMatchingInlineSnapshot( - `"Error updating rule: the interval is less than the minimum interval of 5m"` + `"Error creating rule: the interval is less than the allowed minimum interval of 1m"` ); expect(unsecuredSavedObjectsClient.create).not.toHaveBeenCalled(); expect(taskManager.schedule).not.toHaveBeenCalled(); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts index cfb684f4241ee..7c595ba500e64 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts @@ -30,6 +30,7 @@ const rulesClientParams: jest.Mocked = { taskManager, ruleTypeRegistry, unsecuredSavedObjectsClient, + minimumScheduleInterval: '1m', authorization: authorization as unknown as AlertingAuthorization, actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts index afb67ef47c62f..0716cbf59b258 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts @@ -42,6 +42,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts index c2826974fb8e8..af96097e41f07 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts @@ -36,6 +36,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts index c0079d7787281..60aac3f266e78 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts @@ -38,6 +38,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts index c704c3eec1241..dfdd44a38bca3 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts @@ -35,6 +35,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts index 2bc355343ea89..18fa0278828ca 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts @@ -34,6 +34,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts index 81d98eff0297a..4e6f627dcd4a6 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts @@ -40,6 +40,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/list_alert_types.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/list_alert_types.test.ts index 3ef7cd6f4046e..3b4c07a775eab 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/list_alert_types.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/list_alert_types.test.ts @@ -38,6 +38,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts index 76bc313bed024..17df0d655c5cc 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts @@ -34,6 +34,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts index 4a77bfd38ef83..6122d794d064c 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts @@ -34,6 +34,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts index bfa2a10189a05..dcd25f43ff611 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts @@ -35,6 +35,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts index e05ea363452e8..794e86206b6d6 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts @@ -34,6 +34,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts index fa228478a39d8..5c0a67f98b8c2 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts @@ -34,6 +34,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts index f59b69c0b3fbf..1def4b7d60f4e 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts @@ -54,6 +54,7 @@ const rulesClientParams: jest.Mocked = { getEventLogClient: jest.fn(), kibanaVersion, auditLogger, + minimumScheduleInterval: '1m', }; beforeEach(() => { @@ -73,7 +74,7 @@ describe('update()', () => { enabled: true, tags: ['foo'], alertTypeId: 'myType', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, consumer: 'myApp', scheduledTaskId: 'task-123', params: {}, @@ -139,7 +140,6 @@ describe('update()', () => { recoveryActionGroup: RecoveredActionGroup, async executor() {}, producer: 'alerts', - minimumScheduleInterval: '5s', }); }); @@ -182,7 +182,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -247,7 +247,7 @@ describe('update()', () => { const result = await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -316,7 +316,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -371,7 +371,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -468,7 +468,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -519,7 +519,7 @@ describe('update()', () => { const result = await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -592,7 +592,7 @@ describe('update()', () => { name: 'abc', notifyWhen: 'onActiveAlert', params: { bar: true }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, scheduledTaskId: 'task-123', tags: ['foo'], throttle: null, @@ -643,7 +643,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -698,7 +698,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, parameterThatIsSavedObjectRef: 'soRef_0', @@ -734,7 +734,7 @@ describe('update()', () => { const result = await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: ruleParams, @@ -768,7 +768,7 @@ describe('update()', () => { name: 'abc', notifyWhen: 'onActiveAlert', params: { bar: true, parameterThatIsSavedObjectRef: 'soRef_0' }, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, scheduledTaskId: 'task-123', tags: ['foo'], throttle: null, @@ -814,7 +814,7 @@ describe('update()', () => { "parameterThatIsSavedObjectId": "9", }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -832,7 +832,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -882,7 +882,7 @@ describe('update()', () => { const result = await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -922,7 +922,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -957,7 +957,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -997,7 +997,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: false, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1038,7 +1038,7 @@ describe('update()', () => { const result = await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1079,7 +1079,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "updatedAt": 2019-02-12T21:01:22.479Z, @@ -1114,7 +1114,7 @@ describe('update()', () => { "bar": true, }, "schedule": Object { - "interval": "10s", + "interval": "1m", }, "scheduledTaskId": "task-123", "tags": Array [ @@ -1150,7 +1150,7 @@ describe('update()', () => { await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1209,7 +1209,7 @@ describe('update()', () => { rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1240,7 +1240,7 @@ describe('update()', () => { attributes: { enabled: false, name: ' my alert name ', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1284,7 +1284,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1312,7 +1312,7 @@ describe('update()', () => { await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1376,7 +1376,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1431,7 +1431,7 @@ describe('update()', () => { await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1480,7 +1480,7 @@ describe('update()', () => { rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1585,12 +1585,12 @@ describe('update()', () => { const alertId = uuid.v4(); const taskId = uuid.v4(); - mockApiCalls(alertId, taskId, { interval: '60m' }, { interval: '10s' }); + mockApiCalls(alertId, taskId, { interval: '60m' }, { interval: '1m' }); await rulesClient.update({ id: alertId, data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1617,12 +1617,12 @@ describe('update()', () => { const alertId = uuid.v4(); const taskId = uuid.v4(); - mockApiCalls(alertId, taskId, { interval: '10s' }, { interval: '10s' }); + mockApiCalls(alertId, taskId, { interval: '1m' }, { interval: '1m' }); await rulesClient.update({ id: alertId, data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1649,7 +1649,7 @@ describe('update()', () => { const alertId = uuid.v4(); const taskId = uuid.v4(); - mockApiCalls(alertId, taskId, { interval: '10s' }, { interval: '30s' }); + mockApiCalls(alertId, taskId, { interval: '1m' }, { interval: '30s' }); const resolveAfterAlertUpdatedCompletes = resolvable<{ id: string }>(); @@ -1659,7 +1659,7 @@ describe('update()', () => { await rulesClient.update({ id: alertId, data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1687,7 +1687,7 @@ describe('update()', () => { const alertId = uuid.v4(); const taskId = uuid.v4(); - mockApiCalls(alertId, taskId, { interval: '10s' }, { interval: '30s' }); + mockApiCalls(alertId, taskId, { interval: '1m' }, { interval: '30s' }); taskManager.runNow.mockReset(); taskManager.runNow.mockRejectedValue(new Error('Failed to run alert')); @@ -1695,7 +1695,7 @@ describe('update()', () => { await rulesClient.update({ id: alertId, data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1763,7 +1763,7 @@ describe('update()', () => { rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1801,6 +1801,51 @@ describe('update()', () => { expect(taskManager.schedule).not.toHaveBeenCalled(); }); + test('throws error when updating with an interval less than the minimum configured one', async () => { + await expect( + rulesClient.update({ + id: '1', + data: { + schedule: { interval: '1s' }, + name: 'abc', + tags: ['foo'], + params: { + bar: true, + }, + throttle: null, + notifyWhen: 'onActiveAlert', + actions: [ + { + group: 'default', + id: '1', + params: { + foo: true, + }, + }, + { + group: 'default', + id: '1', + params: { + foo: true, + }, + }, + { + group: 'default', + id: '2', + params: { + foo: true, + }, + }, + ], + }, + }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"Error updating rule: the interval is less than the allowed minimum interval of 1m"` + ); + expect(unsecuredSavedObjectsClient.create).not.toHaveBeenCalled(); + expect(taskManager.schedule).not.toHaveBeenCalled(); + }); + describe('authorization', () => { beforeEach(() => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ @@ -1810,7 +1855,7 @@ describe('update()', () => { alertTypeId: 'myType', consumer: 'myApp', enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1827,7 +1872,7 @@ describe('update()', () => { await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1856,7 +1901,7 @@ describe('update()', () => { rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1887,7 +1932,7 @@ describe('update()', () => { type: 'alert', attributes: { enabled: true, - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, params: { bar: true, }, @@ -1904,7 +1949,7 @@ describe('update()', () => { await rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1934,7 +1979,7 @@ describe('update()', () => { rulesClient.update({ id: '1', data: { - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, name: 'abc', tags: ['foo'], params: { @@ -1966,49 +2011,4 @@ describe('update()', () => { ); }); }); - - test('throws error when updating with an interval less than the minimum configured one', async () => { - await expect( - rulesClient.update({ - id: '1', - data: { - schedule: { interval: '1s' }, - name: 'abc', - tags: ['foo'], - params: { - bar: true, - }, - throttle: null, - notifyWhen: 'onActiveAlert', - actions: [ - { - group: 'default', - id: '1', - params: { - foo: true, - }, - }, - { - group: 'default', - id: '1', - params: { - foo: true, - }, - }, - { - group: 'default', - id: '2', - params: { - foo: true, - }, - }, - ], - }, - }) - ).rejects.toThrowErrorMatchingInlineSnapshot( - `"Error updating rule: the interval is less than the minimum interval of 5s"` - ); - expect(unsecuredSavedObjectsClient.create).not.toHaveBeenCalled(); - expect(taskManager.schedule).not.toHaveBeenCalled(); - }); }); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts index 0b335a13d07e3..b60f0185e0b57 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts @@ -35,6 +35,7 @@ const rulesClientParams: jest.Mocked = { actionsAuthorization: actionsAuthorization as unknown as ActionsAuthorization, spaceId: 'default', namespace: 'default', + minimumScheduleInterval: '1m', getUserName: jest.fn(), createAPIKey: jest.fn(), logger: loggingSystemMock.create().get(), diff --git a/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts b/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts index 0b35f250ba3c6..5e1bc99e9378e 100644 --- a/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts +++ b/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts @@ -52,6 +52,7 @@ const rulesClientParams: jest.Mocked = { getActionsClient: jest.fn(), getEventLogClient: jest.fn(), kibanaVersion, + minimumScheduleInterval: '1m', }; // this suite consists of two suites running tests against mutable RulesClient APIs: @@ -101,7 +102,7 @@ async function update(success: boolean) { await rulesClient.update({ id: MockAlertId, data: { - schedule: { interval: '5s' }, + schedule: { interval: '1m' }, name: 'cba', tags: ['bar'], params: { bar: true }, @@ -267,7 +268,7 @@ function setupRawAlertMocks( enabled: true, tags: ['foo'], alertTypeId: 'myType', - schedule: { interval: '10s' }, + schedule: { interval: '1m' }, consumer: 'myApp', scheduledTaskId: 'task-123', params: {}, diff --git a/x-pack/plugins/alerting/server/rules_client_factory.test.ts b/x-pack/plugins/alerting/server/rules_client_factory.test.ts index 76d09c3623e83..b59cff0f9986d 100644 --- a/x-pack/plugins/alerting/server/rules_client_factory.test.ts +++ b/x-pack/plugins/alerting/server/rules_client_factory.test.ts @@ -44,6 +44,7 @@ const rulesClientFactoryParams: jest.Mocked = { ruleTypeRegistry: ruleTypeRegistryMock.create(), getSpaceId: jest.fn(), spaceIdToNamespace: jest.fn(), + minimumScheduleInterval: '1m', encryptedSavedObjectsClient: encryptedSavedObjectsMock.createClient(), actions: actionsMock.createStart(), eventLog: eventLogMock.createStart(), @@ -119,6 +120,7 @@ test('creates an alerts client with proper constructor arguments when security i createAPIKey: expect.any(Function), encryptedSavedObjectsClient: rulesClientFactoryParams.encryptedSavedObjectsClient, kibanaVersion: '7.10.0', + minimumScheduleInterval: '1m', }); }); @@ -156,6 +158,7 @@ test('creates an alerts client with proper constructor arguments', async () => { getActionsClient: expect.any(Function), getEventLogClient: expect.any(Function), kibanaVersion: '7.10.0', + minimumScheduleInterval: '1m', }); }); diff --git a/x-pack/plugins/alerting/server/rules_client_factory.ts b/x-pack/plugins/alerting/server/rules_client_factory.ts index 1e9a021a0be51..919902339e78f 100644 --- a/x-pack/plugins/alerting/server/rules_client_factory.ts +++ b/x-pack/plugins/alerting/server/rules_client_factory.ts @@ -33,6 +33,7 @@ export interface RulesClientFactoryOpts { kibanaVersion: PluginInitializerContext['env']['packageInfo']['version']; authorization: AlertingAuthorizationClientFactory; eventLogger?: IEventLogger; + minimumScheduleInterval: string; } export class RulesClientFactory { @@ -50,6 +51,7 @@ export class RulesClientFactory { private kibanaVersion!: PluginInitializerContext['env']['packageInfo']['version']; private authorization!: AlertingAuthorizationClientFactory; private eventLogger?: IEventLogger; + private minimumScheduleInterval!: string; public initialize(options: RulesClientFactoryOpts) { if (this.isInitialized) { @@ -69,6 +71,7 @@ export class RulesClientFactory { this.kibanaVersion = options.kibanaVersion; this.authorization = options.authorization; this.eventLogger = options.eventLogger; + this.minimumScheduleInterval = options.minimumScheduleInterval; } public create(request: KibanaRequest, savedObjects: SavedObjectsServiceStart): RulesClient { @@ -85,6 +88,7 @@ export class RulesClientFactory { logger: this.logger, taskManager: this.taskManager, ruleTypeRegistry: this.ruleTypeRegistry, + minimumScheduleInterval: this.minimumScheduleInterval, unsecuredSavedObjectsClient: savedObjects.getScopedClient(request, { excludedWrappers: ['security'], includedHiddenTypes: ['alert', 'api_key_pending_invalidation'], diff --git a/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts b/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts index 1337c5a70979b..d2310c26c49d2 100644 --- a/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts @@ -28,6 +28,7 @@ beforeEach(() => { taskRunnerFactory: new TaskRunnerFactory(), licenseState: mockedLicenseState, licensing: licensingMock.createSetup(), + minimumScheduleInterval: '1m', }; }); diff --git a/x-pack/plugins/alerting/server/task_runner/fixtures.ts b/x-pack/plugins/alerting/server/task_runner/fixtures.ts new file mode 100644 index 0000000000000..07f2487de20fb --- /dev/null +++ b/x-pack/plugins/alerting/server/task_runner/fixtures.ts @@ -0,0 +1,378 @@ +/* + * 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 { isNil } from 'lodash'; +import { Alert, AlertTypeParams, RecoveredActionGroup } from '../../common'; +import { getDefaultRuleMonitoring } from './task_runner'; +import { UntypedNormalizedRuleType } from '../rule_type_registry'; +import { TaskStatus } from '../../../task_manager/server'; +import { EVENT_LOG_ACTIONS } from '../plugin'; + +interface GeneratorParams { + [key: string]: string | number | boolean | undefined | object[] | boolean[] | object; +} + +export const RULE_NAME = 'rule-name'; +export const RULE_ID = '1'; +export const RULE_TYPE_ID = 'test'; +export const DATE_1969 = '1969-12-31T00:00:00.000Z'; +export const DATE_1970 = '1970-01-01T00:00:00.000Z'; +export const DATE_1970_5_MIN = '1969-12-31T23:55:00.000Z'; +export const MOCK_DURATION = 86400000000000; + +export const SAVED_OBJECT = { + id: '1', + type: 'alert', + attributes: { + apiKey: Buffer.from('123:abc').toString('base64'), + enabled: true, + }, + references: [], +}; + +export const RULE_ACTIONS = [ + { + actionTypeId: 'action', + group: 'default', + id: '1', + params: { + foo: true, + }, + }, + { + actionTypeId: 'action', + group: 'recovered', + id: '2', + params: { + isResolved: true, + }, + }, +]; + +export const SAVED_OBJECT_UPDATE_PARAMS = [ + 'alert', + '1', + { + monitoring: { + execution: { + calculated_metrics: { + success_ratio: 1, + }, + history: [ + { + success: true, + timestamp: 0, + }, + ], + }, + }, + executionStatus: { + error: null, + lastDuration: 0, + lastExecutionDate: '1970-01-01T00:00:00.000Z', + status: 'ok', + }, + }, + { refresh: false, namespace: undefined }, +]; + +export const GENERIC_ERROR_MESSAGE = 'GENERIC ERROR MESSAGE'; + +export const ruleType: jest.Mocked = { + id: RULE_TYPE_ID, + name: 'My test rule', + actionGroups: [{ id: 'default', name: 'Default' }, RecoveredActionGroup], + defaultActionGroupId: 'default', + minimumLicenseRequired: 'basic', + isExportable: true, + recoveryActionGroup: RecoveredActionGroup, + executor: jest.fn(), + producer: 'alerts', +}; + +export const mockRunNowResponse = { + id: 1, +} as jest.ResolvedValue; + +export const mockDate = new Date('2019-02-12T21:01:22.479Z'); + +export const mockedRuleTypeSavedObject: Alert = { + id: '1', + consumer: 'bar', + createdAt: mockDate, + updatedAt: mockDate, + throttle: null, + muteAll: false, + notifyWhen: 'onActiveAlert', + enabled: true, + alertTypeId: ruleType.id, + apiKey: '', + apiKeyOwner: 'elastic', + schedule: { interval: '10s' }, + name: RULE_NAME, + tags: ['rule-', '-tags'], + createdBy: 'rule-creator', + updatedBy: 'rule-updater', + mutedInstanceIds: [], + params: { + bar: true, + }, + actions: [ + { + group: 'default', + id: '1', + actionTypeId: 'action', + params: { + foo: true, + }, + }, + { + group: RecoveredActionGroup.id, + id: '2', + actionTypeId: 'action', + params: { + isResolved: true, + }, + }, + ], + executionStatus: { + status: 'unknown', + lastExecutionDate: new Date('2020-08-20T19:23:38Z'), + }, + monitoring: getDefaultRuleMonitoring(), +}; + +export const mockTaskInstance = () => ({ + id: '', + attempts: 0, + status: TaskStatus.Running, + version: '123', + runAt: new Date(), + schedule: { interval: '10s' }, + scheduledAt: new Date(), + startedAt: new Date(), + retryAt: new Date(Date.now() + 5 * 60 * 1000), + state: {}, + taskType: 'alerting:test', + params: { + alertId: RULE_ID, + }, + ownerId: null, +}); + +export const generateAlertSO = (id: string) => ({ + id, + rel: 'primary', + type: 'alert', + type_id: RULE_TYPE_ID, +}); + +export const generateActionSO = (id: string) => ({ + id, + namespace: undefined, + type: 'action', + type_id: 'action', +}); + +export const generateEventLog = ({ + action, + task, + duration, + start, + end, + outcome, + reason, + instanceId, + actionSubgroup, + actionGroupId, + status, + numberOfTriggeredActions, + savedObjects = [generateAlertSO('1')], +}: GeneratorParams = {}) => ({ + ...(status === 'error' && { + error: { + message: generateErrorMessage(String(reason)), + }, + }), + event: { + action, + ...(!isNil(duration) && { duration }), + ...(start && { start }), + ...(end && { end }), + ...(outcome && { outcome }), + ...(reason && { reason }), + category: ['alerts'], + kind: 'alert', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', + ...(!isNil(numberOfTriggeredActions) && { + metrics: { + number_of_triggered_actions: numberOfTriggeredActions, + number_of_searches: 3, + es_search_duration_ms: 33, + total_search_duration_ms: 23423, + }, + }), + }, + }, + }, + ...((actionSubgroup || actionGroupId || instanceId || status) && { + alerting: { + ...(actionSubgroup && { action_subgroup: actionSubgroup }), + ...(actionGroupId && { action_group_id: actionGroupId }), + ...(instanceId && { instance_id: instanceId }), + ...(status && { status }), + }, + }), + saved_objects: savedObjects, + ...(task && { + task: { + schedule_delay: 0, + scheduled: '1970-01-01T00:00:00.000Z', + }, + }), + }, + message: generateMessage({ action, instanceId, actionGroupId, actionSubgroup, reason, status }), + rule: { + category: 'test', + id: '1', + license: 'basic', + ...(hasRuleName({ action, status }) && { name: RULE_NAME }), + ruleset: 'alerts', + }, +}); + +const generateMessage = ({ + action, + instanceId, + actionGroupId, + actionSubgroup, + reason, + status, +}: GeneratorParams) => { + if (action === EVENT_LOG_ACTIONS.executeStart) { + return `rule execution start: "${mockTaskInstance().params.alertId}"`; + } + + if (action === EVENT_LOG_ACTIONS.newInstance) { + return `${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}' created new alert: '${instanceId}'`; + } + + if (action === EVENT_LOG_ACTIONS.activeInstance) { + if (actionSubgroup) { + return `${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}' active alert: '${instanceId}' in actionGroup(subgroup): 'default(${actionSubgroup})'`; + } + return `${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}' active alert: '${instanceId}' in actionGroup: '${actionGroupId}'`; + } + + if (action === EVENT_LOG_ACTIONS.recoveredInstance) { + return `${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}' alert '${instanceId}' has recovered`; + } + + if (action === EVENT_LOG_ACTIONS.executeAction) { + if (actionSubgroup) { + return `alert: ${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}' instanceId: '${instanceId}' scheduled actionGroup(subgroup): 'default(${actionSubgroup})' action: action:${instanceId}`; + } + return `alert: ${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}' instanceId: '${instanceId}' scheduled actionGroup: '${actionGroupId}' action: action:${instanceId}`; + } + + if (action === EVENT_LOG_ACTIONS.execute) { + if (status === 'error' && reason === 'execute') { + return `rule execution failure: ${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}'`; + } + if (status === 'error') { + return `${RULE_TYPE_ID}:${RULE_ID}: execution failed`; + } + if (actionGroupId === 'recovered') { + return `rule-name' instanceId: '${instanceId}' scheduled actionGroup: '${actionGroupId}' action: action:${instanceId}`; + } + return `rule executed: ${RULE_TYPE_ID}:${RULE_ID}: '${RULE_NAME}'`; + } +}; + +const generateErrorMessage = (reason: string) => { + if (reason === 'disabled') { + return 'Rule failed to execute because rule ran after it was disabled.'; + } + return GENERIC_ERROR_MESSAGE; +}; + +export const generateRunnerResult = ({ + successRatio = 1, + history = Array(false), + state = false, + interval = '10s', +}: GeneratorParams = {}) => { + return { + monitoring: { + execution: { + calculated_metrics: { + success_ratio: successRatio, + }, + // @ts-ignore + history: history.map((success) => ({ success, timestamp: 0 })), + }, + }, + schedule: { + interval, + }, + state: { + ...(state && { alertInstances: {} }), + ...(state && { alertTypeState: undefined }), + ...(state && { previousStartedAt: new Date('1970-01-01T00:00:00.000Z') }), + }, + }; +}; + +export const generateEnqueueFunctionInput = () => ({ + apiKey: 'MTIzOmFiYw==', + executionId: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', + id: '1', + params: { + foo: true, + }, + relatedSavedObjects: [ + { + id: '1', + namespace: undefined, + type: 'alert', + typeId: RULE_TYPE_ID, + }, + ], + source: { + source: { + id: '1', + type: 'alert', + }, + type: 'SAVED_OBJECT', + }, + spaceId: undefined, +}); + +export const generateAlertInstance = ({ id, duration, start }: GeneratorParams = { id: 1 }) => ({ + [String(id)]: { + meta: { + lastScheduledActions: { + date: new Date(DATE_1970), + group: 'default', + subgroup: undefined, + }, + }, + state: { + bar: false, + duration, + start, + }, + }, +}); +const hasRuleName = ({ action, status }: GeneratorParams) => { + return action !== 'execute-start' && status !== 'error'; +}; diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index 7496cdf7fd336..99feefb472df1 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -19,10 +19,9 @@ import { ConcreteTaskInstance, isUnrecoverableError, RunNowResult, - TaskStatus, } from '../../../task_manager/server'; import { TaskRunnerContext } from './task_runner_factory'; -import { TaskRunner, getDefaultRuleMonitoring } from './task_runner'; +import { TaskRunner } from './task_runner'; import { encryptedSavedObjectsMock } from '../../../encrypted_saved_objects/server/mocks'; import { loggingSystemMock, @@ -38,32 +37,42 @@ import { alertsMock, rulesClientMock } from '../mocks'; import { eventLoggerMock } from '../../../event_log/server/event_logger.mock'; import { IEventLogger } from '../../../event_log/server'; import { SavedObjectsErrorHelpers } from '../../../../../src/core/server'; -import { Alert, RecoveredActionGroup } from '../../common'; import { omit } from 'lodash'; -import { UntypedNormalizedRuleType } from '../rule_type_registry'; import { ruleTypeRegistryMock } from '../rule_type_registry.mock'; import { ExecuteOptions } from '../../../actions/server/create_execute_function'; import moment from 'moment'; +import { + generateActionSO, + generateAlertSO, + generateEventLog, + mockDate, + mockedRuleTypeSavedObject, + mockRunNowResponse, + ruleType, + RULE_NAME, + SAVED_OBJECT, + generateRunnerResult, + RULE_ACTIONS, + generateEnqueueFunctionInput, + SAVED_OBJECT_UPDATE_PARAMS, + mockTaskInstance, + GENERIC_ERROR_MESSAGE, + generateAlertInstance, + MOCK_DURATION, + DATE_1969, + DATE_1970, + DATE_1970_5_MIN, +} from './fixtures'; +import { EVENT_LOG_ACTIONS } from '../plugin'; jest.mock('uuid', () => ({ v4: () => '5f6aa57d-3e22-484e-bae8-cbed868f4d28', })); + jest.mock('../lib/wrap_scoped_cluster_client', () => ({ createWrappedScopedClusterClientFactory: jest.fn(), })); -const ruleType: jest.Mocked = { - id: 'test', - name: 'My test rule', - actionGroups: [{ id: 'default', name: 'Default' }, RecoveredActionGroup], - defaultActionGroupId: 'default', - minimumLicenseRequired: 'basic', - isExportable: true, - recoveryActionGroup: RecoveredActionGroup, - executor: jest.fn(), - producer: 'alerts', -}; - let fakeTimer: sinon.SinonFakeTimers; const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); @@ -74,23 +83,7 @@ describe('Task Runner', () => { beforeAll(() => { fakeTimer = sinon.useFakeTimers(); - mockedTaskInstance = { - id: '', - attempts: 0, - status: TaskStatus.Running, - version: '123', - runAt: new Date(), - schedule: { interval: '10s' }, - scheduledAt: new Date(), - startedAt: new Date(), - retryAt: new Date(Date.now() + 5 * 60 * 1000), - state: {}, - taskType: 'alerting:test', - params: { - alertId: '1', - }, - ownerId: null, - }; + mockedTaskInstance = mockTaskInstance(); }); afterAll(() => fakeTimer.restore()); @@ -131,56 +124,6 @@ describe('Task Runner', () => { usageCounter: mockUsageCounter, }; - const mockDate = new Date('2019-02-12T21:01:22.479Z'); - const mockedRuleTypeSavedObject: Alert = { - id: '1', - consumer: 'bar', - createdAt: mockDate, - updatedAt: mockDate, - throttle: null, - muteAll: false, - notifyWhen: 'onActiveAlert', - enabled: true, - alertTypeId: ruleType.id, - apiKey: '', - apiKeyOwner: 'elastic', - schedule: { interval: '10s' }, - name: 'rule-name', - tags: ['rule-', '-tags'], - createdBy: 'rule-creator', - updatedBy: 'rule-updater', - mutedInstanceIds: [], - params: { - bar: true, - }, - actions: [ - { - group: 'default', - id: '1', - actionTypeId: 'action', - params: { - foo: true, - }, - }, - { - group: RecoveredActionGroup.id, - id: '2', - actionTypeId: 'action', - params: { - isResolved: true, - }, - }, - ], - executionStatus: { - status: 'unknown', - lastExecutionDate: new Date('2020-08-20T19:23:38Z'), - }, - monitoring: getDefaultRuleMonitoring(), - }; - const mockRunNowResponse = { - id: 1, - } as jest.ResolvedValue; - const ephemeralTestParams: Array< [ nameExtension: string, @@ -241,65 +184,25 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 1, - }, - "history": Array [ - Object { - "success": true, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object { - "alertInstances": Object {}, - "alertTypeState": undefined, - "previousStartedAt": 1970-01-01T00:00:00.000Z, - }, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ state: true, history: [true] })); expect(ruleType.executor).toHaveBeenCalledTimes(1); const call = ruleType.executor.mock.calls[0][0]; - expect(call.params).toMatchInlineSnapshot(` - Object { - "bar": true, - } - `); - expect(call.startedAt).toMatchInlineSnapshot(`1970-01-01T00:00:00.000Z`); - expect(call.previousStartedAt).toMatchInlineSnapshot(`1969-12-31T23:55:00.000Z`); - expect(call.state).toMatchInlineSnapshot(`Object {}`); - expect(call.name).toBe('rule-name'); + expect(call.params).toEqual({ bar: true }); + expect(call.startedAt).toStrictEqual(new Date(DATE_1970)); + expect(call.previousStartedAt).toStrictEqual(new Date(DATE_1970_5_MIN)); + expect(call.state).toEqual({}); + expect(call.name).toBe(RULE_NAME); expect(call.tags).toEqual(['rule-', '-tags']); expect(call.createdBy).toBe('rule-creator'); expect(call.updatedBy).toBe('rule-updater'); expect(call.rule).not.toBe(null); - expect(call.rule.name).toBe('rule-name'); + expect(call.rule.name).toBe(RULE_NAME); expect(call.rule.tags).toEqual(['rule-', '-tags']); expect(call.rule.consumer).toBe('bar'); expect(call.rule.enabled).toBe(true); - expect(call.rule.schedule).toMatchInlineSnapshot(` - Object { - "interval": "10s", - } - `); + expect(call.rule.schedule).toEqual({ interval: '10s' }); expect(call.rule.createdBy).toBe('rule-creator'); expect(call.rule.updatedBy).toBe('rule-updater'); expect(call.rule.createdAt).toBe(mockDate); @@ -309,26 +212,7 @@ describe('Task Runner', () => { expect(call.rule.producer).toBe('alerts'); expect(call.rule.ruleTypeId).toBe('test'); expect(call.rule.ruleTypeName).toBe('My test rule'); - expect(call.rule.actions).toMatchInlineSnapshot(` - Array [ - Object { - "actionTypeId": "action", - "group": "default", - "id": "1", - "params": Object { - "foo": true, - }, - }, - Object { - "actionTypeId": "action", - "group": "recovered", - "id": "2", - "params": Object { - "isResolved": true, - }, - }, - ] - `); + expect(call.rule.actions).toEqual(RULE_ACTIONS); expect(call.services.alertFactory.create).toBeTruthy(); expect(call.services.scopedClusterClient).toBeTruthy(); expect(call.services).toBeTruthy(); @@ -344,75 +228,16 @@ describe('Task Runner', () => { const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls[0][0]).toMatchInlineSnapshot(` - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - } - `); + expect(eventLogger.logEvent).toHaveBeenCalledWith( + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); expect( taskRunnerFactoryInitializerParams.internalSavedObjectsRepository.update - ).toHaveBeenCalledWith( - 'alert', - '1', - { - monitoring: { - execution: { - calculated_metrics: { - success_ratio: 1, - }, - history: [ - { - success: true, - timestamp: 0, - }, - ], - }, - }, - executionStatus: { - error: null, - lastDuration: 0, - lastExecutionDate: '1970-01-01T00:00:00.000Z', - status: 'ok', - }, - }, - { refresh: false, namespace: undefined } - ); + ).toHaveBeenCalledWith(...SAVED_OBJECT_UPDATE_PARAMS); expect(taskRunnerFactoryInitializerParams.executionContext.withContext).toBeCalledTimes(1); expect(taskRunnerFactoryInitializerParams.executionContext.withContext).toHaveBeenCalledWith( @@ -461,262 +286,74 @@ describe('Task Runner', () => { customTaskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); expect(enqueueFunction).toHaveBeenCalledTimes(1); - expect((enqueueFunction as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` - Array [ - Object { - "apiKey": "MTIzOmFiYw==", - "executionId": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - "id": "1", - "params": Object { - "foo": true, - }, - "relatedSavedObjects": Array [ - Object { - "id": "1", - "namespace": undefined, - "type": "alert", - "typeId": "test", - }, - ], - "source": Object { - "source": Object { - "id": "1", - "type": "alert", - }, - "type": "SAVED_OBJECT", - }, - "spaceId": undefined, - }, - ] - `); + expect(enqueueFunction).toHaveBeenCalledWith(generateEnqueueFunctionInput()); const logger = customTaskRunnerFactoryInitializerParams.logger; expect(logger.debug).toHaveBeenCalledTimes(4); expect(logger.debug).nthCalledWith(1, 'executing rule test:1 at 1970-01-01T00:00:00.000Z'); expect(logger.debug).nthCalledWith( 2, - `rule test:1: 'rule-name' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` + `rule test:1: '${RULE_NAME}' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( 3, 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); - // ruleExecutionStatus for test:1: {\"lastExecutionDate\":\"1970-01-01T00:00:00.000Z\",\"status\":\"error\",\"error\":{\"reason\":\"unknown\",\"message\":\"Cannot read property 'catch' of undefined\"}} const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(5); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { - event: { - action: 'execute-start', - category: ['alerts'], - kind: 'alert', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - task: { - schedule_delay: 0, - scheduled: '1970-01-01T00:00:00.000Z', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: `rule execution start: "1"`, - rule: { - category: 'test', - id: '1', - license: 'basic', - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(2, { - event: { - action: 'new-instance', - category: ['alerts'], - kind: 'alert', + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ duration: 0, - start: '1970-01-01T00:00:00.000Z', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - alerting: { - action_group_id: 'default', - action_subgroup: 'subDefault', - instance_id: '1', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: "test:1: 'rule-name' created new alert: '1'", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - namespace: undefined, - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(3, { - event: { - action: 'active-instance', - category: ['alerts'], + start: DATE_1970, + action: EVENT_LOG_ACTIONS.newInstance, + actionSubgroup: 'subDefault', + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ duration: 0, - kind: 'alert', - start: '1970-01-01T00:00:00.000Z', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - alerting: { - action_group_id: 'default', - action_subgroup: 'subDefault', - instance_id: '1', - }, - saved_objects: [ - { id: '1', namespace: undefined, rel: 'primary', type: 'alert', type_id: 'test' }, - ], - }, - message: - "test:1: 'rule-name' active alert: '1' in actionGroup(subgroup): 'default(subDefault)'", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - namespace: undefined, - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(4, { - event: { - action: 'execute-action', - category: ['alerts'], - kind: 'alert', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - alerting: { - instance_id: '1', - action_group_id: 'default', - action_subgroup: 'subDefault', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - { - id: '1', - namespace: undefined, - type: 'action', - type_id: 'action', - }, - ], - }, - message: - "alert: test:1: 'rule-name' instanceId: '1' scheduled actionGroup(subgroup): 'default(subDefault)' action: action:1", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - namespace: undefined, - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(5, { - event: { action: 'execute', category: ['alerts'], kind: 'alert', outcome: 'success' }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - metrics: { - number_of_searches: 3, - number_of_triggered_actions: 1, - es_search_duration_ms: 33, - total_search_duration_ms: 23423, - }, - }, - }, - }, - task: { - schedule_delay: 0, - scheduled: '1970-01-01T00:00:00.000Z', - }, - alerting: { - status: 'active', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: "rule executed: test:1: 'rule-name'", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - ruleset: 'alerts', - }, - }); + start: DATE_1970, + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + actionSubgroup: 'subDefault', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.executeAction, + actionGroupId: 'default', + instanceId: '1', + actionSubgroup: 'subDefault', + savedObjects: [generateAlertSO('1'), generateActionSO('1')], + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 5, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 1, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } ); @@ -746,15 +383,7 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, muteAll: true, }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); expect(actionsClient.ephemeralEnqueuedExecution).toHaveBeenCalledTimes(0); @@ -763,11 +392,11 @@ describe('Task Runner', () => { expect(logger.debug).nthCalledWith(1, 'executing rule test:1 at 1970-01-01T00:00:00.000Z'); expect(logger.debug).nthCalledWith( 2, - `rule test:1: 'rule-name' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` + `rule test:1: '${RULE_NAME}' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( 3, - `no scheduling of actions for rule test:1: 'rule-name': rule is muted.` + `no scheduling of actions for rule test:1: '${RULE_NAME}': rule is muted.` ); expect(logger.debug).nthCalledWith( 4, @@ -777,169 +406,43 @@ describe('Task Runner', () => { const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); expect(eventLogger.logEvent).toHaveBeenCalledTimes(4); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(1, { - event: { - action: 'execute-start', - category: ['alerts'], - kind: 'alert', - }, - kibana: { - task: { - schedule_delay: 0, - scheduled: '1970-01-01T00:00:00.000Z', - }, - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: `rule execution start: \"1\"`, - rule: { - category: 'test', - id: '1', - license: 'basic', - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(2, { - event: { - action: 'new-instance', - category: ['alerts'], - kind: 'alert', + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ duration: 0, - start: '1970-01-01T00:00:00.000Z', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - alerting: { - action_group_id: 'default', - instance_id: '1', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: "test:1: 'rule-name' created new alert: '1'", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - namespace: undefined, - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(3, { - event: { - action: 'active-instance', - category: ['alerts'], - kind: 'alert', + start: DATE_1970, + action: EVENT_LOG_ACTIONS.newInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ duration: 0, - start: '1970-01-01T00:00:00.000Z', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - alerting: { - instance_id: '1', - action_group_id: 'default', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - namespace: undefined, - ruleset: 'alerts', - }, - }); - expect(eventLogger.logEvent).toHaveBeenNthCalledWith(4, { - event: { - action: 'execute', - category: ['alerts'], - kind: 'alert', + start: DATE_1970, + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, outcome: 'success', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - metrics: { - number_of_searches: 3, - number_of_triggered_actions: 0, - es_search_duration_ms: 33, - total_search_duration_ms: 23423, - }, - }, - }, - }, - alerting: { - status: 'active', - }, - task: { - schedule_delay: 0, - scheduled: '1970-01-01T00:00:00.000Z', - }, - saved_objects: [ - { - id: '1', - namespace: undefined, - rel: 'primary', - type: 'alert', - type_id: 'test', - }, - ], - }, - message: "rule executed: test:1: 'rule-name'", - rule: { - category: 'test', - id: '1', - license: 'basic', - name: 'rule-name', - ruleset: 'alerts', - }, - }); + status: 'active', + numberOfTriggeredActions: 0, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -976,15 +479,7 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, mutedInstanceIds: ['2'], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); expect(enqueueFunction).toHaveBeenCalledTimes(1); @@ -993,11 +488,11 @@ describe('Task Runner', () => { expect(logger.debug).nthCalledWith(1, 'executing rule test:1 at 1970-01-01T00:00:00.000Z'); expect(logger.debug).nthCalledWith( 2, - `rule test:1: 'rule-name' has 2 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"},{\"instanceId\":\"2\",\"actionGroup\":\"default\"}]` + `rule test:1: '${RULE_NAME}' has 2 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"},{\"instanceId\":\"2\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( 3, - `skipping scheduling of actions for '2' in rule test:1: 'rule-name': rule is muted` + `skipping scheduling of actions for '2' in rule test:1: '${RULE_NAME}': rule is muted` ); expect(logger.debug).nthCalledWith( 4, @@ -1044,8 +539,8 @@ describe('Task Runner', () => { }, state: { bar: false, - start: '1969-12-31T00:00:00.000Z', - duration: 86400000000000, + start: DATE_1969, + duration: MOCK_DURATION, }, }, }, @@ -1057,15 +552,7 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, throttle: '1d', }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); // expect(enqueueFunction).toHaveBeenCalledTimes(1); @@ -1073,7 +560,7 @@ describe('Task Runner', () => { // expect(logger.debug).toHaveBeenCalledTimes(5); expect(logger.debug).nthCalledWith( 3, - `skipping scheduling of actions for '2' in rule test:1: 'rule-name': rule is throttled` + `skipping scheduling of actions for '2' in rule test:1: '${RULE_NAME}': rule is throttled` ); } ); @@ -1108,22 +595,14 @@ describe('Task Runner', () => { mutedInstanceIds: ['2'], notifyWhen: 'onActionGroupChange', }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); expect(enqueueFunction).toHaveBeenCalledTimes(1); const logger = customTaskRunnerFactoryInitializerParams.logger; expect(logger.debug).toHaveBeenCalledTimes(5); expect(logger.debug).nthCalledWith( 3, - `skipping scheduling of actions for '2' in rule test:1: 'rule-name': rule is muted` + `skipping scheduling of actions for '2' in rule test:1: '${RULE_NAME}': rule is muted` ); } ); @@ -1153,12 +632,12 @@ describe('Task Runner', () => { alertInstances: { '1': { meta: { - lastScheduledActions: { date: '1970-01-01T00:00:00.000Z', group: 'default' }, + lastScheduledActions: { date: DATE_1970, group: 'default' }, }, state: { bar: false, - start: '1969-12-31T00:00:00.000Z', - duration: 86400000000000, + start: DATE_1969, + duration: MOCK_DURATION, }, }, }, @@ -1170,159 +649,40 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, notifyWhen: 'onActionGroupChange', }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); expect(actionsClient.ephemeralEnqueuedExecution).toHaveBeenCalledTimes(0); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(3); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 86400000000000, - "kind": "alert", - "start": "1969-12-31T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + duration: MOCK_DURATION, + start: DATE_1969, + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 0, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -1370,35 +730,19 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, notifyWhen: 'onActionGroupChange', }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; await taskRunner.run(); - expect(eventLogger.logEvent.mock.calls[3][0]).toEqual( - expect.objectContaining({ - kibana: expect.objectContaining({ - alert: expect.objectContaining({ - rule: expect.objectContaining({ - execution: expect.objectContaining({ - metrics: expect.objectContaining({ - number_of_searches: 3, - number_of_triggered_actions: 1, - es_search_duration_ms: 33, - total_search_duration_ms: 23423, - }), - }), - }), - }), - }), + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 1, + task: true, }) ); expect(enqueueFunction).toHaveBeenCalledTimes(1); @@ -1457,37 +801,22 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, notifyWhen: 'onActionGroupChange', }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; - expect(eventLogger.logEvent.mock.calls[3][0]).toEqual( - expect.objectContaining({ - kibana: expect.objectContaining({ - alert: expect.objectContaining({ - rule: expect.objectContaining({ - execution: expect.objectContaining({ - metrics: expect.objectContaining({ - number_of_searches: 3, - number_of_triggered_actions: 1, - es_search_duration_ms: 33, - total_search_duration_ms: 23423, - }), - }), - }), - }), - }), + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 1, + task: true, }) ); + expect(enqueueFunction).toHaveBeenCalledTimes(1); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } @@ -1522,15 +851,7 @@ describe('Task Runner', () => { customTaskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); await taskRunner.run(); expect( customTaskRunnerFactoryInitializerParams.actionsPlugin.getActionsClientWithRequest @@ -1553,266 +874,58 @@ describe('Task Runner', () => { ); expect(enqueueFunction).toHaveBeenCalledTimes(1); - expect((enqueueFunction as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` - Array [ - Object { - "apiKey": "MTIzOmFiYw==", - "executionId": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - "id": "1", - "params": Object { - "foo": true, - }, - "relatedSavedObjects": Array [ - Object { - "id": "1", - "namespace": undefined, - "type": "alert", - "typeId": "test", - }, - ], - "source": Object { - "source": Object { - "id": "1", - "type": "alert", - }, - "type": "SAVED_OBJECT", - }, - "spaceId": undefined, - }, - ] - `); + expect(enqueueFunction).toHaveBeenCalledWith(generateEnqueueFunctionInput()); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(5); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "new-instance", - "category": Array [ - "alerts", - ], - "duration": 0, - "kind": "alert", - "start": "1970-01-01T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' created new alert: '1'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 0, - "kind": "alert", - "start": "1970-01-01T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute-action", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - Object { - "id": "1", - "namespace": undefined, - "type": "action", - "type_id": "action", - }, - ], - }, - "message": "alert: test:1: 'rule-name' instanceId: '1' scheduled actionGroup: 'default' action: action:1", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 1, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + duration: 0, + start: DATE_1970, + action: EVENT_LOG_ACTIONS.newInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + duration: 0, + start: DATE_1970, + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.executeAction, + actionGroupId: 'default', + instanceId: '1', + savedObjects: [generateAlertSO('1'), generateActionSO('1')], + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 5, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 1, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } ); @@ -1852,7 +965,7 @@ describe('Task Runner', () => { meta: {}, state: { bar: false, - start: '1969-12-31T00:00:00.000Z', + start: DATE_1969, duration: 80000000000, }, }, @@ -1870,45 +983,22 @@ describe('Task Runner', () => { customTaskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult.state.alertInstances).toMatchInlineSnapshot(` - Object { - "1": Object { - "meta": Object { - "lastScheduledActions": Object { - "date": 1970-01-01T00:00:00.000Z, - "group": "default", - "subgroup": undefined, - }, - }, - "state": Object { - "bar": false, - "duration": 86400000000000, - "start": "1969-12-31T00:00:00.000Z", - }, - }, - } - `); + expect(runnerResult.state.alertInstances).toEqual( + generateAlertInstance({ id: 1, duration: MOCK_DURATION, start: DATE_1969 }) + ); const logger = customTaskRunnerFactoryInitializerParams.logger; expect(logger.debug).toHaveBeenCalledTimes(5); expect(logger.debug).nthCalledWith(1, 'executing rule test:1 at 1970-01-01T00:00:00.000Z'); expect(logger.debug).nthCalledWith( 2, - `rule test:1: 'rule-name' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` + `rule test:1: '${RULE_NAME}' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( 3, - `rule test:1: 'rule-name' has 1 recovered alerts: [\"2\"]` + `rule test:1: '${RULE_NAME}' has 1 recovered alerts: [\"2\"]` ); expect(logger.debug).nthCalledWith( 4, @@ -1918,311 +1008,66 @@ describe('Task Runner', () => { const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(6); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "recovered-instance", - "category": Array [ - "alerts", - ], - "duration": 64800000000000, - "end": "1970-01-01T00:00:00.000Z", - "kind": "alert", - "start": "1969-12-31T06:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' alert '2' has recovered", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 86400000000000, - "kind": "alert", - "start": "1969-12-31T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute-action", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "recovered", - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - Object { - "id": "2", - "namespace": undefined, - "type": "action", - "type_id": "action", - }, - ], - }, - "message": "alert: test:1: 'rule-name' instanceId: '2' scheduled actionGroup: 'recovered' action: action:2", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute-action", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - Object { - "id": "1", - "namespace": undefined, - "type": "action", - "type_id": "action", - }, - ], - }, - "message": "alert: test:1: 'rule-name' instanceId: '1' scheduled actionGroup: 'default' action: action:1", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 2, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.recoveredInstance, + duration: 64800000000000, + instanceId: '2', + start: '1969-12-31T06:00:00.000Z', + end: DATE_1970, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + duration: MOCK_DURATION, + start: DATE_1969, + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.executeAction, + savedObjects: [generateAlertSO('1'), generateActionSO('2')], + actionGroupId: 'recovered', + instanceId: '2', + }) + ); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 5, + generateEventLog({ + action: EVENT_LOG_ACTIONS.executeAction, + savedObjects: [generateAlertSO('1'), generateActionSO('1')], + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 6, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 2, + task: true, + }) + ); expect(enqueueFunction).toHaveBeenCalledTimes(2); - expect((enqueueFunction as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` - Array [ - Object { - "apiKey": "MTIzOmFiYw==", - "executionId": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - "id": "2", - "params": Object { - "isResolved": true, - }, - "relatedSavedObjects": Array [ - Object { - "id": "1", - "namespace": undefined, - "type": "alert", - "typeId": "test", - }, - ], - "source": Object { - "source": Object { - "id": "1", - "type": "alert", - }, - "type": "SAVED_OBJECT", - }, - "spaceId": undefined, - }, - ] - `); + expect(enqueueFunction).toHaveBeenCalledWith(generateEnqueueFunctionInput()); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } ); @@ -2273,41 +1118,18 @@ describe('Task Runner', () => { customTaskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: alertId, - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult.state.alertInstances).toMatchInlineSnapshot(` - Object { - "1": Object { - "meta": Object { - "lastScheduledActions": Object { - "date": 1970-01-01T00:00:00.000Z, - "group": "default", - "subgroup": undefined, - }, - }, - "state": Object { - "bar": false, - }, - }, - } - `); + expect(runnerResult.state.alertInstances).toEqual(generateAlertInstance()); const logger = customTaskRunnerFactoryInitializerParams.logger; expect(logger.debug).toHaveBeenCalledWith( - `rule test:${alertId}: 'rule-name' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` + `rule test:${alertId}: '${RULE_NAME}' has 1 active alerts: [{\"instanceId\":\"1\",\"actionGroup\":\"default\"}]` ); expect(logger.debug).nthCalledWith( 3, - `rule test:${alertId}: 'rule-name' has 1 recovered alerts: [\"2\"]` + `rule test:${alertId}: '${RULE_NAME}' has 1 recovered alerts: [\"2\"]` ); expect(logger.debug).nthCalledWith( 4, @@ -2393,64 +1215,14 @@ describe('Task Runner', () => { }, ], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult.state.alertInstances).toMatchInlineSnapshot(` - Object { - "1": Object { - "meta": Object { - "lastScheduledActions": Object { - "date": 1970-01-01T00:00:00.000Z, - "group": "default", - "subgroup": undefined, - }, - }, - "state": Object { - "bar": false, - }, - }, - } - `); + expect(runnerResult.state.alertInstances).toEqual(generateAlertInstance()); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(6); expect(enqueueFunction).toHaveBeenCalledTimes(2); - expect((enqueueFunction as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` - Array [ - Object { - "apiKey": "MTIzOmFiYw==", - "executionId": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - "id": "2", - "params": Object { - "isResolved": true, - }, - "relatedSavedObjects": Array [ - Object { - "id": "1", - "namespace": undefined, - "type": "alert", - "typeId": "test", - }, - ], - "source": Object { - "source": Object { - "id": "1", - "type": "alert", - }, - "type": "SAVED_OBJECT", - }, - "spaceId": undefined, - }, - ] - `); + expect(enqueueFunction).toHaveBeenCalledWith(generateEnqueueFunctionInput()); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } ); @@ -2481,7 +1253,7 @@ describe('Task Runner', () => { meta: { lastScheduledActions: { group: 'default', date } }, state: { bar: false, - start: '1969-12-31T00:00:00.000Z', + start: DATE_1969, duration: 80000000000, }, }, @@ -2499,222 +1271,56 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult.state.alertInstances).toMatchInlineSnapshot(` - Object { - "1": Object { - "meta": Object { - "lastScheduledActions": Object { - "date": 1970-01-01T00:00:00.000Z, - "group": "default", - "subgroup": undefined, - }, - }, - "state": Object { - "bar": false, - "duration": 86400000000000, - "start": "1969-12-31T00:00:00.000Z", - }, - }, - } - `); + expect(runnerResult.state.alertInstances).toEqual( + generateAlertInstance({ id: 1, duration: MOCK_DURATION, start: DATE_1969 }) + ); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(4); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "recovered-instance", - "category": Array [ - "alerts", - ], - "duration": 64800000000000, - "end": "1970-01-01T00:00:00.000Z", - "kind": "alert", - "start": "1969-12-31T06:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' alert '2' has recovered", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 86400000000000, - "kind": "alert", - "start": "1969-12-31T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); - expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); - }); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.recoveredInstance, + actionGroupId: 'default', + duration: 64800000000000, + instanceId: '2', + start: '1969-12-31T06:00:00.000Z', + end: DATE_1970, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + duration: MOCK_DURATION, + start: DATE_1969, + instanceId: '1', + }) + ); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 0, + task: true, + }) + ); + expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); + }); test('validates params before executing the alert type', async () => { const taskRunner = new TaskRunner( @@ -2736,37 +1342,9 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0 })); expect(taskRunnerFactoryInitializerParams.logger.error).toHaveBeenCalledWith( `Executing Rule foo:test:1 has resulted in Error: params invalid: [param1]: expected value of type [string] but got [undefined]` ); @@ -2780,15 +1358,7 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); await taskRunner.run(); expect(taskRunnerFactoryInitializerParams.getRulesClientWithRequest).toHaveBeenCalledWith( @@ -2816,12 +1386,8 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - enabled: true, - }, - references: [], + ...SAVED_OBJECT, + attributes: { enabled: true }, }); await taskRunner.run(); @@ -2853,42 +1419,12 @@ describe('Task Runner', () => { ...mockedRuleTypeSavedObject, schedule: { interval: '30s' }, }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 1, - }, - "history": Array [ - Object { - "success": true, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "30s", - }, - "state": Object { - "alertInstances": Object {}, - "alertTypeState": undefined, - "previousStartedAt": 1970-01-01T00:00:00.000Z, - }, - } - `); + expect(runnerResult).toEqual( + generateRunnerResult({ state: true, interval: '30s', history: [true] }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -2903,7 +1439,7 @@ describe('Task Runner', () => { AlertInstanceContext, string >) => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); } ); @@ -2914,141 +1450,37 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); - + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0 })); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "error": Object { - "message": "OMG", - }, - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "failure", - "reason": "execute", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "error", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution failure: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'failure', + reason: 'execute', + task: true, + status: 'error', + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); test('recovers gracefully when the Alert Task Runner throws an exception when fetching the encrypted attributes', async () => { encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockImplementation(() => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); }); const taskRunner = new TaskRunner( @@ -3061,129 +1493,34 @@ describe('Task Runner', () => { const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0 })); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "error": Object { - "message": "OMG", - }, - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "failure", - "reason": "decrypt", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "error", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "test:1: execution failed", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'failure', + task: true, + reason: 'decrypt', + status: 'error', + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); test('recovers gracefully when the Alert Task Runner throws an exception when license is higher than supported', async () => { ruleTypeRegistry.ensureRuleTypeEnabled.mockImplementation(() => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); }); const taskRunner = new TaskRunner( @@ -3193,141 +1530,38 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0 })); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "error": Object { - "message": "OMG", - }, - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "failure", - "reason": "license", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "error", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "test:1: execution failed", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'failure', + task: true, + reason: 'license', + status: 'error', + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); test('recovers gracefully when the Alert Task Runner throws an exception when getting internal Services', async () => { taskRunnerFactoryInitializerParams.getRulesClientWithRequest.mockImplementation(() => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); }); const taskRunner = new TaskRunner( @@ -3337,141 +1571,31 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0 })); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "error": Object { - "message": "OMG", - }, - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "failure", - "reason": "unknown", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "error", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "test:1: execution failed", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'failure', + task: true, + reason: 'unknown', + status: 'error', + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); test('recovers gracefully when the Alert Task Runner throws an exception when fetching attributes', async () => { rulesClient.get.mockImplementation(() => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); }); const taskRunner = new TaskRunner( @@ -3480,141 +1604,31 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0 })); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "error": Object { - "message": "OMG", - }, - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "failure", - "reason": "read", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "error", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "test:1: execution failed", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'failure', + task: true, + reason: 'read', + status: 'error', + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); test('recovers gracefully when the Runner of a legacy Alert task which has no schedule throws an exception when fetching attributes', async () => { rulesClient.get.mockImplementation(() => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); }); // legacy alerts used to run by returning a new `runAt` instead of using a schedule @@ -3627,45 +1641,17 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "5m", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0, interval: '5m' })); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); test(`doesn't change previousStartedAt when it fails to run`, async () => { const originalAlertSate = { - previousStartedAt: '1970-01-05T00:00:00.000Z', + previousStartedAt: DATE_1970, }; ruleType.executor.mockImplementation( @@ -3678,7 +1664,7 @@ describe('Task Runner', () => { AlertInstanceContext, string >) => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); } ); @@ -3692,15 +1678,7 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); @@ -3727,19 +1705,11 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const logger = taskRunnerFactoryInitializerParams.logger; return taskRunner.run().catch((ex) => { - expect(ex).toMatchInlineSnapshot(`[Error: Saved object [alert/1] not found]`); + expect(ex.toString()).toEqual(`Error: Saved object [alert/1] not found`); expect(logger.debug).toHaveBeenCalledWith( `Executing Rule foo:test:1 has resulted in Error: Saved object [alert/1] not found` ); @@ -3764,15 +1734,7 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); expect(runnerResult.schedule!.interval).toEqual(mockedTaskInstance.schedule!.interval); @@ -3794,15 +1756,7 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); @@ -3826,19 +1780,11 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const logger = taskRunnerFactoryInitializerParams.logger; return taskRunner.run().catch((ex) => { - expect(ex).toMatchInlineSnapshot(`[Error: Saved object [alert/1] not found]`); + expect(ex.toString()).toEqual(`Error: Saved object [alert/1] not found`); expect(logger.debug).toHaveBeenCalledWith( `Executing Rule test space:test:1 has resulted in Error: Saved object [alert/1] not found` ); @@ -3884,287 +1830,70 @@ describe('Task Runner', () => { notifyWhen: 'onActionGroupChange', actions: [], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(6); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "new-instance", - "category": Array [ - "alerts", - ], - "duration": 0, - "kind": "alert", - "start": "1970-01-01T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' created new alert: '1'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "new-instance", - "category": Array [ - "alerts", - ], - "duration": 0, - "kind": "alert", - "start": "1970-01-01T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' created new alert: '2'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 0, - "kind": "alert", - "start": "1970-01-01T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 0, - "kind": "alert", - "start": "1970-01-01T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '2' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + duration: 0, + start: DATE_1970, + action: EVENT_LOG_ACTIONS.newInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + duration: 0, + start: DATE_1970, + action: EVENT_LOG_ACTIONS.newInstance, + actionGroupId: 'default', + instanceId: '2', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + duration: 0, + start: DATE_1970, + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 5, + generateEventLog({ + duration: 0, + start: DATE_1970, + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '2', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 6, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 0, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -4196,7 +1925,7 @@ describe('Task Runner', () => { meta: {}, state: { bar: false, - start: '1969-12-31T00:00:00.000Z', + start: DATE_1969, duration: 80000000000, }, }, @@ -4218,201 +1947,51 @@ describe('Task Runner', () => { notifyWhen: 'onActionGroupChange', actions: [], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(4); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 86400000000000, - "kind": "alert", - "start": "1969-12-31T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "duration": 64800000000000, - "kind": "alert", - "start": "1969-12-31T06:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '2' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + duration: MOCK_DURATION, + start: DATE_1969, + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + duration: 64800000000000, + start: '1969-12-31T06:00:00.000Z', + instanceId: '2', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 0, + task: true, + }) + ); + expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -4458,197 +2037,45 @@ describe('Task Runner', () => { notifyWhen: 'onActionGroupChange', actions: [], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(4); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '1' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "active-instance", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "action_group_id": "default", - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' active alert: '2' in actionGroup: 'default'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "active", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.activeInstance, + actionGroupId: 'default', + instanceId: '2', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'active', + numberOfTriggeredActions: 0, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -4667,7 +2094,7 @@ describe('Task Runner', () => { meta: {}, state: { bar: false, - start: '1969-12-31T00:00:00.000Z', + start: DATE_1969, duration: 80000000000, }, }, @@ -4689,201 +2116,50 @@ describe('Task Runner', () => { notifyWhen: 'onActionGroupChange', actions: [], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(4); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "recovered-instance", - "category": Array [ - "alerts", - ], - "duration": 86400000000000, - "end": "1970-01-01T00:00:00.000Z", - "kind": "alert", - "start": "1969-12-31T00:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' alert '1' has recovered", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "recovered-instance", - "category": Array [ - "alerts", - ], - "duration": 64800000000000, - "end": "1970-01-01T00:00:00.000Z", - "kind": "alert", - "start": "1969-12-31T06:00:00.000Z", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' alert '2' has recovered", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "ok", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.recoveredInstance, + duration: MOCK_DURATION, + start: DATE_1969, + end: DATE_1970, + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.recoveredInstance, + duration: 64800000000000, + start: '1969-12-31T06:00:00.000Z', + end: DATE_1970, + instanceId: '2', + }) + ); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'ok', + numberOfTriggeredActions: 0, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -4926,195 +2202,44 @@ describe('Task Runner', () => { notifyWhen: 'onActionGroupChange', actions: [], }); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(4); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls).toMatchInlineSnapshot(` - Array [ - Array [ - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "recovered-instance", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "instance_id": "1", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' alert '1' has recovered", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "recovered-instance", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "instance_id": "2", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - }, - "message": "test:1: 'rule-name' alert '2' has recovered", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - Array [ - Object { - "event": Object { - "action": "execute", - "category": Array [ - "alerts", - ], - "kind": "alert", - "outcome": "success", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "metrics": Object { - "es_search_duration_ms": 33, - "number_of_searches": 3, - "number_of_triggered_actions": 0, - "total_search_duration_ms": 23423, - }, - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "alerting": Object { - "status": "ok", - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule executed: test:1: 'rule-name'", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "name": "rule-name", - "ruleset": "alerts", - }, - }, - ], - ] - `); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + action: EVENT_LOG_ACTIONS.recoveredInstance, + instanceId: '1', + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 3, + generateEventLog({ + action: EVENT_LOG_ACTIONS.recoveredInstance, + instanceId: '2', + }) + ); + + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 4, + generateEventLog({ + action: EVENT_LOG_ACTIONS.execute, + outcome: 'success', + status: 'ok', + numberOfTriggeredActions: 0, + task: true, + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -5134,65 +2259,25 @@ describe('Task Runner', () => { } ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 1, - }, - "history": Array [ - Object { - "success": true, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object { - "alertInstances": Object {}, - "alertTypeState": undefined, - "previousStartedAt": 1970-01-01T00:00:00.000Z, - }, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ state: true, history: [true] })); expect(ruleType.executor).toHaveBeenCalledTimes(1); const call = ruleType.executor.mock.calls[0][0]; - expect(call.params).toMatchInlineSnapshot(` - Object { - "bar": true, - } - `); - expect(call.startedAt).toMatchInlineSnapshot(`1970-01-01T00:00:00.000Z`); - expect(call.previousStartedAt).toMatchInlineSnapshot(`1969-12-31T23:55:00.000Z`); - expect(call.state).toMatchInlineSnapshot(`Object {}`); - expect(call.name).toBe('rule-name'); + expect(call.params).toEqual({ bar: true }); + expect(call.startedAt).toEqual(new Date(DATE_1970)); + expect(call.previousStartedAt).toEqual(new Date(DATE_1970_5_MIN)); + expect(call.state).toEqual({}); + expect(call.name).toBe(RULE_NAME); expect(call.tags).toEqual(['rule-', '-tags']); expect(call.createdBy).toBe('rule-creator'); expect(call.updatedBy).toBe('rule-updater'); expect(call.rule).not.toBe(null); - expect(call.rule.name).toBe('rule-name'); + expect(call.rule.name).toBe(RULE_NAME); expect(call.rule.tags).toEqual(['rule-', '-tags']); expect(call.rule.consumer).toBe('bar'); expect(call.rule.enabled).toBe(true); - expect(call.rule.schedule).toMatchInlineSnapshot(` - Object { - "interval": "10s", - } - `); + expect(call.rule.schedule).toEqual({ interval: '10s' }); expect(call.rule.createdBy).toBe('rule-creator'); expect(call.rule.updatedBy).toBe('rule-updater'); expect(call.rule.createdAt).toBe(mockDate); @@ -5202,26 +2287,7 @@ describe('Task Runner', () => { expect(call.rule.producer).toBe('alerts'); expect(call.rule.ruleTypeId).toBe('test'); expect(call.rule.ruleTypeName).toBe('My test rule'); - expect(call.rule.actions).toMatchInlineSnapshot(` - Array [ - Object { - "actionTypeId": "action", - "group": "default", - "id": "1", - "params": Object { - "foo": true, - }, - }, - Object { - "actionTypeId": "action", - "group": "recovered", - "id": "2", - "params": Object { - "isResolved": true, - }, - }, - ] - `); + expect(call.rule.actions).toEqual(RULE_ACTIONS); expect(call.services.alertFactory.create).toBeTruthy(); expect(call.services.scopedClusterClient).toBeTruthy(); expect(call.services).toBeTruthy(); @@ -5237,75 +2303,16 @@ describe('Task Runner', () => { const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); expect(eventLogger.startTiming).toHaveBeenCalledTimes(1); - expect(eventLogger.logEvent.mock.calls[0][0]).toMatchInlineSnapshot(` - Object { - "event": Object { - "action": "execute-start", - "category": Array [ - "alerts", - ], - "kind": "alert", - }, - "kibana": Object { - "alert": Object { - "rule": Object { - "execution": Object { - "uuid": "5f6aa57d-3e22-484e-bae8-cbed868f4d28", - }, - }, - }, - "saved_objects": Array [ - Object { - "id": "1", - "namespace": undefined, - "rel": "primary", - "type": "alert", - "type_id": "test", - }, - ], - "task": Object { - "schedule_delay": 0, - "scheduled": "1970-01-01T00:00:00.000Z", - }, - }, - "message": "rule execution start: \\"1\\"", - "rule": Object { - "category": "test", - "id": "1", - "license": "basic", - "ruleset": "alerts", - }, - } - `); - + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); expect( taskRunnerFactoryInitializerParams.internalSavedObjectsRepository.update - ).toHaveBeenCalledWith( - 'alert', - '1', - { - monitoring: { - execution: { - calculated_metrics: { - success_ratio: 1, - }, - history: [ - { - success: true, - timestamp: 0, - }, - ], - }, - }, - executionStatus: { - error: null, - lastDuration: 0, - lastExecutionDate: '1970-01-01T00:00:00.000Z', - status: 'ok', - }, - }, - { refresh: false, namespace: undefined } - ); + ).toHaveBeenCalledWith(...SAVED_OBJECT_UPDATE_PARAMS); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -5324,13 +2331,8 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: false, - }, - references: [], + ...SAVED_OBJECT, + attributes: { ...SAVED_OBJECT.attributes, enabled: false }, }); const runnerResult = await taskRunner.run(); expect(runnerResult.state.previousStartedAt?.toISOString()).toBe(state.previousStartedAt); @@ -5338,69 +2340,24 @@ describe('Task Runner', () => { const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; expect(eventLogger.logEvent).toHaveBeenCalledTimes(2); - expect(eventLogger.logEvent.mock.calls[0][0]).toStrictEqual({ - event: { - action: 'execute-start', - kind: 'alert', - category: ['alerts'], - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - saved_objects: [ - { rel: 'primary', type: 'alert', id: '1', namespace: undefined, type_id: 'test' }, - ], - task: { scheduled: '1970-01-01T00:00:00.000Z', schedule_delay: 0 }, - }, - rule: { - id: '1', - license: 'basic', - category: 'test', - ruleset: 'alerts', - }, - message: 'rule execution start: "1"', - }); - expect(eventLogger.logEvent.mock.calls[1][0]).toStrictEqual({ - event: { - action: 'execute', - kind: 'alert', - category: ['alerts'], - reason: 'disabled', + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 1, + generateEventLog({ + task: true, + action: EVENT_LOG_ACTIONS.executeStart, + }) + ); + expect(eventLogger.logEvent).toHaveBeenNthCalledWith( + 2, + generateEventLog({ + errorMessage: 'Rule failed to execute because rule ran after it was disabled.', + action: EVENT_LOG_ACTIONS.execute, outcome: 'failure', - }, - kibana: { - alert: { - rule: { - execution: { - uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - }, - }, - }, - saved_objects: [ - { rel: 'primary', type: 'alert', id: '1', namespace: undefined, type_id: 'test' }, - ], - task: { - scheduled: '1970-01-01T00:00:00.000Z', - schedule_delay: 0, - }, - alerting: { status: 'error' }, - }, - rule: { - id: '1', - license: 'basic', - category: 'test', - ruleset: 'alerts', - }, - error: { - message: 'Rule failed to execute because rule ran after it was disabled.', - }, - message: 'test:1: execution failed', - }); + task: true, + reason: 'disabled', + status: 'error', + }) + ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); }); @@ -5412,41 +2369,9 @@ describe('Task Runner', () => { ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 1, - }, - "history": Array [ - Object { - "success": true, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object { - "alertInstances": Object {}, - "alertTypeState": undefined, - "previousStartedAt": 1970-01-01T00:00:00.000Z, - }, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ state: true, history: [true] })); }); test('successfully stores failure runs', async () => { @@ -5456,15 +2381,7 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); ruleType.executor.mockImplementation( async ({ services: executorServices, @@ -5475,31 +2392,11 @@ describe('Task Runner', () => { AlertInstanceContext, string >) => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); } ); const runnerResult = await taskRunner.run(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0, - }, - "history": Array [ - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual(generateRunnerResult({ successRatio: 0, success: false })); }); test('successfully stores the success ratio', async () => { @@ -5509,15 +2406,7 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); await taskRunner.run(); await taskRunner.run(); await taskRunner.run(); @@ -5532,44 +2421,14 @@ describe('Task Runner', () => { AlertInstanceContext, string >) => { - throw new Error('OMG'); + throw new Error(GENERIC_ERROR_MESSAGE); } ); const runnerResult = await taskRunner.run(); ruleType.executor.mockClear(); - expect(runnerResult).toMatchInlineSnapshot(` - Object { - "monitoring": Object { - "execution": Object { - "calculated_metrics": Object { - "success_ratio": 0.75, - }, - "history": Array [ - Object { - "success": true, - "timestamp": 0, - }, - Object { - "success": true, - "timestamp": 0, - }, - Object { - "success": true, - "timestamp": 0, - }, - Object { - "success": false, - "timestamp": 0, - }, - ], - }, - }, - "schedule": Object { - "interval": "10s", - }, - "state": Object {}, - } - `); + expect(runnerResult).toEqual( + generateRunnerResult({ successRatio: 0.75, history: [true, true, true, false] }) + ); }); test('caps monitoring history at 200', async () => { @@ -5579,15 +2438,7 @@ describe('Task Runner', () => { taskRunnerFactoryInitializerParams ); rulesClient.get.mockResolvedValue(mockedRuleTypeSavedObject); - encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ - id: '1', - type: 'alert', - attributes: { - apiKey: Buffer.from('123:abc').toString('base64'), - enabled: true, - }, - references: [], - }); + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue(SAVED_OBJECT); for (let i = 0; i < 300; i++) { await taskRunner.run(); diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index c5651dcf4f57b..dbc7749a0fbdf 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -5,7 +5,7 @@ * 2.0. */ import apm from 'elastic-apm-node'; -import { Dictionary, pickBy, mapValues, without, cloneDeep, concat, set, omit } from 'lodash'; +import { pickBy, mapValues, without, cloneDeep, concat, set, omit } from 'lodash'; import type { Request } from '@hapi/hapi'; import { UsageCounter } from 'src/plugins/usage_collection/server'; import uuid from 'uuid'; @@ -38,16 +38,16 @@ import { RawRuleExecutionStatus, AlertAction, RuleExecutionState, + RuleExecutionRunResult, } from '../types'; import { promiseResult, map, Resultable, asOk, asErr, resolveErr } from '../lib/result_type'; import { getExecutionSuccessRatio, getExecutionDurationPercentiles } from '../lib/monitoring'; import { taskInstanceToAlertTaskInstance } from './alert_task_instance'; import { EVENT_LOG_ACTIONS } from '../plugin'; -import { IEvent, IEventLogger, SAVED_OBJECT_REL_PRIMARY } from '../../../event_log/server'; +import { IEvent, SAVED_OBJECT_REL_PRIMARY } from '../../../event_log/server'; import { isAlertSavedObjectNotFoundError, isEsUnavailableError } from '../lib/is_alerting_error'; import { partiallyUpdateAlert } from '../saved_objects'; import { - ActionGroup, AlertTypeParams, AlertTypeState, AlertInstanceState, @@ -65,6 +65,14 @@ import { import { createAbortableEsClientFactory } from '../lib/create_abortable_es_client_factory'; import { createWrappedScopedClusterClientFactory } from '../lib'; import { getRecoveredAlerts } from '../lib'; +import { + GenerateNewAndRecoveredAlertEventsParams, + LogActiveAndRecoveredAlertsParams, + RuleTaskInstance, + RuleTaskRunResult, + ScheduleActionsForRecoveredAlertsParams, + TrackAlertDurationsParams, +} from './types'; const FALLBACK_RETRY_INTERVAL = '5m'; const CONNECTIVITY_RETRY_INTERVAL = '5m'; @@ -81,22 +89,6 @@ export const getDefaultRuleMonitoring = (): RuleMonitoring => ({ }, }); -interface RuleExecutionRunResult { - state: RuleExecutionState; - monitoring: RuleMonitoring | undefined; - schedule: IntervalSchedule | undefined; -} - -interface RuleTaskRunResult { - state: RuleTaskState; - monitoring: RuleMonitoring | undefined; - schedule: IntervalSchedule | undefined; -} - -interface RuleTaskInstance extends ConcreteTaskInstance { - state: RuleTaskState; -} - export class TaskRunner< Params extends AlertTypeParams, ExtractedParams extends AlertTypeParams, @@ -940,15 +932,6 @@ export class TaskRunner< } } -interface TrackAlertDurationsParams< - InstanceState extends AlertInstanceState, - InstanceContext extends AlertInstanceContext -> { - originalAlerts: Dictionary>; - currentAlerts: Dictionary>; - recoveredAlerts: Dictionary>; -} - function trackAlertDurations< InstanceState extends AlertInstanceState, InstanceContext extends AlertInstanceContext @@ -995,34 +978,6 @@ function trackAlertDurations< } } -interface GenerateNewAndRecoveredAlertEventsParams< - InstanceState extends AlertInstanceState, - InstanceContext extends AlertInstanceContext -> { - eventLogger: IEventLogger; - executionId: string; - originalAlerts: Dictionary>; - currentAlerts: Dictionary>; - recoveredAlerts: Dictionary>; - ruleId: string; - ruleLabel: string; - namespace: string | undefined; - ruleType: NormalizedRuleType< - AlertTypeParams, - AlertTypeParams, - AlertTypeState, - { - [x: string]: unknown; - }, - { - [x: string]: unknown; - }, - string, - string - >; - rule: SanitizedAlert; -} - function generateNewAndRecoveredAlertEvents< InstanceState extends AlertInstanceState, InstanceContext extends AlertInstanceContext @@ -1144,19 +1099,6 @@ function generateNewAndRecoveredAlertEvents< } } -interface ScheduleActionsForRecoveredAlertsParams< - InstanceState extends AlertInstanceState, - InstanceContext extends AlertInstanceContext, - RecoveryActionGroupId extends string -> { - logger: Logger; - recoveryActionGroup: ActionGroup; - recoveredAlerts: Dictionary>; - executionHandler: ExecutionHandler; - mutedAlertIdsSet: Set; - ruleLabel: string; -} - async function scheduleActionsForRecoveredAlerts< InstanceState extends AlertInstanceState, InstanceContext extends AlertInstanceContext, @@ -1200,19 +1142,6 @@ async function scheduleActionsForRecoveredAlerts< return triggeredActions; } -interface LogActiveAndRecoveredAlertsParams< - InstanceState extends AlertInstanceState, - InstanceContext extends AlertInstanceContext, - ActionGroupIds extends string, - RecoveryActionGroupId extends string -> { - logger: Logger; - activeAlerts: Dictionary>; - recoveredAlerts: Dictionary>; - ruleLabel: string; - canSetRecoveryContext: boolean; -} - function logActiveAndRecoveredAlerts< InstanceState extends AlertInstanceState, InstanceContext extends AlertInstanceContext, diff --git a/x-pack/plugins/alerting/server/task_runner/types.ts b/x-pack/plugins/alerting/server/task_runner/types.ts new file mode 100644 index 0000000000000..c14ccfbef3220 --- /dev/null +++ b/x-pack/plugins/alerting/server/task_runner/types.ts @@ -0,0 +1,105 @@ +/* + * 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 { Dictionary } from 'lodash'; +import { Logger } from 'kibana/server'; +import { + ActionGroup, + AlertInstanceContext, + AlertInstanceState, + AlertTypeParams, + AlertTypeState, + IntervalSchedule, + RuleExecutionState, + RuleMonitoring, + RuleTaskState, + SanitizedAlert, +} from '../../common'; +import { ConcreteTaskInstance } from '../../../task_manager/server'; +import { Alert as CreatedAlert } from '../alert'; +import { IEventLogger } from '../../../event_log/server'; +import { NormalizedRuleType } from '../rule_type_registry'; +import { ExecutionHandler } from './create_execution_handler'; + +export interface RuleTaskRunResultWithActions { + state: RuleExecutionState; + monitoring: RuleMonitoring | undefined; + schedule: IntervalSchedule | undefined; +} + +export interface RuleTaskRunResult { + state: RuleTaskState; + monitoring: RuleMonitoring | undefined; + schedule: IntervalSchedule | undefined; +} + +export interface RuleTaskInstance extends ConcreteTaskInstance { + state: RuleTaskState; +} + +export interface TrackAlertDurationsParams< + InstanceState extends AlertInstanceState, + InstanceContext extends AlertInstanceContext +> { + originalAlerts: Dictionary>; + currentAlerts: Dictionary>; + recoveredAlerts: Dictionary>; +} + +export interface GenerateNewAndRecoveredAlertEventsParams< + InstanceState extends AlertInstanceState, + InstanceContext extends AlertInstanceContext +> { + eventLogger: IEventLogger; + executionId: string; + originalAlerts: Dictionary>; + currentAlerts: Dictionary>; + recoveredAlerts: Dictionary>; + ruleId: string; + ruleLabel: string; + namespace: string | undefined; + ruleType: NormalizedRuleType< + AlertTypeParams, + AlertTypeParams, + AlertTypeState, + { + [x: string]: unknown; + }, + { + [x: string]: unknown; + }, + string, + string + >; + rule: SanitizedAlert; +} + +export interface ScheduleActionsForRecoveredAlertsParams< + InstanceState extends AlertInstanceState, + InstanceContext extends AlertInstanceContext, + RecoveryActionGroupId extends string +> { + logger: Logger; + recoveryActionGroup: ActionGroup; + recoveredAlerts: Dictionary>; + executionHandler: ExecutionHandler; + mutedAlertIdsSet: Set; + ruleLabel: string; +} + +export interface LogActiveAndRecoveredAlertsParams< + InstanceState extends AlertInstanceState, + InstanceContext extends AlertInstanceContext, + ActionGroupIds extends string, + RecoveryActionGroupId extends string +> { + logger: Logger; + activeAlerts: Dictionary>; + recoveredAlerts: Dictionary>; + ruleLabel: string; + canSetRecoveryContext: boolean; +} diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index b2818c670f037..95c1a07e241b2 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -170,7 +170,6 @@ export interface RuleType< }; isExportable: boolean; defaultScheduleInterval?: string; - minimumScheduleInterval?: string; ruleTaskTimeout?: string; cancelAlertsOnRuleTimeout?: boolean; doesSetRecoveryContext?: boolean; diff --git a/x-pack/plugins/apm/common/apm_saved_object_constants.ts b/x-pack/plugins/apm/common/apm_saved_object_constants.ts index 7d9e571242afe..17c5a802a440a 100644 --- a/x-pack/plugins/apm/common/apm_saved_object_constants.ts +++ b/x-pack/plugins/apm/common/apm_saved_object_constants.ts @@ -8,9 +8,9 @@ // the types have to match the names of the saved object mappings // in /x-pack/plugins/apm/mappings.json -// APM indices -export const APM_INDICES_SAVED_OBJECT_TYPE = 'apm-indices'; -export const APM_INDICES_SAVED_OBJECT_ID = 'apm-indices'; +// APM index settings +export const APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE = 'apm-indices'; +export const APM_INDEX_SETTINGS_SAVED_OBJECT_ID = 'apm-indices'; // APM telemetry export const APM_TELEMETRY_SAVED_OBJECT_TYPE = 'apm-telemetry'; diff --git a/x-pack/plugins/apm/common/fleet.ts b/x-pack/plugins/apm/common/fleet.ts index 367528f79b222..183192e6bd1da 100644 --- a/x-pack/plugins/apm/common/fleet.ts +++ b/x-pack/plugins/apm/common/fleet.ts @@ -8,7 +8,7 @@ import semverParse from 'semver/functions/parse'; export const POLICY_ELASTIC_AGENT_ON_CLOUD = 'policy-elastic-agent-on-cloud'; -export const SUPPORTED_APM_PACKAGE_VERSION = '8.0.0'; +export const SUPPORTED_APM_PACKAGE_VERSION = '8.1.0'; export function isPrereleaseVersion(version: string) { return semverParse(version)?.prerelease?.length ?? 0 > 0; diff --git a/x-pack/plugins/apm/dev_docs/vscode_setup.md b/x-pack/plugins/apm/dev_docs/vscode_setup.md index c7adad4fd0942..9be3a53b52176 100644 --- a/x-pack/plugins/apm/dev_docs/vscode_setup.md +++ b/x-pack/plugins/apm/dev_docs/vscode_setup.md @@ -31,7 +31,10 @@ To make the [VSCode debugger](https://vscode.readthedocs.io/en/latest/editor/deb "type": "node", "name": "vscode-jest-tests", "request": "launch", - "args": ["--runInBand"], + "args": [ + "--runInBand", + "--config=${workspaceFolder}/jest.config.js" + ], "cwd": "${workspaceFolder}", "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts b/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts index a6d2454de99fd..b51874f951c0e 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts @@ -34,7 +34,11 @@ export function opbeans({ from, to }: { from: number; to: number }) { .timestamp(timestamp) .duration(1000) .success() - .errors(opbeansJava.error('[MockError] Foo').timestamp(timestamp)) + .errors( + opbeansJava + .error('[MockError] Foo', `Exception`) + .timestamp(timestamp) + ) .children( opbeansJava .span('SELECT * FROM product', 'db', 'postgresql') diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/errors_table.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/errors_table.spec.ts index 9ea6ef028b805..efeeec72941a2 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/errors_table.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/errors_table.spec.ts @@ -48,6 +48,21 @@ describe('Errors table', () => { cy.url().should('include', '/opbeans-java/errors'); }); + it('clicking on type adds a filter in the kuerybar and navigates to errors page', () => { + cy.visit(serviceOverviewHref); + cy.get('[data-test-subj="headerFilterKuerybar"]') + .invoke('val') + .should('be.empty'); + // `force: true` because Cypress says the element is 0x0 + cy.contains('Exception').click({ + force: true, + }); + cy.get('[data-test-subj="headerFilterKuerybar"]') + .its('length') + .should('be.gt', 0); + cy.get('table').find('td:contains("Exception")').should('have.length', 1); + }); + it('navigates to error detail page', () => { cy.visit(serviceOverviewHref); cy.contains('a', '[MockError] Foo').click(); diff --git a/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx b/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx index 36f96f901f1ff..84a5eeccd3228 100644 --- a/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx @@ -55,7 +55,7 @@ export function AlertingFlyout(props: Props) { services.triggersActionsUi.getAddAlertFlyout({ consumer: APM_SERVER_FEATURE_ID, onClose: onCloseAddFlyout, - alertTypeId: alertType, + ruleTypeId: alertType, canChangeTrigger: false, initialValues, metadata: { diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx index 3d6a9af707955..c61a37fa86e5e 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx @@ -21,7 +21,11 @@ const stories: Meta = { decorators: [ (StoryComponent) => { return ( - + diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx index cd991b0f128c5..7a54a633e7f15 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx @@ -13,15 +13,14 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useMemo } from 'react'; +import { useApmParams } from '../../../../hooks/use_apm_params'; import { asInteger } from '../../../../../common/utils/formatters'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; -import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { truncate, unit } from '../../../../utils/style'; import { ErrorDetailLink } from '../../../shared/links/apm/error_detail_link'; import { ErrorOverviewLink } from '../../../shared/links/apm/error_overview_link'; -import { APMQueryParams } from '../../../shared/links/url_helpers'; import { ITableColumn, ManagedTable } from '../../../shared/managed_table'; import { TimestampTooltip } from '../../../shared/timestamp_tooltip'; import { SparkPlot } from '../../../shared/charts/spark_plot'; @@ -70,7 +69,7 @@ function ErrorGroupList({ detailedStatistics, comparisonEnabled, }: Props) { - const { urlParams } = useLegacyUrlParams(); + const { query } = useApmParams('/services/{serviceName}/errors'); const columns = useMemo(() => { return [ @@ -119,12 +118,10 @@ function ErrorGroupList({ {type} @@ -232,7 +229,7 @@ function ErrorGroupList({ }, }, ] as Array>; - }, [serviceName, urlParams, detailedStatistics, comparisonEnabled]); + }, [serviceName, query, detailedStatistics, comparisonEnabled]); return ( { - if (!hasDisplayedToast) { - hasDisplayedToast = true; - - core.notifications.toasts.addWarning({ - title: i18n.translate('xpack.apm.serviceInventory.toastTitle', { - defaultMessage: - 'Legacy data was detected within the selected time range', - }), - text: toMountPoint( -

- {i18n.translate('xpack.apm.serviceInventory.toastText', { - defaultMessage: - "You're running Elastic Stack 7.0+ and we've detected incompatible data from a previous 6.x version. If you want to view this data in APM, you should migrate it. See more in ", - })} - - - {i18n.translate( - 'xpack.apm.serviceInventory.upgradeAssistantLinkText', - { - defaultMessage: 'the upgrade assistant', - } - )} - -

- ), - }); - } - }, [upgradeAssistantHref, core.notifications.toasts]); - return { mainStatisticsData, mainStatisticsStatus, diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx index 6a3db6221e008..9370f866c5207 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx @@ -7,17 +7,26 @@ import { EuiBasicTableColumn, RIGHT_ALIGNMENT } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { TypeOf } from '@kbn/typed-react-router-config'; import React from 'react'; +import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { asInteger } from '../../../../../common/utils/formatters'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; +import { truncate } from '../../../../utils/style'; import { SparkPlot } from '../../../shared/charts/spark_plot'; import { ErrorDetailLink } from '../../../shared/links/apm/error_detail_link'; +import { ErrorOverviewLink } from '../../../shared/links/apm/error_overview_link'; import { TimestampTooltip } from '../../../shared/timestamp_tooltip'; import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; import { ChartType, getTimeSeriesColor, } from '../../../shared/charts/helper/get_timeseries_color'; +import { ApmRoutes } from '../../../routing/apm_route_config'; + +const ErrorLink = euiStyled(ErrorOverviewLink)` + ${truncate('100%')}; +`; type ErrorGroupMainStatistics = APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>; @@ -28,12 +37,37 @@ export function getColumns({ serviceName, errorGroupDetailedStatistics, comparisonEnabled, + query, }: { serviceName: string; errorGroupDetailedStatistics: ErrorGroupDetailedStatistics; comparisonEnabled?: boolean; + query: TypeOf['query']; }): Array> { return [ + { + name: i18n.translate('xpack.apm.errorsTable.typeColumnLabel', { + defaultMessage: 'Type', + }), + field: 'type', + sortable: false, + render: (_, { type }) => { + return ( + ['query'] + } + > + {type} + + ); + }, + }, { field: 'name', name: i18n.translate('xpack.apm.serviceOverview.errorsTableColumnName', { diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx index 0b7d3c32957e2..8eb5158f304c5 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx @@ -15,7 +15,6 @@ import { i18n } from '@kbn/i18n'; import { orderBy } from 'lodash'; import React, { useState } from 'react'; import uuid from 'uuid'; -import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { ErrorOverviewLink } from '../../../shared/links/apm/error_overview_link'; @@ -58,9 +57,6 @@ const INITIAL_STATE_DETAILED_STATISTICS: ErrorGroupDetailedStatistics = { }; export function ServiceOverviewErrorsTable({ serviceName }: Props) { - const { - urlParams: { comparisonType, comparisonEnabled }, - } = useLegacyUrlParams(); const [tableOptions, setTableOptions] = useState<{ pageIndex: number; sort: { @@ -72,9 +68,16 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { sort: DEFAULT_SORT, }); + const { query } = useApmParams('/services/{serviceName}/overview'); + const { - query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/{serviceName}/overview'); + environment, + kuery, + rangeFrom, + rangeTo, + comparisonType, + comparisonEnabled, + } = query; const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -177,6 +180,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { serviceName, errorGroupDetailedStatistics, comparisonEnabled, + query, }); return ( @@ -197,7 +201,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { - + {i18n.translate('xpack.apm.serviceOverview.errorsTableLinkText', { defaultMessage: 'View errors', })} diff --git a/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.test.tsx b/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.test.tsx deleted file mode 100644 index 1b19bb5860b2c..0000000000000 --- a/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.test.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { render } from '@testing-library/react'; -import React from 'react'; -import { ApmIndices } from '.'; -import * as hooks from '../../../../hooks/use_fetcher'; -import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; - -describe('ApmIndices', () => { - it('should not get stuck in infinite loop', () => { - const spy = jest.spyOn(hooks, 'useFetcher').mockReturnValue({ - data: undefined, - status: hooks.FETCH_STATUS.LOADING, - refetch: jest.fn(), - }); - const { getByText } = render( - - - - ); - - expect(getByText('Indices')).toMatchInlineSnapshot(` -

- Indices -

- `); - - expect(spy).toHaveBeenCalledTimes(2); - }); -}); diff --git a/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.tsx b/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.tsx index 1a1654e22eb19..383be90168a10 100644 --- a/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.tsx +++ b/x-pack/plugins/apm/public/components/app/settings/apm_indices/index.tsx @@ -8,6 +8,7 @@ import { EuiButton, EuiButtonEmpty, + EuiCallOut, EuiFieldText, EuiFlexGroup, EuiFlexItem, @@ -19,9 +20,12 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect, useState } from 'react'; +import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { useFetcher } from '../../../../hooks/use_fetcher'; +import { ApmPluginStartDeps } from '../../../../plugin'; import { clearCache } from '../../../../services/rest/call_api'; import { APIReturnType, @@ -93,6 +97,8 @@ const INITIAL_STATE: ApiResponse = { apmIndexSettings: [] }; export function ApmIndices() { const { core } = useApmPluginContext(); + const { services } = useKibana(); + const { notifications, application } = core; const canSave = application.capabilities.apm.save; @@ -108,6 +114,10 @@ export function ApmIndices() { [canSave] ); + const { data: space } = useFetcher(() => { + return services.spaces?.getActiveSpace(); + }, [services.spaces]); + useEffect(() => { setApmIndices( data.apmIndexSettings.reduce( @@ -191,6 +201,31 @@ export function ApmIndices() { + {space?.name && ( + <> + + + + {space?.name}, + }} + /> + + } + /> + + + + + )} + diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx index 67dfe72b133f2..863f2c6227f41 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx @@ -131,7 +131,7 @@ export function APMPolicyForm({ } ), settings: tailSamplingSettings, - isBeta: true, + isBeta: false, isPlatinumLicence: true, }, ] diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts index 509b0d13552c2..ed3cf83962df4 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts @@ -22,7 +22,6 @@ describe('apm-fleet-apm-integration', () => { expect(secretToken).toEqual({ type: 'text', key: 'secret_token', - readOnly: true, labelAppend: 'Optional', label: 'Secret token', }); @@ -34,7 +33,6 @@ describe('apm-fleet-apm-integration', () => { expect(secretToken).toEqual({ type: 'text', key: 'secret_token', - readOnly: false, labelAppend: 'Optional', label: 'Secret token', }); diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts index 3540fb97fb173..dff95bbf1702c 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts @@ -65,7 +65,6 @@ export function getAgentAuthorizationSettings({ { type: 'text', key: 'secret_token', - readOnly: isCloudPolicy, labelAppend: OPTIONAL_LABEL, label: i18n.translate( 'xpack.apm.fleet_integration.settings.agentAuthorization.secretTokenLabel', diff --git a/x-pack/plugins/apm/public/components/routing/app_root.tsx b/x-pack/plugins/apm/public/components/routing/app_root.tsx index aca6d3d737e3d..0bab92c74f1bd 100644 --- a/x-pack/plugins/apm/public/components/routing/app_root.tsx +++ b/x-pack/plugins/apm/public/components/routing/app_root.tsx @@ -36,6 +36,7 @@ import { ApmHeaderActionMenu } from '../shared/apm_header_action_menu'; import { RedirectWithDefaultDateRange } from '../shared/redirect_with_default_date_range'; import { apmRouter } from './apm_route_config'; import { TrackPageview } from './track_pageview'; +import { RedirectWithDefaultEnvironment } from '../shared/redirect_with_default_environment'; export function ApmAppRoot({ apmPluginContextValue, @@ -60,26 +61,28 @@ export function ApmAppRoot({ - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + diff --git a/x-pack/plugins/apm/public/components/shared/links/apm/error_overview_link.tsx b/x-pack/plugins/apm/public/components/shared/links/apm/error_overview_link.tsx index b517a39c1004d..bfa2067e9e7ee 100644 --- a/x-pack/plugins/apm/public/components/shared/links/apm/error_overview_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/apm/error_overview_link.tsx @@ -6,34 +6,26 @@ */ import React from 'react'; -import { pickKeys } from '../../../../../common/utils/pick_keys'; -import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; -import { APMQueryParams } from '../url_helpers'; -import { APMLink, APMLinkExtendProps } from './apm_link'; +import { EuiLink } from '@elastic/eui'; +import { TypeOf } from '@kbn/typed-react-router-config'; +import { useApmRouter } from '../../../../hooks/use_apm_router'; +import { ApmRoutes } from '../../../routing/apm_route_config'; -const persistedFilters: Array = [ - 'host', - 'containerId', - 'podName', - 'serviceVersion', -]; - -interface Props extends APMLinkExtendProps { +interface Props { + children: React.ReactNode; + title?: string; serviceName: string; - query?: APMQueryParams; + query: TypeOf['query']; } export function ErrorOverviewLink({ serviceName, query, ...rest }: Props) { - const { urlParams } = useLegacyUrlParams(); + const router = useApmRouter(); + const errorOverviewLink = router.link('/services/{serviceName}/errors', { + path: { + serviceName, + }, + query, + }); - return ( - - ); + return ; } diff --git a/x-pack/plugins/apm/public/components/shared/links/kibana.ts b/x-pack/plugins/apm/public/components/shared/links/kibana.ts index c0bdf3a98aa31..e05ccf4e6fcff 100644 --- a/x-pack/plugins/apm/public/components/shared/links/kibana.ts +++ b/x-pack/plugins/apm/public/components/shared/links/kibana.ts @@ -12,12 +12,6 @@ export function getUpgradeAssistantHref(basePath: IBasePath) { return basePath.prepend('/app/management/stack/upgrade_assistant'); } -export function useUpgradeAssistantHref() { - const { core } = useApmPluginContext(); - - return getUpgradeAssistantHref(core.http.basePath); -} - export function useFleetCloudAgentPolicyHref() { const { core: { diff --git a/x-pack/plugins/apm/public/components/shared/redirect_with_default_environment/index.test.tsx b/x-pack/plugins/apm/public/components/shared/redirect_with_default_environment/index.test.tsx new file mode 100644 index 0000000000000..469e384a06ee4 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/redirect_with_default_environment/index.test.tsx @@ -0,0 +1,119 @@ +/* + * 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 React from 'react'; +import { RouterProvider } from '@kbn/typed-react-router-config'; +import { render } from '@testing-library/react'; +import { createMemoryHistory, Location, MemoryHistory } from 'history'; +import qs from 'query-string'; +import { RedirectWithDefaultEnvironment } from './'; +import { apmRouter } from '../../routing/apm_route_config'; +import * as useApmPluginContextExports from '../../../context/apm_plugin/use_apm_plugin_context'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; + +describe('RedirectWithDefaultEnvironment', () => { + let history: MemoryHistory; + + beforeEach(() => { + history = createMemoryHistory(); + }); + + function renderUrl( + location: Pick, + defaultSetting: string + ) { + history.replace(location); + + jest + .spyOn(useApmPluginContextExports, 'useApmPluginContext') + .mockReturnValue({ + core: { + uiSettings: { + get: () => defaultSetting, + }, + }, + } as any); + + return render( + + + <>Foo + + + ); + } + + it('eventually renders the child element', async () => { + const element = renderUrl( + { + pathname: '/services', + search: location.search, + }, + '' + ); + + await expect(element.findByText('Foo')).resolves.not.toBeUndefined(); + + // assertion to make sure our element test actually works + await expect(element.findByText('Bar')).rejects.not.toBeUndefined(); + }); + + it('redirects to ENVIRONMENT_ALL if not set', async () => { + renderUrl( + { + pathname: '/services', + search: location.search, + }, + '' + ); + + expect(qs.parse(history.entries[0].search).environment).toEqual( + ENVIRONMENT_ALL.value + ); + }); + + it('redirects to the default environment if set', () => { + renderUrl( + { + pathname: '/services', + search: location.search, + }, + 'production' + ); + + expect(qs.parse(history.entries[0].search).environment).toEqual( + 'production' + ); + }); + + it('does not redirect when an environment has been set', () => { + renderUrl( + { + pathname: '/services', + search: qs.stringify({ + environment: 'development', + }), + }, + 'production' + ); + + expect(qs.parse(history.entries[0].search).environment).toEqual( + 'development' + ); + }); + + it('does not redirect for the service overview', () => { + renderUrl( + { + pathname: '/services/opbeans-java', + search: location.search, + }, + '' + ); + + expect(qs.parse(history.entries[0].search).environment).toBeUndefined(); + }); +}); diff --git a/x-pack/plugins/apm/public/components/shared/redirect_with_default_environment/index.tsx b/x-pack/plugins/apm/public/components/shared/redirect_with_default_environment/index.tsx new file mode 100644 index 0000000000000..83f93a0c6d090 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/redirect_with_default_environment/index.tsx @@ -0,0 +1,48 @@ +/* + * 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 { useLocation, Redirect } from 'react-router-dom'; +import qs from 'query-string'; +import React from 'react'; +import { defaultApmServiceEnvironment } from '../../../../../observability/common'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; + +export function RedirectWithDefaultEnvironment({ + children, +}: { + children: React.ReactElement; +}) { + const { core } = useApmPluginContext(); + const location = useLocation(); + + const query = qs.parse(location.search); + + if ('environment' in query) { + return children; + } + + if (location.pathname === '/services' || location.pathname === '/services/') { + const defaultServiceEnvironment = + core.uiSettings.get(defaultApmServiceEnvironment) || + ENVIRONMENT_ALL.value; + + return ( + + ); + } + + return children; +} diff --git a/x-pack/plugins/apm/public/components/shared/service_icons/cloud_details.tsx b/x-pack/plugins/apm/public/components/shared/service_icons/cloud_details.tsx index 91780fec15845..b5e4013d08ecb 100644 --- a/x-pack/plugins/apm/public/components/shared/service_icons/cloud_details.tsx +++ b/x-pack/plugins/apm/public/components/shared/service_icons/cloud_details.tsx @@ -5,13 +5,7 @@ * 2.0. */ -import { - EuiBadge, - EuiDescriptionList, - EuiBetaBadge, - EuiFlexGroup, - EuiFlexItem, -} from '@elastic/eui'; +import { EuiBadge, EuiDescriptionList } from '@elastic/eui'; import { EuiDescriptionListProps } from '@elastic/eui/src/components/description_list/description_list'; import { i18n } from '@kbn/i18n'; import React from 'react'; @@ -51,32 +45,7 @@ export function CloudDetails({ cloud, isServerless }: Props) { defaultMessage: 'Cloud service', } ), - description: ( - - {cloud.serviceName} - {isServerless && ( - - - - )} - - ), + description: cloud.serviceName, }); } diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index 952df64da840a..75c3c290512d8 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -53,6 +53,7 @@ import { getLazyAPMPolicyCreateExtension } from './components/fleet_integration/ import { getLazyAPMPolicyEditExtension } from './components/fleet_integration/lazy_apm_policy_edit_extension'; import { featureCatalogueEntry } from './feature_catalogue_entry'; import type { SecurityPluginStart } from '../../security/public'; +import { SpacesPluginStart } from '../../spaces/public'; export type ApmPluginSetup = ReturnType; @@ -82,6 +83,7 @@ export interface ApmPluginStartDeps { observability: ObservabilityPublicStart; fleet?: FleetStart; security?: SecurityPluginStart; + spaces?: SpacesPluginStart; } const servicesTitle = i18n.translate('xpack.apm.navigation.servicesTitle', { diff --git a/x-pack/plugins/apm/server/plugin.ts b/x-pack/plugins/apm/server/plugin.ts index e5ad2cb6c6c1f..34a09fe57a05b 100644 --- a/x-pack/plugins/apm/server/plugin.ts +++ b/x-pack/plugins/apm/server/plugin.ts @@ -48,6 +48,7 @@ import { TRANSACTION_TYPE, } from '../common/elasticsearch_fieldnames'; import { tutorialProvider } from './tutorial'; +import { migrateLegacyAPMIndicesToSpaceAware } from './saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware'; export class APMPlugin implements @@ -247,6 +248,11 @@ export class APMPlugin config: this.currentConfig, logger: this.logger, }); + + migrateLegacyAPMIndicesToSpaceAware({ + coreStart: core, + logger: this.logger, + }); } public stop() {} diff --git a/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap index 4014f2a4a2acc..00ec21b4ef3d9 100644 --- a/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap @@ -124,7 +124,7 @@ Array [ }, "terms": Object { "field": "service.name", - "size": 50, + "size": 500, }, }, }, @@ -177,7 +177,7 @@ Array [ }, "terms": Object { "field": "service.name", - "size": 50, + "size": 500, }, }, }, diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts index c158f83ff5560..716fd82aefd46 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts @@ -15,7 +15,7 @@ import { mergeServiceStats } from './merge_service_stats'; export type ServicesItemsSetup = Setup; -const MAX_NUMBER_OF_SERVICES = 50; +const MAX_NUMBER_OF_SERVICES = 500; export async function getServicesItems({ environment, diff --git a/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts b/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts index 450ce3fa18dad..7d98502ee5d93 100644 --- a/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts +++ b/x-pack/plugins/apm/server/routes/settings/apm_indices/get_apm_indices.ts @@ -7,13 +7,14 @@ import { SavedObjectsClient } from 'src/core/server'; import { - APM_INDICES_SAVED_OBJECT_TYPE, - APM_INDICES_SAVED_OBJECT_ID, + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + APM_INDEX_SETTINGS_SAVED_OBJECT_ID, } from '../../../../common/apm_saved_object_constants'; import { APMConfig } from '../../..'; import { APMRouteHandlerResources } from '../../typings'; import { withApmSpan } from '../../../utils/with_apm_span'; import { ApmIndicesConfig } from '../../../../../observability/common/typings'; +import { APMIndices } from '../../../saved_objects/apm_indices'; export type { ApmIndicesConfig }; @@ -22,13 +23,15 @@ type ISavedObjectsClient = Pick; async function getApmIndicesSavedObject( savedObjectsClient: ISavedObjectsClient ) { - const apmIndices = await withApmSpan('get_apm_indices_saved_object', () => - savedObjectsClient.get>( - APM_INDICES_SAVED_OBJECT_TYPE, - APM_INDICES_SAVED_OBJECT_ID - ) + const apmIndicesSavedObject = await withApmSpan( + 'get_apm_indices_saved_object', + () => + savedObjectsClient.get>( + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + APM_INDEX_SETTINGS_SAVED_OBJECT_ID + ) ); - return apmIndices.attributes; + return apmIndicesSavedObject.attributes.apmIndices; } export function getApmIndicesConfig(config: APMConfig): ApmIndicesConfig { @@ -90,6 +93,6 @@ export async function getApmIndexSettings({ return apmIndices.map((configurationName) => ({ configurationName, defaultValue: apmIndicesConfig[configurationName], // value defined in kibana[.dev].yml - savedValue: apmIndicesSavedObject[configurationName], // value saved via Saved Objects service + savedValue: apmIndicesSavedObject?.[configurationName], // value saved via Saved Objects service })); } diff --git a/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.test.ts b/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.test.ts index bce6857aa4ff2..0c91bccb42999 100644 --- a/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.test.ts +++ b/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.test.ts @@ -26,7 +26,10 @@ describe('saveApmIndices', () => { await saveApmIndices(savedObjectsClient, apmIndices); expect(savedObjectsClient.create).toHaveBeenCalledWith( expect.any(String), - { settingA: 'aa', settingF: 'ff', settingG: 'gg' }, + { + apmIndices: { settingA: 'aa', settingF: 'ff', settingG: 'gg' }, + isSpaceAware: true, + }, expect.any(Object) ); }); diff --git a/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.ts b/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.ts index 14a5830d8246c..2bd4273910bbf 100644 --- a/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.ts +++ b/x-pack/plugins/apm/server/routes/settings/apm_indices/save_apm_indices.ts @@ -7,9 +7,10 @@ import { SavedObjectsClientContract } from '../../../../../../../src/core/server'; import { - APM_INDICES_SAVED_OBJECT_TYPE, - APM_INDICES_SAVED_OBJECT_ID, + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + APM_INDEX_SETTINGS_SAVED_OBJECT_ID, } from '../../../../common/apm_saved_object_constants'; +import { APMIndices } from '../../../saved_objects/apm_indices'; import { withApmSpan } from '../../../utils/with_apm_span'; import { ApmIndicesConfig } from './get_apm_indices'; @@ -18,13 +19,10 @@ export function saveApmIndices( apmIndices: Partial ) { return withApmSpan('save_apm_indices', () => - savedObjectsClient.create( - APM_INDICES_SAVED_OBJECT_TYPE, - removeEmpty(apmIndices), - { - id: APM_INDICES_SAVED_OBJECT_ID, - overwrite: true, - } + savedObjectsClient.create( + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + { apmIndices: removeEmpty(apmIndices), isSpaceAware: true }, + { id: APM_INDEX_SETTINGS_SAVED_OBJECT_ID, overwrite: true } ) ); } diff --git a/x-pack/plugins/apm/server/saved_objects/apm_indices.ts b/x-pack/plugins/apm/server/saved_objects/apm_indices.ts index 4aa6c4953056a..fe6650fb356ff 100644 --- a/x-pack/plugins/apm/server/saved_objects/apm_indices.ts +++ b/x-pack/plugins/apm/server/saved_objects/apm_indices.ts @@ -8,23 +8,27 @@ import { SavedObjectsType } from 'src/core/server'; import { i18n } from '@kbn/i18n'; import { updateApmOssIndexPaths } from './migrations/update_apm_oss_index_paths'; -import { ApmIndicesConfigName } from '..'; -const properties: { [Property in ApmIndicesConfigName]: { type: 'keyword' } } = - { - sourcemap: { type: 'keyword' }, - error: { type: 'keyword' }, - onboarding: { type: 'keyword' }, - span: { type: 'keyword' }, - transaction: { type: 'keyword' }, - metric: { type: 'keyword' }, +export interface APMIndices { + apmIndices?: { + sourcemap?: string; + error?: string; + onboarding?: string; + span?: string; + transaction?: string; + metric?: string; }; + isSpaceAware?: boolean; +} export const apmIndices: SavedObjectsType = { name: 'apm-indices', hidden: false, - namespaceType: 'agnostic', - mappings: { properties }, + namespaceType: 'single', + mappings: { + dynamic: false, + properties: {}, // several fields exist, but we don't need to search or aggregate on them, so we exclude them from the mappings + }, management: { importableAndExportable: true, icon: 'apmApp', @@ -38,5 +42,9 @@ export const apmIndices: SavedObjectsType = { const attributes = updateApmOssIndexPaths(doc.attributes); return { ...doc, attributes }; }, + '8.2.0': (doc) => { + // Any future changes on this structure should be also tested on migrateLegacyAPMIndicesToSpaceAware + return { ...doc, attributes: { apmIndices: doc.attributes } }; + }, }, }; diff --git a/x-pack/plugins/apm/server/saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware.test.ts b/x-pack/plugins/apm/server/saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware.test.ts new file mode 100644 index 0000000000000..71488ab007c67 --- /dev/null +++ b/x-pack/plugins/apm/server/saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware.test.ts @@ -0,0 +1,210 @@ +/* + * 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 { CoreStart, Logger } from 'src/core/server'; +import { + APM_INDEX_SETTINGS_SAVED_OBJECT_ID, + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, +} from '../../../common/apm_saved_object_constants'; +import { migrateLegacyAPMIndicesToSpaceAware } from './migrate_legacy_apm_indices_to_space_aware'; + +const loggerMock = { + debug: jest.fn(), + warn: jest.fn(), + error: jest.fn(), +} as unknown as Logger; + +describe('migrateLegacyAPMIndicesToSpaceAware', () => { + describe('when legacy APM indices is not found', () => { + const mockBulkCreate = jest.fn(); + const mockCreate = jest.fn(); + const mockFind = jest.fn(); + const core = { + savedObjects: { + createInternalRepository: jest.fn().mockReturnValue({ + get: () => { + throw new Error('BOOM'); + }, + find: mockFind, + bulkCreate: mockBulkCreate, + create: mockCreate, + }), + }, + } as unknown as CoreStart; + + it('does not save any new saved object', () => { + migrateLegacyAPMIndicesToSpaceAware({ + coreStart: core, + logger: loggerMock, + }); + expect(mockFind).not.toHaveBeenCalled(); + expect(mockBulkCreate).not.toHaveBeenCalled(); + expect(mockCreate).not.toHaveBeenCalled(); + }); + }); + + describe('when only default space is available', () => { + const mockBulkCreate = jest.fn(); + const mockCreate = jest.fn(); + const mockSpaceFind = jest.fn().mockReturnValue({ + page: 1, + per_page: 10000, + total: 3, + saved_objects: [ + { + type: 'space', + id: 'default', + attributes: { + name: 'Default', + }, + references: [], + migrationVersion: { + space: '6.6.0', + }, + coreMigrationVersion: '8.2.0', + updated_at: '2022-02-22T14:13:28.839Z', + version: 'WzI4OSwxXQ==', + score: 0, + }, + ], + }); + const core = { + savedObjects: { + createInternalRepository: jest.fn().mockReturnValue({ + get: jest.fn().mockReturnValue({ + id: 'apm-indices', + type: 'apm-indices', + namespaces: [], + updated_at: '2022-02-22T14:17:10.584Z', + version: 'WzE1OSwxXQ==', + attributes: { + apmIndices: { + transaction: 'default-apm-*', + span: 'default-apm-*', + error: 'default-apm-*', + metric: 'default-apm-*', + sourcemap: 'default-apm-*', + onboarding: 'default-apm-*', + }, + }, + references: [], + migrationVersion: { + 'apm-indices': '7.16.0', + }, + coreMigrationVersion: '8.2.0', + }), + find: mockSpaceFind, + bulkCreate: mockBulkCreate, + create: mockCreate, + }), + }, + } as unknown as CoreStart; + it('creates new default saved object with space awareness and delete legacy', async () => { + await migrateLegacyAPMIndicesToSpaceAware({ + coreStart: core, + logger: loggerMock, + }); + expect(mockCreate).toBeCalledWith( + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + { + apmIndices: { + transaction: 'default-apm-*', + span: 'default-apm-*', + error: 'default-apm-*', + metric: 'default-apm-*', + sourcemap: 'default-apm-*', + onboarding: 'default-apm-*', + }, + isSpaceAware: true, + }, + { + id: APM_INDEX_SETTINGS_SAVED_OBJECT_ID, + overwrite: true, + } + ); + }); + }); + + describe('when multiple spaces are found', () => { + const mockBulkCreate = jest.fn(); + const mockCreate = jest.fn(); + + const savedObjects = [ + { id: 'default', name: 'Default' }, + { id: 'space-a', name: 'Space A' }, + { id: 'space-b', name: 'Space B' }, + ]; + const mockSpaceFind = jest.fn().mockReturnValue({ + page: 1, + per_page: 10000, + total: 3, + saved_objects: savedObjects.map(({ id, name }) => { + return { + type: 'space', + id, + attributes: { name }, + references: [], + migrationVersion: { space: '6.6.0' }, + coreMigrationVersion: '8.2.0', + updated_at: '2022-02-22T14:13:28.839Z', + version: 'WzI4OSwxXQ==', + score: 0, + }; + }), + }); + const attributes = { + apmIndices: { + transaction: 'space-apm-*', + span: 'space-apm-*', + error: 'space-apm-*', + metric: 'space-apm-*', + sourcemap: 'space-apm-*', + onboarding: 'space-apm-*', + }, + }; + const core = { + savedObjects: { + createInternalRepository: jest.fn().mockReturnValue({ + get: jest.fn().mockReturnValue({ + id: 'apm-indices', + type: 'apm-indices', + namespaces: [], + updated_at: '2022-02-22T14:17:10.584Z', + version: 'WzE1OSwxXQ==', + attributes, + references: [], + migrationVersion: { + 'apm-indices': '7.16.0', + }, + coreMigrationVersion: '8.2.0', + }), + find: mockSpaceFind, + bulkCreate: mockBulkCreate, + create: mockCreate, + }), + }, + } as unknown as CoreStart; + it('creates multiple saved objects with space awareness and delete legacies', async () => { + await migrateLegacyAPMIndicesToSpaceAware({ + coreStart: core, + logger: loggerMock, + }); + expect(mockCreate).toBeCalled(); + expect(mockBulkCreate).toBeCalledWith( + savedObjects + .filter(({ id }) => id !== 'default') + .map(({ id }) => { + return { + type: APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + id: APM_INDEX_SETTINGS_SAVED_OBJECT_ID, + initialNamespaces: [id], + attributes: { ...attributes, isSpaceAware: true }, + }; + }) + ); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware.ts b/x-pack/plugins/apm/server/saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware.ts new file mode 100644 index 0000000000000..3f97191a5b88a --- /dev/null +++ b/x-pack/plugins/apm/server/saved_objects/migrations/migrate_legacy_apm_indices_to_space_aware.ts @@ -0,0 +1,91 @@ +/* + * 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 { + CoreStart, + Logger, + ISavedObjectsRepository, +} from 'src/core/server'; +import { SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; +import { + APM_INDEX_SETTINGS_SAVED_OBJECT_ID, + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, +} from '../../../common/apm_saved_object_constants'; +import { ApmIndicesConfig } from '../../routes/settings/apm_indices/get_apm_indices'; +import { APMIndices } from '../apm_indices'; + +async function fetchLegacyAPMIndices(repository: ISavedObjectsRepository) { + try { + const apmIndices = await repository.get>( + APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + APM_INDEX_SETTINGS_SAVED_OBJECT_ID + ); + if (apmIndices.attributes.isSpaceAware) { + // This has already been migrated to become space-aware + return null; + } + return apmIndices; + } catch (err) { + if (SavedObjectsErrorHelpers.isNotFoundError(err)) { + // This can happen if APM is not being used + return null; + } + throw err; + } +} + +export async function migrateLegacyAPMIndicesToSpaceAware({ + coreStart, + logger, +}: { + coreStart: CoreStart; + logger: Logger; +}) { + const repository = coreStart.savedObjects.createInternalRepository(['space']); + try { + // Fetch legacy APM indices + const legacyAPMIndices = await fetchLegacyAPMIndices(repository); + + if (legacyAPMIndices === null) { + return; + } + // Fetch spaces available + const spaces = await repository.find({ + type: 'space', + page: 1, + perPage: 10_000, // max number of spaces as of 8.2 + fields: ['name'], // to avoid fetching *all* fields + }); + + const savedObjectAttributes = { + ...legacyAPMIndices.attributes, + isSpaceAware: true, + }; + + // Calls create first to update the default space setting isSpaceAware to true + await repository.create< + Partial + >(APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, savedObjectAttributes, { + id: APM_INDEX_SETTINGS_SAVED_OBJECT_ID, + overwrite: true, + }); + + // Create new APM indices space aware for all spaces available + await repository.bulkCreate>( + spaces.saved_objects + // Skip default space since it was already updated + .filter(({ id: spaceId }) => spaceId !== 'default') + .map(({ id: spaceId }) => ({ + id: APM_INDEX_SETTINGS_SAVED_OBJECT_ID, + type: APM_INDEX_SETTINGS_SAVED_OBJECT_TYPE, + initialNamespaces: [spaceId], + attributes: savedObjectAttributes, + })) + ); + } catch (e) { + logger.error('Failed to migrate legacy APM indices object: ' + e.message); + } +} diff --git a/x-pack/plugins/canvas/i18n/functions/dict/alter_column.ts b/x-pack/plugins/canvas/i18n/functions/dict/alter_column.ts index 25975410ef8bc..795a70abb981a 100644 --- a/x-pack/plugins/canvas/i18n/functions/dict/alter_column.ts +++ b/x-pack/plugins/canvas/i18n/functions/dict/alter_column.ts @@ -15,7 +15,7 @@ export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.alterColumnHelpText', { defaultMessage: 'Converts between core types, including {list}, and {end}, and renames columns. ' + - 'See also {mapColumnFn} and {staticColumnFn}.', + 'See also {mapColumnFn}, {mathColumnFn}, and {staticColumnFn}.', values: { list: Object.values(DATATABLE_COLUMN_TYPES) .slice(0, -1) @@ -24,6 +24,7 @@ export const help: FunctionHelp> = { end: `\`${Object.values(DATATABLE_COLUMN_TYPES).slice(-1)[0]}\``, mapColumnFn: '`mapColumn`', staticColumnFn: '`staticColumn`', + mathColumnFn: '`mathColumn`', }, }), args: { diff --git a/x-pack/plugins/canvas/i18n/functions/dict/static_column.ts b/x-pack/plugins/canvas/i18n/functions/dict/static_column.ts index 3b5a632edf993..a27c1491fc0af 100644 --- a/x-pack/plugins/canvas/i18n/functions/dict/static_column.ts +++ b/x-pack/plugins/canvas/i18n/functions/dict/static_column.ts @@ -13,10 +13,11 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.staticColumnHelpText', { defaultMessage: - 'Adds a column with the same static value in every row. See also {alterColumnFn} and {mapColumnFn}.', + 'Adds a column with the same static value in every row. See also {alterColumnFn}, {mapColumnFn}, and {mathColumnFn}', values: { alterColumnFn: '`alterColumn`', mapColumnFn: '`mapColumn`', + mathColumnFn: '`mathColumn`', }, }), args: { diff --git a/x-pack/plugins/canvas/public/components/function_reference_generator/function_examples.ts b/x-pack/plugins/canvas/public/components/function_reference_generator/function_examples.ts index 785f183b193f1..c25e163a0c210 100644 --- a/x-pack/plugins/canvas/public/components/function_reference_generator/function_examples.ts +++ b/x-pack/plugins/canvas/public/components/function_reference_generator/function_examples.ts @@ -134,6 +134,20 @@ case if={lte 50} then="green"`, help: 'This sets the color of the progress indicator and the color of the label to `"green"` if the value is less than or equal to `0.5`, `"orange"` if the value is greater than `0.5` and less than or equal to `0.75`, and `"red"` if `none` of the case conditions are met.', }, }, + clog: { + syntax: `clog`, + usage: { + expression: `kibana +| demodata +| clog +| filterrows fn={getCell "age" | gt 70} +| clog +| pointseries x="time" y="mean(price)" +| plot defaultStyle={seriesStyle lines=1 fill=1} +| render`, + help: 'This prints the `datatable` objects in the browser console before and after the `filterrows` function.', + }, + }, columns: { syntax: `columns include="@timestamp, projects, cost" columns exclude="username, country, age"`, @@ -199,6 +213,23 @@ containerStyle backgroundImage={asset id=asset-f40d2292-cf9e-4f2c-8c6f-a504a25e9 help: 'Using the `context` function allows us to pass the output, or _context_, of the previous function as a value to an argument in the next function. Here we get the formatted date string from the previous function and pass it as `content` for the markdown element.', }, }, + createTable: { + syntax: `createTable id="a" id="b" +createTable id="a" name="A" id="b" name="B" rowCount=5`, + usage: { + expression: `var_set +name="logs" value={essql "select count(*) as a from kibana_sample_data_logs"} +name="commerce" value={essql "select count(*) as b from kibana_sample_data_ecommerce"} +| createTable ids="totalA" ids="totalB" +| staticColumn name="totalA" value={var "logs" | getCell "a"} +| alterColumn column="totalA" type="number" +| staticColumn name="totalB" value={var "commerce" | getCell "b"} +| alterColumn column="totalB" type="number" +| mathColumn id="percent" name="percent" expression="totalA / totalB" +| render`, + help: 'This creates a table based on the results of two `essql` queries, joined into one table.', + }, + }, csv: { syntax: `csv "fruit, stock kiwi, 10 diff --git a/x-pack/plugins/canvas/public/components/function_reference_generator/generate_function_reference.ts b/x-pack/plugins/canvas/public/components/function_reference_generator/generate_function_reference.ts index 289704ae79539..7f7f897b4f28e 100644 --- a/x-pack/plugins/canvas/public/components/function_reference_generator/generate_function_reference.ts +++ b/x-pack/plugins/canvas/public/components/function_reference_generator/generate_function_reference.ts @@ -26,12 +26,32 @@ const fnList = [ ...browserFunctions.map((fn) => fn().name), ...serverFunctions.map((fn) => fn().name), 'asset', + 'clog', + 'createTable', + 'embeddable', 'filters', + 'font', + 'image', + 'kibana', + 'mapColumn', + 'math', + 'mathColumn', + 'metric', + 'palette', + 'pie', + 'plot', + 'progress', + 'removeFilter', + 'repeatImage', + 'revealImage', + 'selectFilter', + 'shape', 'timelion', 'to', - 'font', + 'uiSetting', 'var', 'var_set', + // ignore unsupported embeddables functions for now ].filter((fn) => !['savedSearch'].includes(fn)); diff --git a/x-pack/plugins/canvas/server/lib/essql_strategy.ts b/x-pack/plugins/canvas/server/lib/essql_strategy.ts index 0cc5c8a21121b..4e69f4831d375 100644 --- a/x-pack/plugins/canvas/server/lib/essql_strategy.ts +++ b/x-pack/plugins/canvas/server/lib/essql_strategy.ts @@ -32,11 +32,11 @@ export const essqlSearchStrategyProvider = (): ISearchStrategy< format: 'json', body: { query, - // @ts-expect-error `params` missing from `QuerySqlRequest` type params, field_multi_value_leniency: true, time_zone: timezone, fetch_size: count, + // @ts-expect-error `client_id` missing from `QuerySqlRequest` type client_id: 'canvas', filter: { bool: { diff --git a/x-pack/plugins/cases/kibana.json b/x-pack/plugins/cases/kibana.json index bf3cc0ee320bd..170ac2a96aaa8 100644 --- a/x-pack/plugins/cases/kibana.json +++ b/x-pack/plugins/cases/kibana.json @@ -11,7 +11,8 @@ "kibanaVersion":"kibana", "optionalPlugins":[ "security", - "spaces" + "spaces", + "usageCollection" ], "owner":{ "githubTeam":"response-ops", diff --git a/x-pack/plugins/cases/public/common/mock/test_providers.tsx b/x-pack/plugins/cases/public/common/mock/test_providers.tsx index 314796bdaa0ed..0bd08e348c3bd 100644 --- a/x-pack/plugins/cases/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/cases/public/common/mock/test_providers.tsx @@ -21,12 +21,14 @@ import { } from '../lib/kibana/kibana_react.mock'; import { FieldHook } from '../shared_imports'; import { StartServices } from '../../types'; +import { ReleasePhase } from '../../components/types'; -interface Props { +interface TestProviderProps { children: React.ReactNode; userCanCrud?: boolean; features?: CasesFeatures; owner?: string[]; + releasePhase?: ReleasePhase; } type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; @@ -34,11 +36,12 @@ window.scrollTo = jest.fn(); const MockKibanaContextProvider = createKibanaContextProviderMock(); /** A utility for wrapping children in the providers required to run most tests */ -const TestProvidersComponent: React.FC = ({ +const TestProvidersComponent: React.FC = ({ children, features, owner = [SECURITY_SOLUTION_OWNER], userCanCrud = true, + releasePhase = 'ga', }) => { return ( @@ -63,18 +66,17 @@ export const createAppMockRenderer = ({ features, owner = [SECURITY_SOLUTION_OWNER], userCanCrud = true, -}: { - features?: CasesFeatures; - owner?: string[]; - userCanCrud?: boolean; -} = {}): AppMockRenderer => { + releasePhase = 'ga', +}: Omit = {}): AppMockRenderer => { const services = createStartServicesMock(); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( ({ eui: euiDarkVars, darkMode: true })}> - {children} + + {children} + diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/uses_cases_add_to_existing_case_modal.test.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/uses_cases_add_to_existing_case_modal.test.tsx index 954284a670fd2..6eeff6102ae6a 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/uses_cases_add_to_existing_case_modal.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/uses_cases_add_to_existing_case_modal.test.tsx @@ -32,6 +32,7 @@ describe('use cases add to existing case modal hook', () => { basePath: '/jest', dispatch, features: { alerts: { sync: true }, metrics: [] }, + releasePhase: 'ga', }} > {children} diff --git a/x-pack/plugins/cases/public/components/cases_context/index.tsx b/x-pack/plugins/cases/public/components/cases_context/index.tsx index 1f1da31595a04..70490882d31b3 100644 --- a/x-pack/plugins/cases/public/components/cases_context/index.tsx +++ b/x-pack/plugins/cases/public/components/cases_context/index.tsx @@ -17,6 +17,7 @@ import { } from './cases_context_reducer'; import { CasesContextFeatures, CasesFeatures } from '../../containers/types'; import { CasesGlobalComponents } from './cases_global_components'; +import { ReleasePhase } from '../types'; export type CasesContextValueDispatch = Dispatch; @@ -27,12 +28,14 @@ export interface CasesContextValue { userCanCrud: boolean; basePath: string; features: CasesContextFeatures; + releasePhase: ReleasePhase; dispatch: CasesContextValueDispatch; } export interface CasesContextProps extends Pick { basePath?: string; features?: CasesFeatures; + releasePhase?: ReleasePhase; } export const CasesContext = React.createContext(undefined); @@ -44,7 +47,7 @@ export interface CasesContextStateValue extends Omit = ({ children, - value: { owner, userCanCrud, basePath = DEFAULT_BASE_PATH, features = {} }, + value: { owner, userCanCrud, basePath = DEFAULT_BASE_PATH, features = {}, releasePhase = 'ga' }, }) => { const { appId, appTitle } = useApplication(); const [state, dispatch] = useReducer(casesContextReducer, getInitialCasesContextState()); @@ -57,6 +60,7 @@ export const CasesProvider: React.FC<{ value: CasesContextProps }> = ({ * of the DEFAULT_FEATURES object */ features: merge({}, DEFAULT_FEATURES, features), + releasePhase, dispatch, })); diff --git a/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.test.tsx b/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.test.tsx index 2c3750887cb1d..103e24c4b7a65 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.test.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/use_cases_add_to_new_case_flyout.test.tsx @@ -29,6 +29,7 @@ describe('use cases add to new case flyout hook', () => { basePath: '/jest', dispatch, features: { alerts: { sync: true }, metrics: [] }, + releasePhase: 'ga', }} > {children} diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap index 86d752f84a8b3..ae50f4fd81cb6 100644 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap +++ b/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap @@ -1,27 +1,30 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`EditableTitle it renders 1`] = ` - - - - - - - - +exports[`EditableTitle renders 1`] = ` + + + + + + + + + `; diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap index 17517b1d05f19..b5175e7e8c116 100644 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap @@ -1,40 +1,34 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`HeaderPage it renders 1`] = ` -
- - - + + + - - - - -

- Test supplement -

-
-
-
+ > + +

+ Test supplement +

+
+ + + +
`; diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/title.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/title.test.tsx.snap deleted file mode 100644 index 60714d6e7bb29..0000000000000 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/title.test.tsx.snap +++ /dev/null @@ -1,35 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Title it renders 1`] = ` - -

- - - -

-
-`; - -exports[`Title it renders the title if is not a string 1`] = ` - -

- - Test title - -

-
-`; diff --git a/x-pack/plugins/cases/public/components/header_page/editable_title.test.tsx b/x-pack/plugins/cases/public/components/header_page/editable_title.test.tsx index 19aea39f1f793..9cf956c78fe72 100644 --- a/x-pack/plugins/cases/public/components/header_page/editable_title.test.tsx +++ b/x-pack/plugins/cases/public/components/header_page/editable_title.test.tsx @@ -9,7 +9,7 @@ import { shallow } from 'enzyme'; import React from 'react'; import '../../common/mock/match_media'; -import { TestProviders } from '../../common/mock'; +import { AppMockRenderer, createAppMockRenderer, TestProviders } from '../../common/mock'; import { EditableTitle, EditableTitleProps } from './editable_title'; import { useMountAppended } from '../../utils/use_mount_appended'; @@ -27,13 +27,17 @@ describe('EditableTitle', () => { jest.clearAllMocks(); }); - test('it renders', () => { - const wrapper = shallow(); + it('renders', () => { + const wrapper = shallow( + + + + ); expect(wrapper).toMatchSnapshot(); }); - test('it does not show the edit icon when the user does not have edit permissions', () => { + it('does not show the edit icon when the user does not have edit permissions', () => { const wrapper = mount( @@ -43,7 +47,7 @@ describe('EditableTitle', () => { expect(wrapper.find('[data-test-subj="editable-title-edit-icon"]').exists()).toBeFalsy(); }); - test('it shows the edit title input field', () => { + it('shows the edit title input field', () => { const wrapper = mount( @@ -58,7 +62,7 @@ describe('EditableTitle', () => { ); }); - test('it shows the submit button', () => { + it('shows the submit button', () => { const wrapper = mount( @@ -73,7 +77,7 @@ describe('EditableTitle', () => { ); }); - test('it shows the cancel button', () => { + it('shows the cancel button', () => { const wrapper = mount( @@ -88,7 +92,7 @@ describe('EditableTitle', () => { ); }); - test('it DOES NOT shows the edit icon when in edit mode', () => { + it('DOES NOT shows the edit icon when in edit mode', () => { const wrapper = mount( @@ -103,7 +107,7 @@ describe('EditableTitle', () => { ); }); - test('it switch to non edit mode when canceled', () => { + it('switch to non edit mode when canceled', () => { const wrapper = mount( @@ -117,7 +121,7 @@ describe('EditableTitle', () => { expect(wrapper.find('[data-test-subj="editable-title-edit-icon"]').first().exists()).toBe(true); }); - test('it should change the title', () => { + it('should change the title', () => { const newTitle = 'new test title'; const wrapper = mount( @@ -140,7 +144,7 @@ describe('EditableTitle', () => { ).toEqual(newTitle); }); - test('it should NOT change the title when cancel', () => { + it('should NOT change the title when cancel', () => { const title = 'Test title'; const newTitle = 'new test title'; @@ -164,7 +168,7 @@ describe('EditableTitle', () => { expect(wrapper.find('h1[data-test-subj="header-page-title"]').text()).toEqual(title); }); - test('it submits the title', () => { + it('submits the title', () => { const newTitle = 'new test title'; const wrapper = mount( @@ -188,7 +192,7 @@ describe('EditableTitle', () => { expect(wrapper.find('[data-test-subj="editable-title-edit-icon"]').first().exists()).toBe(true); }); - test('it does not submits the title when the length is longer than 64 characters', () => { + it('does not submit the title when the length is longer than 64 characters', () => { const longTitle = 'This is a title that should not be saved as it is longer than 64 characters.'; @@ -216,4 +220,36 @@ describe('EditableTitle', () => { false ); }); + + describe('Badges', () => { + let appMock: AppMockRenderer; + + beforeEach(() => { + appMock = createAppMockRenderer(); + }); + + it('does not render the badge if the release is ga', () => { + const renderResult = appMock.render(); + + expect(renderResult.getByText('Test title')).toBeInTheDocument(); + expect(renderResult.queryByText('Beta')).toBeFalsy(); + expect(renderResult.queryByText('Technical preview')).toBeFalsy(); + }); + + it('does render the beta badge', () => { + appMock = createAppMockRenderer({ releasePhase: 'beta' }); + const renderResult = appMock.render(); + + expect(renderResult.getByText('Test title')).toBeInTheDocument(); + expect(renderResult.getByText('Beta')).toBeInTheDocument(); + }); + + it('does render the experimental badge', () => { + appMock = createAppMockRenderer({ releasePhase: 'experimental' }); + const renderResult = appMock.render(); + + expect(renderResult.getByText('Test title')).toBeInTheDocument(); + expect(renderResult.getByText('Technical preview')).toBeInTheDocument(); + }); + }); }); diff --git a/x-pack/plugins/cases/public/components/header_page/editable_title.tsx b/x-pack/plugins/cases/public/components/header_page/editable_title.tsx index 674a31122d983..95e3f6f4a4bcb 100644 --- a/x-pack/plugins/cases/public/components/header_page/editable_title.tsx +++ b/x-pack/plugins/cases/public/components/header_page/editable_title.tsx @@ -22,6 +22,7 @@ import { import { MAX_TITLE_LENGTH } from '../../../common/constants'; import * as i18n from './translations'; import { Title } from './title'; +import { useCasesContext } from '../cases_context/use_cases_context'; const MyEuiButtonIcon = styled(EuiButtonIcon)` ${({ theme }) => css` @@ -48,6 +49,7 @@ const EditableTitleComponent: React.FC = ({ isLoading, title, }) => { + const { releasePhase } = useCasesContext(); const [editMode, setEditMode] = useState(false); const [errors, setErrors] = useState([]); const [newTitle, setNewTitle] = useState(title); @@ -116,22 +118,17 @@ const EditableTitleComponent: React.FC = ({
) : ( - - - - </EuiFlexItem> - <EuiFlexItem grow={false}> - {isLoading && <MySpinner data-test-subj="editable-title-loading" />} - {!isLoading && userCanCrud && ( - <MyEuiButtonIcon - aria-label={i18n.EDIT_TITLE_ARIA(title as string)} - iconType="pencil" - onClick={onClickEditIcon} - data-test-subj="editable-title-edit-icon" - /> - )} - </EuiFlexItem> - </EuiFlexGroup> + <Title title={title} releasePhase={releasePhase}> + {isLoading && <MySpinner data-test-subj="editable-title-loading" />} + {!isLoading && userCanCrud && ( + <MyEuiButtonIcon + aria-label={i18n.EDIT_TITLE_ARIA(title as string)} + iconType="pencil" + onClick={onClickEditIcon} + data-test-subj="editable-title-edit-icon" + /> + )} + ); }; EditableTitleComponent.displayName = 'EditableTitle'; diff --git a/x-pack/plugins/cases/public/components/header_page/index.test.tsx b/x-pack/plugins/cases/public/components/header_page/index.test.tsx index 4f0da554f3d1b..bd4069cd11679 100644 --- a/x-pack/plugins/cases/public/components/header_page/index.test.tsx +++ b/x-pack/plugins/cases/public/components/header_page/index.test.tsx @@ -10,7 +10,7 @@ import { shallow } from 'enzyme'; import React from 'react'; import '../../common/mock/match_media'; -import { TestProviders } from '../../common/mock'; +import { AppMockRenderer, createAppMockRenderer, TestProviders } from '../../common/mock'; import { HeaderPage } from './index'; import { useMountAppended } from '../../utils/use_mount_appended'; @@ -21,15 +21,11 @@ describe('HeaderPage', () => { test('it renders', () => { const wrapper = shallow( - -

{'Test supplement'}

-
+ + +

{'Test supplement'}

+
+
); expect(wrapper).toMatchSnapshot(); @@ -142,4 +138,36 @@ describe('HeaderPage', () => { expect(casesHeaderPage).not.toHaveStyleRule('border-bottom', euiDarkVars.euiBorderThin); expect(casesHeaderPage).not.toHaveStyleRule('padding-bottom', euiDarkVars.paddingSizes.l); }); + + describe('Badges', () => { + let appMock: AppMockRenderer; + + beforeEach(() => { + appMock = createAppMockRenderer(); + }); + + it('does not render the badge if the release is ga', () => { + const renderResult = appMock.render(); + + expect(renderResult.getByText('Test title')).toBeInTheDocument(); + expect(renderResult.queryByText('Beta')).toBeFalsy(); + expect(renderResult.queryByText('Technical preview')).toBeFalsy(); + }); + + it('does render the beta badge', () => { + appMock = createAppMockRenderer({ releasePhase: 'beta' }); + const renderResult = appMock.render(); + + expect(renderResult.getByText('Test title')).toBeInTheDocument(); + expect(renderResult.getByText('Beta')).toBeInTheDocument(); + }); + + it('does render the experimental badge', () => { + appMock = createAppMockRenderer({ releasePhase: 'experimental' }); + const renderResult = appMock.render(); + + expect(renderResult.getByText('Test title')).toBeInTheDocument(); + expect(renderResult.getByText('Technical preview')).toBeInTheDocument(); + }); + }); }); diff --git a/x-pack/plugins/cases/public/components/header_page/index.tsx b/x-pack/plugins/cases/public/components/header_page/index.tsx index 3afcd15bfa817..db0c9bb3011c7 100644 --- a/x-pack/plugins/cases/public/components/header_page/index.tsx +++ b/x-pack/plugins/cases/public/components/header_page/index.tsx @@ -6,15 +6,15 @@ */ import React, { useCallback } from 'react'; -import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiProgress } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiProgress } from '@elastic/eui'; import styled, { css } from 'styled-components'; -import { useAllCasesNavigation } from '../../common/navigation'; +import { useAllCasesNavigation } from '../../common/navigation'; import { LinkIcon } from '../link_icon'; import { Subtitle, SubtitleProps } from '../subtitle'; import { Title } from './title'; -import { BadgeOptions, TitleProp } from './types'; import * as i18n from './translations'; +import { useCasesContext } from '../cases_context/use_cases_context'; interface HeaderProps { border?: boolean; @@ -55,24 +55,17 @@ const LinkBack = styled.div.attrs({ `; LinkBack.displayName = 'LinkBack'; -const Badge = styled(EuiBadge)` - letter-spacing: 0; -` as unknown as typeof EuiBadge; -Badge.displayName = 'Badge'; - export interface HeaderPageProps extends HeaderProps { showBackButton?: boolean; - badgeOptions?: BadgeOptions; children?: React.ReactNode; subtitle?: SubtitleProps['items']; subtitle2?: SubtitleProps['items']; - title: TitleProp; + title: string | React.ReactNode; titleNode?: React.ReactElement; } const HeaderPageComponent: React.FC = ({ showBackButton = false, - badgeOptions, border, children, isLoading, @@ -80,8 +73,8 @@ const HeaderPageComponent: React.FC = ({ subtitle2, title, titleNode, - ...rest }) => { + const { releasePhase } = useCasesContext(); const { getAllCasesUrl, navigateToAllCases } = useAllCasesNavigation(); const navigateToAllCasesClick = useCallback( @@ -95,7 +88,7 @@ const HeaderPageComponent: React.FC = ({ ); return ( -
+
{showBackButton && ( @@ -111,7 +104,7 @@ const HeaderPageComponent: React.FC = ({ )} - {titleNode || } + {titleNode || <Title title={title} releasePhase={releasePhase} />} {subtitle && <Subtitle data-test-subj="header-page-subtitle" items={subtitle} />} {subtitle2 && <Subtitle data-test-subj="header-page-subtitle-2" items={subtitle2} />} diff --git a/x-pack/plugins/cases/public/components/header_page/title.test.tsx b/x-pack/plugins/cases/public/components/header_page/title.test.tsx index 063b21e4d8906..bd26b37956e65 100644 --- a/x-pack/plugins/cases/public/components/header_page/title.test.tsx +++ b/x-pack/plugins/cases/public/components/header_page/title.test.tsx @@ -5,41 +5,50 @@ * 2.0. */ -import { shallow } from 'enzyme'; import React from 'react'; +import { render, screen } from '@testing-library/react'; import '../../common/mock/match_media'; -import { TestProviders } from '../../common/mock'; import { Title } from './title'; -import { useMountAppended } from '../../utils/use_mount_appended'; describe('Title', () => { - const mount = useMountAppended(); - - test('it renders', () => { - const wrapper = shallow( - <Title - badgeOptions={{ beta: true, text: 'Beta', tooltip: 'Test tooltip' }} - title="Test title" - /> - ); + it('does not render the badge if the release is ga', () => { + render(<Title title="Test title" releasePhase="ga" />); - expect(wrapper).toMatchSnapshot(); + expect(screen.getByText('Test title')).toBeInTheDocument(); + expect(screen.queryByText('Beta')).toBeFalsy(); + expect(screen.queryByText('Technical preview')).toBeFalsy(); }); - test('it renders the title', () => { - const wrapper = mount( - <TestProviders> - <Title title="Test title" /> - </TestProviders> - ); + it('does render the beta badge', () => { + render(<Title title="Test title" releasePhase="beta" />); + + expect(screen.getByText('Test title')).toBeInTheDocument(); + expect(screen.getByText('Beta')).toBeInTheDocument(); + }); + + it('does render the experimental badge', () => { + render(<Title title="Test title" releasePhase="experimental" />); - expect(wrapper.find('[data-test-subj="header-page-title"]').first().exists()).toBe(true); + expect(screen.getByText('Test title')).toBeInTheDocument(); + expect(screen.getByText('Technical preview')).toBeInTheDocument(); }); - test('it renders the title if is not a string', () => { - const wrapper = shallow(<Title title={<span>{'Test title'}</span>} />); + it('renders the title if is not a string', () => { + render(<Title title={<span>{'Test title'}</span>} releasePhase="experimental" />); + + expect(screen.getByText('Test title')).toBeInTheDocument(); + expect(screen.getByText('Technical preview')).toBeInTheDocument(); + }); + + it('renders the children if provided', () => { + render( + <Title title="Test title" releasePhase="ga"> + <span>{'children'}</span> + + ); - expect(wrapper).toMatchSnapshot(); + expect(screen.getByText('Test title')).toBeInTheDocument(); + expect(screen.getByText('children')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/cases/public/components/header_page/title.tsx b/x-pack/plugins/cases/public/components/header_page/title.tsx index 9ccf13b8d83a9..c6d2bf97e1cf1 100644 --- a/x-pack/plugins/cases/public/components/header_page/title.tsx +++ b/x-pack/plugins/cases/public/components/header_page/title.tsx @@ -7,51 +7,54 @@ import React from 'react'; import { isString } from 'lodash'; -import { EuiBetaBadge, EuiBadge, EuiTitle } from '@elastic/eui'; -import styled from 'styled-components'; +import { EuiBetaBadge, EuiTitle, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; -import { BadgeOptions, TitleProp } from './types'; import { TruncatedText } from '../truncated_text'; +import { ReleasePhase } from '../types'; +import * as i18n from './translations'; -const StyledEuiBetaBadge = styled(EuiBetaBadge)` - vertical-align: middle; -`; +interface Props { + title: string | React.ReactNode; + releasePhase: ReleasePhase; + children?: React.ReactNode; +} -StyledEuiBetaBadge.displayName = 'StyledEuiBetaBadge'; +const ExperimentalBadge: React.FC = () => ( + +); -const Badge = styled(EuiBadge)` - letter-spacing: 0; -` as unknown as typeof EuiBadge; -Badge.displayName = 'Badge'; +ExperimentalBadge.displayName = 'ExperimentalBadge'; -interface Props { - badgeOptions?: BadgeOptions; - title: TitleProp; -} +const BetaBadge: React.FC = () => ( + +); -const TitleComponent: React.FC = ({ title, badgeOptions }) => ( - -

- {isString(title) ? : title} - {badgeOptions && ( - <> - {' '} - {badgeOptions.beta ? ( - - ) : ( - - {badgeOptions.text} - - )} - - )} -

-
+BetaBadge.displayName = 'BetaBadge'; + +const TitleComponent: React.FC = ({ title, releasePhase, children }) => ( + + + + + +

+ {isString(title) ? : title} +

+
+
+ {children} +
+
+ + {releasePhase === 'experimental' && } + {releasePhase === 'beta' && } + +
); -TitleComponent.displayName = 'Title'; +TitleComponent.displayName = 'Title'; export const Title = React.memo(TitleComponent); diff --git a/x-pack/plugins/cases/public/components/header_page/translations.ts b/x-pack/plugins/cases/public/components/header_page/translations.ts index ba987d1f45f15..358f667bba367 100644 --- a/x-pack/plugins/cases/public/components/header_page/translations.ts +++ b/x-pack/plugins/cases/public/components/header_page/translations.ts @@ -22,3 +22,21 @@ export const EDIT_TITLE_ARIA = (title: string) => values: { title }, defaultMessage: 'You can edit {title} by clicking', }); + +export const EXPERIMENTAL_LABEL = i18n.translate('xpack.cases.header.badge.experimentalLabel', { + defaultMessage: 'Technical preview', +}); + +export const EXPERIMENTAL_DESC = i18n.translate('xpack.cases.header.badge.experimentalDesc', { + defaultMessage: + 'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.', +}); + +export const BETA_LABEL = i18n.translate('xpack.cases.header.badge.betaLabel', { + defaultMessage: 'Beta', +}); + +export const BETA_DESC = i18n.translate('xpack.cases.header.badge.betaDesc', { + defaultMessage: + 'This feature is currently in beta. If you encounter any bugs or have feedback, please open an issue or visit our discussion forum.', +}); diff --git a/x-pack/plugins/cases/public/components/types.ts b/x-pack/plugins/cases/public/components/types.ts index 6d72a74fa5d81..d31c297d18b1c 100644 --- a/x-pack/plugins/cases/public/components/types.ts +++ b/x-pack/plugins/cases/public/components/types.ts @@ -6,3 +6,5 @@ */ export type { CaseActionConnector } from '../../common/ui/types'; + +export type ReleasePhase = 'experimental' | 'beta' | 'ga'; diff --git a/x-pack/plugins/cases/public/methods/get_cases.tsx b/x-pack/plugins/cases/public/methods/get_cases.tsx index 94e7d321840a8..3c1d3294d38ce 100644 --- a/x-pack/plugins/cases/public/methods/get_cases.tsx +++ b/x-pack/plugins/cases/public/methods/get_cases.tsx @@ -25,8 +25,9 @@ export const getCasesLazy = ({ refreshRef, timelineIntegration, features, + releasePhase, }: GetCasesProps) => ( - + }> { return ( }> - {children} + + {children} + ); }; diff --git a/x-pack/plugins/cases/server/client/attachments/get.ts b/x-pack/plugins/cases/server/client/attachments/get.ts index 4cd620ac5a772..6e9e924fbee30 100644 --- a/x-pack/plugins/cases/server/client/attachments/get.ts +++ b/x-pack/plugins/cases/server/client/attachments/get.ts @@ -25,7 +25,7 @@ import { getIDsAndIndicesAsArrays, } from '../../common/utils'; import { createCaseError } from '../../common/error'; -import { defaultPage, defaultPerPage } from '../../routes/api'; +import { DEFAULT_PAGE, DEFAULT_PER_PAGE } from '../../routes/api'; import { CasesClientArgs } from '../types'; import { combineFilters, stringToKueryNode } from '../utils'; import { Operations } from '../../authorization'; @@ -170,8 +170,8 @@ export async function find( // We need this because the default behavior of getAllCaseComments is to return all the comments // unless the page and/or perPage is specified. Since we're spreading the query after the request can // still override this behavior. - page: defaultPage, - perPage: defaultPerPage, + page: DEFAULT_PAGE, + perPage: DEFAULT_PER_PAGE, sortField: 'created_at', filter: combinedFilter, ...queryWithoutFilter, @@ -183,8 +183,8 @@ export async function find( unsecuredSavedObjectsClient, id, options: { - page: defaultPage, - perPage: defaultPerPage, + page: DEFAULT_PAGE, + perPage: DEFAULT_PER_PAGE, sortField: 'created_at', filter: combinedFilter, }, diff --git a/x-pack/plugins/cases/server/plugin.ts b/x-pack/plugins/cases/server/plugin.ts index 5881b7b7633be..e6c4faac93938 100644 --- a/x-pack/plugins/cases/server/plugin.ts +++ b/x-pack/plugins/cases/server/plugin.ts @@ -8,6 +8,7 @@ import { IContextProvider, KibanaRequest, Logger, PluginInitializerContext } from 'kibana/server'; import { CoreSetup, CoreStart } from 'src/core/server'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/server'; import { SecurityPluginSetup, SecurityPluginStart } from '../../security/server'; import { PluginSetupContract as ActionsPluginSetup, @@ -15,7 +16,6 @@ import { } from '../../actions/server'; import { APP_ID } from '../common/constants'; -import { initCaseApi } from './routes/api'; import { createCaseCommentSavedObjectType, caseConfigureSavedObjectType, @@ -30,11 +30,14 @@ import { CasesClientFactory } from './client/factory'; import { SpacesPluginStart } from '../../spaces/server'; import { PluginStartContract as FeaturesPluginStart } from '../../features/server'; import { LensServerPluginSetup } from '../../lens/server'; +import { registerRoutes } from './routes/api/register_routes'; +import { getExternalRoutes } from './routes/api/get_external_routes'; export interface PluginsSetup { - security?: SecurityPluginSetup; actions: ActionsPluginSetup; lens: LensServerPluginSetup; + usageCollection?: UsageCollectionSetup; + security?: SecurityPluginSetup; } export interface PluginsStart { @@ -100,10 +103,14 @@ export class CasePlugin { ); const router = core.http.createRouter(); - initCaseApi({ - logger: this.log, + const telemetryUsageCounter = plugins.usageCollection?.createUsageCounter(APP_ID); + + registerRoutes({ router, + routes: getExternalRoutes(), + logger: this.log, kibanaVersion: this.kibanaVersion, + telemetryUsageCounter, }); } diff --git a/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts index 8a490e2f68bd0..00a368e834a0a 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts @@ -6,42 +6,35 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from '@hapi/boom'; -import { RouteDeps } from '../../types'; -import { escapeHatch, wrapError } from '../../utils'; import { CasesByAlertIDRequest } from '../../../../../common/api'; import { CASE_ALERTS_URL } from '../../../../../common/constants'; +import { createCaseError } from '../../../../common/error'; +import { createCasesRoute } from '../../create_cases_route'; -export function initGetCasesByAlertIdApi({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_ALERTS_URL, - validate: { - params: schema.object({ - alert_id: schema.string(), - }), - query: escapeHatch, - }, - }, - async (context, request, response) => { - try { - const alertID = request.params.alert_id; - if (alertID == null || alertID === '') { - throw Boom.badRequest('The `alertId` is not valid'); - } - const casesClient = await context.cases.getCasesClient(); - const options = request.query as CasesByAlertIDRequest; +export const getCasesByAlertIdRoute = createCasesRoute({ + method: 'get', + path: CASE_ALERTS_URL, + params: { + params: schema.object({ + alert_id: schema.string({ minLength: 1 }), + }), + }, + handler: async ({ context, request, response }) => { + try { + const alertID = request.params.alert_id; - return response.ok({ - body: await casesClient.cases.getCasesByAlertID({ alertID, options }), - }); - } catch (error) { - logger.error( - `Failed to retrieve case ids for this alert id: ${request.params.alert_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + const casesClient = await context.cases.getCasesClient(); + const options = request.query as CasesByAlertIDRequest; + + return response.ok({ + body: await casesClient.cases.getCasesByAlertID({ alertID, options }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve case ids for this alert id: ${request.params.alert_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts index 1784a434292cc..a63d07037de01 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts @@ -7,32 +7,31 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; import { CASES_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initDeleteCasesApi({ router, logger }: RouteDeps) { - router.delete( - { - path: CASES_URL, - validate: { - query: schema.object({ - ids: schema.arrayOf(schema.string()), - }), - }, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); - await client.cases.delete(request.query.ids); +export const deleteCaseRoute = createCasesRoute({ + method: 'delete', + path: CASES_URL, + params: { + query: schema.object({ + ids: schema.arrayOf(schema.string()), + }), + }, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); + await client.cases.delete(request.query.ids); - return response.noContent(); - } catch (error) { - logger.error( - `Failed to delete cases in route ids: ${JSON.stringify(request.query.ids)}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.noContent(); + } catch (error) { + throw createCaseError({ + message: `Failed to delete cases in route ids: ${JSON.stringify( + request.query.ids + )}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts index 8474d781a202a..711c6909df46c 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts @@ -7,32 +7,25 @@ import { CasesFindRequest } from '../../../../common/api'; import { CASES_URL } from '../../../../common/constants'; -import { wrapError, escapeHatch } from '../utils'; -import { RouteDeps } from '../types'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initFindCasesApi({ router, logger }: RouteDeps) { - router.get( - { - path: `${CASES_URL}/_find`, - validate: { - query: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } - const casesClient = await context.cases.getCasesClient(); - const options = request.query as CasesFindRequest; +export const findCaseRoute = createCasesRoute({ + method: 'get', + path: `${CASES_URL}/_find`, + handler: async ({ context, request, response }) => { + try { + const casesClient = await context.cases.getCasesClient(); + const options = request.query as CasesFindRequest; - return response.ok({ - body: await casesClient.cases.find({ ...options }), - }); - } catch (error) { - logger.error(`Failed to find cases in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.cases.find({ ...options }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to find cases in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/get_case.ts b/x-pack/plugins/cases/server/routes/api/cases/get_case.ts index c8558d09e5c5f..f0e53e82f1494 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/get_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/get_case.ts @@ -7,91 +7,83 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { getWarningHeader, logDeprecatedEndpoint, wrapError } from '../utils'; +import { getWarningHeader, logDeprecatedEndpoint } from '../utils'; import { CASE_DETAILS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initGetCaseApi({ router, logger, kibanaVersion }: RouteDeps) { - router.get( - { - path: CASE_DETAILS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - query: schema.object({ - /** - * @deprecated since version 8.1.0 - */ - includeComments: schema.boolean({ defaultValue: true }), - }), - }, - }, - async (context, request, response) => { - try { - const isIncludeCommentsParamProvidedByTheUser = - request.url.searchParams.has('includeComments'); - - if (isIncludeCommentsParamProvidedByTheUser) { - logDeprecatedEndpoint( - logger, - request.headers, - `The query parameter 'includeComments' of the get case API '${CASE_DETAILS_URL}' is deprecated` - ); - } +const params = { + params: schema.object({ + case_id: schema.string(), + }), + query: schema.object({ + /** + * @deprecated since version 8.1.0 + */ + includeComments: schema.boolean({ defaultValue: true }), + }), +}; - const casesClient = await context.cases.getCasesClient(); - const id = request.params.case_id; +export const getCaseRoute = createCasesRoute({ + method: 'get', + path: CASE_DETAILS_URL, + params, + handler: async ({ context, request, response, logger, kibanaVersion }) => { + try { + const isIncludeCommentsParamProvidedByTheUser = + request.url.searchParams.has('includeComments'); - return response.ok({ - ...(isIncludeCommentsParamProvidedByTheUser && { - headers: { - ...getWarningHeader(kibanaVersion, 'Deprecated query parameter includeComments'), - }, - }), - body: await casesClient.cases.get({ - id, - includeComments: request.query.includeComments, - }), - }); - } catch (error) { - logger.error( - `Failed to retrieve case in route case id: ${request.params.case_id} \ninclude comments: ${request.query.includeComments}: ${error}` + if (isIncludeCommentsParamProvidedByTheUser) { + logDeprecatedEndpoint( + logger, + request.headers, + `The query parameter 'includeComments' of the get case API '${CASE_DETAILS_URL}' is deprecated` ); - return response.customError(wrapError(error)); } - } - ); - router.get( - { - path: `${CASE_DETAILS_URL}/resolve`, - validate: { - params: schema.object({ - case_id: schema.string(), + const casesClient = await context.cases.getCasesClient(); + const id = request.params.case_id; + + return response.ok({ + ...(isIncludeCommentsParamProvidedByTheUser && { + headers: { + ...getWarningHeader(kibanaVersion, 'Deprecated query parameter includeComments'), + }, }), - query: schema.object({ - includeComments: schema.boolean({ defaultValue: true }), + body: await casesClient.cases.get({ + id, + includeComments: request.query.includeComments, }), - }, - }, - async (context, request, response) => { - try { - const casesClient = await context.cases.getCasesClient(); - const id = request.params.case_id; + }); + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve case in route case id: ${request.params.case_id} \ninclude comments: ${request.query.includeComments}: ${error}`, + error, + }); + } + }, +}); - return response.ok({ - body: await casesClient.cases.resolve({ - id, - includeComments: request.query.includeComments, - }), - }); - } catch (error) { - logger.error( - `Failed to retrieve case in resolve route case id: ${request.params.case_id} \ninclude comments: ${request.query.includeComments}: ${error}` - ); - return response.customError(wrapError(error)); - } +export const resolveCaseRoute = createCasesRoute({ + method: 'get', + path: `${CASE_DETAILS_URL}/resolve`, + params, + handler: async ({ context, request, response }) => { + try { + const casesClient = await context.cases.getCasesClient(); + const id = request.params.case_id; + + return response.ok({ + body: await casesClient.cases.resolve({ + id, + includeComments: request.query.includeComments, + }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve case in resolve route case id: ${request.params.case_id} \ninclude comments: ${request.query.includeComments}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts index 5cde28bcb01f9..c148a45220a74 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts @@ -5,35 +5,27 @@ * 2.0. */ -import { escapeHatch, wrapError } from '../utils'; -import { RouteDeps } from '../types'; import { CasesPatchRequest } from '../../../../common/api'; import { CASES_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initPatchCasesApi({ router, logger }: RouteDeps) { - router.patch( - { - path: CASES_URL, - validate: { - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } +export const patchCaseRoute = createCasesRoute({ + method: 'patch', + path: CASES_URL, + handler: async ({ context, request, response }) => { + try { + const casesClient = await context.cases.getCasesClient(); + const cases = request.body as CasesPatchRequest; - const casesClient = await context.cases.getCasesClient(); - const cases = request.body as CasesPatchRequest; - - return response.ok({ - body: await casesClient.cases.update(cases), - }); - } catch (error) { - logger.error(`Failed to patch cases in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.cases.update(cases), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to patch cases in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/post_case.ts b/x-pack/plugins/cases/server/routes/api/cases/post_case.ts index df994f18c5bbd..226d0308a3152 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/post_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/post_case.ts @@ -5,35 +5,27 @@ * 2.0. */ -import { wrapError, escapeHatch } from '../utils'; - -import { RouteDeps } from '../types'; import { CasePostRequest } from '../../../../common/api'; import { CASES_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initPostCaseApi({ router, logger }: RouteDeps) { - router.post( - { - path: CASES_URL, - validate: { - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } - const casesClient = await context.cases.getCasesClient(); - const theCase = request.body as CasePostRequest; +export const postCaseRoute = createCasesRoute({ + method: 'post', + path: CASES_URL, + handler: async ({ context, request, response }) => { + try { + const casesClient = await context.cases.getCasesClient(); + const theCase = request.body as CasePostRequest; - return response.ok({ - body: await casesClient.cases.create({ ...theCase }), - }); - } catch (error) { - logger.error(`Failed to post case in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.cases.create({ ...theCase }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to post case in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/push_case.ts b/x-pack/plugins/cases/server/routes/api/cases/push_case.ts index 2b3e7954febfe..175838a9d313c 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/push_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/push_case.ts @@ -10,44 +10,35 @@ import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; -import { wrapError, escapeHatch } from '../utils'; - import { throwErrors, CasePushRequestParamsRt } from '../../../../common/api'; import { CASE_PUSH_URL } from '../../../../common/constants'; -import { RouteDeps } from '../types'; - -export function initPushCaseApi({ router, logger }: RouteDeps) { - router.post( - { - path: CASE_PUSH_URL, - validate: { - params: escapeHatch, - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } +import { CaseRoute } from '../types'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; - const casesClient = await context.cases.getCasesClient(); +export const pushCaseRoute: CaseRoute = createCasesRoute({ + method: 'post', + path: CASE_PUSH_URL, + handler: async ({ context, request, response }) => { + try { + const casesClient = await context.cases.getCasesClient(); - const params = pipe( - CasePushRequestParamsRt.decode(request.params), - fold(throwErrors(Boom.badRequest), identity) - ); + const params = pipe( + CasePushRequestParamsRt.decode(request.params), + fold(throwErrors(Boom.badRequest), identity) + ); - return response.ok({ - body: await casesClient.cases.push({ - caseId: params.case_id, - connectorId: params.connector_id, - }), - }); - } catch (error) { - logger.error(`Failed to push case in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.cases.push({ + caseId: params.case_id, + connectorId: params.connector_id, + }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to push case in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts b/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts index 8e0d0640263ec..ee413d73565ee 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts @@ -5,33 +5,25 @@ * 2.0. */ -import { RouteDeps } from '../../types'; -import { wrapError, escapeHatch } from '../../utils'; import { AllReportersFindRequest } from '../../../../../common/api'; import { CASE_REPORTERS_URL } from '../../../../../common/constants'; +import { createCaseError } from '../../../../common/error'; +import { createCasesRoute } from '../../create_cases_route'; -export function initGetReportersApi({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_REPORTERS_URL, - validate: { - query: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } +export const getReportersRoute = createCasesRoute({ + method: 'get', + path: CASE_REPORTERS_URL, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); + const options = request.query as AllReportersFindRequest; - const client = await context.cases.getCasesClient(); - const options = request.query as AllReportersFindRequest; - - return response.ok({ body: await client.cases.getReporters({ ...options }) }); - } catch (error) { - logger.error(`Failed to get reporters in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ body: await client.cases.getReporters({ ...options }) }); + } catch (error) { + throw createCaseError({ + message: `Failed to find cases in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts b/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts index 2afa96be95bc1..7dfa948aa623c 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts @@ -5,33 +5,25 @@ * 2.0. */ -import { RouteDeps } from '../../types'; -import { wrapError, escapeHatch } from '../../utils'; import { AllTagsFindRequest } from '../../../../../common/api'; import { CASE_TAGS_URL } from '../../../../../common/constants'; +import { createCaseError } from '../../../../common/error'; +import { createCasesRoute } from '../../create_cases_route'; -export function initGetTagsApi({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_TAGS_URL, - validate: { - query: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } +export const getTagsRoute = createCasesRoute({ + method: 'get', + path: CASE_TAGS_URL, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); + const options = request.query as AllTagsFindRequest; - const client = await context.cases.getCasesClient(); - const options = request.query as AllTagsFindRequest; - - return response.ok({ body: await client.cases.getTags({ ...options }) }); - } catch (error) { - logger.error(`Failed to retrieve tags in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ body: await client.cases.getTags({ ...options }) }); + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve tags in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts b/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts index d79f90ac43935..0a1ebd3b66a74 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts @@ -6,35 +6,32 @@ */ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; import { CASE_COMMENTS_URL } from '../../../../common/constants'; +import { createCasesRoute } from '../create_cases_route'; +import { createCaseError } from '../../../common/error'; -export function initDeleteAllCommentsApi({ router, logger }: RouteDeps) { - router.delete( - { - path: CASE_COMMENTS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - }, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); +export const deleteAllCommentsRoute = createCasesRoute({ + method: 'delete', + path: CASE_COMMENTS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + }), + }, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); - await client.attachments.deleteAll({ - caseID: request.params.case_id, - }); + await client.attachments.deleteAll({ + caseID: request.params.case_id, + }); - return response.noContent(); - } catch (error) { - logger.error( - `Failed to delete all comments in route case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.noContent(); + } catch (error) { + throw createCaseError({ + message: `Failed to delete all comments in route case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts index b27be46d7220d..220fbffc76cc0 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts @@ -7,36 +7,33 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; import { CASE_COMMENT_DETAILS_URL } from '../../../../common/constants'; +import { createCasesRoute } from '../create_cases_route'; +import { createCaseError } from '../../../common/error'; -export function initDeleteCommentApi({ router, logger }: RouteDeps) { - router.delete( - { - path: CASE_COMMENT_DETAILS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - comment_id: schema.string(), - }), - }, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); - await client.attachments.delete({ - attachmentID: request.params.comment_id, - caseID: request.params.case_id, - }); +export const deleteCommentRoute = createCasesRoute({ + method: 'delete', + path: CASE_COMMENT_DETAILS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + comment_id: schema.string(), + }), + }, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); + await client.attachments.delete({ + attachmentID: request.params.comment_id, + caseID: request.params.case_id, + }); - return response.noContent(); - } catch (error) { - logger.error( - `Failed to delete comment in route case id: ${request.params.case_id} comment id: ${request.params.comment_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.noContent(); + } catch (error) { + throw createCaseError({ + message: `Failed to delete comment in route case id: ${request.params.case_id} comment id: ${request.params.comment_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts b/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts index d4c65e6306a63..14c6090d62ea1 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts @@ -14,40 +14,36 @@ import { identity } from 'fp-ts/lib/function'; import { FindQueryParamsRt, throwErrors, excess } from '../../../../common/api'; import { CASE_COMMENTS_URL } from '../../../../common/constants'; -import { RouteDeps } from '../types'; -import { escapeHatch, wrapError } from '../utils'; +import { createCasesRoute } from '../create_cases_route'; +import { createCaseError } from '../../../common/error'; -export function initFindCaseCommentsApi({ router, logger }: RouteDeps) { - router.get( - { - path: `${CASE_COMMENTS_URL}/_find`, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - query: escapeHatch, - }, - }, - async (context, request, response) => { - try { - const query = pipe( - excess(FindQueryParamsRt).decode(request.query), - fold(throwErrors(Boom.badRequest), identity) - ); +export const findCommentsRoute = createCasesRoute({ + method: 'get', + path: `${CASE_COMMENTS_URL}/_find`, + params: { + params: schema.object({ + case_id: schema.string(), + }), + }, + handler: async ({ context, request, response }) => { + try { + const query = pipe( + excess(FindQueryParamsRt).decode(request.query), + fold(throwErrors(Boom.badRequest), identity) + ); - const client = await context.cases.getCasesClient(); - return response.ok({ - body: await client.attachments.find({ - caseID: request.params.case_id, - queryParams: query, - }), - }); - } catch (error) { - logger.error( - `Failed to find comments in route case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + const client = await context.cases.getCasesClient(); + return response.ok({ + body: await client.attachments.find({ + caseID: request.params.case_id, + queryParams: query, + }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to find comments in route case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts b/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts index 9c0bfac4d9c6e..4fa793059ed63 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts @@ -7,35 +7,32 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; import { CASE_DETAILS_ALERTS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initGetAllAlertsAttachToCaseApi({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_DETAILS_ALERTS_URL, - validate: { - params: schema.object({ - case_id: schema.string({ minLength: 1 }), - }), - }, - }, - async (context, request, response) => { - try { - const caseId = request.params.case_id; +export const getAllAlertsAttachedToCaseRoute = createCasesRoute({ + method: 'get', + path: CASE_DETAILS_ALERTS_URL, + params: { + params: schema.object({ + case_id: schema.string({ minLength: 1 }), + }), + }, + handler: async ({ context, request, response }) => { + try { + const caseId = request.params.case_id; - const casesClient = await context.cases.getCasesClient(); + const casesClient = await context.cases.getCasesClient(); - return response.ok({ - body: await casesClient.attachments.getAllAlertsAttachToCase({ caseId }), - }); - } catch (error) { - logger.error( - `Failed to retrieve alert ids for this case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.attachments.getAllAlertsAttachToCase({ caseId }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve alert ids for this case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts index e94b19cdd9a1c..44f8f59550fb3 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts @@ -7,47 +7,36 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError, getWarningHeader, logDeprecatedEndpoint } from '../utils'; import { CASE_COMMENTS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; /** * @deprecated since version 8.1.0 */ -export function initGetAllCommentsApi({ router, logger, kibanaVersion }: RouteDeps) { - router.get( - { - path: CASE_COMMENTS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - }, - }, - async (context, request, response) => { - try { - logDeprecatedEndpoint( - logger, - request.headers, - `The get all cases comments API '${CASE_COMMENTS_URL}' is deprecated.` - ); - - const client = await context.cases.getCasesClient(); +export const getAllCommentsRoute = createCasesRoute({ + method: 'get', + path: CASE_COMMENTS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + }), + }, + options: { deprecated: true }, + handler: async ({ context, request, response, logger, kibanaVersion }) => { + try { + const client = await context.cases.getCasesClient(); - return response.ok({ - headers: { - ...getWarningHeader(kibanaVersion), - }, - body: await client.attachments.getAll({ - caseID: request.params.case_id, - }), - }); - } catch (error) { - logger.error( - `Failed to get all comments in route case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await client.attachments.getAll({ + caseID: request.params.case_id, + }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to get all comments in route case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts index 09805c00cb10a..91adf832f1ea6 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts @@ -7,37 +7,34 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; import { CASE_COMMENT_DETAILS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initGetCommentApi({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_COMMENT_DETAILS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - comment_id: schema.string(), - }), - }, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); +export const getCommentRoute = createCasesRoute({ + method: 'get', + path: CASE_COMMENT_DETAILS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + comment_id: schema.string(), + }), + }, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); - return response.ok({ - body: await client.attachments.get({ - attachmentID: request.params.comment_id, - caseID: request.params.case_id, - }), - }); - } catch (error) { - logger.error( - `Failed to get comment in route case id: ${request.params.case_id} comment id: ${request.params.comment_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await client.attachments.get({ + attachmentID: request.params.comment_id, + caseID: request.params.case_id, + }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to get comment in route case id: ${request.params.case_id} comment id: ${request.params.comment_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts index 5f9d885178404..ebc17daa25611 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts @@ -11,43 +11,39 @@ import { identity } from 'fp-ts/lib/function'; import { schema } from '@kbn/config-schema'; import Boom from '@hapi/boom'; -import { RouteDeps } from '../types'; -import { escapeHatch, wrapError } from '../utils'; import { CommentPatchRequestRt, throwErrors } from '../../../../common/api'; import { CASE_COMMENTS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initPatchCommentApi({ router, logger }: RouteDeps) { - router.patch( - { - path: CASE_COMMENTS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - const query = pipe( - CommentPatchRequestRt.decode(request.body), - fold(throwErrors(Boom.badRequest), identity) - ); +export const patchCommentRoute = createCasesRoute({ + method: 'patch', + path: CASE_COMMENTS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + }), + }, + handler: async ({ context, request, response }) => { + try { + const query = pipe( + CommentPatchRequestRt.decode(request.body), + fold(throwErrors(Boom.badRequest), identity) + ); - const client = await context.cases.getCasesClient(); + const client = await context.cases.getCasesClient(); - return response.ok({ - body: await client.attachments.update({ - caseID: request.params.case_id, - updateRequest: query, - }), - }); - } catch (error) { - logger.error( - `Failed to patch comment in route case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await client.attachments.update({ + caseID: request.params.case_id, + updateRequest: query, + }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to patch comment in route case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts index ed9c917008417..1ececb3653741 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts @@ -6,41 +6,33 @@ */ import { schema } from '@kbn/config-schema'; -import { escapeHatch, wrapError } from '../utils'; -import { RouteDeps } from '../types'; import { CASE_COMMENTS_URL } from '../../../../common/constants'; import { CommentRequest } from '../../../../common/api'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initPostCommentApi({ router, logger }: RouteDeps) { - router.post( - { - path: CASE_COMMENTS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } +export const postCommentRoute = createCasesRoute({ + method: 'post', + path: CASE_COMMENTS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + }), + }, + handler: async ({ context, request, response }) => { + try { + const casesClient = await context.cases.getCasesClient(); + const caseId = request.params.case_id; + const comment = request.body as CommentRequest; - const casesClient = await context.cases.getCasesClient(); - const caseId = request.params.case_id; - const comment = request.body as CommentRequest; - - return response.ok({ - body: await casesClient.attachments.add({ caseId, comment }), - }); - } catch (error) { - logger.error( - `Failed to post comment in route case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.attachments.add({ caseId, comment }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to post comment in route case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts index 8222ac8fe5690..8dabf7862fc88 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts @@ -5,31 +5,27 @@ * 2.0. */ -import { RouteDeps } from '../types'; -import { escapeHatch, wrapError } from '../utils'; import { CASE_CONFIGURE_URL } from '../../../../common/constants'; import { GetConfigureFindRequest } from '../../../../common/api'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initGetCaseConfigure({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_CONFIGURE_URL, - validate: { - query: escapeHatch, - }, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); - const options = request.query as GetConfigureFindRequest; +export const getCaseConfigureRoute = createCasesRoute({ + method: 'get', + path: CASE_CONFIGURE_URL, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); + const options = request.query as GetConfigureFindRequest; - return response.ok({ - body: await client.configure.get({ ...options }), - }); - } catch (error) { - logger.error(`Failed to get case configure in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await client.configure.get({ ...options }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to get case configure in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts b/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts index 46c110bbb8ba5..da99cd19065d6 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts @@ -5,29 +5,26 @@ * 2.0. */ -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; - import { CASE_CONFIGURE_CONNECTORS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; /* * Be aware that this api will only return 20 connectors */ -export function initCaseConfigureGetActionConnector({ router, logger }: RouteDeps) { - router.get( - { - path: `${CASE_CONFIGURE_CONNECTORS_URL}/_find`, - validate: false, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); +export const getConnectorsRoute = createCasesRoute({ + method: 'get', + path: `${CASE_CONFIGURE_CONNECTORS_URL}/_find`, + handler: async ({ context, response }) => { + try { + const client = await context.cases.getCasesClient(); - return response.ok({ body: await client.configure.getConnectors() }); - } catch (error) { - logger.error(`Failed to get connectors in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ body: await client.configure.getConnectors() }); + } catch (error) { + throw createCaseError({ + message: `Failed to get connectors in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts index e856a568f387a..40b0d5123f429 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts @@ -17,35 +17,30 @@ import { excess, } from '../../../../common/api'; import { CASE_CONFIGURE_DETAILS_URL } from '../../../../common/constants'; -import { RouteDeps } from '../types'; -import { wrapError, escapeHatch } from '../utils'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initPatchCaseConfigure({ router, logger }: RouteDeps) { - router.patch( - { - path: CASE_CONFIGURE_DETAILS_URL, - validate: { - params: escapeHatch, - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - const params = pipe( - excess(CaseConfigureRequestParamsRt).decode(request.params), - fold(throwErrors(Boom.badRequest), identity) - ); +export const patchCaseConfigureRoute = createCasesRoute({ + method: 'patch', + path: CASE_CONFIGURE_DETAILS_URL, + handler: async ({ context, request, response }) => { + try { + const params = pipe( + excess(CaseConfigureRequestParamsRt).decode(request.params), + fold(throwErrors(Boom.badRequest), identity) + ); - const client = await context.cases.getCasesClient(); - const configuration = request.body as CasesConfigurePatch; + const client = await context.cases.getCasesClient(); + const configuration = request.body as CasesConfigurePatch; - return response.ok({ - body: await client.configure.update(params.configuration_id, configuration), - }); - } catch (error) { - logger.error(`Failed to get patch configure in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await client.configure.update(params.configuration_id, configuration), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to patch configure in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts index ed4c3529f2ca0..bb64175fb52ad 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts @@ -12,33 +12,29 @@ import { identity } from 'fp-ts/lib/function'; import { CasesConfigureRequestRt, throwErrors } from '../../../../common/api'; import { CASE_CONFIGURE_URL } from '../../../../common/constants'; -import { RouteDeps } from '../types'; -import { wrapError, escapeHatch } from '../utils'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initPostCaseConfigure({ router, logger }: RouteDeps) { - router.post( - { - path: CASE_CONFIGURE_URL, - validate: { - body: escapeHatch, - }, - }, - async (context, request, response) => { - try { - const query = pipe( - CasesConfigureRequestRt.decode(request.body), - fold(throwErrors(Boom.badRequest), identity) - ); +export const postCaseConfigureRoute = createCasesRoute({ + method: 'post', + path: CASE_CONFIGURE_URL, + handler: async ({ context, request, response }) => { + try { + const query = pipe( + CasesConfigureRequestRt.decode(request.body), + fold(throwErrors(Boom.badRequest), identity) + ); - const client = await context.cases.getCasesClient(); + const client = await context.cases.getCasesClient(); - return response.ok({ - body: await client.configure.create(query), - }); - } catch (error) { - logger.error(`Failed to post case configure in route: ${error}`); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await client.configure.create(query), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to post case configure in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/create_cases_route.ts b/x-pack/plugins/cases/server/routes/api/create_cases_route.ts new file mode 100644 index 0000000000000..eb6a1079440a0 --- /dev/null +++ b/x-pack/plugins/cases/server/routes/api/create_cases_route.ts @@ -0,0 +1,10 @@ +/* + * 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 { CaseRoute } from './types'; + +export const createCasesRoute = (route: CaseRoute) => route; diff --git a/x-pack/plugins/cases/server/routes/api/get_external_routes.ts b/x-pack/plugins/cases/server/routes/api/get_external_routes.ts new file mode 100644 index 0000000000000..7908e4eb84359 --- /dev/null +++ b/x-pack/plugins/cases/server/routes/api/get_external_routes.ts @@ -0,0 +1,61 @@ +/* + * 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 { getCasesByAlertIdRoute } from './cases/alerts/get_cases'; +import { deleteCaseRoute } from './cases/delete_cases'; +import { findCaseRoute } from './cases/find_cases'; +import { getCaseRoute, resolveCaseRoute } from './cases/get_case'; +import { patchCaseRoute } from './cases/patch_cases'; +import { postCaseRoute } from './cases/post_case'; +import { pushCaseRoute } from './cases/push_case'; +import { getReportersRoute } from './cases/reporters/get_reporters'; +import { getStatusRoute } from './stats/get_status'; +import { getUserActionsRoute } from './user_actions/get_all_user_actions'; +import { CaseRoute } from './types'; +import { getTagsRoute } from './cases/tags/get_tags'; +import { deleteAllCommentsRoute } from './comments/delete_all_comments'; +import { deleteCommentRoute } from './comments/delete_comment'; +import { findCommentsRoute } from './comments/find_comments'; +import { getCommentRoute } from './comments/get_comment'; +import { getAllCommentsRoute } from './comments/get_all_comment'; +import { patchCommentRoute } from './comments/patch_comment'; +import { postCommentRoute } from './comments/post_comment'; +import { getCaseConfigureRoute } from './configure/get_configure'; +import { getConnectorsRoute } from './configure/get_connectors'; +import { patchCaseConfigureRoute } from './configure/patch_configure'; +import { postCaseConfigureRoute } from './configure/post_configure'; +import { getAllAlertsAttachedToCaseRoute } from './comments/get_alerts'; +import { getCaseMetricRoute } from './metrics/get_case_metrics'; + +export const getExternalRoutes = () => + [ + deleteCaseRoute, + findCaseRoute, + getCaseRoute, + resolveCaseRoute, + patchCaseRoute, + postCaseRoute, + pushCaseRoute, + getUserActionsRoute, + getStatusRoute, + getCasesByAlertIdRoute, + getReportersRoute, + getTagsRoute, + deleteCommentRoute, + deleteAllCommentsRoute, + findCommentsRoute, + getCommentRoute, + getAllCommentsRoute, + patchCommentRoute, + postCommentRoute, + getCaseConfigureRoute, + getConnectorsRoute, + patchCaseConfigureRoute, + postCaseConfigureRoute, + getAllAlertsAttachedToCaseRoute, + getCaseMetricRoute, + ] as CaseRoute[]; diff --git a/x-pack/plugins/cases/server/routes/api/index.ts b/x-pack/plugins/cases/server/routes/api/index.ts index 8298f7469f236..31eafe0f29d28 100644 --- a/x-pack/plugins/cases/server/routes/api/index.ts +++ b/x-pack/plugins/cases/server/routes/api/index.ts @@ -5,76 +5,11 @@ * 2.0. */ -import { initDeleteCasesApi } from './cases/delete_cases'; -import { initFindCasesApi } from '././cases/find_cases'; -import { initGetCaseApi } from './cases/get_case'; -import { initPatchCasesApi } from './cases/patch_cases'; -import { initPostCaseApi } from './cases/post_case'; -import { initPushCaseApi } from './cases/push_case'; -import { initGetReportersApi } from './cases/reporters/get_reporters'; -import { initGetCasesStatusApi } from './stats/get_status'; -import { initGetTagsApi } from './cases/tags/get_tags'; -import { initGetAllCaseUserActionsApi } from './user_actions/get_all_user_actions'; - -import { initDeleteCommentApi } from './comments/delete_comment'; -import { initDeleteAllCommentsApi } from './comments/delete_all_comments'; -import { initFindCaseCommentsApi } from './comments/find_comments'; -import { initGetAllCommentsApi } from './comments/get_all_comment'; -import { initGetCommentApi } from './comments/get_comment'; -import { initPatchCommentApi } from './comments/patch_comment'; -import { initPostCommentApi } from './comments/post_comment'; - -import { initCaseConfigureGetActionConnector } from './configure/get_connectors'; -import { initGetCaseConfigure } from './configure/get_configure'; -import { initPatchCaseConfigure } from './configure/patch_configure'; -import { initPostCaseConfigure } from './configure/post_configure'; - -import { RouteDeps } from './types'; -import { initGetCasesByAlertIdApi } from './cases/alerts/get_cases'; -import { initGetAllAlertsAttachToCaseApi } from './comments/get_alerts'; -import { initGetCaseMetricsApi } from './metrics/get_case_metrics'; - /** * Default page number when interacting with the saved objects API. */ -export const defaultPage = 1; +export const DEFAULT_PAGE = 1; /** * Default number of results when interacting with the saved objects API. */ -export const defaultPerPage = 20; - -export function initCaseApi(deps: RouteDeps) { - // Cases - initDeleteCasesApi(deps); - initFindCasesApi(deps); - initGetCaseApi(deps); - initPatchCasesApi(deps); - initPostCaseApi(deps); - initPushCaseApi(deps); - initGetAllCaseUserActionsApi(deps); - - // Comments - initDeleteCommentApi(deps); - initDeleteAllCommentsApi(deps); - initFindCaseCommentsApi(deps); - initGetCommentApi(deps); - initGetAllCommentsApi(deps); - initPatchCommentApi(deps); - initPostCommentApi(deps); - // Cases Configure - initCaseConfigureGetActionConnector(deps); - initGetCaseConfigure(deps); - initPatchCaseConfigure(deps); - initPostCaseConfigure(deps); - // Reporters - initGetReportersApi(deps); - // Status - initGetCasesStatusApi(deps); - // Tags - initGetTagsApi(deps); - // Alerts - initGetCasesByAlertIdApi(deps); - initGetAllAlertsAttachToCaseApi(deps); - // Metrics - initGetCaseMetricsApi(deps); -} +export const DEFAULT_PER_PAGE = 20; diff --git a/x-pack/plugins/cases/server/routes/api/metrics/get_case_metrics.ts b/x-pack/plugins/cases/server/routes/api/metrics/get_case_metrics.ts index 0cfad10b28316..b86b84410abe6 100644 --- a/x-pack/plugins/cases/server/routes/api/metrics/get_case_metrics.ts +++ b/x-pack/plugins/cases/server/routes/api/metrics/get_case_metrics.ts @@ -7,37 +7,35 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { wrapError } from '../utils'; - import { CASE_METRICS_DETAILS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; -export function initGetCaseMetricsApi({ router, logger }: RouteDeps) { - router.get( - { - path: CASE_METRICS_DETAILS_URL, - validate: { - params: schema.object({ - case_id: schema.string({ minLength: 1 }), - }), - query: schema.object({ - features: schema.arrayOf(schema.string({ minLength: 1 })), +export const getCaseMetricRoute = createCasesRoute({ + method: 'get', + path: CASE_METRICS_DETAILS_URL, + params: { + params: schema.object({ + case_id: schema.string({ minLength: 1 }), + }), + query: schema.object({ + features: schema.arrayOf(schema.string({ minLength: 1 })), + }), + }, + handler: async ({ context, request, response }) => { + try { + const client = await context.cases.getCasesClient(); + return response.ok({ + body: await client.metrics.getCaseMetrics({ + caseId: request.params.case_id, + features: request.query.features, }), - }, - }, - async (context, request, response) => { - try { - const client = await context.cases.getCasesClient(); - return response.ok({ - body: await client.metrics.getCaseMetrics({ - caseId: request.params.case_id, - features: request.query.features, - }), - }); - } catch (error) { - logger.error(`Failed to get case metrics in route: ${error}`); - return response.customError(wrapError(error)); - } + }); + } catch (error) { + throw createCaseError({ + message: `Failed to get case metrics in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/register_routes.test.ts b/x-pack/plugins/cases/server/routes/api/register_routes.test.ts new file mode 100644 index 0000000000000..4082ed3f6e6ae --- /dev/null +++ b/x-pack/plugins/cases/server/routes/api/register_routes.test.ts @@ -0,0 +1,336 @@ +/* + * 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 { schema } from '@kbn/config-schema'; + +import { + httpServerMock, + httpServiceMock, + loggingSystemMock, +} from '../../../../../../src/core/server/mocks'; + +import { usageCollectionPluginMock } from '../../../../../../src/plugins/usage_collection/server/mocks'; + +import { CasesRouter } from '../../types'; +import { createCasesRoute } from './create_cases_route'; +import { registerRoutes } from './register_routes'; +import { CaseRoute } from './types'; +import { extractWarningValueFromWarningHeader } from './utils'; + +describe('registerRoutes', () => { + let router: jest.Mocked; + const logger = loggingSystemMock.createLogger(); + const response = httpServerMock.createResponseFactory(); + const telemetryUsageCounter = usageCollectionPluginMock + .createSetupContract() + .createUsageCounter('test'); + + const handler = jest.fn(); + const customError = jest.fn(); + const badRequest = jest.fn(); + + const routes = [ + createCasesRoute({ + method: 'get', + path: '/foo/{case_id}', + params: { + params: schema.object({ + case_id: schema.string(), + }), + query: schema.object({ + includeComments: schema.boolean(), + }), + }, + handler, + }), + + createCasesRoute({ + method: 'post', + path: '/bar', + params: { + body: schema.object({ + title: schema.string(), + }), + }, + handler: async () => response.ok(), + }), + createCasesRoute({ + method: 'put', + path: '/baz', + handler: async () => response.ok(), + }), + createCasesRoute({ + method: 'patch', + path: '/qux', + handler: async () => response.ok(), + }), + createCasesRoute({ + method: 'delete', + path: '/quux', + handler: async () => response.ok(), + }), + ] as CaseRoute[]; + + const initApi = (casesRoutes: CaseRoute[]) => { + registerRoutes({ + router, + logger, + routes: casesRoutes, + kibanaVersion: '8.2.0', + telemetryUsageCounter, + }); + + const simulateRequest = async ({ + method, + path, + context = { cases: {} }, + headers = {}, + }: { + method: keyof Pick; + path: string; + context?: Record; + headers?: Record; + }) => { + const [, registeredRouteHandler] = + // @ts-ignore + router[method].mock.calls.find((call) => { + return call[0].path === path; + }) ?? []; + + const result = await registeredRouteHandler( + context, + { headers }, + { customError, badRequest } + ); + + return result; + }; + + return { + simulateRequest, + }; + }; + + const initAndSimulateError = async () => { + const { simulateRequest } = initApi([ + ...routes, + createCasesRoute({ + method: 'get', + path: '/error', + handler: async () => { + throw new Error('API error'); + }, + }), + ]); + + await simulateRequest({ + method: 'get', + path: '/error', + }); + }; + + const initAndSimulateDeprecationEndpoint = async (headers?: Record) => { + const { simulateRequest } = initApi([ + ...routes, + createCasesRoute({ + method: 'get', + path: '/deprecated', + options: { deprecated: true }, + handler: async () => response.ok(), + }), + ]); + + const res = await simulateRequest({ + method: 'get', + path: '/deprecated', + headers, + }); + + return res; + }; + + beforeEach(() => { + jest.clearAllMocks(); + router = httpServiceMock.createRouter(); + }); + + describe('api registration', () => { + const endpoints: Array<[CaseRoute['method'], string]> = [ + ['get', '/foo/{case_id}'], + ['post', '/bar'], + ['put', '/baz'], + ['patch', '/qux'], + ['delete', '/quux'], + ]; + + it('registers the endpoints correctly', () => { + initApi(routes); + + for (const endpoint of endpoints) { + const [method, path] = endpoint; + + expect(router[method]).toHaveBeenCalledTimes(1); + expect(router[method]).toBeCalledWith( + { path, validate: expect.anything() }, + expect.anything() + ); + } + }); + }); + + describe('api validation', () => { + const validation: Array< + ['params' | 'query' | 'body', keyof CasesRouter, Record] + > = [ + ['params', 'get', { case_id: '123' }], + ['query', 'get', { includeComments: false }], + ['body', 'post', { title: 'test' }], + ]; + + describe.each(validation)('%s', (type, method, value) => { + it(`validates ${type} correctly`, () => { + initApi(routes); + // @ts-ignore + const params = router[method].mock.calls[0][0].validate[type]; + expect(() => params.validate(value)).not.toThrow(); + }); + + it(`throws if ${type} is wrong`, () => { + initApi(routes); + // @ts-ignore + const params = router[method].mock.calls[0][0].validate[type]; + expect(() => params.validate({})).toThrow(); + }); + + it(`skips path parameter validation if ${type} is not provided`, () => { + initApi(routes); + // @ts-ignore + const params = router.put.mock.calls[0][0].validate[type]; + expect(() => params.validate({})).not.toThrow(); + }); + }); + }); + + describe('handler execution', () => { + it('calls the handler correctly', async () => { + const { simulateRequest } = initApi(routes); + await simulateRequest({ method: 'get', path: '/foo/{case_id}' }); + expect(handler).toHaveBeenCalled(); + }); + }); + + describe('telemetry', () => { + it('increases the counters correctly on a successful kibana request', async () => { + const { simulateRequest } = initApi(routes); + await simulateRequest({ + method: 'get', + path: '/foo/{case_id}', + headers: { 'kbn-version': '8.2.0', referer: 'https://example.com' }, + }); + expect(telemetryUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: 'GET /foo/{case_id}', + counterType: 'success', + }); + + expect(telemetryUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: 'GET /foo/{case_id}', + counterType: 'kibanaRequest.yes', + }); + }); + + it('increases the counters correctly on a successful non kibana request', async () => { + const { simulateRequest } = initApi(routes); + await simulateRequest({ + method: 'get', + path: '/foo/{case_id}', + }); + expect(telemetryUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: 'GET /foo/{case_id}', + counterType: 'success', + }); + + expect(telemetryUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: 'GET /foo/{case_id}', + counterType: 'kibanaRequest.no', + }); + }); + + it('increases the counters correctly on an error', async () => { + await initAndSimulateError(); + + expect(telemetryUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: 'GET /error', + counterType: 'error', + }); + }); + + it('increases the deprecation counters correctly', async () => { + await initAndSimulateDeprecationEndpoint(); + + expect(telemetryUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: 'GET /deprecated', + counterType: 'deprecated', + }); + }); + }); + + describe('deprecation', () => { + it('logs the deprecation message if it is not a kibana request', async () => { + await initAndSimulateDeprecationEndpoint(); + + expect(logger.warn).toHaveBeenCalledWith('The endpoint GET /deprecated is deprecated.'); + }); + + it('does NOT log the deprecation message if it is a kibana request', async () => { + await initAndSimulateDeprecationEndpoint({ + 'kbn-version': '8.2.0', + referer: 'https://example.com', + }); + + expect(logger.warn).not.toHaveBeenCalled(); + }); + + it('adds the warning header', async () => { + response.ok.mockReturnValue({ status: 200, options: {} }); + const res = await initAndSimulateDeprecationEndpoint(); + const warningHeader = res.options.headers.warning; + const warningValue = extractWarningValueFromWarningHeader(warningHeader); + expect(warningValue).toBe('Deprecated endpoint'); + }); + }); + + describe('errors', () => { + it('logs the error', async () => { + await initAndSimulateError(); + + expect(logger.error).toBeCalledWith('API error'); + }); + + it('returns an error response', async () => { + await initAndSimulateError(); + + expect(customError).toBeCalledWith({ + body: expect.anything(), + headers: {}, + statusCode: 500, + }); + }); + + it('returns an error response when the case context is not registered', async () => { + const { simulateRequest } = initApi(routes); + await simulateRequest({ + method: 'get', + path: '/foo/{case_id}', + context: {}, + }); + + expect(badRequest).toBeCalledWith({ + body: 'RouteHandlerContext is not registered for cases', + }); + }); + }); +}); diff --git a/x-pack/plugins/cases/server/routes/api/register_routes.ts b/x-pack/plugins/cases/server/routes/api/register_routes.ts new file mode 100644 index 0000000000000..a4545d82efef7 --- /dev/null +++ b/x-pack/plugins/cases/server/routes/api/register_routes.ts @@ -0,0 +1,142 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { Headers, RouteRegistrar } from 'kibana/server'; +import { CasesRequestHandlerContext } from '../../types'; +import { RegisterRoutesDeps } from './types'; +import { + escapeHatch, + getIsKibanaRequest, + getWarningHeader, + logDeprecatedEndpoint, + wrapError, +} from './utils'; + +const getEndpoint = (method: string, path: string): string => `${method.toUpperCase()} ${path}`; + +const increaseTelemetryCounters = ({ + telemetryUsageCounter, + method, + path, + isKibanaRequest, + isError = false, +}: { + telemetryUsageCounter: Exclude; + method: string; + path: string; + isKibanaRequest: boolean; + isError?: boolean; +}) => { + const counterName = getEndpoint(method, path); + + telemetryUsageCounter.incrementCounter({ + counterName, + counterType: isError ? 'error' : 'success', + }); + + telemetryUsageCounter.incrementCounter({ + counterName, + counterType: `kibanaRequest.${isKibanaRequest ? 'yes' : 'no'}`, + }); +}; + +const logAndIncreaseDeprecationTelemetryCounters = ({ + logger, + headers, + method, + path, + telemetryUsageCounter, +}: { + logger: RegisterRoutesDeps['logger']; + headers: Headers; + method: string; + path: string; + telemetryUsageCounter?: Exclude; +}) => { + const endpoint = getEndpoint(method, path); + + logDeprecatedEndpoint(logger, headers, `The endpoint ${endpoint} is deprecated.`); + + if (telemetryUsageCounter) { + telemetryUsageCounter.incrementCounter({ + counterName: endpoint, + counterType: 'deprecated', + }); + } +}; + +export const registerRoutes = (deps: RegisterRoutesDeps) => { + const { router, routes, logger, kibanaVersion, telemetryUsageCounter } = deps; + + routes.forEach((route) => { + const { method, path, params, options, handler } = route; + + (router[method] as RouteRegistrar)( + { + path, + validate: { + params: params?.params ?? escapeHatch, + query: params?.query ?? escapeHatch, + body: params?.body ?? schema.nullable(escapeHatch), + }, + }, + async (context, request, response) => { + let responseHeaders = {}; + const isKibanaRequest = getIsKibanaRequest(request.headers); + + if (!context.cases) { + return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); + } + + try { + if (options?.deprecated) { + logAndIncreaseDeprecationTelemetryCounters({ + telemetryUsageCounter, + logger, + path, + method, + headers: request.headers, + }); + + responseHeaders = { + ...responseHeaders, + ...getWarningHeader(kibanaVersion), + }; + } + + const res = await handler({ logger, context, request, response, kibanaVersion }); + + if (telemetryUsageCounter) { + increaseTelemetryCounters({ telemetryUsageCounter, method, path, isKibanaRequest }); + } + + res.options.headers = { + ...res.options.headers, + ...responseHeaders, + }; + + return res; + } catch (error) { + logger.error(error.message); + + if (telemetryUsageCounter) { + increaseTelemetryCounters({ + telemetryUsageCounter, + method, + path, + isError: true, + isKibanaRequest, + }); + } + + return response.customError(wrapError(error)); + } + } + ); + }); +}; diff --git a/x-pack/plugins/cases/server/routes/api/stats/get_status.ts b/x-pack/plugins/cases/server/routes/api/stats/get_status.ts index 90044c9516b3a..c245f435835f6 100644 --- a/x-pack/plugins/cases/server/routes/api/stats/get_status.ts +++ b/x-pack/plugins/cases/server/routes/api/stats/get_status.ts @@ -5,40 +5,31 @@ * 2.0. */ -import { RouteDeps } from '../types'; -import { escapeHatch, wrapError, getWarningHeader, logDeprecatedEndpoint } from '../utils'; +import { CaseRoute } from '../types'; import { CasesStatusRequest } from '../../../../common/api'; import { CASE_STATUS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; /** * @deprecated since version 8.1.0 */ -export function initGetCasesStatusApi({ router, logger, kibanaVersion }: RouteDeps) { - router.get( - { - path: CASE_STATUS_URL, - validate: { query: escapeHatch }, - }, - async (context, request, response) => { - try { - logDeprecatedEndpoint( - logger, - request.headers, - `The get cases status API '${CASE_STATUS_URL}' is deprecated.` - ); - - const client = await context.cases.getCasesClient(); - return response.ok({ - headers: { - ...getWarningHeader(kibanaVersion), - }, - body: await client.metrics.getStatusTotalsByType(request.query as CasesStatusRequest), - }); - } catch (error) { - logger.error(`Failed to get status stats in route: ${error}`); - return response.customError(wrapError(error)); - } +export const getStatusRoute: CaseRoute = createCasesRoute({ + method: 'get', + path: CASE_STATUS_URL, + options: { deprecated: true }, + handler: async ({ context, request, response, logger, kibanaVersion }) => { + try { + const client = await context.cases.getCasesClient(); + return response.ok({ + body: await client.metrics.getStatusTotalsByType(request.query as CasesStatusRequest), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to get status stats in route: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/types.ts b/x-pack/plugins/cases/server/routes/api/types.ts index e3aa6e0e970fa..ffa06526dc68c 100644 --- a/x-pack/plugins/cases/server/routes/api/types.ts +++ b/x-pack/plugins/cases/server/routes/api/types.ts @@ -5,17 +5,45 @@ * 2.0. */ -import type { Logger, PluginInitializerContext } from 'kibana/server'; +import type { + Logger, + PluginInitializerContext, + KibanaRequest, + IKibanaResponse, + KibanaResponseFactory, + RouteValidatorConfig, +} from 'kibana/server'; -import type { CasesRouter } from '../../types'; +import { UsageCollectionSetup } from '../../../../../../src/plugins/usage_collection/server'; +import type { CasesRequestHandlerContext, CasesRouter } from '../../types'; -export interface RouteDeps { +type TelemetryUsageCounter = ReturnType; + +export interface RegisterRoutesDeps { router: CasesRouter; + routes: CaseRoute[]; logger: Logger; kibanaVersion: PluginInitializerContext['env']['packageInfo']['version']; + telemetryUsageCounter?: TelemetryUsageCounter; } export interface TotalCommentByCase { caseId: string; totalComments: number; } + +interface CaseRouteHandlerArguments { + request: KibanaRequest; + context: CasesRequestHandlerContext; + response: KibanaResponseFactory; + logger: Logger; + kibanaVersion: PluginInitializerContext['env']['packageInfo']['version']; +} + +export interface CaseRoute

{ + method: 'get' | 'post' | 'put' | 'delete' | 'patch'; + path: string; + params?: RouteValidatorConfig; + options?: { deprecated?: boolean }; + handler: (args: CaseRouteHandlerArguments) => Promise; +} diff --git a/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts b/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts index 2e38ac8b4ebc7..ae686969974ea 100644 --- a/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts +++ b/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts @@ -7,50 +7,35 @@ import { schema } from '@kbn/config-schema'; -import { RouteDeps } from '../types'; -import { getWarningHeader, logDeprecatedEndpoint, wrapError } from '../utils'; import { CASE_USER_ACTIONS_URL } from '../../../../common/constants'; +import { createCaseError } from '../../../common/error'; +import { createCasesRoute } from '../create_cases_route'; /** * @deprecated since version 8.1.0 */ -export function initGetAllCaseUserActionsApi({ router, logger, kibanaVersion }: RouteDeps) { - router.get( - { - path: CASE_USER_ACTIONS_URL, - validate: { - params: schema.object({ - case_id: schema.string(), - }), - }, - }, - async (context, request, response) => { - try { - if (!context.cases) { - return response.badRequest({ body: 'RouteHandlerContext is not registered for cases' }); - } +export const getUserActionsRoute = createCasesRoute({ + method: 'get', + path: CASE_USER_ACTIONS_URL, + params: { + params: schema.object({ + case_id: schema.string(), + }), + }, + options: { deprecated: true }, + handler: async ({ context, request, response, logger, kibanaVersion }) => { + try { + const casesClient = await context.cases.getCasesClient(); + const caseId = request.params.case_id; - logDeprecatedEndpoint( - logger, - request.headers, - `The get all cases user actions API '${CASE_USER_ACTIONS_URL}' is deprecated.` - ); - - const casesClient = await context.cases.getCasesClient(); - const caseId = request.params.case_id; - - return response.ok({ - headers: { - ...getWarningHeader(kibanaVersion), - }, - body: await casesClient.userActions.getAll({ caseId }), - }); - } catch (error) { - logger.error( - `Failed to retrieve case user actions in route case id: ${request.params.case_id}: ${error}` - ); - return response.customError(wrapError(error)); - } + return response.ok({ + body: await casesClient.userActions.getAll({ caseId }), + }); + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve case user actions in route case id: ${request.params.case_id}: ${error}`, + error, + }); } - ); -} + }, +}); diff --git a/x-pack/plugins/cases/server/routes/api/utils.test.ts b/x-pack/plugins/cases/server/routes/api/utils.test.ts index 2614536e3242b..ec9dff072d359 100644 --- a/x-pack/plugins/cases/server/routes/api/utils.test.ts +++ b/x-pack/plugins/cases/server/routes/api/utils.test.ts @@ -8,7 +8,7 @@ import { isBoom, boomify } from '@hapi/boom'; import { loggingSystemMock } from '../../../../../../src/core/server/mocks'; import { HTTPError } from '../../common/error'; -import { logDeprecatedEndpoint, wrapError } from './utils'; +import { extractWarningValueFromWarningHeader, logDeprecatedEndpoint, wrapError } from './utils'; describe('Utils', () => { describe('wrapError', () => { @@ -75,4 +75,12 @@ describe('Utils', () => { expect(logger.warn).toHaveBeenCalledWith('test'); }); }); + + describe('extractWarningValueFromWarningHeader', () => { + it('extracts the warning value from a warning header correctly', () => { + expect(extractWarningValueFromWarningHeader(`299 Kibana-8.1.0 "Deprecation endpoint"`)).toBe( + 'Deprecation endpoint' + ); + }); + }); }); diff --git a/x-pack/plugins/cases/server/routes/api/utils.ts b/x-pack/plugins/cases/server/routes/api/utils.ts index 532a316e9a7b8..41fe1db9a7eb6 100644 --- a/x-pack/plugins/cases/server/routes/api/utils.ts +++ b/x-pack/plugins/cases/server/routes/api/utils.ts @@ -52,10 +52,10 @@ export const getWarningHeader = ( * https://github.com/elastic/kibana/blob/ec30f2aeeb10fb64b507935e558832d3ef5abfaa/x-pack/plugins/spaces/server/usage_stats/usage_stats_client.ts#L113-L118 */ -const getIsKibanaRequest = (headers?: Headers) => { +export const getIsKibanaRequest = (headers?: Headers): boolean => { // The presence of these two request headers gives us a good indication that this is a first-party request from the Kibana client. // We can't be 100% certain, but this is a reasonable attempt. - return headers && headers['kbn-version'] && headers.referer; + return !!(headers && headers['kbn-version'] && headers.referer); }; export const logDeprecatedEndpoint = (logger: Logger, headers: Headers, msg: string) => { @@ -63,3 +63,15 @@ export const logDeprecatedEndpoint = (logger: Logger, headers: Headers, msg: str logger.warn(msg); } }; + +/** + * Extracts the warning value a warning header that is formatted according to RFC 7234. + * For example for the string 299 Kibana-8.1.0 "Deprecation endpoint", the return value is Deprecation endpoint. + * + */ +export const extractWarningValueFromWarningHeader = (warningHeader: string) => { + const firstQuote = warningHeader.indexOf('"'); + const lastQuote = warningHeader.length - 1; + const warningValue = warningHeader.substring(firstQuote + 1, lastQuote); + return warningValue; +}; diff --git a/x-pack/plugins/cases/server/services/cases/index.ts b/x-pack/plugins/cases/server/services/cases/index.ts index 832d12071b466..684edcc077f8e 100644 --- a/x-pack/plugins/cases/server/services/cases/index.ts +++ b/x-pack/plugins/cases/server/services/cases/index.ts @@ -39,7 +39,7 @@ import { } from '../../../common/api'; import { SavedObjectFindOptionsKueryNode } from '../../common/types'; import { defaultSortField, flattenCaseSavedObject } from '../../common/utils'; -import { defaultPage, defaultPerPage } from '../../routes/api'; +import { DEFAULT_PAGE, DEFAULT_PER_PAGE } from '../../routes/api'; import { combineFilters } from '../../client/utils'; import { includeFieldsRequiredForAuthentication } from '../../authorization/utils'; import { @@ -420,8 +420,8 @@ export class CasesService { return { saved_objects: [], total: 0, - per_page: options?.perPage ?? defaultPerPage, - page: options?.page ?? defaultPage, + per_page: options?.perPage ?? DEFAULT_PER_PAGE, + page: options?.page ?? DEFAULT_PAGE, }; } diff --git a/x-pack/plugins/cloud_security_posture/README.md b/x-pack/plugins/cloud_security_posture/README.md new file mode 100755 index 0000000000000..8d2e3f62a3f7a --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/README.md @@ -0,0 +1,9 @@ +# Cloud Security Posture Kibana Plugin + +Cloud Posture automates the identification and remediation of risks across cloud infrastructures + +--- + +## Development + +See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. diff --git a/x-pack/plugins/cloud_security_posture/common/constants.ts b/x-pack/plugins/cloud_security_posture/common/constants.ts new file mode 100644 index 0000000000000..84c62e62c3351 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/common/constants.ts @@ -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. + */ + +export const STATS_ROUTE_PATH = '/api/csp/stats'; +export const FINDINGS_ROUTE_PATH = '/api/csp/findings'; +export const BENCHMARKS_ROUTE_PATH = '/api/csp/benchmarks'; + +export const CSP_KUBEBEAT_INDEX_PATTERN = 'logs-cis_kubernetes_benchmark.findings*'; +export const AGENT_LOGS_INDEX_PATTERN = '.logs-cis_kubernetes_benchmark.metadata*'; + +export const CSP_FINDINGS_INDEX_NAME = 'findings'; +export const CIS_KUBERNETES_PACKAGE_NAME = 'cis_kubernetes_benchmark'; + +export const RULE_PASSED = `passed`; +export const RULE_FAILED = `failed`; + +// A mapping of in-development features to their status. These features should be hidden from users but can be easily +// activated via a simple code change in a single location. +export const INTERNAL_FEATURE_FLAGS = { + showBenchmarks: false, + showTrendLineMock: false, + showClusterMetaMock: false, + showManageRulesMock: false, + showRisksMock: false, +} as const; diff --git a/x-pack/plugins/cloud_security_posture/common/index.ts b/x-pack/plugins/cloud_security_posture/common/index.ts new file mode 100755 index 0000000000000..e52b68e2fc2bd --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/common/index.ts @@ -0,0 +1,9 @@ +/* + * 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 const PLUGIN_ID = 'csp'; +export const PLUGIN_NAME = 'Cloud Security'; diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule.ts b/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule.ts new file mode 100644 index 0000000000000..d5c8e9fab1f2e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/common/schemas/csp_rule.ts @@ -0,0 +1,26 @@ +/* + * 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 { schema as rt, TypeOf } from '@kbn/config-schema'; + +export const cspRuleAssetSavedObjectType = 'csp_rule'; + +// TODO: needs to be shared with kubebeat +export const cspRuleSchema = rt.object({ + id: rt.string(), + name: rt.string(), + description: rt.string(), + rationale: rt.string(), + impact: rt.string(), + default_value: rt.string(), + remediation: rt.string(), + benchmark: rt.object({ name: rt.string(), version: rt.string() }), + tags: rt.arrayOf(rt.string()), + enabled: rt.boolean(), + muted: rt.boolean(), +}); + +export type CspRuleSchema = TypeOf; diff --git a/x-pack/plugins/cloud_security_posture/common/types.ts b/x-pack/plugins/cloud_security_posture/common/types.ts new file mode 100644 index 0000000000000..435b9836c5754 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/common/types.ts @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export type Evaluation = 'passed' | 'failed' | 'NA'; +/** number between 1-100 */ +export type Score = number; + +export interface FindingsEvaluation { + totalFindings: number; + totalPassed: number; + totalFailed: number; +} + +export interface Stats extends FindingsEvaluation { + postureScore: Score; +} + +export interface ResourceType extends FindingsEvaluation { + name: string; +} + +export interface Cluster { + meta: { + clusterId: string; + benchmarkName: string; + }; + stats: Stats; + resourcesTypes: ResourceType[]; +} + +export interface CloudPostureStats { + stats: Stats; + resourcesTypes: ResourceType[]; + clusters: Cluster[]; +} diff --git a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts new file mode 100644 index 0000000000000..1df0c18ebdd02 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts @@ -0,0 +1,22 @@ +/* + * 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 * as t from 'io-ts'; + +/** + * @example + * declare const foo: Array + * foo.filter(isNonNullable) // foo is Array + */ +export const isNonNullable = (v: T): v is NonNullable => + v !== null && v !== undefined; + +export const extractErrorMessage = (e: unknown, defaultMessage = 'Unknown Error'): string => { + if (e instanceof Error) return e.message; + if (t.record(t.literal('message'), t.string).is(e)) return e.message; + + return defaultMessage; // TODO: i18n +}; diff --git a/x-pack/plugins/cloud_security_posture/jest.config.js b/x-pack/plugins/cloud_security_posture/jest.config.js new file mode 100644 index 0000000000000..eb1e880646e56 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/jest.config.js @@ -0,0 +1,18 @@ +/* + * 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. + */ + +/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/plugins/cloud_security_posture'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/cloud_security_posture', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/cloud_security_posture/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/cloud_security_posture/kibana.json b/x-pack/plugins/cloud_security_posture/kibana.json new file mode 100755 index 0000000000000..29f3813c211c7 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/kibana.json @@ -0,0 +1,15 @@ +{ + "id": "cloudSecurityPosture", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack", "cloudSecurityPosture"], + "owner": { + "name": "Cloud Security Posture", + "githubTeam": "cloud-posture-security" + }, + "description": "The cloud security posture plugin", + "server": true, + "ui": true, + "requiredPlugins": ["navigation", "data", "fleet"], + "requiredBundles": ["kibanaReact"] +} diff --git a/x-pack/plugins/cloud_security_posture/public/application/app.test.ts b/x-pack/plugins/cloud_security_posture/public/application/app.test.ts new file mode 100644 index 0000000000000..d79d5b6922e26 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/application/app.test.ts @@ -0,0 +1,36 @@ +/* + * 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 Chance from 'chance'; +import { createNavigationItemFixture } from '../test/fixtures/navigation_item'; +import { getRoutesFromMapping } from './app'; + +const chance = new Chance(); +const DummyComponent = () => null; + +describe('getRoutesFromMapping', () => { + it('should map routes', () => { + const pageId = chance.word(); + const navigationItems = { [pageId]: createNavigationItemFixture() }; + const routesMapping = { [pageId]: DummyComponent }; + const routes = getRoutesFromMapping(navigationItems, routesMapping); + + expect(routes).toHaveLength(1); + expect(routes[0]).toMatchObject({ + path: navigationItems[pageId].path, + component: DummyComponent, + }); + }); + + it('should not map routes where the navigation item is disabled', () => { + const pageId = chance.word(); + const navigationItems = { [pageId]: createNavigationItemFixture({ disabled: true }) }; + const routesMapping = { [pageId]: DummyComponent }; + const routes = getRoutesFromMapping(navigationItems, routesMapping); + + expect(routes).toHaveLength(0); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/application/app.tsx b/x-pack/plugins/cloud_security_posture/public/application/app.tsx new file mode 100755 index 0000000000000..73dfa7b804378 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/application/app.tsx @@ -0,0 +1,65 @@ +/* + * 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 React from 'react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { Router, Redirect, Switch, Route } from 'react-router-dom'; +import type { RouteProps } from 'react-router-dom'; +import { QueryClient, QueryClientProvider } from 'react-query'; +import { EuiErrorBoundary } from '@elastic/eui'; +import { allNavigationItems } from '../common/navigation/constants'; +import { CspNavigationItem } from '../common/navigation/types'; +import { UnknownRoute } from '../components/unknown_route'; +import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; +import type { AppMountParameters, CoreStart } from '../../../../../src/core/public'; +import type { CspClientPluginStartDeps } from '../types'; +import { pageToComponentMapping } from './constants'; + +const queryClient = new QueryClient(); + +export interface CspAppDeps { + core: CoreStart; + deps: CspClientPluginStartDeps; + params: AppMountParameters; +} + +type RoutePropsWithStringPath = RouteProps & { path: string }; + +// Converts the mapping of page -> component to be of type `RouteProps` while filtering out disabled navigation items +export const getRoutesFromMapping = ( + navigationItems: Record, + componentMapping: Record +): readonly RoutePropsWithStringPath[] => + Object.entries(componentMapping) + .filter(([id, _]) => !navigationItems[id as T].disabled) + .map(([id, component]) => ({ + path: navigationItems[id as T].path, + component: component as RouteProps['component'], + })); + +const routes = getRoutesFromMapping(allNavigationItems, pageToComponentMapping); + +export const CspApp = ({ core, deps, params }: CspAppDeps) => ( + + + + + + + {routes.map((route) => ( + + ))} + + + + + + + + +); + +const RedirectToDashboard = () => ; diff --git a/x-pack/plugins/cloud_security_posture/public/application/constants.tsx b/x-pack/plugins/cloud_security_posture/public/application/constants.tsx new file mode 100644 index 0000000000000..128382d039f15 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/application/constants.tsx @@ -0,0 +1,16 @@ +/* + * 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 { RouteProps } from 'react-router-dom'; +import { CspPage } from '../common/navigation/types'; +import * as pages from '../pages'; + +export const pageToComponentMapping: Record = { + findings: pages.Findings, + dashboard: pages.ComplianceDashboard, + benchmarks: pages.Benchmarks, + rules: pages.Rules, +}; diff --git a/x-pack/plugins/cloud_security_posture/public/application/index.tsx b/x-pack/plugins/cloud_security_posture/public/application/index.tsx new file mode 100644 index 0000000000000..38fbef254ea44 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/application/index.tsx @@ -0,0 +1,28 @@ +/* + * 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 React from 'react'; +import ReactDOM from 'react-dom'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; +import { CspApp } from './app'; +import type { AppMountParameters, CoreStart } from '../../../../../src/core/public'; +import type { CspClientPluginStartDeps } from '../types'; + +export const renderApp = ( + core: CoreStart, + deps: CspClientPluginStartDeps, + params: AppMountParameters +) => { + ReactDOM.render( + + + , + params.element + ); + + return () => ReactDOM.unmountComponentAtNode(params.element); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/index.ts b/x-pack/plugins/cloud_security_posture/public/common/api/index.ts new file mode 100644 index 0000000000000..915881e2ab9b2 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/api/index.ts @@ -0,0 +1,8 @@ +/* + * 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 './use_cloud_posture_stats_api'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_cloud_posture_stats_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_cloud_posture_stats_api.ts new file mode 100644 index 0000000000000..c1cc4a61fd7ae --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_cloud_posture_stats_api.ts @@ -0,0 +1,18 @@ +/* + * 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 { useQuery } from 'react-query'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import { CloudPostureStats } from '../../../common/types'; +import { STATS_ROUTE_PATH } from '../../../common/constants'; + +const getStatsKey = 'csp_dashboard_stats'; + +export const useCloudPostureStatsApi = () => { + const { http } = useKibana().services; + return useQuery([getStatsKey], () => http!.get(STATS_ROUTE_PATH)); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/constants.ts b/x-pack/plugins/cloud_security_posture/public/common/constants.ts new file mode 100644 index 0000000000000..e7ad29937e49d --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/constants.ts @@ -0,0 +1,12 @@ +/* + * 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 { euiPaletteForStatus } from '@elastic/eui'; + +const [success, warning, danger] = euiPaletteForStatus(3); + +export const statusColors = { success, warning, danger }; diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts new file mode 100644 index 0000000000000..b2d1d2a7b6bbe --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts @@ -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. + */ + +import type { CoreStart } from '../../../../../../src/core/public'; +import type { CspClientPluginStartDeps } from '../../types'; +import { useKibana as useKibanaBase } from '../../../../../../src/plugins/kibana_react/public'; + +type CspKibanaContext = CoreStart & CspClientPluginStartDeps; + +export const useKibana = () => useKibanaBase(); diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.ts new file mode 100644 index 0000000000000..6cc1582d7ff7b --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.ts @@ -0,0 +1,44 @@ +/* + * 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 { useHistory } from 'react-router-dom'; +import { Query } from '@kbn/es-query'; +import { allNavigationItems } from '../navigation/constants'; +import { encodeQuery } from '../navigation/query_utils'; +import { CspFindingsRequest } from '../../pages/findings/use_findings'; + +const getFindingsQuery = (queryValue: Query['query']): Pick => { + const query = + typeof queryValue === 'string' + ? queryValue + : // TODO: use a tested query builder instead ASAP + Object.entries(queryValue) + .reduce((a, [key, value]) => { + a.push(`${key} : "${value}"`); + return a; + }, []) + .join(' and '); + + return { + query: { + language: 'kuery', + // NOTE: a query object is valid TS but throws on runtime + query, + }, + }!; +}; + +export const useNavigateFindings = () => { + const history = useHistory(); + + return (query?: Query['query']) => { + history.push({ + pathname: allNavigationItems.findings.path, + ...(query && { search: encodeQuery(getFindingsQuery(query)) }), + }); + }; +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts new file mode 100644 index 0000000000000..20649d01be8fc --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts @@ -0,0 +1,63 @@ +/* + * 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 { renderHook, act } from '@testing-library/react-hooks/dom'; +import { useUrlQuery } from './use_url_query'; +import { useLocation, useHistory } from 'react-router-dom'; +import { encodeQuery } from '../navigation/query_utils'; + +jest.mock('react-router-dom', () => ({ + useHistory: jest.fn(), + useLocation: jest.fn(), +})); + +describe('useUrlQuery', () => { + it('uses default query when no query is provided', () => { + const defaultQuery = { foo: 1 }; + (useHistory as jest.Mock).mockReturnValue({ + push: jest.fn(), + }); + (useLocation as jest.Mock).mockReturnValue({ + search: encodeQuery(defaultQuery), + }); + + const { result } = renderHook(() => useUrlQuery(() => defaultQuery)); + + act(() => { + result.current.setUrlQuery({}); + }); + + expect(result.current.urlQuery.foo).toBe(defaultQuery.foo); + expect(useHistory().push).toHaveBeenCalledTimes(1); + }); + + it('merges default query, partial first query and partial second query', () => { + const defaultQuery = { foo: 1, zoo: 2, moo: 3 }; + const first = { zoo: 3 }; + const second = { moo: 4 }; + (useHistory as jest.Mock).mockReturnValue({ + push: jest.fn(), + }); + (useLocation as jest.Mock).mockReturnValue({ + search: encodeQuery({ ...defaultQuery, ...first, ...second }), + }); + + const { result } = renderHook(() => useUrlQuery(() => defaultQuery)); + + act(() => { + result.current.setUrlQuery(first); + }); + act(() => { + result.current.setUrlQuery(second); + }); + + expect(result.current.urlQuery.foo).toBe(defaultQuery.foo); + expect(result.current.urlQuery.zoo).toBe(first.zoo); + expect(result.current.urlQuery.moo).toBe(second.moo); + expect(useHistory().push).toHaveBeenCalledTimes(2); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts new file mode 100644 index 0000000000000..69055de1a78af --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts @@ -0,0 +1,46 @@ +/* + * 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 { useEffect, useCallback, useMemo } from 'react'; +import { useHistory, useLocation } from 'react-router-dom'; +import { decodeQuery, encodeQuery } from '../navigation/query_utils'; + +/** + * @description uses 'rison' to encode/decode a url query + * @todo replace getDefaultQuery with schema. validate after decoded from URL, use defaultValues + * @note shallow-merges default, current and next query + */ +export const useUrlQuery = (getDefaultQuery: () => T) => { + const { push } = useHistory(); + const { search, key } = useLocation(); + + const urlQuery = useMemo( + () => ({ ...getDefaultQuery(), ...decodeQuery(search) }), + [getDefaultQuery, search] + ); + + const setUrlQuery = useCallback( + (query: Partial) => + push({ + search: encodeQuery({ ...getDefaultQuery(), ...urlQuery, ...query }), + }), + [getDefaultQuery, urlQuery, push] + ); + + // Set initial query + useEffect(() => { + // TODO: condition should be if decoding failed + if (search) return; + + setUrlQuery(getDefaultQuery()); + }, [getDefaultQuery, search, setUrlQuery]); + + return { + key, + urlQuery, + setUrlQuery, + }; +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts new file mode 100644 index 0000000000000..4e07a4c800f53 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts @@ -0,0 +1,21 @@ +/* + * 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 * as TEXT from './translations'; +import { INTERNAL_FEATURE_FLAGS } from '../../../common/constants'; +import type { CspPage, CspNavigationItem } from './types'; + +export const allNavigationItems: Record = { + dashboard: { name: TEXT.DASHBOARD, path: '/dashboard' }, + findings: { name: TEXT.FINDINGS, path: '/findings' }, + rules: { name: 'Rules', path: '/rules', disabled: true }, + benchmarks: { + name: TEXT.MY_BENCHMARKS, + path: '/benchmarks', + disabled: !INTERNAL_FEATURE_FLAGS.showBenchmarks, + }, +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/query_utils.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/query_utils.ts new file mode 100644 index 0000000000000..8e4e3e50ae310 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/query_utils.ts @@ -0,0 +1,40 @@ +/* + * 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 { encode, decode, type RisonObject } from 'rison-node'; +import type { LocationDescriptorObject } from 'history'; + +const encodeRison = (v: RisonObject): string | undefined => { + try { + return encode(v); + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } +}; + +const decodeRison = (query: string): T | undefined => { + try { + return decode(query) as T; + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } +}; + +const QUERY_PARAM_KEY = 'query'; + +export const encodeQuery = (query: RisonObject): LocationDescriptorObject['search'] => { + const risonQuery = encodeRison(query); + if (!risonQuery) return; + return `${QUERY_PARAM_KEY}=${risonQuery}`; +}; + +export const decodeQuery = (search?: string): Partial | undefined => { + const risonQuery = new URLSearchParams(search).get(QUERY_PARAM_KEY); + if (!risonQuery) return; + return decodeRison(risonQuery); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/translations.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/translations.ts new file mode 100644 index 0000000000000..c434ea55a2829 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/translations.ts @@ -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 { i18n } from '@kbn/i18n'; + +export const CLOUD_POSTURE = i18n.translate('xpack.csp.navigation.cloudPosture', { + defaultMessage: 'Cloud Posture', +}); + +export const FINDINGS = i18n.translate('xpack.csp.navigation.findings', { + defaultMessage: 'Findings', +}); + +export const DASHBOARD = i18n.translate('xpack.csp.navigation.dashboard', { + defaultMessage: 'Dashboard', +}); + +export const MY_BENCHMARKS = i18n.translate('xpack.csp.navigation.my_benchmarks', { + defaultMessage: 'My Benchmarks', +}); diff --git a/x-pack/plugins/cases/public/components/header_page/types.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts similarity index 51% rename from x-pack/plugins/cases/public/components/header_page/types.ts rename to x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts index e95d0c8e1e69c..87f62b88ba171 100644 --- a/x-pack/plugins/cases/public/components/header_page/types.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts @@ -4,17 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import type React from 'react'; -export type TitleProp = string | React.ReactNode; - -export interface DraggableArguments { - field: string; - value: string; +export interface CspNavigationItem { + readonly name: string; + readonly path: string; + readonly disabled?: boolean; } -export interface BadgeOptions { - beta?: boolean; - text: string; - tooltip?: string; -} +export type CspPage = 'dashboard' | 'findings' | 'benchmarks' | 'rules'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/use_csp_breadcrumbs.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/use_csp_breadcrumbs.ts new file mode 100644 index 0000000000000..f11b09bc559dc --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/navigation/use_csp_breadcrumbs.ts @@ -0,0 +1,40 @@ +/* + * 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 { ChromeBreadcrumb, CoreStart } from 'kibana/public'; +import { useEffect } from 'react'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import { PLUGIN_ID } from '../../../common'; +import type { CspNavigationItem } from './types'; +import { CLOUD_POSTURE } from './translations'; + +export const useCspBreadcrumbs = (breadcrumbs: CspNavigationItem[]) => { + const { + services: { + chrome: { setBreadcrumbs }, + application: { getUrlForApp }, + }, + } = useKibana(); + + useEffect(() => { + const cspPath = getUrlForApp(PLUGIN_ID); + const additionalBreadCrumbs: ChromeBreadcrumb[] = breadcrumbs.map((breadcrumb) => ({ + text: breadcrumb.name, + path: breadcrumb.path.startsWith('/') + ? `${cspPath}${breadcrumb.path}` + : `${cspPath}/${breadcrumb.path}`, + })); + + setBreadcrumbs([ + { + text: CLOUD_POSTURE, + href: cspPath, + }, + ...additionalBreadCrumbs, + ]); + }, [getUrlForApp, setBreadcrumbs, breadcrumbs]); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/translations.ts b/x-pack/plugins/cloud_security_posture/public/common/translations.ts new file mode 100644 index 0000000000000..2aeb21ca33c5f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/common/translations.ts @@ -0,0 +1,12 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const CLOUD_SECURITY_POSTURE = i18n.translate('xpack.csp.cloudSecurityPosture', { + defaultMessage: 'Cloud Security Posture', +}); diff --git a/x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx new file mode 100644 index 0000000000000..114459bcd0865 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx @@ -0,0 +1,52 @@ +/* + * 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 React from 'react'; +import { render, screen } from '@testing-library/react'; +import { ChartPanel } from './chart_panel'; +import { CHART_PANEL_TEST_SUBJECTS } from './constants'; +import Chance from 'chance'; + +const chance = new Chance(); +const testData = chance.word(); + +const TestingChart = ({ data }: { data: string | undefined }) => { + return

{data}
; +}; + +describe('', () => { + it('renders loading state', () => { + render( + + + + ); + expect(screen.getByTestId(CHART_PANEL_TEST_SUBJECTS.LOADING)).toBeInTheDocument(); + expect(screen.queryByTestId(CHART_PANEL_TEST_SUBJECTS.TEST_CHART)).not.toBeInTheDocument(); + }); + + it('renders error state', () => { + render( + + + + ); + expect(screen.getByTestId(CHART_PANEL_TEST_SUBJECTS.ERROR)).toBeInTheDocument(); + expect(screen.queryByTestId(CHART_PANEL_TEST_SUBJECTS.TEST_CHART)).not.toBeInTheDocument(); + }); + + it('renders chart component', () => { + render( + + + + ); + expect(screen.queryByTestId(CHART_PANEL_TEST_SUBJECTS.LOADING)).not.toBeInTheDocument(); + expect(screen.queryByTestId(CHART_PANEL_TEST_SUBJECTS.ERROR)).not.toBeInTheDocument(); + expect(screen.getByTestId(CHART_PANEL_TEST_SUBJECTS.TEST_CHART)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/components/chart_panel.tsx b/x-pack/plugins/cloud_security_posture/public/components/chart_panel.tsx new file mode 100644 index 0000000000000..2b0882d0916e6 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/chart_panel.tsx @@ -0,0 +1,75 @@ +/* + * 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 React from 'react'; +import { + EuiPanel, + EuiText, + EuiTitle, + EuiLoadingChart, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import { CHART_PANEL_TEST_SUBJECTS } from './constants'; + +interface ChartPanelProps { + title?: string; + hasBorder?: boolean; + isLoading: boolean; + isError: boolean; +} + +const Loading = () => ( + + + +); + +const Error = () => ( + + + {'Error'} + + +); + +export const ChartPanel: React.FC = ({ + title, + hasBorder = true, + isLoading, + isError, + children, +}) => { + const renderChart = () => { + if (isLoading) return ; + if (isError) return ; + return children; + }; + + return ( + + + + {title && ( + +

{title}

+
+ )} +
+ {renderChart()} +
+
+ ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx b/x-pack/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx new file mode 100644 index 0000000000000..bec44a30b7665 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx @@ -0,0 +1,17 @@ +/* + * 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 React from 'react'; +import { FormattedNumber } from '@kbn/i18n-react'; + +export const CompactFormattedNumber = ({ number }: { number: number }) => ( + +); diff --git a/x-pack/plugins/cloud_security_posture/public/components/constants.ts b/x-pack/plugins/cloud_security_posture/public/components/constants.ts new file mode 100644 index 0000000000000..e319fba593b1f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/constants.ts @@ -0,0 +1,13 @@ +/* + * 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 const CHART_PANEL_TEST_SUBJECTS = { + LOADING: 'chart_is_loading', + EMPTY: 'chart_is_empty', + ERROR: 'chart_is_error', + TEST_CHART: 'testing_chart', +}; diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_evaluation_badge.tsx b/x-pack/plugins/cloud_security_posture/public/components/csp_evaluation_badge.tsx new file mode 100644 index 0000000000000..93aa87c18a9b8 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/csp_evaluation_badge.tsx @@ -0,0 +1,26 @@ +/* + * 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 React from 'react'; +import { EuiBadge, type EuiBadgeProps } from '@elastic/eui'; +import { CSP_EVALUATION_BADGE_FAILED, CSP_EVALUATION_BADGE_PASSED } from './translations'; + +interface Props { + type: 'passed' | 'failed'; +} + +const getColor = (type: Props['type']): EuiBadgeProps['color'] => { + if (type === 'passed') return 'success'; + if (type === 'failed') return 'danger'; + return 'default'; +}; + +export const CspEvaluationBadge = ({ type }: Props) => ( + + {type === 'failed' ? CSP_EVALUATION_BADGE_FAILED : CSP_EVALUATION_BADGE_PASSED} + +); diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_health_badge.tsx b/x-pack/plugins/cloud_security_posture/public/components/csp_health_badge.tsx new file mode 100644 index 0000000000000..570789086e464 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/csp_health_badge.tsx @@ -0,0 +1,22 @@ +/* + * 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 React from 'react'; +import { EuiBadge } from '@elastic/eui'; +import type { Score } from '../../common/types'; +import * as TEXT from './translations'; + +interface Props { + value: Score; +} + +export const CspHealthBadge = ({ value }: Props) => { + if (value <= 65) return {TEXT.CRITICAL}; + if (value <= 86) return {TEXT.WARNING}; + if (value <= 100) return {TEXT.HEALTHY}; + return null; +}; diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_loading_state.tsx b/x-pack/plugins/cloud_security_posture/public/components/csp_loading_state.tsx new file mode 100644 index 0000000000000..eb89284f27351 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/csp_loading_state.tsx @@ -0,0 +1,18 @@ +/* + * 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 { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; +import React from 'react'; + +export const CspLoadingState: React.FunctionComponent = ({ children }) => ( + + + + + {children} + +); diff --git a/x-pack/plugins/cloud_security_posture/public/components/page_template.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/page_template.test.tsx new file mode 100644 index 0000000000000..a9be5ebcdebfe --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/page_template.test.tsx @@ -0,0 +1,75 @@ +/* + * 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 React, { ComponentProps } from 'react'; +import { render, screen } from '@testing-library/react'; +import Chance from 'chance'; +import { createNavigationItemFixture } from '../test/fixtures/navigation_item'; +import { TestProvider } from '../test/test_provider'; +import { CspPageTemplate, getSideNavItems } from './page_template'; + +const chance = new Chance(); + +describe('getSideNavItems', () => { + it('maps navigation items to side navigation items', () => { + const navigationItem = createNavigationItemFixture(); + const id = chance.word(); + const sideNavItems = getSideNavItems({ [id]: navigationItem }); + + expect(sideNavItems).toHaveLength(1); + expect(sideNavItems[0]).toMatchObject({ + id, + name: navigationItem.name, + renderItem: expect.any(Function), + }); + }); + + it('does not map disabled navigation items to side navigation items', () => { + const navigationItem = createNavigationItemFixture({ disabled: true }); + const id = chance.word(); + const sideNavItems = getSideNavItems({ [id]: navigationItem }); + expect(sideNavItems).toHaveLength(0); + }); +}); + +describe('', () => { + const renderCspPageTemplate = (props: ComponentProps) => { + render( + + + + ); + }; + + it('renders children when not loading', () => { + const children = chance.sentence(); + renderCspPageTemplate({ isLoading: false, children }); + + expect(screen.getByText(children)).toBeInTheDocument(); + }); + + it('does not render loading text when not loading', () => { + const children = chance.sentence(); + const loadingText = chance.sentence(); + renderCspPageTemplate({ isLoading: false, loadingText, children }); + + expect(screen.queryByText(loadingText)).not.toBeInTheDocument(); + }); + + it('renders loading text when loading is true', () => { + const loadingText = chance.sentence(); + renderCspPageTemplate({ loadingText, isLoading: true }); + + expect(screen.getByText(loadingText)).toBeInTheDocument(); + }); + + it('does not render children when loading', () => { + const children = chance.sentence(); + renderCspPageTemplate({ isLoading: true, children }); + + expect(screen.queryByText(children)).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/components/page_template.tsx b/x-pack/plugins/cloud_security_posture/public/components/page_template.tsx new file mode 100644 index 0000000000000..4b28671a446ce --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/page_template.tsx @@ -0,0 +1,73 @@ +/* + * 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 { EuiSpacer } from '@elastic/eui'; +import React from 'react'; +import { NavLink } from 'react-router-dom'; +import { EuiErrorBoundary } from '@elastic/eui'; +import { + KibanaPageTemplate, + KibanaPageTemplateProps, +} from '../../../../../src/plugins/kibana_react/public'; +import { allNavigationItems } from '../common/navigation/constants'; +import type { CspNavigationItem } from '../common/navigation/types'; +import { CLOUD_SECURITY_POSTURE } from '../common/translations'; +import { CspLoadingState } from './csp_loading_state'; +import { LOADING } from './translations'; + +const activeItemStyle = { fontWeight: 700 }; + +export const getSideNavItems = ( + navigationItems: Record +): NonNullable['items'] => + Object.entries(navigationItems) + .filter(([_, navigationItem]) => !navigationItem.disabled) + .map(([id, navigationItem]) => ({ + id, + name: navigationItem.name, + renderItem: () => ( + + {navigationItem.name} + + ), + })); + +const defaultProps: KibanaPageTemplateProps = { + solutionNav: { + name: CLOUD_SECURITY_POSTURE, + items: getSideNavItems(allNavigationItems), + }, + restrictWidth: false, + template: 'default', +}; + +interface CspPageTemplateProps extends KibanaPageTemplateProps { + isLoading?: boolean; + loadingText?: string; +} + +export const CspPageTemplate: React.FC = ({ + children, + isLoading, + loadingText = LOADING, + ...props +}) => { + return ( + + + {isLoading ? ( + <> + + {loadingText} + + ) : ( + children + )} + + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/components/translations.ts b/x-pack/plugins/cloud_security_posture/public/components/translations.ts new file mode 100644 index 0000000000000..ac03b9e9df721 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/translations.ts @@ -0,0 +1,42 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const CRITICAL = i18n.translate('xpack.csp.critical', { + defaultMessage: 'Critical', +}); + +export const WARNING = i18n.translate('xpack.csp.warning', { + defaultMessage: 'Warning', +}); + +export const HEALTHY = i18n.translate('xpack.csp.healthy', { + defaultMessage: 'Healthy', +}); + +export const PAGE_NOT_FOUND = i18n.translate('xpack.csp.page_not_found', { + defaultMessage: 'Page not found', +}); + +export const LOADING = i18n.translate('xpack.csp.loading', { + defaultMessage: 'Loading...', +}); + +export const CSP_EVALUATION_BADGE_FAILED = i18n.translate( + 'xpack.csp.cspEvaluationBadge.failedLabelText', + { + defaultMessage: 'FAILED', + } +); + +export const CSP_EVALUATION_BADGE_PASSED = i18n.translate( + 'xpack.csp.cspEvaluationBadge.passedLabelText', + { + defaultMessage: 'PASSED', + } +); diff --git a/x-pack/plugins/cloud_security_posture/public/components/unknown_route.tsx b/x-pack/plugins/cloud_security_posture/public/components/unknown_route.tsx new file mode 100644 index 0000000000000..248d598302b9f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/unknown_route.tsx @@ -0,0 +1,22 @@ +/* + * 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 React from 'react'; +import { EuiEmptyPrompt } from '@elastic/eui'; +import { CspPageTemplate } from './page_template'; +import * as TEXT from './translations'; + +export const UnknownRoute = React.memo(() => ( + + {TEXT.PAGE_NOT_FOUND}

} + /> +
+)); diff --git a/x-pack/plugins/cloud_security_posture/public/index.ts b/x-pack/plugins/cloud_security_posture/public/index.ts new file mode 100755 index 0000000000000..62f00735247ca --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/index.ts @@ -0,0 +1,12 @@ +/* + * 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 { CspPlugin } from './plugin'; + +export type { CspClientPluginSetup, CspClientPluginStart } from './types'; + +export const plugin = () => new CspPlugin(); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx new file mode 100644 index 0000000000000..c23d6599a1c30 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx @@ -0,0 +1,72 @@ +/* + * 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 React from 'react'; +import { render, screen } from '@testing-library/react'; +import type { UseQueryResult } from 'react-query/types/react/types'; +import { createCspBenchmarkIntegrationFixture } from '../../test/fixtures/csp_benchmark_integration'; +import { createReactQueryResponse } from '../../test/fixtures/react_query'; +import { TestProvider } from '../../test/test_provider'; +import { Benchmarks, BENCHMARKS_ERROR_TEXT, BENCHMARKS_TABLE_DATA_TEST_SUBJ } from './benchmarks'; +import { ADD_A_CIS_INTEGRATION, BENCHMARK_INTEGRATIONS, LOADING_BENCHMARKS } from './translations'; +import { useCspBenchmarkIntegrations } from './use_csp_benchmark_integrations'; + +jest.mock('./use_csp_benchmark_integrations'); + +describe('', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + const renderBenchmarks = ( + queryResponse: Partial = createReactQueryResponse() + ) => { + (useCspBenchmarkIntegrations as jest.Mock).mockImplementation(() => queryResponse); + + return render( + + + + ); + }; + + it('renders the page header', () => { + renderBenchmarks(); + + expect(screen.getByText(BENCHMARK_INTEGRATIONS)).toBeInTheDocument(); + }); + + it('renders the "add integration" button', () => { + renderBenchmarks(); + + expect(screen.getByText(ADD_A_CIS_INTEGRATION)).toBeInTheDocument(); + }); + + it('renders loading state while loading', () => { + renderBenchmarks(createReactQueryResponse({ status: 'loading' })); + + expect(screen.getByText(LOADING_BENCHMARKS)).toBeInTheDocument(); + expect(screen.queryByTestId(BENCHMARKS_TABLE_DATA_TEST_SUBJ)).not.toBeInTheDocument(); + }); + + it('renders error state while there is an error', () => { + renderBenchmarks(createReactQueryResponse({ status: 'error', error: new Error() })); + + expect(screen.getByText(BENCHMARKS_ERROR_TEXT)).toBeInTheDocument(); + expect(screen.queryByTestId(BENCHMARKS_TABLE_DATA_TEST_SUBJ)).not.toBeInTheDocument(); + }); + + it('renders the benchmarks table', () => { + renderBenchmarks( + createReactQueryResponse({ + status: 'success', + data: [createCspBenchmarkIntegrationFixture()], + }) + ); + + expect(screen.getByTestId(BENCHMARKS_TABLE_DATA_TEST_SUBJ)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx new file mode 100644 index 0000000000000..56d43816cf34d --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx @@ -0,0 +1,49 @@ +/* + * 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 { EuiPageHeaderProps, EuiButton } from '@elastic/eui'; +import React from 'react'; +import { allNavigationItems } from '../../common/navigation/constants'; +import { useCspBreadcrumbs } from '../../common/navigation/use_csp_breadcrumbs'; +import { CspPageTemplate } from '../../components/page_template'; +import { BenchmarksTable } from './benchmarks_table'; +import { ADD_A_CIS_INTEGRATION, BENCHMARK_INTEGRATIONS, LOADING_BENCHMARKS } from './translations'; +import { useCspBenchmarkIntegrations } from './use_csp_benchmark_integrations'; + +const PAGE_HEADER: EuiPageHeaderProps = { + pageTitle: BENCHMARK_INTEGRATIONS, + rightSideItems: [ + // TODO: Link this to integrations once we have one + + {ADD_A_CIS_INTEGRATION} + , + ], +}; + +const BENCHMARKS_BREADCRUMBS = [allNavigationItems.benchmarks]; + +export const BENCHMARKS_TABLE_DATA_TEST_SUBJ = 'cspBenchmarksTable'; +// TODO: Error state +export const BENCHMARKS_ERROR_TEXT = 'TODO: Error state'; +const BenchmarksErrorState = () =>
{BENCHMARKS_ERROR_TEXT}
; + +export const Benchmarks = () => { + useCspBreadcrumbs(BENCHMARKS_BREADCRUMBS); + const query = useCspBenchmarkIntegrations(); + + return ( + + {query.status === 'error' && } + {query.status === 'success' && ( + + )} + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx new file mode 100644 index 0000000000000..ec0da6359eb49 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx @@ -0,0 +1,103 @@ +/* + * 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 React from 'react'; +import Chance from 'chance'; +import { render, screen } from '@testing-library/react'; +import moment from 'moment'; +import { createCspBenchmarkIntegrationFixture } from '../../test/fixtures/csp_benchmark_integration'; +import { BenchmarksTable } from './benchmarks_table'; +import { TABLE_COLUMN_HEADERS } from './translations'; + +describe('', () => { + const chance = new Chance(); + + it('renders all column headers', () => { + render(); + + Object.values(TABLE_COLUMN_HEADERS).forEach((columnHeader) => { + expect(screen.getByText(columnHeader)).toBeInTheDocument(); + }); + }); + + it('renders integration name', () => { + const integrationName = chance.sentence(); + const benchmarks = [ + createCspBenchmarkIntegrationFixture({ integration_name: integrationName }), + ]; + + render(); + + expect(screen.getByText(integrationName)).toBeInTheDocument(); + }); + + it('renders benchmark name', () => { + const benchmarkName = chance.sentence(); + const benchmarks = [createCspBenchmarkIntegrationFixture({ benchmark: benchmarkName })]; + + render(); + + expect(screen.getByText(benchmarkName)).toBeInTheDocument(); + }); + + it('renders active rules', () => { + const activeRules = chance.integer({ min: 1 }); + const totalRules = chance.integer({ min: activeRules }); + const benchmarks = [ + createCspBenchmarkIntegrationFixture({ rules: { active: activeRules, total: totalRules } }), + ]; + + render(); + + expect(screen.getByText(`${activeRules} of ${totalRules}`)).toBeInTheDocument(); + }); + + it('renders agent policy name', () => { + const agentPolicy = { + id: chance.guid(), + name: chance.sentence(), + number_of_agents: chance.integer({ min: 1 }), + }; + + const benchmarks = [createCspBenchmarkIntegrationFixture({ agent_policy: agentPolicy })]; + + render(); + + expect(screen.getByText(agentPolicy.name)).toBeInTheDocument(); + }); + + it('renders number of agents', () => { + const agentPolicy = { + id: chance.guid(), + name: chance.sentence(), + number_of_agents: chance.integer({ min: 1 }), + }; + + const benchmarks = [createCspBenchmarkIntegrationFixture({ agent_policy: agentPolicy })]; + + render(); + + expect(screen.getByText(agentPolicy.number_of_agents)).toBeInTheDocument(); + }); + + it('renders created by', () => { + const createdBy = chance.sentence(); + const benchmarks = [createCspBenchmarkIntegrationFixture({ created_by: createdBy })]; + + render(); + + expect(screen.getByText(createdBy)).toBeInTheDocument(); + }); + + it('renders created at', () => { + const createdAt = chance.date({ year: chance.integer({ min: 2015, max: 2021 }) }) as Date; + const benchmarks = [createCspBenchmarkIntegrationFixture({ created_at: createdAt })]; + + render(); + + expect(screen.getByText(moment(createdAt).fromNow())).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx new file mode 100644 index 0000000000000..b81065e7f354e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx @@ -0,0 +1,64 @@ +/* + * 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 { EuiBasicTable, type EuiBasicTableColumn } from '@elastic/eui'; +import React from 'react'; +import moment from 'moment'; +import { TABLE_COLUMN_HEADERS } from './translations'; +import type { CspBenchmarkIntegration } from './types'; + +interface BenchmarksTableProps { + benchmarks: CspBenchmarkIntegration[]; + 'data-test-subj'?: string; +} + +const BENCHMARKS_TABLE_COLUMNS: Array> = [ + { + field: 'integration_name', + name: TABLE_COLUMN_HEADERS.INTEGRATION_NAME, + dataType: 'string', + }, + { + field: 'benchmark', + name: TABLE_COLUMN_HEADERS.BENCHMARK, + dataType: 'string', + }, + { + render: (benchmarkIntegration: CspBenchmarkIntegration) => + `${benchmarkIntegration.rules.active} of ${benchmarkIntegration.rules.total}`, + name: TABLE_COLUMN_HEADERS.ACTIVE_RULES, + }, + { + field: 'agent_policy.name', + name: TABLE_COLUMN_HEADERS.AGENT_POLICY, + dataType: 'string', + }, + { + field: 'agent_policy.number_of_agents', + name: TABLE_COLUMN_HEADERS.NUMBER_OF_AGENTS, + dataType: 'number', + }, + { + field: 'created_by', + name: TABLE_COLUMN_HEADERS.CREATED_BY, + dataType: 'string', + }, + { + field: 'created_at', + name: TABLE_COLUMN_HEADERS.CREATED_AT, + dataType: 'date', + render: (date: CspBenchmarkIntegration['created_at']) => moment(date).fromNow(), + }, +]; + +export const BenchmarksTable = ({ benchmarks, ...rest }: BenchmarksTableProps) => ( + +); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/index.ts b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/index.ts new file mode 100644 index 0000000000000..839cf37ebf49e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/index.ts @@ -0,0 +1,8 @@ +/* + * 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 { Benchmarks } from './benchmarks'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/translations.ts b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/translations.ts new file mode 100644 index 0000000000000..a422295ebf812 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/translations.ts @@ -0,0 +1,47 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const BENCHMARK_INTEGRATIONS = i18n.translate( + 'xpack.csp.benchmarks.benchmark_integrations', + { + defaultMessage: 'Benchmark Integrations', + } +); + +export const LOADING_BENCHMARKS = i18n.translate('xpack.csp.benchmarks.loading_benchmarks', { + defaultMessage: 'Loading your benchmarks...', +}); + +export const ADD_A_CIS_INTEGRATION = i18n.translate('xpack.csp.benchmarks.add_a_cis_integration', { + defaultMessage: 'Add a CIS integration', +}); + +export const TABLE_COLUMN_HEADERS = { + INTEGRATION_NAME: i18n.translate('xpack.csp.benchmarks.table_column_headers.integration_name', { + defaultMessage: 'Integration Name', + }), + BENCHMARK: i18n.translate('xpack.csp.benchmarks.table_column_headers.benchmark', { + defaultMessage: 'Benchmark', + }), + ACTIVE_RULES: i18n.translate('xpack.csp.benchmarks.table_column_headers.active_rules', { + defaultMessage: 'Active Rules', + }), + AGENT_POLICY: i18n.translate('xpack.csp.benchmarks.table_column_headers.agent_policy', { + defaultMessage: 'Agent Policy', + }), + NUMBER_OF_AGENTS: i18n.translate('xpack.csp.benchmarks.table_column_headers.number_of_agents', { + defaultMessage: 'Number of Agents', + }), + CREATED_BY: i18n.translate('xpack.csp.benchmarks.table_column_headers.created_by', { + defaultMessage: 'Created by', + }), + CREATED_AT: i18n.translate('xpack.csp.benchmarks.table_column_headers.created_at', { + defaultMessage: 'Created at', + }), +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/types.ts b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/types.ts new file mode 100644 index 0000000000000..df35b6ac7869a --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/types.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +// TODO: Use interface from BE +export interface CspBenchmarkIntegration { + integration_name: string; + benchmark: string; + rules: { + active: number; + total: number; + }; + agent_policy: { + id: string; + name: string; + number_of_agents: number; + }; + created_by: string; + created_at: Date; +} diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts new file mode 100644 index 0000000000000..8508b1bab1fc4 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts @@ -0,0 +1,25 @@ +/* + * 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 { useQuery } from 'react-query'; +import { createCspBenchmarkIntegrationFixture } from '../../test/fixtures/csp_benchmark_integration'; +import { CspBenchmarkIntegration } from './types'; + +const QUERY_KEY = 'csp_benchmark_integrations'; + +const FAKE_DATA: CspBenchmarkIntegration[] = [ + createCspBenchmarkIntegrationFixture(), + createCspBenchmarkIntegrationFixture(), + createCspBenchmarkIntegrationFixture(), + createCspBenchmarkIntegrationFixture(), + createCspBenchmarkIntegrationFixture(), +]; + +// TODO: Use data from BE +export const useCspBenchmarkIntegrations = () => { + return useQuery(QUERY_KEY, () => Promise.resolve(FAKE_DATA)); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/cases_table.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/cases_table.tsx new file mode 100644 index 0000000000000..30107d6689752 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/cases_table.tsx @@ -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 React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { EuiIcon } from '@elastic/eui'; +import * as TEXT from '../translations'; + +export const CasesTable = () => { + return ( + + + + + + {TEXT.COMING_SOON} + + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/cloud_posture_score_chart.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/cloud_posture_score_chart.tsx new file mode 100644 index 0000000000000..a1f044241e5d3 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/cloud_posture_score_chart.tsx @@ -0,0 +1,141 @@ +/* + * 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 React from 'react'; +import { + AreaSeries, + Axis, + Chart, + ElementClickListener, + niceTimeFormatByDay, + Partition, + PartitionElementEvent, + PartitionLayout, + Settings, + timeFormatter, +} from '@elastic/charts'; +import { EuiFlexGroup, EuiText, EuiHorizontalRule, EuiFlexItem } from '@elastic/eui'; +import { statusColors } from '../../../common/constants'; +import type { Stats } from '../../../../common/types'; +import * as TEXT from '../translations'; +import { CompactFormattedNumber } from '../../../components/compact_formatted_number'; +import { INTERNAL_FEATURE_FLAGS } from '../../../../common/constants'; + +interface CloudPostureScoreChartProps { + data: Stats; + id: string; + partitionOnElementClick: (elements: PartitionElementEvent[]) => void; +} + +const ScoreChart = ({ + data: { totalPassed, totalFailed }, + id, + partitionOnElementClick, +}: CloudPostureScoreChartProps) => { + const data = [ + { label: TEXT.PASSED, value: totalPassed }, + { label: TEXT.FAILED, value: totalFailed }, + ]; + + return ( + + + d.value} + layout={PartitionLayout.sunburst} + layers={[ + { + groupByRollup: (d: { label: string }) => d.label, + shape: { + fillColor: (d, index) => + d.dataName === 'Passed' ? statusColors.success : statusColors.danger, + }, + }, + ]} + /> + + ); +}; + +const PercentageInfo = ({ + postureScore, + totalPassed, + totalFindings, +}: CloudPostureScoreChartProps['data']) => { + const percentage = `${Math.round(postureScore)}%`; + + return ( + + {percentage} + + + {'/'} + + {' Findings passed'} + + + ); +}; + +const mockData = [ + [0, 9], + [1000, 70], + [2000, 40], + [4000, 90], + [5000, 53], +]; + +const ComplianceTrendChart = () => ( + + + + + + +); + +export const CloudPostureScoreChart = ({ + data, + id, + partitionOnElementClick, +}: CloudPostureScoreChartProps) => ( + + + + + + + + + + + + + + + + +); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_trend_chart.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_trend_chart.tsx new file mode 100644 index 0000000000000..51aed6ed4e958 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_trend_chart.tsx @@ -0,0 +1,32 @@ +/* + * 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 React from 'react'; +import { + Chart, + Settings, + Axis, + timeFormatter, + niceTimeFormatByDay, + AreaSeries, +} from '@elastic/charts'; + +export const ComplianceTrendChart = () => ( + + + + + + +); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts new file mode 100644 index 0000000000000..6b2c00c507e6f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts @@ -0,0 +1,73 @@ +/* + * 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 { getTopRisks, RisksTableProps } from './risks_table'; + +const podsAgg = { + name: 'pods', + totalFindings: 2, + totalPassed: 1, + totalFailed: 1, +}; + +const etcdAgg = { + name: 'etcd', + totalFindings: 5, + totalPassed: 0, + totalFailed: 5, +}; + +const clusterAgg = { + name: 'cluster', + totalFindings: 2, + totalPassed: 2, + totalFailed: 0, +}; + +const systemAgg = { + name: 'system', + totalFindings: 10, + totalPassed: 6, + totalFailed: 4, +}; + +const apiAgg = { + name: 'api', + totalFindings: 19100, + totalPassed: 2100, + totalFailed: 17000, +}; + +const serverAgg = { + name: 'server', + totalFindings: 7, + totalPassed: 4, + totalFailed: 3, +}; + +const mockData: RisksTableProps['data'] = [ + podsAgg, + etcdAgg, + clusterAgg, + systemAgg, + apiAgg, + serverAgg, +]; + +describe('getTopRisks', () => { + it('returns sorted by failed findings', () => { + expect(getTopRisks([systemAgg, etcdAgg, apiAgg], 3)).toEqual([apiAgg, etcdAgg, systemAgg]); + }); + + it('return array filtered with failed findings only', () => { + expect(getTopRisks([systemAgg, clusterAgg, apiAgg], 3)).toEqual([apiAgg, systemAgg]); + }); + + it('return sorted and filtered array with the correct number of elements', () => { + expect(getTopRisks(mockData, 5)).toEqual([apiAgg, etcdAgg, systemAgg, serverAgg, podsAgg]); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx new file mode 100644 index 0000000000000..1e355b3f3c82f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx @@ -0,0 +1,134 @@ +/* + * 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 React, { useMemo } from 'react'; +import { + EuiBasicTable, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiText, +} from '@elastic/eui'; +import { CloudPostureStats, ResourceType } from '../../../../common/types'; +import { CompactFormattedNumber } from '../../../components/compact_formatted_number'; +import * as TEXT from '../translations'; +import { INTERNAL_FEATURE_FLAGS } from '../../../../common/constants'; + +const mockData = [ + { + name: 'pods', + totalFindings: 2, + totalPassed: 1, + totalFailed: 1, + }, + { + name: 'etcd', + totalFindings: 5, + totalPassed: 0, + totalFailed: 5, + }, + { + name: 'cluster', + totalFindings: 2, + totalPassed: 2, + totalFailed: 0, + }, + { + name: 'system', + totalFindings: 10, + totalPassed: 6, + totalFailed: 4, + }, + { + name: 'api', + totalFindings: 19100, + totalPassed: 2100, + totalFailed: 17000, + }, + { + name: 'server', + totalFindings: 7, + totalPassed: 4, + totalFailed: 3, + }, +]; + +export interface RisksTableProps { + data: CloudPostureStats['resourcesTypes']; + maxItems: number; + onCellClick: (resourceTypeName: string) => void; + onViewAllClick: () => void; +} + +export const getTopRisks = ( + resourcesTypes: CloudPostureStats['resourcesTypes'], + maxItems: number +) => { + const filtered = resourcesTypes.filter((x) => x.totalFailed > 0); + const sorted = filtered.slice().sort((first, second) => second.totalFailed - first.totalFailed); + + return sorted.slice(0, maxItems); +}; + +export const RisksTable = ({ + data: resourcesTypes, + maxItems, + onCellClick, + onViewAllClick, +}: RisksTableProps) => { + const columns = useMemo( + () => [ + { + field: 'name', + name: TEXT.RESOURCE_TYPE, + render: (resourceTypeName: ResourceType['name']) => ( + onCellClick(resourceTypeName)}>{resourceTypeName} + ), + }, + { + field: 'totalFailed', + name: TEXT.FINDINGS, + render: (totalFailed: ResourceType['totalFailed'], resource: ResourceType) => ( + <> + + + + + {'/'} + + + + ), + }, + ], + [onCellClick] + ); + + const items = useMemo(() => getTopRisks(resourcesTypes, maxItems), [resourcesTypes, maxItems]); + + return ( + + + + rowHeader="name" + items={INTERNAL_FEATURE_FLAGS.showRisksMock ? getTopRisks(mockData, maxItems) : items} + columns={columns} + /> + + + + + + {TEXT.VIEW_ALL_FAILED_FINDINGS} + + + + + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx new file mode 100644 index 0000000000000..a21ac4877f1c6 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx @@ -0,0 +1,44 @@ +/* + * 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 React from 'react'; +import { EuiSpacer } from '@elastic/eui'; +import { allNavigationItems } from '../../common/navigation/constants'; +import { useCspBreadcrumbs } from '../../common/navigation/use_csp_breadcrumbs'; +import { SummarySection } from './dashboard_sections/summary_section'; +import { BenchmarksSection } from './dashboard_sections/benchmarks_section'; +import { useCloudPostureStatsApi } from '../../common/api'; +import { CspPageTemplate } from '../../components/page_template'; +import * as TEXT from './translations'; + +const CompliancePage = () => { + const getStats = useCloudPostureStatsApi(); + if (getStats.isLoading) return null; + + return ( + <> + + + + + + ); +}; + +export const ComplianceDashboard = () => { + useCspBreadcrumbs([allNavigationItems.dashboard]); + + return ( + + + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx new file mode 100644 index 0000000000000..c94f138616f55 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx @@ -0,0 +1,153 @@ +/* + * 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 React from 'react'; +import { + EuiFlexItem, + EuiPanel, + EuiIcon, + EuiSpacer, + EuiFlexGroup, + EuiText, + EuiButtonEmpty, + useEuiTheme, +} from '@elastic/eui'; +import { EuiIconType } from '@elastic/eui/src/components/icon/icon'; +import { PartitionElementEvent } from '@elastic/charts'; +import { EuiThemeComputed } from '@elastic/eui/src/services/theme/types'; +import { CloudPostureScoreChart } from '../compliance_charts/cloud_posture_score_chart'; +import { useCloudPostureStatsApi } from '../../../common/api/use_cloud_posture_stats_api'; +import { ChartPanel } from '../../../components/chart_panel'; +import * as TEXT from '../translations'; +import { Evaluation } from '../../../../common/types'; +import { RisksTable } from '../compliance_charts/risks_table'; +import { INTERNAL_FEATURE_FLAGS, RULE_FAILED } from '../../../../common/constants'; +import { useNavigateFindings } from '../../../common/hooks/use_navigate_findings'; + +const logoMap: ReadonlyMap = new Map([['CIS Kubernetes', 'logoKubernetes']]); + +const getBenchmarkLogo = (benchmarkName: string): EuiIconType => { + return logoMap.get(benchmarkName) ?? 'logoElastic'; +}; + +const mockClusterId = '2468540'; + +const cardHeight = 300; + +export const BenchmarksSection = () => { + const { euiTheme } = useEuiTheme(); + const navToFindings = useNavigateFindings(); + const getStats = useCloudPostureStatsApi(); + const clusters = getStats.isSuccess && getStats.data.clusters; + if (!clusters) return null; + + const handleElementClick = (clusterId: string, elements: PartitionElementEvent[]) => { + const [element] = elements; + const [layerValue] = element; + const evaluation = layerValue[0].groupByRollup as Evaluation; + + navToFindings({ cluster_id: clusterId, 'result.evaluation': evaluation }); + }; + + const handleCellClick = (clusterId: string, resourceTypeName: string) => { + navToFindings({ + cluster_id: clusterId, + 'resource.type': resourceTypeName, + 'result.evaluation': RULE_FAILED, + }); + }; + + const handleViewAllClick = (clusterId: string) => { + navToFindings({ cluster_id: clusterId, 'result.evaluation': RULE_FAILED }); + }; + + return ( + <> + {clusters.map((cluster) => { + const shortId = cluster.meta.clusterId.slice(0, 6); + + return ( + <> + + + + + + +

{cluster.meta.benchmarkName}

+
+ +

{`Cluster ID ${shortId || mockClusterId}`}

+
+ {INTERNAL_FEATURE_FLAGS.showClusterMetaMock && ( + + + {' Updated 7 second ago'} + + )} +
+ + + + + {INTERNAL_FEATURE_FLAGS.showManageRulesMock && ( + {'Manage Rules'} + )} + +
+
+ + + + handleElementClick(cluster.meta.clusterId, elements) + } + /> + + + + + + handleCellClick(cluster.meta.clusterId, resourceTypeName) + } + onViewAllClick={() => handleViewAllClick(cluster.meta.clusterId)} + /> + + +
+
+ + + ); + })} + + ); +}; + +const getIntegrationBoxStyle = (euiTheme: EuiThemeComputed) => ({ + border: `1px solid ${euiTheme.colors.lightShade}`, + borderRadius: `${euiTheme.border.radius.medium} 0 0 ${euiTheme.border.radius.medium}`, + background: euiTheme.colors.lightestShade, +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx new file mode 100644 index 0000000000000..01dd072907472 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx @@ -0,0 +1,85 @@ +/* + * 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 React from 'react'; +import { EuiFlexGrid, EuiFlexItem } from '@elastic/eui'; +import { PartitionElementEvent } from '@elastic/charts'; +import { ChartPanel } from '../../../components/chart_panel'; +import { useCloudPostureStatsApi } from '../../../common/api'; +import * as TEXT from '../translations'; +import { CloudPostureScoreChart } from '../compliance_charts/cloud_posture_score_chart'; +import { Evaluation } from '../../../../common/types'; +import { RisksTable } from '../compliance_charts/risks_table'; +import { CasesTable } from '../compliance_charts/cases_table'; +import { useNavigateFindings } from '../../../common/hooks/use_navigate_findings'; +import { RULE_FAILED } from '../../../../common/constants'; + +const defaultHeight = 360; + +// TODO: limit this to desktop media queries only +const summarySectionWrapperStyle = { + height: defaultHeight, +}; + +export const SummarySection = () => { + const navToFindings = useNavigateFindings(); + const getStats = useCloudPostureStatsApi(); + if (!getStats.isSuccess) return null; + + const handleElementClick = (elements: PartitionElementEvent[]) => { + const [element] = elements; + const [layerValue] = element; + const evaluation = layerValue[0].groupByRollup as Evaluation; + + navToFindings({ 'result.evaluation': evaluation }); + }; + + const handleCellClick = (resourceTypeName: string) => { + navToFindings({ 'resource.type': resourceTypeName, 'result.evaluation': RULE_FAILED }); + }; + + const handleViewAllClick = () => { + navToFindings({ 'result.evaluation': RULE_FAILED }); + }; + + return ( + + + + + + + + + + + + + + + + + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx new file mode 100644 index 0000000000000..40ac9c5fbee89 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx @@ -0,0 +1,8 @@ +/* + * 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 './compliance_dashboard'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/translations.ts b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/translations.ts new file mode 100644 index 0000000000000..0d62625f98254 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/translations.ts @@ -0,0 +1,84 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const CLOUD_POSTURE = i18n.translate('xpack.csp.cloud_posture', { + defaultMessage: 'Cloud Posture', +}); + +export const CLOUD_POSTURE_SCORE = i18n.translate('xpack.csp.cloud_posture_score', { + defaultMessage: 'Cloud Posture Score', +}); + +export const RISKS = i18n.translate('xpack.csp.risks', { + defaultMessage: 'Risks', +}); + +export const OPEN_CASES = i18n.translate('xpack.csp.open_cases', { + defaultMessage: 'Open Cases', +}); + +export const COMING_SOON = i18n.translate('xpack.csp.coming_soon', { + defaultMessage: 'Coming soon', +}); + +export const COMPLIANCE_SCORE = i18n.translate('xpack.csp.compliance_score', { + defaultMessage: 'Compliance Score', +}); + +export const COMPLIANCE_TREND = i18n.translate('xpack.csp.compliance_trend', { + defaultMessage: 'Compliance Trend', +}); + +export const POSTURE_SCORE = i18n.translate('xpack.csp.posture_score', { + defaultMessage: 'Posture Score', +}); + +export const STATUS = i18n.translate('xpack.csp.status', { + defaultMessage: 'STATUS', +}); + +export const TOTAL_FAILURES = i18n.translate('xpack.csp.total_failures', { + defaultMessage: 'Total Failures', +}); + +export const ERROR = i18n.translate('xpack.csp.error', { + defaultMessage: 'Error', +}); + +export const POSTURE_SCORE_TREND = i18n.translate('xpack.csp.posture_score_trend', { + defaultMessage: 'Posture Score Trend', +}); + +export const ACTIVE_FRAMEWORKS = i18n.translate('xpack.csp.active_frameworks', { + defaultMessage: 'Active Frameworks', +}); + +export const TOTAL_RESOURCES = i18n.translate('xpack.csp.total_resources', { + defaultMessage: 'Total Resources', +}); + +export const PASSED = i18n.translate('xpack.csp.passed', { + defaultMessage: 'Passed', +}); + +export const FAILED = i18n.translate('xpack.csp.failed', { + defaultMessage: 'Failed', +}); + +export const VIEW_ALL_FAILED_FINDINGS = i18n.translate('xpack.csp.view_all_failed_findings', { + defaultMessage: 'View all failed findings', +}); + +export const RESOURCE_TYPE = i18n.translate('xpack.csp.resource_type', { + defaultMessage: 'Resource Type', +}); + +export const FINDINGS = i18n.translate('xpack.csp.findings', { + defaultMessage: 'Findings', +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx new file mode 100644 index 0000000000000..8678993a73803 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx @@ -0,0 +1,74 @@ +/* + * 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 React from 'react'; +import type { UseQueryResult } from 'react-query'; +import { render, screen } from '@testing-library/react'; +import { Findings } from './findings'; +import { MISSING_KUBEBEAT } from './translations'; +import { TestProvider } from '../../test/test_provider'; +import { dataPluginMock } from '../../../../../../src/plugins/data/public/mocks'; +import { createStubDataView } from '../../../../../../src/plugins/data_views/public/data_views/data_view.stub'; +import { useKubebeatDataView } from './utils'; +import { CSP_KUBEBEAT_INDEX_PATTERN } from '../../../common/constants'; +import * as TEST_SUBJECTS from './test_subjects'; +import type { DataView } from '../../../../../../src/plugins/data/common'; + +jest.mock('./utils'); + +beforeEach(() => { + jest.restoreAllMocks(); +}); + +const Wrapper = ({ data = dataPluginMock.createStartContract() }) => ( + + + +); + +describe('', () => { + it("renders the error state component when 'kubebeat' DataView doesn't exists", async () => { + (useKubebeatDataView as jest.Mock).mockReturnValue({ + status: 'success', + } as UseQueryResult); + + render(); + + expect(await screen.findByText(MISSING_KUBEBEAT)).toBeInTheDocument(); + }); + + it("renders the error state component when 'kubebeat' request status is 'error'", async () => { + (useKubebeatDataView as jest.Mock).mockReturnValue({ + status: 'error', + } as UseQueryResult); + + render(); + + expect(await screen.findByText(MISSING_KUBEBEAT)).toBeInTheDocument(); + }); + + it("renders the success state component when 'kubebeat' DataView exists and request status is 'success'", async () => { + const data = dataPluginMock.createStartContract(); + const source = await data.search.searchSource.create(); + + (source.fetch$ as jest.Mock).mockReturnValue({ + toPromise: () => Promise.resolve({ rawResponse: { hits: { hits: [] } } }), + }); + + (useKubebeatDataView as jest.Mock).mockReturnValue({ + status: 'success', + data: createStubDataView({ + spec: { + id: CSP_KUBEBEAT_INDEX_PATTERN, + }, + }), + } as UseQueryResult); + + render(); + + expect(await screen.findByTestId(TEST_SUBJECTS.FINDINGS_CONTAINER)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx new file mode 100644 index 0000000000000..801632d4915bd --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx @@ -0,0 +1,50 @@ +/* + * 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 React from 'react'; +import { EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; +import type { EuiPageHeaderProps } from '@elastic/eui'; +import { allNavigationItems } from '../../common/navigation/constants'; +import { useCspBreadcrumbs } from '../../common/navigation/use_csp_breadcrumbs'; +import { FindingsContainer } from './findings_container'; +import { CspPageTemplate } from '../../components/page_template'; +import { useKubebeatDataView } from './utils'; +import * as TEST_SUBJECTS from './test_subjects'; +import { FINDINGS, MISSING_KUBEBEAT } from './translations'; + +const pageHeader: EuiPageHeaderProps = { + pageTitle: FINDINGS, +}; + +export const Findings = () => { + const dataView = useKubebeatDataView(); + useCspBreadcrumbs([allNavigationItems.findings]); + + return ( + + {dataView.status === 'loading' && } + {(dataView.status === 'error' || (dataView.status !== 'loading' && !dataView.data)) && ( + + )} + {dataView.status === 'success' && dataView.data && ( + + )} + + ); +}; + +const LoadingPrompt = () => } />; + +// TODO: follow https://elastic.github.io/eui/#/display/empty-prompt/guidelines +const ErrorPrompt = () => ( + {MISSING_KUBEBEAT}} + /> +); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_container.tsx new file mode 100644 index 0000000000000..0b16f1d877a5e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_container.tsx @@ -0,0 +1,47 @@ +/* + * 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 React from 'react'; +import { EuiSpacer } from '@elastic/eui'; +import { FindingsTable } from './findings_table'; +import { FindingsSearchBar } from './findings_search_bar'; +import * as TEST_SUBJECTS from './test_subjects'; +import type { DataView } from '../../../../../../src/plugins/data/common'; +import { SortDirection } from '../../../../../../src/plugins/data/common'; +import { useUrlQuery } from '../../common/hooks/use_url_query'; +import { useFindings, type CspFindingsRequest } from './use_findings'; + +// TODO: define this as a schema with default values +// need to get Query and DateRange schema +const getDefaultQuery = (): CspFindingsRequest => ({ + query: { language: 'kuery', query: '' }, + filters: [], + dateRange: { + from: 'now-15m', + to: 'now', + }, + sort: [{ ['@timestamp']: SortDirection.desc }], + from: 0, + size: 10, +}); + +export const FindingsContainer = ({ dataView }: { dataView: DataView }) => { + const { urlQuery: findingsQuery, setUrlQuery, key } = useUrlQuery(getDefaultQuery); + const findingsResult = useFindings(dataView, findingsQuery, key); + + return ( +
+ + + +
+ ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_flyout.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_flyout.tsx new file mode 100644 index 0000000000000..544e3542d1b59 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_flyout.tsx @@ -0,0 +1,182 @@ +/* + * 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 React, { useState } from 'react'; +import { + EuiFlexItem, + EuiSpacer, + EuiCode, + EuiDescriptionList, + EuiTextColor, + EuiFlyout, + EuiFlyoutHeader, + EuiTitle, + EuiFlyoutBody, + EuiBadge, + EuiTabs, + EuiTab, + EuiFlexGrid, + EuiCard, + PropsOf, +} from '@elastic/eui'; +import { assertNever } from '@kbn/std'; +import type { CspFinding } from './types'; +import { CspEvaluationBadge } from '../../components/csp_evaluation_badge'; +import * as TEXT from './translations'; + +const tabs = ['result', 'rule', 'resource'] as const; + +type FindingsTab = typeof tabs[number]; + +type EuiListItemsProps = NonNullable['listItems']>[number]; + +interface Card { + title: string; + listItems: Array<[EuiListItemsProps['title'], EuiListItemsProps['description']]>; +} + +interface FindingFlyoutProps { + onClose(): void; + findings: CspFinding; +} + +export const FindingsRuleFlyout = ({ onClose, findings }: FindingFlyoutProps) => { + const [tab, setTab] = useState('result'); + return ( + + + + +

{TEXT.FINDINGS}

+
+
+ + + {tabs.map((v) => ( + setTab(v)} + style={{ textTransform: 'capitalize' }} + > + {v} + + ))} + +
+ + + +
+ ); +}; + +const Cards = ({ data }: { data: Card[] }) => ( + + {data.map((card) => ( + + + ({ title: v[0], description: v[1] }))} + /> + + + ))} + +); + +const FindingsTab = ({ tab, findings }: { findings: CspFinding; tab: FindingsTab }) => { + switch (tab) { + case 'result': + return ; + case 'rule': + return ; + case 'resource': + return ; + default: + assertNever(tab); + } +}; + +const getResourceCards = ({ resource }: CspFinding): Card[] => [ + { + title: TEXT.RESOURCE, + listItems: [ + [TEXT.FILENAME, {resource.filename}], + [TEXT.MODE, resource.mode], + [TEXT.PATH, {resource.path}], + [TEXT.TYPE, resource.type], + [TEXT.UID, resource.uid], + ], + }, +]; + +const getRuleCards = ({ rule }: CspFinding): Card[] => [ + { + title: TEXT.RULE, + listItems: [ + [TEXT.BENCHMARK, rule.benchmark], + [TEXT.NAME, rule.name], + [TEXT.DESCRIPTION, rule.description], + [TEXT.REMEDIATION, {rule.remediation}], + [ + TEXT.TAGS, + rule.tags.map((t) => ( + + {t} + + )), + ], + ], + }, +]; + +const getResultCards = ({ result, agent, host, ...rest }: CspFinding): Card[] => [ + { + title: TEXT.RESULT, + listItems: [ + [TEXT.EVALUATION, ], + [TEXT.EVIDENCE, {JSON.stringify(result.evidence, null, 2)}], + [TEXT.TIMESTAMP, rest['@timestamp']], + result.evaluation === 'failed' && [TEXT.REMEDIATION, rest.rule.remediation], + ].filter(Boolean) as Card['listItems'], + }, + { + title: TEXT.AGENT, + listItems: [ + [TEXT.NAME, agent.name], + [TEXT.ID, agent.id], + [TEXT.TYPE, agent.type], + [TEXT.VERSION, agent.version], + ], + }, + { + title: TEXT.HOST, + listItems: [ + [TEXT.ARCHITECTURE, host.architecture], + [TEXT.CONTAINERIZED, host.containerized ? 'true' : 'false'], + [TEXT.HOSTNAME, host.hostname], + [TEXT.ID, host.id], + [TEXT.IP, host.ip.join(',')], + [TEXT.MAC, host.mac.join(',')], + [TEXT.NAME, host.name], + ], + }, + { + title: TEXT.OS, + listItems: [ + [TEXT.CODENAME, host.os.codename], + [TEXT.FAMILY, host.os.family], + [TEXT.KERNEL, host.os.kernel], + [TEXT.NAME, host.os.name], + [TEXT.PLATFORM, host.os.platform], + [TEXT.TYPE, host.os.type], + [TEXT.VERSION, host.os.version], + ], + }, +]; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_search_bar.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_search_bar.tsx new file mode 100644 index 0000000000000..c4e16cb873e35 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_search_bar.tsx @@ -0,0 +1,57 @@ +/* + * 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 React from 'react'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import * as TEST_SUBJECTS from './test_subjects'; +import type { CspFindingsRequest, CspFindingsResponse } from './use_findings'; +import type { CspClientPluginStartDeps } from '../../types'; +import { PLUGIN_NAME } from '../../../common'; +import type { DataView } from '../../../../../../src/plugins/data/common'; + +type SearchBarQueryProps = Pick; + +interface BaseFindingsSearchBarProps extends SearchBarQueryProps { + setQuery(v: Partial): void; +} + +type FindingsSearchBarProps = CspFindingsResponse & BaseFindingsSearchBarProps; + +export const FindingsSearchBar = ({ + dataView, + dateRange, + query, + filters, + status, + setQuery, +}: FindingsSearchBarProps & { dataView: DataView }) => { + const { + data: { + ui: { SearchBar }, + }, + } = useKibana().services; + + return ( + setQuery({ filters: value })} + /> + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_table.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_table.test.tsx new file mode 100644 index 0000000000000..0fa106fda1c8f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_table.test.tsx @@ -0,0 +1,93 @@ +/* + * 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 React from 'react'; +import { render, screen } from '@testing-library/react'; +import * as TEST_SUBJECTS from './test_subjects'; +import { FindingsTable } from './findings_table'; +import type { PropsOf } from '@elastic/eui'; +import Chance from 'chance'; +import type { CspFinding } from './types'; + +const chance = new Chance(); + +const getFakeFindings = (): CspFinding & { id: string } => ({ + id: chance.word(), + result: { + evaluation: chance.weighted(['passed', 'failed'], [0.5, 0.5]), + evidence: { + filemode: chance.word(), + }, + }, + rule: { + name: chance.word(), + description: chance.paragraph(), + impact: chance.word(), + remediation: chance.word(), + benchmark: { + name: 'CIS Kubernetes', + version: '1.6.0', + }, + tags: [], + }, + agent: { + id: chance.string(), + name: chance.string(), + type: chance.string(), + version: chance.string(), + }, + resource: { + filename: chance.string(), + type: chance.string(), + path: chance.string(), + uid: chance.string(), + mode: chance.string(), + }, + run_id: chance.string(), + host: {} as any, + ecs: {} as any, + '@timestamp': new Date().toISOString(), +}); + +type TableProps = PropsOf; + +describe('', () => { + it('renders the zero state when status success and data has a length of zero ', async () => { + const props: TableProps = { + status: 'success', + data: { data: [], total: 0 }, + error: null, + sort: [], + from: 1, + size: 10, + setQuery: jest.fn, + }; + + render(); + + expect(screen.getByTestId(TEST_SUBJECTS.FINDINGS_TABLE_ZERO_STATE)).toBeInTheDocument(); + }); + + it('renders the table with provided items', () => { + const data = Array.from({ length: 10 }, getFakeFindings); + + const props: TableProps = { + status: 'success', + data: { data, total: 10 }, + error: null, + sort: [], + from: 0, + size: 10, + setQuery: jest.fn, + }; + + render(); + + data.forEach((item) => { + expect(screen.getByText(item.rule.name)).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_table.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_table.tsx new file mode 100644 index 0000000000000..176141aaebca6 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings_table.tsx @@ -0,0 +1,195 @@ +/* + * 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 React, { useCallback, useMemo, useState } from 'react'; +import { + type Criteria, + EuiToolTip, + EuiLink, + EuiTableFieldDataColumnType, + EuiEmptyPrompt, + EuiBasicTable, + PropsOf, + EuiBasicTableProps, +} from '@elastic/eui'; +import moment from 'moment'; +import { extractErrorMessage } from '../../../common/utils/helpers'; +import * as TEST_SUBJECTS from './test_subjects'; +import * as TEXT from './translations'; +import type { CspFinding } from './types'; +import { CspEvaluationBadge } from '../../components/csp_evaluation_badge'; +import type { CspFindingsRequest, CspFindingsResponse } from './use_findings'; +import { SortDirection } from '../../../../../../src/plugins/data/common'; +import { FindingsRuleFlyout } from './findings_flyout'; + +type TableQueryProps = Pick; + +interface BaseFindingsTableProps extends TableQueryProps { + setQuery(query: Partial): void; +} + +type FindingsTableProps = CspFindingsResponse & BaseFindingsTableProps; + +const FindingsTableComponent = ({ + setQuery, + from, + size, + sort = [], + error, + ...props +}: FindingsTableProps) => { + const [selectedFinding, setSelectedFinding] = useState(); + + const pagination = useMemo( + () => + getEuiPaginationFromEsSearchSource({ + from, + size, + total: props.status === 'success' ? props.data.total : 0, + }), + [from, size, props] + ); + + const sorting = useMemo(() => getEuiSortFromEsSearchSource(sort), [sort]); + + const getCellProps = useCallback( + (item: CspFinding, column: EuiTableFieldDataColumnType) => ({ + onClick: column.field === 'rule.name' ? () => setSelectedFinding(item) : undefined, + }), + [] + ); + + const onTableChange = useCallback( + (params: Criteria) => { + setQuery(getEsSearchQueryFromEuiTableParams(params)); + }, + [setQuery] + ); + + // Show "zero state" + if (props.status === 'success' && !props.data.data.length) + // TODO: use our own logo + return ( + {TEXT.NO_FINDINGS}} + data-test-subj={TEST_SUBJECTS.FINDINGS_TABLE_ZERO_STATE} + /> + ); + + return ( + <> + + {selectedFinding && ( + setSelectedFinding(undefined)} + /> + )} + + ); +}; + +const getEuiPaginationFromEsSearchSource = ({ + from: pageIndex, + size: pageSize, + total, +}: Pick & { + total: number; +}): EuiBasicTableProps['pagination'] => ({ + pageSize, + pageIndex: Math.ceil(pageIndex / pageSize), + totalItemCount: total, + pageSizeOptions: [10, 25, 100], + hidePerPageOptions: false, +}); + +const getEuiSortFromEsSearchSource = ( + sort: TableQueryProps['sort'] +): EuiBasicTableProps['sorting'] => { + if (!sort.length) return; + + const entry = Object.entries(sort[0])?.[0]; + if (!entry) return; + + const [field, direction] = entry; + return { sort: { field: field as keyof CspFinding, direction: direction as SortDirection } }; +}; + +const getEsSearchQueryFromEuiTableParams = ({ + page, + sort, +}: Criteria): Partial => ({ + ...(!!page && { from: page.index * page.size, size: page.size }), + sort: sort ? [{ [sort.field]: SortDirection[sort.direction] }] : undefined, +}); + +const timestampRenderer = (timestamp: string) => ( + + {moment.duration(moment().diff(timestamp)).humanize()} + +); + +const resourceFilenameRenderer = (filename: string) => ( + + {filename} + +); + +const ruleNameRenderer = (name: string) => ( + + {name} + +); + +const resultEvaluationRenderer = (type: PropsOf['type']) => ( + +); + +const columns: Array> = [ + { + field: 'resource.filename', + name: TEXT.RESOURCE, + truncateText: true, + width: '15%', + sortable: true, + render: resourceFilenameRenderer, + }, + { + field: 'rule.name', + name: TEXT.RULE_NAME, + truncateText: true, + render: ruleNameRenderer, + sortable: true, + }, + { + field: 'result.evaluation', + name: TEXT.EVALUATION, + width: '100px', + render: resultEvaluationRenderer, + sortable: true, + }, + { + field: '@timestamp', + width: '100px', + name: TEXT.TIMESTAMP, + truncateText: true, + render: timestampRenderer, + sortable: true, + }, +]; + +export const FindingsTable = React.memo(FindingsTableComponent); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/index.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/index.tsx new file mode 100644 index 0000000000000..2905f2af97e24 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/index.tsx @@ -0,0 +1,8 @@ +/* + * 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 './findings'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/test_subjects.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/test_subjects.ts new file mode 100644 index 0000000000000..06c1888a09122 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/test_subjects.ts @@ -0,0 +1,12 @@ +/* + * 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 const FINDINGS_SEARCH_BAR = 'findings_search_bar'; +export const FINDINGS_TABLE = 'findings_table'; +export const FINDINGS_CONTAINER = 'findings_container'; +export const FINDINGS_MISSING_INDEX = 'findings_page_missing_dataview'; +export const FINDINGS_TABLE_ZERO_STATE = 'findings_table_zero_state'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/translations.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/translations.ts new file mode 100644 index 0000000000000..0205a6ee0e68d --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/translations.ts @@ -0,0 +1,151 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const NAME = i18n.translate('xpack.csp.name', { + defaultMessage: 'Name', +}); + +export const SEARCH_FAILED = i18n.translate('xpack.csp.search_failed', { + defaultMessage: 'Search failed', +}); + +export const TAGS = i18n.translate('xpack.csp.tags', { + defaultMessage: 'Tags', +}); + +export const RULE_NAME = i18n.translate('xpack.csp.rule_name', { + defaultMessage: 'Rule Name', +}); + +export const OS = i18n.translate('xpack.csp.os', { + defaultMessage: 'OS', +}); + +export const FINDINGS = i18n.translate('xpack.csp.findings', { + defaultMessage: 'Findings', +}); + +export const MISSING_KUBEBEAT = i18n.translate('xpack.csp.kubebeatDataViewIsMissing', { + defaultMessage: 'Kubebeat DataView is missing', +}); + +export const RESOURCE = i18n.translate('xpack.csp.resource', { + defaultMessage: 'Resource', +}); + +export const FILENAME = i18n.translate('xpack.csp.filename', { + defaultMessage: 'Filename', +}); + +export const MODE = i18n.translate('xpack.csp.mode', { + defaultMessage: 'Mode', +}); + +export const TYPE = i18n.translate('xpack.csp.type', { + defaultMessage: 'Type', +}); + +export const PATH = i18n.translate('xpack.csp.path', { + defaultMessage: 'Path', +}); + +export const UID = i18n.translate('xpack.csp.uid', { + defaultMessage: 'UID', +}); + +export const GID = i18n.translate('xpack.csp.gid', { + defaultMessage: 'GID', +}); + +export const RULE = i18n.translate('xpack.csp.rule', { + defaultMessage: 'Rule', +}); + +export const DESCRIPTION = i18n.translate('xpack.csp.description', { + defaultMessage: 'Description', +}); + +export const REMEDIATION = i18n.translate('xpack.csp.remediation', { + defaultMessage: 'Remediation', +}); + +export const BENCHMARK = i18n.translate('xpack.csp.benchmark', { + defaultMessage: 'Benchmark', +}); + +export const RESULT = i18n.translate('xpack.csp.result', { + defaultMessage: 'Result', +}); + +export const EVALUATION = i18n.translate('xpack.csp.evaluation', { + defaultMessage: 'Evaluation', +}); + +export const EVIDENCE = i18n.translate('xpack.csp.evidence', { + defaultMessage: 'Evidence', +}); + +export const TIMESTAMP = i18n.translate('xpack.csp.timestamp', { + defaultMessage: 'Timestamp', +}); + +export const AGENT = i18n.translate('xpack.csp.agent', { + defaultMessage: 'Agent', +}); + +export const VERSION = i18n.translate('xpack.csp.version', { + defaultMessage: 'Version', +}); + +export const ID = i18n.translate('xpack.csp.id', { + defaultMessage: 'ID', +}); + +export const HOST = i18n.translate('xpack.csp.host', { + defaultMessage: 'HOST', +}); + +export const ARCHITECTURE = i18n.translate('xpack.csp.architecture', { + defaultMessage: 'Architecture', +}); + +export const CONTAINERIZED = i18n.translate('xpack.csp.containerized', { + defaultMessage: 'Containerized', +}); + +export const HOSTNAME = i18n.translate('xpack.csp.hostname', { + defaultMessage: 'Hostname', +}); + +export const MAC = i18n.translate('xpack.csp.mac', { + defaultMessage: 'Mac', +}); + +export const IP = i18n.translate('xpack.csp.ip', { + defaultMessage: 'IP', +}); + +export const CODENAME = i18n.translate('xpack.csp.codename', { + defaultMessage: 'Codename', +}); + +export const FAMILY = i18n.translate('xpack.csp.family', { + defaultMessage: 'Family', +}); + +export const KERNEL = i18n.translate('xpack.csp.kernel', { + defaultMessage: 'Kernel', +}); + +export const PLATFORM = i18n.translate('xpack.csp.platform', { + defaultMessage: 'Platform', +}); + +export const NO_FINDINGS = i18n.translate('xpack.csp.thereAreNoFindings', { + defaultMessage: 'There are no Findings', +}); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/types.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/types.ts new file mode 100644 index 0000000000000..b20d1fa801bfd --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/types.ts @@ -0,0 +1,72 @@ +/* + * 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. + */ + +// TODO: this needs to be defined in a versioned schema +export interface CspFinding { + '@timestamp': string; + run_id: string; + result: CspFindingResult; + resource: CspFindingResource; + rule: CspRule; + host: CspFindingHost; + agent: CspFindingAgent; + ecs: { + version: string; + }; +} + +interface CspRule { + benchmark: { name: string; version: string }; + description: string; + impact: string; + name: string; + remediation: string; + tags: string[]; +} + +interface CspFindingResult { + evaluation: 'passed' | 'failed'; + evidence: { + filemode: string; + }; +} + +interface CspFindingResource { + uid: string; + filename: string; + // gid: string; + mode: string; + path: string; + type: string; +} + +interface CspFindingHost { + id: string; + containerized: boolean; + ip: string[]; + mac: string[]; + name: string; + hostname: string; + architecture: string; + os: { + kernel: string; + codename: string; + type: string; + platform: string; + version: string; + family: string; + name: string; + }; +} + +interface CspFindingAgent { + version: string; + // ephemeral_id: string; + id: string; + name: string; + type: string; +} diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/use_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/use_findings.ts new file mode 100644 index 0000000000000..38228e513e31b --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/use_findings.ts @@ -0,0 +1,142 @@ +/* + * 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 { Filter } from '@kbn/es-query'; +import { type UseQueryResult, useQuery } from 'react-query'; +import type { AggregationsAggregate, SearchResponse } from '@elastic/elasticsearch/lib/api/types'; +import { number } from 'io-ts'; +import { extractErrorMessage, isNonNullable } from '../../../common/utils/helpers'; +import type { + DataView, + EsQuerySortValue, + IKibanaSearchResponse, + SerializedSearchSourceFields, + TimeRange, +} from '../../../../../../src/plugins/data/common'; +import type { CspClientPluginStartDeps } from '../../types'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import * as TEXT from './translations'; +import type { CoreStart } from '../../../../../../src/core/public'; +import type { CspFinding } from './types'; + +interface CspFindings { + data: CspFinding[]; + total: number; +} + +export interface CspFindingsRequest + extends Required> { + filters: Filter[]; + dateRange: TimeRange; +} + +type ResponseProps = 'data' | 'error' | 'status'; +type Result = UseQueryResult; + +// TODO: use distributive Pick +export type CspFindingsResponse = + | Pick, ResponseProps> + | Pick, ResponseProps> + | Pick, ResponseProps> + | Pick, ResponseProps>; + +const FIELDS_WITHOUT_KEYWORD_MAPPING = new Set(['@timestamp']); + +// NOTE: .keyword comes from the mapping we defined for the Findings index +const getSortKey = (key: string): string => + FIELDS_WITHOUT_KEYWORD_MAPPING.has(key) ? key : `${key}.keyword`; + +/** + * @description utility to transform a column header key to its field mapping for sorting + * @example Adds '.keyword' to every property we sort on except values of `FIELDS_WITHOUT_KEYWORD_MAPPING` + * @todo find alternative + * @note we choose the keyword 'keyword' in the field mapping + */ +const mapEsQuerySortKey = (sort: readonly EsQuerySortValue[]): EsQuerySortValue[] => + sort.slice().reduce((acc, cur) => { + const entry = Object.entries(cur)[0]; + if (!entry) return acc; + + const [k, v] = entry; + acc.push({ [getSortKey(k)]: v }); + + return acc; + }, []); + +const showResponseErrorToast = + ({ toasts }: CoreStart['notifications']) => + (error: unknown): void => { + if (error instanceof Error) toasts.addError(error, { title: TEXT.SEARCH_FAILED }); + else toasts.addDanger(extractErrorMessage(error, TEXT.SEARCH_FAILED)); + }; + +const extractFindings = ({ + rawResponse: { hits }, +}: IKibanaSearchResponse< + SearchResponse> +>): CspFindings => ({ + // TODO: use 'fields' instead of '_source' ? + data: hits.hits.map((hit) => hit._source!), + total: number.is(hits.total) ? hits.total : 0, +}); + +const createFindingsSearchSource = ( + { + query, + dateRange, + dataView, + filters, + ...rest + }: Omit & { + dataView: DataView; + }, + queryService: CspClientPluginStartDeps['data']['query'] +): SerializedSearchSourceFields => { + if (query) queryService.queryString.setQuery(query); + const timeFilter = queryService.timefilter.timefilter.createFilter(dataView, dateRange); + queryService.filterManager.setFilters([...filters, timeFilter].filter(isNonNullable)); + + return { + ...rest, + sort: mapEsQuerySortKey(rest.sort), + filter: queryService.filterManager.getFilters(), + query: queryService.queryString.getQuery(), + index: dataView.id, // TODO: constant + }; +}; + +/** + * @description a react-query#mutation wrapper on the data plugin searchSource + * @todo use 'searchAfter'. currently limited to 10k docs. see https://github.com/elastic/kibana/issues/116776 + */ +export const useFindings = ( + dataView: DataView, + searchProps: CspFindingsRequest, + urlKey?: string // Needed when URL query (searchProps) didn't change (now-15) but require a refetch +): CspFindingsResponse => { + const { + notifications, + data: { query, search }, + } = useKibana().services; + + return useQuery( + ['csp_findings', { searchProps, urlKey }], + async () => { + const source = await search.searchSource.create( + createFindingsSearchSource({ ...searchProps, dataView }, query) + ); + + const response = await source.fetch$().toPromise(); + + return response; + }, + { + cacheTime: 0, + onError: showResponseErrorToast(notifications!), + select: extractFindings, + } + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/utils.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/utils.tsx new file mode 100644 index 0000000000000..529b1ca5cdd1e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/utils.tsx @@ -0,0 +1,28 @@ +/* + * 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 { useQuery } from 'react-query'; +import type { CspClientPluginStartDeps } from '../../types'; +import { CSP_KUBEBEAT_INDEX_PATTERN } from '../../../common/constants'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; + +/** + * TODO: use perfected kibana data views + */ +export const useKubebeatDataView = () => { + const { + data: { dataViews }, + } = useKibana().services; + + // TODO: check if index exists + // if not, no point in creating a data view + // const check = () => http?.get(`/kubebeat`); + + // TODO: use `dataViews.get(ID)` + const findDataView = async () => (await dataViews.find(CSP_KUBEBEAT_INDEX_PATTERN))?.[0]; + + return useQuery(['kubebeat_dataview'], findDataView); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/index.ts b/x-pack/plugins/cloud_security_posture/public/pages/index.ts new file mode 100644 index 0000000000000..1e667a8949fc0 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/index.ts @@ -0,0 +1,11 @@ +/* + * 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 { Findings } from './findings'; +export * from './compliance_dashboard'; +export { Benchmarks } from './benchmarks'; +export { Rules } from './rules'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx new file mode 100644 index 0000000000000..130f03fd5784d --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx @@ -0,0 +1,20 @@ +/* + * 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 React from 'react'; +import type { EuiPageHeaderProps } from '@elastic/eui'; +import { CspPageTemplate } from '../../components/page_template'; + +// TODO: +// - get selected integration + +const pageHeader: EuiPageHeaderProps = { + pageTitle: 'Rules', +}; + +export const Rules = () => { + return ; +}; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts new file mode 100644 index 0000000000000..a11256edaa40e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts @@ -0,0 +1,66 @@ +/* + * 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 { useQuery, useMutation, useQueryClient } from 'react-query'; +import { cspRuleAssetSavedObjectType, type CspRuleSchema } from '../../../common/schemas/csp_rule'; +import type { + SavedObjectsBatchResponse, + SavedObjectsFindOptions, +} from '../../../../../../src/core/public'; +import { useKibana } from '../../common/hooks/use_kibana'; + +export type UseCspRulesOptions = Pick< + SavedObjectsFindOptions, + 'search' | 'searchFields' | 'page' | 'perPage' +>; + +export const useFindCspRules = ({ + search, + searchFields, + page = 1, + perPage = 10, +}: UseCspRulesOptions) => { + const { savedObjects } = useKibana().services; + return useQuery( + [cspRuleAssetSavedObjectType, { search, searchFields, page, perPage }], + () => + savedObjects.client.find({ + type: cspRuleAssetSavedObjectType, + search, + searchFields, + page, + // NOTE: 'name.raw' is a field maping we defined on 'name' so it'd also be sortable + // TODO: this needs to be shared or removed + sortField: 'name.raw', + perPage, + }), + { refetchOnWindowFocus: false } + ); +}; + +export const useBulkUpdateCspRules = () => { + const { savedObjects } = useKibana().services; + const queryClient = useQueryClient(); + + return useMutation( + (rules: CspRuleSchema[]) => + savedObjects.client.bulkUpdate( + rules.map((rule) => ({ + type: cspRuleAssetSavedObjectType, + id: rule.id, + attributes: rule, + })) + // TODO: fix bulkUpdate types in core + ) as Promise>, + { + onSettled: () => + queryClient.invalidateQueries({ + queryKey: cspRuleAssetSavedObjectType, + exact: false, + }), + } + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/plugin.ts b/x-pack/plugins/cloud_security_posture/public/plugin.ts new file mode 100755 index 0000000000000..d4cdeddd48d92 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/plugin.ts @@ -0,0 +1,54 @@ +/* + * 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 { AppMountParameters, CoreSetup, CoreStart, Plugin } from '../../../../src/core/public'; +import type { + CspClientPluginSetup, + CspClientPluginStart, + CspClientPluginSetupDeps, + CspClientPluginStartDeps, +} from './types'; +import { PLUGIN_NAME, PLUGIN_ID } from '../common'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; + +export class CspPlugin + implements + Plugin< + CspClientPluginSetup, + CspClientPluginStart, + CspClientPluginSetupDeps, + CspClientPluginStartDeps + > +{ + public setup( + core: CoreSetup, + plugins: CspClientPluginSetupDeps + ): CspClientPluginSetup { + // Register an application into the side navigation menu + core.application.register({ + id: PLUGIN_ID, + title: PLUGIN_NAME, + category: DEFAULT_APP_CATEGORIES.security, + async mount(params: AppMountParameters) { + // Load application bundle + const { renderApp } = await import('./application/index'); + // Get start services as specified in kibana.json + const [coreStart, depsStart] = await core.getStartServices(); + // Render the application + return renderApp(coreStart, depsStart, params); + }, + }); + + // Return methods that should be available to other plugins + return {}; + } + public start(core: CoreStart, plugins: CspClientPluginStartDeps): CspClientPluginStart { + return {}; + } + + public stop() {} +} diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts b/x-pack/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts new file mode 100644 index 0000000000000..63bde111d5c1e --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import Chance from 'chance'; +import type { CspBenchmarkIntegration } from '../../pages/benchmarks/types'; + +type CreateCspBenchmarkIntegrationFixtureInput = { + chance?: Chance.Chance; +} & Partial; + +export const createCspBenchmarkIntegrationFixture = ({ + chance = new Chance(), + integration_name = chance.sentence(), + benchmark = chance.sentence(), + rules = undefined, + agent_policy = { + id: chance.guid(), + name: chance.sentence(), + number_of_agents: chance.integer({ min: 1 }), + }, + created_by = chance.sentence(), + created_at = chance.date({ year: 2021 }) as Date, +}: CreateCspBenchmarkIntegrationFixtureInput = {}): CspBenchmarkIntegration => { + let outputRules: CspBenchmarkIntegration['rules'] | undefined = rules; + if (!outputRules) { + const activeRules = chance.integer({ min: 1 }); + const totalRules = chance.integer({ min: activeRules }); + outputRules = { + active: activeRules, + total: totalRules, + }; + } + + return { + integration_name, + benchmark, + rules: outputRules, + agent_policy, + created_by, + created_at, + }; +}; diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/navigation_item.ts b/x-pack/plugins/cloud_security_posture/public/test/fixtures/navigation_item.ts new file mode 100644 index 0000000000000..74b78dbd699e7 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/fixtures/navigation_item.ts @@ -0,0 +1,20 @@ +/* + * 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 Chance from 'chance'; +import type { CspNavigationItem } from '../../common/navigation/types'; + +type CreateNavigationItemFixtureInput = { chance?: Chance.Chance } & Partial; +export const createNavigationItemFixture = ({ + chance = new Chance(), + name = chance.word(), + path = `/${chance.word()}`, + disabled = undefined, +}: CreateNavigationItemFixtureInput = {}): CspNavigationItem => ({ + name, + path, + disabled, +}); diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts b/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts new file mode 100644 index 0000000000000..2e6eeb5addb0a --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts @@ -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 { UseQueryResult } from 'react-query/types/react/types'; + +interface CreateReactQueryResponseInput { + status?: UseQueryResult['status']; + data?: TData; + error?: TError; +} + +// TODO: Consider alternatives to using `Partial` over `UseQueryResult` for the return type: +// 1. Fully mock `UseQueryResult` +// 2. Mock the network layer instead of `useQuery` - see: https://tkdodo.eu/blog/testing-react-query +export const createReactQueryResponse = ({ + status = 'loading', + error = undefined, + data = undefined, +}: CreateReactQueryResponseInput = {}): Partial> => { + if (status === 'success') { + return { status, data }; + } + + if (status === 'error') { + return { status, error }; + } + + return { status }; +}; diff --git a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx new file mode 100755 index 0000000000000..1bb04128d4a67 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx @@ -0,0 +1,36 @@ +/* + * 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 React, { useMemo } from 'react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { Router, Switch, Route } from 'react-router-dom'; +import { QueryClient, QueryClientProvider } from 'react-query'; +import { coreMock } from '../../../../../src/core/public/mocks'; +import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; +import type { CspAppDeps } from '../application/app'; + +export const TestProvider: React.FC> = ({ + core = coreMock.createStart(), + deps = {}, + params = coreMock.createAppMountParameters(), + children, +} = {}) => { + const queryClient = useMemo(() => new QueryClient(), []); + return ( + + + + + + <>{children}} /> + + + + + + ); +}; diff --git a/x-pack/plugins/cloud_security_posture/public/types.ts b/x-pack/plugins/cloud_security_posture/public/types.ts new file mode 100755 index 0000000000000..c01ec0df41e28 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/types.ts @@ -0,0 +1,30 @@ +/* + * 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 { + DataPublicPluginSetup, + DataPublicPluginStart, +} from '../../../../src/plugins/data/public'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CspClientPluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CspClientPluginStart {} + +export interface CspClientPluginSetupDeps { + // required + data: DataPublicPluginSetup; + + // optional +} + +export interface CspClientPluginStartDeps { + // required + data: DataPublicPluginStart; + + // optional +} diff --git a/x-pack/plugins/cloud_security_posture/server/config.ts b/x-pack/plugins/cloud_security_posture/server/config.ts new file mode 100644 index 0000000000000..9c9ff926a2c38 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/config.ts @@ -0,0 +1,19 @@ +/* + * 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 { schema, type TypeOf } from '@kbn/config-schema'; +import type { PluginConfigDescriptor } from 'kibana/server'; + +const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: false }), +}); + +type CloudSecurityPostureConfig = TypeOf; + +export const config: PluginConfigDescriptor = { + schema: configSchema, +}; diff --git a/x-pack/plugins/cloud_security_posture/server/constants.ts b/x-pack/plugins/cloud_security_posture/server/constants.ts new file mode 100644 index 0000000000000..321a662e53914 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/constants.ts @@ -0,0 +1,9 @@ +/* + * 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 const RULE_PASSED = `passed`; +export const RULE_FAILED = `failed`; diff --git a/x-pack/plugins/cloud_security_posture/server/index.ts b/x-pack/plugins/cloud_security_posture/server/index.ts new file mode 100755 index 0000000000000..f790ac5256ff8 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/index.ts @@ -0,0 +1,15 @@ +/* + * 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 { PluginInitializerContext } from '../../../../src/core/server'; +import { CspPlugin } from './plugin'; + +export type { CspServerPluginSetup, CspServerPluginStart } from './types'; + +export const plugin = (initializerContext: PluginInitializerContext) => + new CspPlugin(initializerContext); + +export { config } from './config'; diff --git a/x-pack/plugins/cloud_security_posture/server/lib/csp_app_services.ts b/x-pack/plugins/cloud_security_posture/server/lib/csp_app_services.ts new file mode 100644 index 0000000000000..f769ea171c176 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/lib/csp_app_services.ts @@ -0,0 +1,36 @@ +/* + * 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 { + AgentService, + PackageService, + AgentPolicyServiceInterface, + PackagePolicyServiceInterface, +} from '../../../fleet/server'; + +export interface CspAppServiceDependencies { + packageService: PackageService; + agentService: AgentService; + packagePolicyService: PackagePolicyServiceInterface; + agentPolicyService: AgentPolicyServiceInterface; +} + +export class CspAppService { + public agentService: AgentService | undefined; + public packageService: PackageService | undefined; + public packagePolicyService: PackagePolicyServiceInterface | undefined; + public agentPolicyService: AgentPolicyServiceInterface | undefined; + + public start(dependencies: CspAppServiceDependencies) { + this.agentService = dependencies.agentService; + this.packageService = dependencies.packageService; + this.packagePolicyService = dependencies.packagePolicyService; + this.agentPolicyService = dependencies.agentPolicyService; + } + + public stop() {} +} diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.ts b/x-pack/plugins/cloud_security_posture/server/plugin.ts new file mode 100755 index 0000000000000..ce6e38e4c63c5 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/plugin.ts @@ -0,0 +1,75 @@ +/* + * 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 { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + Logger, +} from '../../../../src/core/server'; +import { CspAppService } from './lib/csp_app_services'; +import type { + CspServerPluginSetup, + CspServerPluginStart, + CspServerPluginSetupDeps, + CspServerPluginStartDeps, +} from './types'; +import { defineRoutes } from './routes'; +import { cspRuleAssetType } from './saved_objects/cis_1_4_1/csp_rule_type'; +import { initializeCspRules } from './saved_objects/cis_1_4_1/initialize_rules'; + +export interface CspAppContext { + logger: Logger; + service: CspAppService; +} + +export class CspPlugin + implements + Plugin< + CspServerPluginSetup, + CspServerPluginStart, + CspServerPluginSetupDeps, + CspServerPluginStartDeps + > +{ + private readonly logger: Logger; + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + private readonly CspAppService = new CspAppService(); + + public setup( + core: CoreSetup, + plugins: CspServerPluginSetupDeps + ): CspServerPluginSetup { + const cspAppContext: CspAppContext = { + logger: this.logger, + service: this.CspAppService, + }; + + core.savedObjects.registerType(cspRuleAssetType); + + const router = core.http.createRouter(); + + // Register server side APIs + defineRoutes(router, cspAppContext); + + return {}; + } + + public start(core: CoreStart, plugins: CspServerPluginStartDeps): CspServerPluginStart { + this.CspAppService.start({ + ...plugins.fleet, + }); + + initializeCspRules(core.savedObjects.createInternalRepository()); + + return {}; + } + public stop() {} +} diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts new file mode 100644 index 0000000000000..b728948cf2a05 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts @@ -0,0 +1,182 @@ +/* + * 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 { httpServiceMock, loggingSystemMock, savedObjectsClientMock } from 'src/core/server/mocks'; +import { + defineGetBenchmarksRoute, + benchmarksInputSchema, + DEFAULT_BENCHMARKS_PER_PAGE, + PACKAGE_POLICY_SAVED_OBJECT_TYPE, + getPackagePolicies, + getAgentPolicies, + createBenchmarkEntry, +} from './benchmarks'; +import { SavedObjectsClientContract } from 'src/core/server'; +import { + createMockAgentPolicyService, + createPackagePolicyServiceMock, +} from '../../../../fleet/server/mocks'; +import { createPackagePolicyMock } from '../../../../fleet/common/mocks'; +import { AgentPolicy } from '../../../../fleet/common'; + +import { CspAppService } from '../../lib/csp_app_services'; +import { CspAppContext } from '../../plugin'; + +function createMockAgentPolicy(props: Partial = {}): AgentPolicy { + return { + id: 'some-uuid1', + namespace: 'default', + monitoring_enabled: [], + name: 'Test Policy', + description: '', + is_default: false, + is_preconfigured: false, + status: 'active', + is_managed: false, + revision: 1, + updated_at: '', + updated_by: 'elastic', + package_policies: [], + ...props, + }; +} +describe('benchmarks API', () => { + let logger: ReturnType; + + beforeEach(() => { + logger = loggingSystemMock.createLogger(); + jest.clearAllMocks(); + }); + + it('validate the API route path', async () => { + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineGetBenchmarksRoute(router, cspContext); + + const [config, _] = router.get.mock.calls[0]; + + expect(config.path).toEqual('/api/csp/benchmarks'); + }); + + describe('test input schema', () => { + it('expect to find default values', async () => { + const validatedQuery = benchmarksInputSchema.validate({}); + + expect(validatedQuery).toMatchObject({ + page: 1, + per_page: DEFAULT_BENCHMARKS_PER_PAGE, + }); + }); + + it('should throw when page field is not a positive integer', async () => { + expect(() => { + benchmarksInputSchema.validate({ page: -2 }); + }).toThrow(); + }); + + it('should throw when per_page field is not a positive integer', async () => { + expect(() => { + benchmarksInputSchema.validate({ per_page: -2 }); + }).toThrow(); + }); + }); + + describe('test benchmarks utils', () => { + let mockSoClient: jest.Mocked; + + beforeEach(() => { + mockSoClient = savedObjectsClientMock.create(); + }); + + describe('test getPackagePolicies', () => { + it('should throw when agentPolicyService is undefined', async () => { + const mockAgentPolicyService = undefined; + expect( + getPackagePolicies(mockSoClient, mockAgentPolicyService, 'myPackage', { + page: 1, + per_page: 100, + }) + ).rejects.toThrow(); + }); + + it('should format request by package name', async () => { + const mockAgentPolicyService = createPackagePolicyServiceMock(); + + await getPackagePolicies(mockSoClient, mockAgentPolicyService, 'myPackage', { + page: 1, + per_page: 100, + }); + + expect(mockAgentPolicyService.list.mock.calls[0][1]).toMatchObject( + expect.objectContaining({ + kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:myPackage`, + page: 1, + perPage: 100, + }) + ); + }); + }); + + describe('test getAgentPolicies', () => { + it('should return one agent policy id when there is duplication', async () => { + const agentPolicyService = createMockAgentPolicyService(); + const packagePolicies = [createPackagePolicyMock(), createPackagePolicyMock()]; + + await getAgentPolicies(mockSoClient, packagePolicies, agentPolicyService); + + expect(agentPolicyService.getByIds.mock.calls[0][1]).toHaveLength(1); + }); + + it('should return full policy ids list when there is no id duplication', async () => { + const agentPolicyService = createMockAgentPolicyService(); + + const packagePolicy1 = createPackagePolicyMock(); + const packagePolicy2 = createPackagePolicyMock(); + packagePolicy2.policy_id = 'AnotherId'; + const packagePolicies = [packagePolicy1, packagePolicy2]; + + await getAgentPolicies(mockSoClient, packagePolicies, agentPolicyService); + + expect(agentPolicyService.getByIds.mock.calls[0][1]).toHaveLength(2); + }); + }); + + describe('test createBenchmarkEntry', () => { + it('should build benchmark entry agent policy and package policy', async () => { + const packagePolicy = createPackagePolicyMock(); + const agentPolicy = createMockAgentPolicy(); + // @ts-expect-error + agentPolicy.agents = 3; + + const enrichAgentPolicy = await createBenchmarkEntry(agentPolicy, packagePolicy); + + expect(enrichAgentPolicy).toMatchObject({ + package_policy: { + id: 'c6d16e42-c32d-4dce-8a88-113cfe276ad1', + name: 'endpoint-1', + policy_id: '93c46720-c217-11ea-9906-b5b8a21b268e', + namespace: 'default', + updated_at: '2020-06-25T16:03:38.159292', + updated_by: 'kibana', + created_at: '2020-06-25T16:03:38.159292', + created_by: 'kibana', + package: { + name: 'endpoint', + title: 'Elastic Endpoint', + version: '0.9.0', + }, + }, + agent_policy: { id: 'some-uuid1', name: 'Test Policy', agents: 3 }, + }); + }); + }); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts new file mode 100644 index 0000000000000..80c526c248c0f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts @@ -0,0 +1,196 @@ +/* + * 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 { uniq, map } from 'lodash'; +import type { IRouter, SavedObjectsClientContract } from 'src/core/server'; +import { schema as rt, TypeOf } from '@kbn/config-schema'; +import { transformError } from '@kbn/securitysolution-es-utils'; +import { string } from 'io-ts'; +import { + PackagePolicyServiceInterface, + AgentPolicyServiceInterface, + AgentService, +} from '../../../../fleet/server'; +import { GetAgentPoliciesResponseItem, PackagePolicy, AgentPolicy } from '../../../../fleet/common'; +import { BENCHMARKS_ROUTE_PATH, CIS_KUBERNETES_PACKAGE_NAME } from '../../../common/constants'; +import { CspAppContext } from '../../plugin'; + +// TODO: use the same method from common/ once PR 106 is merged +export const isNonNullable = (v: T): v is NonNullable => + v !== null && v !== undefined; + +type BenchmarksQuerySchema = TypeOf; + +export interface Benchmark { + package_policy: Pick< + PackagePolicy, + | 'id' + | 'name' + | 'policy_id' + | 'namespace' + | 'package' + | 'updated_at' + | 'updated_by' + | 'created_at' + | 'created_by' + >; + agent_policy: Pick; +} + +export const DEFAULT_BENCHMARKS_PER_PAGE = 20; +export const PACKAGE_POLICY_SAVED_OBJECT_TYPE = 'ingest-package-policies'; + +const getPackageNameQuery = (packageName: string): string => { + return `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:${packageName}`; +}; + +export const getPackagePolicies = async ( + soClient: SavedObjectsClientContract, + packagePolicyService: PackagePolicyServiceInterface | undefined, + packageName: string, + queryParams: BenchmarksQuerySchema +): Promise => { + if (!packagePolicyService) { + throw new Error('packagePolicyService is undefined'); + } + + const packageNameQuery = getPackageNameQuery(packageName); + + const { items: packagePolicies } = (await packagePolicyService?.list(soClient, { + kuery: packageNameQuery, + page: queryParams.page, + perPage: queryParams.per_page, + })) ?? { items: [] as PackagePolicy[] }; + + return packagePolicies; +}; + +export const getAgentPolicies = async ( + soClient: SavedObjectsClientContract, + packagePolicies: PackagePolicy[], + agentPolicyService: AgentPolicyServiceInterface +): Promise => { + const agentPolicyIds = uniq(map(packagePolicies, 'policy_id')); + const agentPolicies = await agentPolicyService.getByIds(soClient, agentPolicyIds); + + return agentPolicies; +}; + +const addRunningAgentToAgentPolicy = async ( + agentService: AgentService, + agentPolicies: AgentPolicy[] +): Promise => { + if (!agentPolicies?.length) return []; + return Promise.all( + agentPolicies.map((agentPolicy) => + agentService.asInternalUser + .getAgentStatusForAgentPolicy(agentPolicy.id) + .then((agentStatus) => ({ + ...agentPolicy, + agents: agentStatus.total, + })) + ) + ); +}; + +export const createBenchmarkEntry = ( + agentPolicy: GetAgentPoliciesResponseItem, + packagePolicy: PackagePolicy +): Benchmark => ({ + package_policy: { + id: packagePolicy.id, + name: packagePolicy.name, + policy_id: packagePolicy.policy_id, + namespace: packagePolicy.namespace, + updated_at: packagePolicy.updated_at, + updated_by: packagePolicy.updated_by, + created_at: packagePolicy.created_at, + created_by: packagePolicy.created_by, + package: packagePolicy.package + ? { + name: packagePolicy.package.name, + title: packagePolicy.package.title, + version: packagePolicy.package.version, + } + : undefined, + }, + agent_policy: { + id: agentPolicy.id, + name: agentPolicy.name, + agents: agentPolicy.agents, + }, +}); + +const createBenchmarks = ( + agentPolicies: GetAgentPoliciesResponseItem[], + packagePolicies: PackagePolicy[] +): Benchmark[] => + agentPolicies + .flatMap((agentPolicy) => + agentPolicy.package_policies.map((agentPackagePolicy) => { + const id = string.is(agentPackagePolicy) ? agentPackagePolicy : agentPackagePolicy.id; + const packagePolicy = packagePolicies.find((pkgPolicy) => pkgPolicy.id === id); + if (!packagePolicy) return; + return createBenchmarkEntry(agentPolicy, packagePolicy); + }) + ) + .filter(isNonNullable); + +export const defineGetBenchmarksRoute = (router: IRouter, cspContext: CspAppContext): void => + router.get( + { + path: BENCHMARKS_ROUTE_PATH, + validate: { query: benchmarksInputSchema }, + }, + async (context, request, response) => { + try { + const soClient = context.core.savedObjects.client; + const { query } = request; + + const agentService = cspContext.service.agentService; + const agentPolicyService = cspContext.service.agentPolicyService; + const packagePolicyService = cspContext.service.packagePolicyService; + + // TODO: This validate can be remove after #2819 will be merged + if (!agentPolicyService || !agentService) { + throw new Error(`Failed to get Fleet services`); + } + + const packagePolicies = await getPackagePolicies( + soClient, + packagePolicyService, + CIS_KUBERNETES_PACKAGE_NAME, + query + ); + + const agentPolicies = await getAgentPolicies(soClient, packagePolicies, agentPolicyService); + const enrichAgentPolicies = await addRunningAgentToAgentPolicy(agentService, agentPolicies); + const benchmarks = createBenchmarks(enrichAgentPolicies, packagePolicies); + + return response.ok({ + body: benchmarks, + }); + } catch (err) { + const error = transformError(err); + cspContext.logger.error(`Failed to fetch benchmarks ${err}`); + return response.customError({ + body: { message: error.message }, + statusCode: error.statusCode, + }); + } + } + ); + +export const benchmarksInputSchema = rt.object({ + /** + * The page of objects to return + */ + page: rt.number({ defaultValue: 1, min: 1 }), + /** + * The number of objects to include in each page + */ + per_page: rt.number({ defaultValue: DEFAULT_BENCHMARKS_PER_PAGE, min: 0 }), +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts new file mode 100644 index 0000000000000..f554eb91a4a49 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts @@ -0,0 +1,122 @@ +/* + * 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 { ElasticsearchClient, IRouter } from 'src/core/server'; +import { transformError } from '@kbn/securitysolution-es-utils'; +import type { + AggregationsMultiBucketAggregateBase as Aggregation, + AggregationsTopHitsAggregate, + QueryDslQueryContainer, + SearchRequest, +} from '@elastic/elasticsearch/lib/api/types'; +import type { CloudPostureStats } from '../../../common/types'; +import { CSP_KUBEBEAT_INDEX_PATTERN, STATS_ROUTE_PATH } from '../../../common/constants'; +import { CspAppContext } from '../../plugin'; +import { getResourcesTypes } from './get_resources_types'; +import { getClusters } from './get_clusters'; +import { getStats } from './get_stats'; + +export interface ClusterBucket { + ordered_top_hits: AggregationsTopHitsAggregate; +} + +interface ClustersQueryResult { + aggs_by_cluster_id: Aggregation; +} + +export interface KeyDocCount { + key: TKey; + doc_count: number; +} + +export const getLatestFindingQuery = (): SearchRequest => ({ + index: CSP_KUBEBEAT_INDEX_PATTERN, + size: 0, + query: { + match_all: {}, + }, + aggs: { + aggs_by_cluster_id: { + terms: { field: 'cluster_id.keyword' }, + aggs: { + ordered_top_hits: { + top_hits: { + size: 1, + sort: { + '@timestamp': { + order: 'desc', + }, + }, + }, + }, + }, + }, + }, +}); + +const getLatestCyclesIds = async (esClient: ElasticsearchClient): Promise => { + const queryResult = await esClient.search(getLatestFindingQuery(), { + meta: true, + }); + + const clusters = queryResult.body.aggregations?.aggs_by_cluster_id.buckets; + if (!Array.isArray(clusters)) throw new Error('missing aggs by cluster id'); + + return clusters.map((c) => { + const topHit = c.ordered_top_hits.hits.hits[0]; + if (!topHit) throw new Error('missing cluster latest hit'); + return topHit._source.cycle_id; + }); +}; + +// TODO: Utilize ES "Point in Time" feature https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html +export const defineGetComplianceDashboardRoute = ( + router: IRouter, + cspContext: CspAppContext +): void => + router.get( + { + path: STATS_ROUTE_PATH, + validate: false, + }, + async (context, _, response) => { + try { + const esClient = context.core.elasticsearch.client.asCurrentUser; + const latestCyclesIds = await getLatestCyclesIds(esClient); + const query: QueryDslQueryContainer = { + bool: { + should: latestCyclesIds.map((id) => ({ + match: { 'cycle_id.keyword': { query: id } }, + })), + }, + }; + + const [stats, resourcesTypes, clusters] = await Promise.all([ + getStats(esClient, query), + getResourcesTypes(esClient, query), + getClusters(esClient, query), + ]); + + const body: CloudPostureStats = { + stats, + resourcesTypes, + clusters, + }; + + return response.ok({ + body, + }); + } catch (err) { + const error = transformError(err); + + return response.customError({ + body: { message: error.message }, + statusCode: error.statusCode, + }); + } + } + ); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts new file mode 100644 index 0000000000000..8ee05a6e4755f --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts @@ -0,0 +1,82 @@ +/* + * 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 { ClusterBucket, getClustersFromAggs } from './get_clusters'; + +const mockClusterBuckets: ClusterBucket[] = [ + { + key: 'cluster_id', + doc_count: 10, + benchmarks: { + buckets: [{ key: 'CIS Kubernetes', doc_count: 10 }], + }, + failed_findings: { + doc_count: 6, + }, + passed_findings: { + doc_count: 6, + }, + aggs_by_resource_type: { + buckets: [ + { + key: 'foo_type', + doc_count: 6, + failed_findings: { + doc_count: 3, + }, + passed_findings: { + doc_count: 3, + }, + }, + { + key: 'boo_type', + doc_count: 6, + failed_findings: { + doc_count: 3, + }, + passed_findings: { + doc_count: 3, + }, + }, + ], + }, + }, +]; + +describe('getClustersFromAggs', () => { + it('should return value matching CloudPostureStats["clusters"]', async () => { + const clusters = getClustersFromAggs(mockClusterBuckets); + expect(clusters).toEqual([ + { + meta: { + clusterId: 'cluster_id', + benchmarkName: 'CIS Kubernetes', + }, + stats: { + totalFindings: 12, + totalFailed: 6, + totalPassed: 6, + postureScore: 50.0, + }, + resourcesTypes: [ + { + name: 'foo_type', + totalFindings: 6, + totalFailed: 3, + totalPassed: 3, + }, + { + name: 'boo_type', + totalFindings: 6, + totalFailed: 3, + totalPassed: 3, + }, + ], + }, + ]); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts new file mode 100644 index 0000000000000..5be94f7246e53 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts @@ -0,0 +1,98 @@ +/* + * 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 { ElasticsearchClient } from 'kibana/server'; +import type { + AggregationsMultiBucketAggregateBase as Aggregation, + QueryDslQueryContainer, + SearchRequest, +} from '@elastic/elasticsearch/lib/api/types'; +import { CloudPostureStats } from '../../../common/types'; +import { getResourceTypeFromAggs, resourceTypeAggQuery } from './get_resources_types'; +import type { ResourceTypeQueryResult } from './get_resources_types'; +import { CSP_KUBEBEAT_INDEX_PATTERN } from '../../../common/constants'; +import { findingsEvaluationAggsQuery, getStatsFromFindingsEvaluationsAggs } from './get_stats'; +import { KeyDocCount } from './compliance_dashboard'; + +export interface ClusterBucket extends ResourceTypeQueryResult, KeyDocCount { + failed_findings: { + doc_count: number; + }; + passed_findings: { + doc_count: number; + }; + benchmarks: Aggregation; +} + +interface ClustersQueryResult { + aggs_by_cluster_id: Aggregation; +} + +export const getClustersQuery = (query: QueryDslQueryContainer): SearchRequest => ({ + index: CSP_KUBEBEAT_INDEX_PATTERN, + size: 0, + query, + aggs: { + aggs_by_cluster_id: { + terms: { + field: 'cluster_id.keyword', + }, + aggs: { + benchmarks: { + terms: { + field: 'rule.benchmark.name.keyword', + }, + }, + ...resourceTypeAggQuery, + ...findingsEvaluationAggsQuery, + }, + }, + }, +}); + +export const getClustersFromAggs = (clusters: ClusterBucket[]): CloudPostureStats['clusters'] => + clusters.map((cluster) => { + // get cluster's meta data + const benchmarks = cluster.benchmarks.buckets; + if (!Array.isArray(benchmarks)) throw new Error('missing aggs by benchmarks per cluster'); + + const meta = { + clusterId: cluster.key, + benchmarkName: benchmarks[0].key, + }; + + // get cluster's stats + if (!cluster.failed_findings || !cluster.passed_findings) + throw new Error('missing findings evaluations per cluster'); + const stats = getStatsFromFindingsEvaluationsAggs(cluster); + + // get cluster's resource types aggs + const resourcesTypesAggs = cluster.aggs_by_resource_type.buckets; + if (!Array.isArray(resourcesTypesAggs)) + throw new Error('missing aggs by resource type per cluster'); + const resourcesTypes = getResourceTypeFromAggs(resourcesTypesAggs); + + return { + meta, + stats, + resourcesTypes, + }; + }); + +export const getClusters = async ( + esClient: ElasticsearchClient, + query: QueryDslQueryContainer +): Promise => { + const queryResult = await esClient.search(getClustersQuery(query), { + meta: true, + }); + + const clusters = queryResult.body.aggregations?.aggs_by_cluster_id.buckets; + if (!Array.isArray(clusters)) throw new Error('missing aggs by cluster id'); + + return getClustersFromAggs(clusters); +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_resources_types.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_resources_types.test.ts new file mode 100644 index 0000000000000..b01644fc3f45b --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_resources_types.test.ts @@ -0,0 +1,51 @@ +/* + * 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 { getResourceTypeFromAggs, ResourceTypeBucket } from './get_resources_types'; + +const resourceTypeBuckets: ResourceTypeBucket[] = [ + { + key: 'foo_type', + doc_count: 41, + failed_findings: { + doc_count: 30, + }, + passed_findings: { + doc_count: 11, + }, + }, + { + key: 'boo_type', + doc_count: 11, + failed_findings: { + doc_count: 5, + }, + passed_findings: { + doc_count: 6, + }, + }, +]; + +describe('getResourceTypeFromAggs', () => { + it('should return value matching CloudPostureStats["resourcesTypes"]', async () => { + const resourceTypes = getResourceTypeFromAggs(resourceTypeBuckets); + expect(resourceTypes).toEqual([ + { + name: 'foo_type', + totalFindings: 41, + totalFailed: 30, + totalPassed: 11, + }, + { + name: 'boo_type', + totalFindings: 11, + totalFailed: 5, + totalPassed: 6, + }, + ]); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_resources_types.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_resources_types.ts new file mode 100644 index 0000000000000..459dce56042da --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_resources_types.ts @@ -0,0 +1,77 @@ +/* + * 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 { ElasticsearchClient } from 'kibana/server'; +import { + AggregationsMultiBucketAggregateBase as Aggregation, + QueryDslQueryContainer, + SearchRequest, +} from '@elastic/elasticsearch/lib/api/types'; +import { CloudPostureStats } from '../../../common/types'; +import { KeyDocCount } from './compliance_dashboard'; +import { CSP_KUBEBEAT_INDEX_PATTERN } from '../../../common/constants'; + +export interface ResourceTypeQueryResult { + aggs_by_resource_type: Aggregation; +} + +export interface ResourceTypeBucket extends KeyDocCount { + failed_findings: { + doc_count: number; + }; + passed_findings: { + doc_count: number; + }; +} + +export const resourceTypeAggQuery = { + aggs_by_resource_type: { + terms: { + field: 'resource.type.keyword', + }, + aggs: { + failed_findings: { + filter: { term: { 'result.evaluation.keyword': 'failed' } }, + }, + passed_findings: { + filter: { term: { 'result.evaluation.keyword': 'passed' } }, + }, + }, + }, +}; + +export const getRisksEsQuery = (query: QueryDslQueryContainer): SearchRequest => ({ + index: CSP_KUBEBEAT_INDEX_PATTERN, + size: 0, + query, + aggs: resourceTypeAggQuery, +}); + +export const getResourceTypeFromAggs = ( + queryResult: ResourceTypeBucket[] +): CloudPostureStats['resourcesTypes'] => + queryResult.map((bucket) => ({ + name: bucket.key, + totalFindings: bucket.doc_count, + totalFailed: bucket.failed_findings.doc_count || 0, + totalPassed: bucket.passed_findings.doc_count || 0, + })); + +export const getResourcesTypes = async ( + esClient: ElasticsearchClient, + query: QueryDslQueryContainer +): Promise => { + const resourceTypesQueryResult = await esClient.search( + getRisksEsQuery(query), + { meta: true } + ); + + const resourceTypes = resourceTypesQueryResult.body.aggregations?.aggs_by_resource_type.buckets; + if (!Array.isArray(resourceTypes)) throw new Error('missing resources types buckets'); + + return getResourceTypeFromAggs(resourceTypes); +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts new file mode 100644 index 0000000000000..558fec85860ea --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts @@ -0,0 +1,86 @@ +/* + * 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 { + calculatePostureScore, + FindingsEvaluationsQueryResult, + getStatsFromFindingsEvaluationsAggs, + roundScore, +} from './get_stats'; + +const standardQueryResult: FindingsEvaluationsQueryResult = { + failed_findings: { + doc_count: 30, + }, + passed_findings: { + doc_count: 11, + }, +}; + +const oneIsZeroQueryResult: FindingsEvaluationsQueryResult = { + failed_findings: { + doc_count: 0, + }, + passed_findings: { + doc_count: 11, + }, +}; + +const bothAreZeroQueryResult: FindingsEvaluationsQueryResult = { + failed_findings: { + doc_count: 0, + }, + passed_findings: { + doc_count: 0, + }, +}; + +describe('roundScore', () => { + it('should return decimal values with one fraction digit', async () => { + const rounded = roundScore(0.85245); + expect(rounded).toEqual(85.2); + }); +}); + +describe('calculatePostureScore', () => { + it('should return calculated posture score', async () => { + const score = calculatePostureScore(4, 7); + expect(score).toEqual(36.4); + }); +}); + +describe('getStatsFromFindingsEvaluationsAggs', () => { + it('should throw error in case no findings were found', async () => { + const score = calculatePostureScore(4, 7); + expect(score).toEqual(36.4); + }); + + it('should return value matching CloudPostureStats["stats"]', async () => { + const stats = getStatsFromFindingsEvaluationsAggs(standardQueryResult); + expect(stats).toEqual({ + totalFailed: 30, + totalPassed: 11, + totalFindings: 41, + postureScore: 26.8, + }); + }); + + it('checks for stability in case one of the values is zero', async () => { + const stats = getStatsFromFindingsEvaluationsAggs(oneIsZeroQueryResult); + expect(stats).toEqual({ + totalFailed: 0, + totalPassed: 11, + totalFindings: 11, + postureScore: 100.0, + }); + }); + + it('should throw error if both evaluations are zero', async () => { + // const stats = getStatsFromFindingsEvaluationsAggs(bothAreZeroQueryResult); + expect(() => getStatsFromFindingsEvaluationsAggs(bothAreZeroQueryResult)).toThrow(); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts new file mode 100644 index 0000000000000..8d5417de24c52 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts @@ -0,0 +1,74 @@ +/* + * 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 { ElasticsearchClient } from 'kibana/server'; +import { QueryDslQueryContainer, SearchRequest } from '@elastic/elasticsearch/lib/api/types'; +import { CSP_KUBEBEAT_INDEX_PATTERN } from '../../../common/constants'; +import { CloudPostureStats, Score } from '../../../common/types'; + +/** + * @param value value is [0, 1] range + */ +export const roundScore = (value: number): Score => Number((value * 100).toFixed(1)); + +export const calculatePostureScore = (passed: number, failed: number): Score => + roundScore(passed / (passed + failed)); + +export interface FindingsEvaluationsQueryResult { + failed_findings: { + doc_count: number; + }; + passed_findings: { + doc_count: number; + }; +} + +export const findingsEvaluationAggsQuery = { + failed_findings: { + filter: { term: { 'result.evaluation.keyword': 'failed' } }, + }, + passed_findings: { + filter: { term: { 'result.evaluation.keyword': 'passed' } }, + }, +}; + +export const getEvaluationsQuery = (query: QueryDslQueryContainer): SearchRequest => ({ + index: CSP_KUBEBEAT_INDEX_PATTERN, + query, + aggs: findingsEvaluationAggsQuery, +}); + +export const getStatsFromFindingsEvaluationsAggs = ( + findingsEvaluationsAggs: FindingsEvaluationsQueryResult +): CloudPostureStats['stats'] => { + const failedFindings = findingsEvaluationsAggs.failed_findings.doc_count || 0; + const passedFindings = findingsEvaluationsAggs.passed_findings.doc_count || 0; + const totalFindings = failedFindings + passedFindings; + if (!totalFindings) throw new Error("couldn't calculate posture score"); + const postureScore = calculatePostureScore(passedFindings, failedFindings); + + return { + totalFailed: failedFindings, + totalPassed: passedFindings, + totalFindings, + postureScore, + }; +}; + +export const getStats = async ( + esClient: ElasticsearchClient, + query: QueryDslQueryContainer +): Promise => { + const evaluationsQueryResult = await esClient.search( + getEvaluationsQuery(query), + { meta: true } + ); + const findingsEvaluations = evaluationsQueryResult.body.aggregations; + if (!findingsEvaluations) throw new Error('missing findings evaluations'); + + return getStatsFromFindingsEvaluationsAggs(findingsEvaluations); +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/findings/findings.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/findings/findings.test.ts new file mode 100644 index 0000000000000..76fc97e921045 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/findings/findings.test.ts @@ -0,0 +1,352 @@ +/* + * 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 { + elasticsearchClientMock, + ElasticsearchClientMock, + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from 'src/core/server/elasticsearch/client/mocks'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { KibanaRequest } from 'src/core/server/http/router/request'; +import { httpServerMock, httpServiceMock, loggingSystemMock } from 'src/core/server/mocks'; +import { CspAppService } from '../../lib/csp_app_services'; +import { CspAppContext } from '../../plugin'; +import { + defineFindingsIndexRoute, + findingsInputSchema, + DEFAULT_FINDINGS_PER_PAGE, +} from './findings'; + +export const getMockCspContext = (mockEsClient: ElasticsearchClientMock): KibanaRequest => { + return { + core: { + elasticsearch: { + client: { asCurrentUser: mockEsClient }, + }, + }, + } as unknown as KibanaRequest; +}; + +describe('findings API', () => { + let logger: ReturnType; + + beforeEach(() => { + logger = loggingSystemMock.createLogger(); + }); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('validate the API route path', async () => { + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [config, _] = router.get.mock.calls[0]; + + expect(config.path).toEqual('/api/csp/findings'); + }); + + describe('test input schema', () => { + it('expect to find default values', async () => { + const validatedQuery = findingsInputSchema.validate({}); + + expect(validatedQuery).toMatchObject({ + page: 1, + per_page: DEFAULT_FINDINGS_PER_PAGE, + sort_order: expect.stringMatching('desc'), + }); + }); + + it('should throw when page field is not a positive integer', async () => { + expect(() => { + findingsInputSchema.validate({ page: -2 }); + }).toThrow(); + }); + + it('should throw when per_page field is not a positive integer', async () => { + expect(() => { + findingsInputSchema.validate({ per_page: -2 }); + }).toThrow(); + }); + + it('should throw when latest_run is not a boolean', async () => { + expect(() => { + findingsInputSchema.validate({ latest_cycle: 'some string' }); // expects to get boolean + }).toThrow(); + }); + + it('should not throw when latest_run is a boolean', async () => { + expect(() => { + findingsInputSchema.validate({ latest_cycle: true }); + }).not.toThrow(); + }); + + it('should throw when sort_field is not string', async () => { + expect(() => { + findingsInputSchema.validate({ sort_field: true }); + }).toThrow(); + }); + + it('should not throw when sort_field is a string', async () => { + expect(() => { + findingsInputSchema.validate({ sort_field: 'field1' }); + }).not.toThrow(); + }); + + it('should throw when sort_order is not `asc` or `desc`', async () => { + expect(() => { + findingsInputSchema.validate({ sort_order: 'Other Direction' }); + }).toThrow(); + }); + + it('should not throw when `asc` is input for sort_order field', async () => { + expect(() => { + findingsInputSchema.validate({ sort_order: 'asc' }); + }).not.toThrow(); + }); + + it('should not throw when `desc` is input for sort_order field', async () => { + expect(() => { + findingsInputSchema.validate({ sort_order: 'desc' }); + }).not.toThrow(); + }); + + it('should throw when fields is not string', async () => { + expect(() => { + findingsInputSchema.validate({ fields: ['field1', 'field2'] }); + }).toThrow(); + }); + + it('should not throw when fields is a string', async () => { + expect(() => { + findingsInputSchema.validate({ sort_field: 'field1, field2' }); + }).not.toThrow(); + }); + }); + + describe('test query building', () => { + it('takes cycle_id and validate the filter was built right', async () => { + const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [_, handler] = router.get.mock.calls[0]; + const mockContext = getMockCspContext(mockEsClient); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRequest = httpServerMock.createKibanaRequest({ + query: { latest_cycle: true }, + }); + + mockEsClient.search.mockResolvedValueOnce( + // @ts-expect-error @elastic/elasticsearch Aggregate only allows unknown values + elasticsearchClientMock.createSuccessTransportRequestPromise({ + aggregations: { + group: { + buckets: [ + { + group_docs: { + hits: { + hits: [{ fields: { 'run_id.keyword': ['randomId1'] } }], + }, + }, + }, + ], + }, + }, + }) + ); + + const [context, req, res] = [mockContext, mockRequest, mockResponse]; + + await handler(context, req, res); + + expect(mockEsClient.search).toHaveBeenCalledTimes(2); + + const handlerArgs = mockEsClient.search.mock.calls[1][0]; + + expect(handlerArgs).toMatchObject({ + query: { + bool: { + filter: [{ term: { 'run_id.keyword': 'randomId1' } }], + }, + }, + }); + }); + + it('validate that default sort is timestamp desc', async () => { + const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [_, handler] = router.get.mock.calls[0]; + const mockContext = getMockCspContext(mockEsClient); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRequest = httpServerMock.createKibanaRequest({ + query: { + sort_order: 'desc', + }, + }); + + const [context, req, res] = [mockContext, mockRequest, mockResponse]; + + await handler(context, req, res); + + const handlerArgs = mockEsClient.search.mock.calls[0][0]; + + expect(handlerArgs).toMatchObject({ + sort: [{ '@timestamp': { order: 'desc' } }], + }); + }); + + it('should build sort request by `sort_field` and `sort_order` - asc', async () => { + const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [_, handler] = router.get.mock.calls[0]; + const mockContext = getMockCspContext(mockEsClient); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRequest = httpServerMock.createKibanaRequest({ + query: { + sort_field: 'agent.id', + sort_order: 'asc', + }, + }); + + const [context, req, res] = [mockContext, mockRequest, mockResponse]; + + await handler(context, req, res); + + const handlerArgs = mockEsClient.search.mock.calls[0][0]; + + expect(handlerArgs).toMatchObject({ + sort: [{ 'agent.id': 'asc' }], + }); + }); + + it('should build sort request by `sort_field` and `sort_order` - desc', async () => { + const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [_, handler] = router.get.mock.calls[0]; + const mockContext = getMockCspContext(mockEsClient); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRequest = httpServerMock.createKibanaRequest({ + query: { + sort_field: 'agent.id', + sort_order: 'desc', + }, + }); + + const [context, req, res] = [mockContext, mockRequest, mockResponse]; + + await handler(context, req, res); + + const handlerArgs = mockEsClient.search.mock.calls[0][0]; + + expect(handlerArgs).toMatchObject({ + sort: [{ 'agent.id': 'desc' }], + }); + }); + + it('takes `page` number and `per_page` validate that the requested selected page was called', async () => { + const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [_, handler] = router.get.mock.calls[0]; + const mockContext = getMockCspContext(mockEsClient); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRequest = httpServerMock.createKibanaRequest({ + query: { + per_page: 10, + page: 3, + }, + }); + + const [context, req, res] = [mockContext, mockRequest, mockResponse]; + await handler(context, req, res); + + expect(mockEsClient.search).toHaveBeenCalledTimes(1); + const handlerArgs = mockEsClient.search.mock.calls[0][0]; + + expect(handlerArgs).toMatchObject({ + from: 20, + size: 10, + }); + }); + + it('should format request by fields filter', async () => { + const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + const router = httpServiceMock.createRouter(); + const cspAppContextService = new CspAppService(); + + const cspContext: CspAppContext = { + logger, + service: cspAppContextService, + }; + defineFindingsIndexRoute(router, cspContext); + + const [_, handler] = router.get.mock.calls[0]; + + const mockContext = getMockCspContext(mockEsClient); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRequest = httpServerMock.createKibanaRequest({ + query: { + fields: 'field1,field2,field3', + }, + }); + + const [context, req, res] = [mockContext, mockRequest, mockResponse]; + + await handler(context, req, res); + + const handlerArgs = mockEsClient.search.mock.calls[0][0]; + + expect(handlerArgs).toMatchObject({ + _source: ['field1', 'field2', 'field3'], + }); + }); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/findings/findings.ts b/x-pack/plugins/cloud_security_posture/server/routes/findings/findings.ts new file mode 100644 index 0000000000000..5fea7cdbba9db --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/findings/findings.ts @@ -0,0 +1,132 @@ +/* + * 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 { IRouter } from 'src/core/server'; +import { SearchRequest, QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import { schema as rt, TypeOf } from '@kbn/config-schema'; +import type { SortOrder } from '@elastic/elasticsearch/lib/api/types'; +import { transformError } from '@kbn/securitysolution-es-utils'; +import { getLatestCycleIds } from './get_latest_cycle_ids'; + +import { CSP_KUBEBEAT_INDEX_PATTERN, FINDINGS_ROUTE_PATH } from '../../../common/constants'; +import { CspAppContext } from '../../plugin'; + +type FindingsQuerySchema = TypeOf; + +export const DEFAULT_FINDINGS_PER_PAGE = 20; + +export interface FindingsOptions { + size: number; + from?: number; + page?: number; + sortField?: string; + sortOrder?: SortOrder; + fields?: string[]; +} + +const getPointerForFirstDoc = (page: number, perPage: number): number => + page <= 1 ? 0 : page * perPage - perPage; + +const getSort = (sortField: string | undefined, sortOrder: string) => + sortField + ? { sort: [{ [sortField]: sortOrder }] } + : { sort: [{ '@timestamp': { order: sortOrder } }] }; + +const getSearchFields = (fields: string | undefined) => + fields ? { _source: fields.split(',') } : {}; + +const getFindingsEsQuery = ( + query: QueryDslQueryContainer, + options: FindingsOptions +): SearchRequest => { + return { + index: CSP_KUBEBEAT_INDEX_PATTERN, + query, + ...options, + }; +}; + +const buildQueryRequest = (latestCycleIds?: string[]): QueryDslQueryContainer => { + let filterPart: QueryDslQueryContainer = { match_all: {} }; + if (!!latestCycleIds) { + const filter = latestCycleIds.map((latestCycleId) => ({ + term: { 'run_id.keyword': latestCycleId }, + })); + filterPart = { bool: { filter } }; + } + + return { + ...filterPart, + }; +}; + +const buildOptionsRequest = (queryParams: FindingsQuerySchema): FindingsOptions => ({ + size: queryParams.per_page, + from: getPointerForFirstDoc(queryParams.page, queryParams.per_page), + ...getSort(queryParams.sort_field, queryParams.sort_order), + ...getSearchFields(queryParams.fields), +}); + +export const defineFindingsIndexRoute = (router: IRouter, cspContext: CspAppContext): void => + router.get( + { + path: FINDINGS_ROUTE_PATH, + validate: { query: findingsInputSchema }, + }, + async (context, request, response) => { + try { + const esClient = context.core.elasticsearch.client.asCurrentUser; + const options = buildOptionsRequest(request.query); + + const latestCycleIds = + request.query.latest_cycle === true + ? await getLatestCycleIds(esClient, cspContext.logger) + : undefined; + + const query = buildQueryRequest(latestCycleIds); + const esQuery = getFindingsEsQuery(query, options); + + const findings = await esClient.search(esQuery, { meta: true }); + const hits = findings.body.hits.hits; + + return response.ok({ body: hits }); + } catch (err) { + const error = transformError(err); + return response.customError({ + body: { message: error.message }, + statusCode: error.statusCode, + }); + } + } + ); + +export const findingsInputSchema = rt.object({ + /** + * The page of objects to return + */ + page: rt.number({ defaultValue: 1, min: 1 }), + /** + * The number of objects to include in each page + */ + per_page: rt.number({ defaultValue: DEFAULT_FINDINGS_PER_PAGE, min: 0 }), + /** + * Boolean flag to indicate for receiving only the latest findings + */ + latest_cycle: rt.maybe(rt.boolean()), + /** + * The field to use for sorting the found objects. + */ + sort_field: rt.maybe(rt.string()), + /** + * The order to sort by + */ + sort_order: rt.oneOf([rt.literal('asc'), rt.literal('desc')], { defaultValue: 'desc' }), + /** + * The fields in the entity to return in the response + */ + fields: rt.maybe(rt.string()), +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/findings/get_latest_cycle.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/findings/get_latest_cycle.test.ts new file mode 100644 index 0000000000000..3036d6d37cc0a --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/findings/get_latest_cycle.test.ts @@ -0,0 +1,99 @@ +/* + * 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 { + elasticsearchClientMock, + // eslint-disable-next-line @kbn/eslint/no-restricted-paths +} from 'src/core/server/elasticsearch/client/mocks'; +import { loggingSystemMock } from 'src/core/server/mocks'; +import { getLatestCycleIds } from './get_latest_cycle_ids'; + +const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; + +describe('get latest cycle ids', () => { + let logger: ReturnType; + + beforeEach(() => { + logger = loggingSystemMock.createLogger(); + jest.resetAllMocks(); + }); + + it('expect to find empty bucket', async () => { + mockEsClient.search.mockResolvedValueOnce( + // @ts-expect-error @elastic/elasticsearch Aggregate only allows unknown values + elasticsearchClientMock.createSuccessTransportRequestPromise({ + aggregations: { + group: { + buckets: [{}], + }, + }, + }) + ); + const response = await getLatestCycleIds(mockEsClient, logger); + expect(response).toEqual(undefined); + }); + + it('expect to find 1 cycle id', async () => { + mockEsClient.search.mockResolvedValueOnce( + // @ts-expect-error @elastic/elasticsearch Aggregate only allows unknown values + elasticsearchClientMock.createSuccessTransportRequestPromise({ + aggregations: { + group: { + buckets: [ + { + group_docs: { + hits: { + hits: [{ fields: { 'run_id.keyword': ['randomId1'] } }], + }, + }, + }, + ], + }, + }, + }) + ); + const response = await getLatestCycleIds(mockEsClient, logger); + expect(response).toEqual(expect.arrayContaining(['randomId1'])); + }); + + it('expect to find multiple cycle ids', async () => { + mockEsClient.search.mockResolvedValueOnce( + // @ts-expect-error @elastic/elasticsearch Aggregate only allows unknown values + elasticsearchClientMock.createSuccessTransportRequestPromise({ + aggregations: { + group: { + buckets: [ + { + group_docs: { + hits: { + hits: [{ fields: { 'run_id.keyword': ['randomId1'] } }], + }, + }, + }, + { + group_docs: { + hits: { + hits: [{ fields: { 'run_id.keyword': ['randomId2'] } }], + }, + }, + }, + { + group_docs: { + hits: { + hits: [{ fields: { 'run_id.keyword': ['randomId3'] } }], + }, + }, + }, + ], + }, + }, + }) + ); + const response = await getLatestCycleIds(mockEsClient, logger); + expect(response).toEqual(expect.arrayContaining(['randomId1', 'randomId2', 'randomId3'])); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/findings/get_latest_cycle_ids.ts b/x-pack/plugins/cloud_security_posture/server/routes/findings/get_latest_cycle_ids.ts new file mode 100644 index 0000000000000..7af27d79926ab --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/findings/get_latest_cycle_ids.ts @@ -0,0 +1,58 @@ +/* + * 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 { Logger } from 'src/core/server'; +import { AggregationsFiltersAggregate, SearchRequest } from '@elastic/elasticsearch/lib/api/types'; +import type { ElasticsearchClient } from 'src/core/server'; +import { AGENT_LOGS_INDEX_PATTERN } from '../../../common/constants'; + +const getAgentLogsEsQuery = (): SearchRequest => ({ + index: AGENT_LOGS_INDEX_PATTERN, + size: 0, + query: { + bool: { + filter: [{ term: { 'status.keyword': 'end' } }], + }, + }, + aggs: { + group: { + terms: { field: 'agent.id.keyword' }, + aggs: { + group_docs: { + top_hits: { + size: 1, + sort: [{ '@timestamp': { order: 'desc' } }], + }, + }, + }, + }, + }, + fields: ['run_id.keyword', 'agent.id.keyword'], + _source: false, +}); + +const getCycleId = (v: any): string => v.group_docs.hits.hits?.[0]?.fields['run_id.keyword'][0]; + +export const getLatestCycleIds = async ( + esClient: ElasticsearchClient, + logger: Logger +): Promise => { + try { + const agentLogs = await esClient.search(getAgentLogsEsQuery(), { meta: true }); + const aggregations = agentLogs.body.aggregations; + if (!aggregations) { + return; + } + const buckets = (aggregations.group as Record).buckets; + if (!Array.isArray(buckets)) { + return; + } + return buckets.map(getCycleId); + } catch (err) { + logger.error('Failed to fetch cycle_ids'); + return; + } +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/index.ts b/x-pack/plugins/cloud_security_posture/server/routes/index.ts new file mode 100755 index 0000000000000..c0b333e4058aa --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/index.ts @@ -0,0 +1,18 @@ +/* + * 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 { IRouter } from '../../../../../src/core/server'; +import { defineGetComplianceDashboardRoute } from './compliance_dashboard/compliance_dashboard'; +import { defineGetBenchmarksRoute } from './benchmarks/benchmarks'; +import { defineFindingsIndexRoute as defineGetFindingsIndexRoute } from './findings/findings'; +import { CspAppContext } from '../plugin'; + +export function defineRoutes(router: IRouter, cspContext: CspAppContext) { + defineGetComplianceDashboardRoute(router, cspContext); + defineGetFindingsIndexRoute(router, cspContext); + defineGetBenchmarksRoute(router, cspContext); +} diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/csp_rule_type.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/csp_rule_type.ts new file mode 100644 index 0000000000000..fcff7449fb3f5 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/csp_rule_type.ts @@ -0,0 +1,58 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import type { + SavedObjectsType, + SavedObjectsValidationMap, +} from '../../../../../../src/core/server'; +import { + type CspRuleSchema, + cspRuleSchema, + cspRuleAssetSavedObjectType, +} from '../../../common/schemas/csp_rule'; + +const validationMap: SavedObjectsValidationMap = { + '1.0.0': cspRuleSchema, +}; + +export const ruleAssetSavedObjectMappings: SavedObjectsType['mappings'] = { + dynamic: false, + properties: { + name: { + type: 'text', // search + fields: { + // TODO: how is fields mapping shared with UI ? + raw: { + type: 'keyword', // sort + }, + }, + }, + description: { + type: 'text', + }, + }, +}; + +export const cspRuleAssetType: SavedObjectsType = { + name: cspRuleAssetSavedObjectType, + hidden: false, + namespaceType: 'agnostic', + mappings: ruleAssetSavedObjectMappings, + schemas: validationMap, + // migrations: {} + management: { + importableAndExportable: true, + visibleInManagement: true, + getTitle: (savedObject) => + `${i18n.translate('xpack.csp.cspSettings.rules', { + defaultMessage: `CSP Security Rules - `, + })} ${savedObject.attributes.benchmark.name} ${savedObject.attributes.benchmark.version} ${ + savedObject.attributes.name + }`, + }, +}; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/initialize_rules.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/initialize_rules.ts new file mode 100644 index 0000000000000..1cb08ddc1be1a --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/initialize_rules.ts @@ -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 { ISavedObjectsRepository } from 'src/core/server'; +import { CIS_BENCHMARK_1_4_1_RULES } from './rules'; +import { cspRuleAssetSavedObjectType } from '../../../common/schemas/csp_rule'; + +export const initializeCspRules = async (client: ISavedObjectsRepository) => { + const existingRules = await client.find({ type: cspRuleAssetSavedObjectType, perPage: 1 }); + + // TODO: version? + if (existingRules.total !== 0) return; + + try { + await client.bulkCreate(CIS_BENCHMARK_1_4_1_RULES); + } catch (e) { + // TODO: add logger + // TODO: handle error + } +}; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/rules.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/rules.ts new file mode 100644 index 0000000000000..8f3d6df65b6b5 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/cis_1_4_1/rules.ts @@ -0,0 +1,53 @@ +/* + * 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 { SavedObjectsBulkCreateObject } from 'src/core/server'; +import type { CspRuleSchema } from '../../../common/schemas/csp_rule'; +import { cspRuleAssetSavedObjectType } from '../../../common/schemas/csp_rule'; + +const benchmark = { name: 'CIS', version: '1.4.1' } as const; + +const RULES: CspRuleSchema[] = [ + { + id: '1.1.1', + name: 'Ensure that the API server pod specification file permissions are set to 644 or more restrictive (Automated)', + description: 'Disable anonymous requests to the API server', + rationale: + 'When enabled, requests that are not rejected by other configured authentication methods\nare treated as anonymous requests. These requests are then served by the API server. You\nshould rely on authentication to authorize access and disallow anonymous requests.\nIf you are using RBAC authorization, it is generally considered reasonable to allow\nanonymous access to the API Server for health checks and discovery purposes, and hence\nthis recommendation is not scored. However, you should consider whether anonymous\ndiscovery is an acceptable risk for your purposes.', + impact: 'Anonymous requests will be rejected.', + default_value: 'By default, anonymous access is enabled.', + remediation: + 'Edit the API server pod specification file /etc/kubernetes/manifests/kubeapiserver.yaml on the master node and set the below parameter.\n--anonymous-auth=false', + tags: [], + enabled: true, + muted: false, + benchmark, + }, + { + id: '1.1.2', + name: 'Ensure that the --basic-auth-file argument is not set (Scored)', + description: 'Do not use basic authentication', + rationale: + 'Basic authentication uses plaintext credentials for authentication. Currently, the basic\nauthentication credentials last indefinitely, and the password cannot be changed without\nrestarting API server. The basic authentication is currently supported for convenience.\nHence, basic authentication should not be used', + impact: + 'You will have to configure and use alternate authentication mechanisms such as tokens and\ncertificates. Username and password for basic authentication could no longer be used.', + default_value: 'By default, basic authentication is not set', + remediation: + 'Follow the documentation and configure alternate mechanisms for authentication. Then,\nedit the API server pod specification file /etc/kubernetes/manifests/kubeapiserver.yaml on the master node and remove the --basic-auth-file=\nparameter.', + tags: [], + enabled: true, + muted: false, + benchmark, + }, +]; + +export const CIS_BENCHMARK_1_4_1_RULES: Array> = + RULES.map((rule) => ({ + attributes: rule, + id: rule.id, + type: cspRuleAssetSavedObjectType, + })); diff --git a/x-pack/plugins/cloud_security_posture/server/types.ts b/x-pack/plugins/cloud_security_posture/server/types.ts new file mode 100644 index 0000000000000..4e70027013df8 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/types.ts @@ -0,0 +1,31 @@ +/* + * 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 { + PluginSetup as DataPluginSetup, + PluginStart as DataPluginStart, +} from '../../../../src/plugins/data/server'; + +import type { FleetStartContract } from '../../fleet/server'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CspServerPluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CspServerPluginStart {} + +export interface CspServerPluginSetupDeps { + // required + data: DataPluginSetup; + + // optional +} + +export interface CspServerPluginStartDeps { + // required + data: DataPluginStart; + fleet: FleetStartContract; +} diff --git a/x-pack/plugins/cloud_security_posture/tsconfig.json b/x-pack/plugins/cloud_security_posture/tsconfig.json new file mode 100755 index 0000000000000..d7902b8b05977 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "scripts/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + "public/**/*.json", + "../../../typings/**/*" + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../src/plugins/navigation/tsconfig.json" }, + { "path": "../../../x-pack/plugins/fleet/tsconfig.json" }, + ] +} diff --git a/x-pack/plugins/event_log/kibana.json b/x-pack/plugins/event_log/kibana.json index 5223549a2e4fb..c437667512cde 100644 --- a/x-pack/plugins/event_log/kibana.json +++ b/x-pack/plugins/event_log/kibana.json @@ -3,8 +3,8 @@ "version": "0.0.1", "kibanaVersion": "kibana", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "configPath": ["xpack", "eventLog"], "optionalPlugins": ["spaces"], diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts index 5ff3b6c481d74..22898ac54db5a 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts @@ -393,7 +393,9 @@ describe('setIndexToHidden', () => { expect(clusterClient.indices.putSettings).toHaveBeenCalledWith({ index: 'foo-bar-000001', body: { - 'index.hidden': true, + index: { + hidden: true, + }, }, }); }); diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts index 010d162c62ea1..bb958c3ce2b54 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts @@ -178,7 +178,6 @@ export class ClusterClientAdapter; hosts?: string[]; ca_sha256?: string; ca_trusted_fingerprint?: string; config_yaml?: string; - is_preconfigured?: boolean; + ssl?: { + certificate_authorities?: string[]; + certificate?: string; + key?: string; + }; } export type OutputSOAttributes = NewOutput & { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/output.ts b/x-pack/plugins/fleet/common/types/rest_spec/output.ts index 9a5001a3af10b..071ba69c181fb 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/output.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/output.ts @@ -28,7 +28,7 @@ export interface PutOutputRequest { outputId: string; }; body: { - type?: 'elasticsearch'; + type?: 'elasticsearch' | 'logstash'; name?: string; hosts?: string[]; ca_sha256?: string; @@ -36,13 +36,18 @@ export interface PutOutputRequest { config_yaml?: string; is_default?: boolean; is_default_monitoring?: boolean; + ssl?: { + certificate_authorities?: string[]; + certificate?: string; + key?: string; + }; }; } export interface PostOutputRequest { body: { id?: string; - type: 'elasticsearch'; + type: 'elasticsearch' | 'logstash'; name: string; hosts?: string[]; ca_sha256?: string; @@ -50,6 +55,11 @@ export interface PostOutputRequest { is_default?: boolean; is_default_monitoring?: boolean; config_yaml?: string; + ssl?: { + certificate_authorities?: string[]; + certificate?: string; + key?: string; + }; }; } @@ -58,3 +68,7 @@ export interface PutOutputResponse { } export type GetOutputsResponse = ListResult; + +export interface PostLogstashApiKeyResponse { + api_key: string; +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.test.tsx index 7a15276afbcd1..23429cc40c388 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.test.tsx @@ -20,6 +20,7 @@ import { sendGetAgentStatus, useIntraAppState, useStartServices, + useGetPackageInfoByKey, } from '../../../hooks'; import { CreatePackagePolicyPage } from './index'; @@ -43,7 +44,72 @@ jest.mock('../../../hooks', () => { sendGetOneAgentPolicy: jest.fn().mockResolvedValue({ data: { item: { id: 'agent-policy-1', name: 'Agent policy 1', namespace: 'default' } }, }), - useGetPackageInfoByKey: jest.fn().mockReturnValue({ + useGetPackageInfoByKey: jest.fn(), + sendCreatePackagePolicy: jest + .fn() + .mockResolvedValue({ data: { item: { id: 'policy-1', inputs: [] } } }), + sendCreateAgentPolicy: jest.fn().mockResolvedValue({ + data: { item: { id: 'agent-policy-2', name: 'Agent policy 2', namespace: 'default' } }, + }), + useIntraAppState: jest.fn().mockReturnValue({}), + useStartServices: jest.fn().mockReturnValue({ + application: { navigateToApp: jest.fn() }, + notifications: { + toasts: { + addError: jest.fn(), + addSuccess: jest.fn(), + }, + }, + docLinks: { + links: { + fleet: {}, + }, + }, + http: { + basePath: { + get: () => 'http://localhost:5620', + prepend: (url: string) => 'http://localhost:5620' + url, + }, + }, + chrome: { + docTitle: { + change: jest.fn(), + }, + setBreadcrumbs: jest.fn(), + }, + }), + }; +}); + +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useLocation: jest.fn().mockReturnValue({ search: '' }), + useHistory: jest.fn().mockReturnValue({ + push: jest.fn(), + }), +})); + +describe('when on the package policy create page', () => { + const createPageUrlPath = pagePathGetters.add_integration_to_policy({ pkgkey: 'nginx-1.3.0' })[1]; + + let testRenderer: TestRenderer; + let renderResult: ReturnType; + const render = () => + (renderResult = testRenderer.render( + + + + )); + let mockPackageInfo: any; + + beforeEach(() => { + testRenderer = createFleetTestRendererMock(); + mockApiCalls(testRenderer.startServices.http); + testRenderer.mountHistory.push(createPageUrlPath); + + // (useGetPackageInfoByKey as jest.Mock).mockClear(); + + mockPackageInfo = { data: { item: { name: 'nginx', @@ -104,67 +170,9 @@ jest.mock('../../../hooks', () => { }, }, isLoading: false, - }), - sendCreatePackagePolicy: jest - .fn() - .mockResolvedValue({ data: { item: { id: 'policy-1', inputs: [] } } }), - sendCreateAgentPolicy: jest.fn().mockResolvedValue({ - data: { item: { id: 'agent-policy-2', name: 'Agent policy 2', namespace: 'default' } }, - }), - useIntraAppState: jest.fn().mockReturnValue({}), - useStartServices: jest.fn().mockReturnValue({ - application: { navigateToApp: jest.fn() }, - notifications: { - toasts: { - addError: jest.fn(), - addSuccess: jest.fn(), - }, - }, - docLinks: { - links: { - fleet: {}, - }, - }, - http: { - basePath: { - get: () => 'http://localhost:5620', - prepend: (url: string) => 'http://localhost:5620' + url, - }, - }, - chrome: { - docTitle: { - change: jest.fn(), - }, - setBreadcrumbs: jest.fn(), - }, - }), - }; -}); - -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), - useLocation: jest.fn().mockReturnValue({ search: '' }), - useHistory: jest.fn().mockReturnValue({ - push: jest.fn(), - }), -})); - -describe('when on the package policy create page', () => { - const createPageUrlPath = pagePathGetters.add_integration_to_policy({ pkgkey: 'nginx-1.3.0' })[1]; - - let testRenderer: TestRenderer; - let renderResult: ReturnType; - const render = () => - (renderResult = testRenderer.render( - - - - )); + }; - beforeEach(() => { - testRenderer = createFleetTestRendererMock(); - mockApiCalls(testRenderer.startServices.http); - testRenderer.mountHistory.push(createPageUrlPath); + (useGetPackageInfoByKey as jest.Mock).mockReturnValue(mockPackageInfo); }); describe('and Route state is provided via Fleet HashRouter', () => { @@ -345,6 +353,38 @@ describe('when on the package policy create page', () => { }); }); + test('should create agent policy without sys monitoring when new hosts is selected for system integration', async () => { + (useGetPackageInfoByKey as jest.Mock).mockReturnValue({ + ...mockPackageInfo, + data: { + item: { + ...mockPackageInfo.data!.item, + name: 'system', + }, + }, + }); + + render(); + + await waitFor(() => { + renderResult.getByDisplayValue('Agent policy 2'); + }); + + await act(async () => { + fireEvent.click(renderResult.getByText(/Save and continue/).closest('button')!); + }); + + expect(sendCreateAgentPolicy as jest.MockedFunction).toHaveBeenCalledWith( + { + description: '', + monitoring_enabled: ['logs', 'metrics'], + name: 'Agent policy 2', + namespace: 'default', + }, + { withSysMonitoring: false } + ); + }); + describe('without query param', () => { beforeEach(() => { render(); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx index 98e96ce598561..1524f9c1745ef 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx @@ -24,7 +24,7 @@ import { import type { EuiStepProps } from '@elastic/eui/src/components/steps/step'; import { safeLoad } from 'js-yaml'; -import { dataTypes, splitPkgKey } from '../../../../../../common'; +import { dataTypes, FLEET_SYSTEM_PACKAGE, splitPkgKey } from '../../../../../../common'; import type { AgentPolicy, NewAgentPolicy, @@ -386,7 +386,11 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => { const createAgentPolicy = useCallback(async (): Promise => { let policyId; setFormState('LOADING'); - const resp = await sendCreateAgentPolicy(newAgentPolicy, { withSysMonitoring }); + // do not create agent policy with system integration if package policy already is for system package + const packagePolicyIsSystem = packagePolicy?.package?.name === FLEET_SYSTEM_PACKAGE; + const resp = await sendCreateAgentPolicy(newAgentPolicy, { + withSysMonitoring: withSysMonitoring && !packagePolicyIsSystem, + }); if (resp.error) { setFormState('VALID'); throw resp.error; @@ -398,7 +402,7 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => { updatePackagePolicy({ policy_id: policyId }); } return policyId; - }, [newAgentPolicy, updatePackagePolicy, withSysMonitoring]); + }, [newAgentPolicy, updatePackagePolicy, withSysMonitoring, packagePolicy]); const onSubmit = useCallback(async () => { if (formState === 'VALID' && hasErrors) { diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_select_create.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_select_create.tsx index a8354237bbcb7..53e8140086c2c 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_select_create.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_select_create.tsx @@ -70,6 +70,14 @@ export const SelectCreateAgentPolicy: React.FC = ({ [onAgentPolicyChange] ); + const onClickCreatePolicy = () => { + setCreateState({ status: CREATE_STATUS.INITIAL }); + setShowCreatePolicy(true); + if (withKeySelection && onKeyChange) { + onKeyChange(undefined); + } + }; + return ( <> {showCreatePolicy ? ( @@ -86,7 +94,7 @@ export const SelectCreateAgentPolicy: React.FC = ({ onKeyChange={onKeyChange} onAgentPolicyChange={onAgentPolicyChange} excludeFleetServer={excludeFleetServer} - onClickCreatePolicy={() => setShowCreatePolicy(true)} + onClickCreatePolicy={onClickCreatePolicy} selectedAgentPolicy={selectedAgentPolicy} isFleetServerPolicy={isFleetServerPolicy} /> diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/confirm_agent_enrollment.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/confirm_agent_enrollment.tsx new file mode 100644 index 0000000000000..dd39f8700e4fb --- /dev/null +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/confirm_agent_enrollment.tsx @@ -0,0 +1,57 @@ +/* + * 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 React from 'react'; +import { EuiCallOut, EuiButton } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { useGetAgentStatus } from '../../hooks'; +import { AGENTS_PREFIX } from '../../constants'; +interface Props { + policyId: string; + onClickViewAgents: () => void; +} + +export const ConfirmAgentEnrollment: React.FunctionComponent = ({ + policyId, + onClickViewAgents, +}) => { + // Check the agents enrolled in the last 10 minutes + const enrolledAt = 'now-10m'; + const kuery = `${AGENTS_PREFIX}.enrolled_at >= "${enrolledAt}"`; + const agentStatusRequest = useGetAgentStatus({ kuery, policyId }); + const agentsCount = agentStatusRequest.data?.results?.total; + + if (!agentsCount) { + return null; + } + + return ( + + + {i18n.translate('xpack.fleet.agentEnrollment.confirmation.button', { + defaultMessage: 'View enrolled agents', + })} + + + ); +}; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx index 05458a1fcd6eb..ba0da6c7ec83a 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx @@ -120,7 +120,6 @@ export const ManagedInstructions = React.memo( selectedApiKeyId, setSelectedAPIKeyId, setSelectedPolicyId, - excludeFleetServer: true, refreshAgentPolicies, }) : AgentEnrollmentKeySelectionStep({ agentPolicy, selectedApiKeyId, setSelectedAPIKeyId }), diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx index 92c71df1b8f0f..31a56056c0bcc 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx @@ -16,8 +16,6 @@ import semverPatch from 'semver/functions/patch'; import type { AgentPolicy } from '../../types'; import { useKibanaVersion } from '../../hooks'; -import { policyHasFleetServer } from '../../applications/fleet/sections/agents/services/has_fleet_server'; - import { AdvancedAgentAuthenticationSettings } from './advanced_agent_authentication_settings'; import { SelectCreateAgentPolicy } from './agent_policy_select_create'; @@ -95,7 +93,7 @@ export const AgentPolicySelectionStep = ({ const regularAgentPolicies = useMemo(() => { return agentPolicies.filter( (policy) => - policy && !policy.is_managed && (!excludeFleetServer || !policyHasFleetServer(policy)) + policy && !policy.is_managed && (!excludeFleetServer || !policy.is_default_fleet_server) ); }, [agentPolicies, excludeFleetServer]); diff --git a/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap b/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap new file mode 100644 index 0000000000000..80f2c39abe988 --- /dev/null +++ b/x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap @@ -0,0 +1,231 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Fleet preconfiguration reset Preconfigred cloud policy Create correct .fleet-policies 1`] = ` +Object { + "agent": Object { + "monitoring": Object { + "enabled": false, + "logs": false, + "metrics": false, + }, + }, + "id": "policy-elastic-agent-on-cloud", + "inputs": Array [ + Object { + "data_stream": Object { + "namespace": "default", + }, + "id": "elastic-cloud-fleet-server", + "meta": Object { + "package": Object { + "name": "fleet_server", + "version": "1.1.1", + }, + }, + "name": "Fleet Server", + "revision": 1, + "server": Object { + "host": "0.0.0.0", + "port": 8220, + }, + "server.runtime": Object { + "gc_percent": 20, + }, + "type": "fleet-server", + "use_output": "es-containerhost", + }, + Object { + "apm-server": Object { + "auth": Object { + "anonymous": Object { + "allow_agent": Array [ + "rum-js", + "js-base", + "iOS/swift", + ], + "allow_service": null, + "enabled": true, + "rate_limit": Object { + "event_limit": 300, + "ip_limit": 1000, + }, + }, + "api_key": Object { + "enabled": true, + "limit": 100, + }, + "secret_token": "CLOUD_SECRET_TOKEN", + }, + "capture_personal_data": true, + "default_service_environment": null, + "expvar.enabled": false, + "host": "0.0.0.0:8200", + "idle_timeout": "45s", + "java_attacher": Object { + "discovery-rules": null, + "download-agent-version": null, + "enabled": false, + }, + "max_connections": 0, + "max_event_size": 307200, + "max_header_size": 1048576, + "read_timeout": "3600s", + "response_headers": null, + "rum": Object { + "allow_headers": null, + "allow_origins": Array [ + "*", + ], + "enabled": true, + "exclude_from_grouping": "^/webpack", + "library_pattern": "node_modules|bower_components|~", + "response_headers": null, + }, + "sampling": Object { + "tail": Object { + "enabled": false, + "interval": "1m", + "policies": Array [ + Object { + "sample_rate": 0.1, + }, + ], + }, + }, + "shutdown_timeout": "30s", + "ssl": Object { + "certificate": "/app/config/certs/node.crt", + "cipher_suites": null, + "curve_types": null, + "enabled": true, + "key": "/app/config/certs/node.key", + "key_passphrase": null, + "supported_protocols": Array [ + "TLSv1.0", + "TLSv1.1", + "TLSv1.2", + ], + }, + "write_timeout": "30s", + }, + "data_stream": Object { + "namespace": "default", + }, + "id": "elastic-cloud-apm", + "meta": Object { + "package": Object { + "name": "apm", + "version": "8.2.0-dev3", + }, + }, + "name": "Elastic APM", + "revision": 1, + "type": "apm", + "use_output": "es-containerhost", + }, + ], + "output_permissions": Object { + "es-containerhost": Object { + "Elastic APM": Object { + "cluster": Array [ + "cluster:monitor/main", + ], + "indices": Array [ + Object { + "names": Array [ + "logs-apm.app-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + Object { + "names": Array [ + "metrics-apm.app.*-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + Object { + "names": Array [ + "logs-apm.error-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + Object { + "names": Array [ + "metrics-apm.internal-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + Object { + "names": Array [ + "metrics-apm.profiling-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + Object { + "names": Array [ + "traces-apm.rum-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + Object { + "names": Array [ + "traces-apm.sampled-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + "maintenance", + "monitor", + "read", + ], + }, + Object { + "names": Array [ + "traces-apm-default", + ], + "privileges": Array [ + "auto_configure", + "create_doc", + ], + }, + ], + }, + "_elastic_agent_checks": Object { + "cluster": Array [ + "monitor", + ], + }, + "_elastic_agent_monitoring": Object { + "indices": Array [], + }, + }, + }, + "outputs": Object { + "es-containerhost": Object { + "hosts": Array [ + "https://cloudinternales:9200", + ], + "type": "elasticsearch", + }, + }, + "revision": 4, +} +`; diff --git a/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts b/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts new file mode 100644 index 0000000000000..2dbdb58497506 --- /dev/null +++ b/x-pack/plugins/fleet/server/integration_tests/cloud_preconfiguration.test.ts @@ -0,0 +1,195 @@ +/* + * 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 Path from 'path'; + +import * as kbnTestServer from 'src/core/test_helpers/kbn_server'; + +import { AGENT_POLICY_INDEX } from '../../common'; +import type { PackagePolicySOAttributes } from '../../common'; +import type { AgentPolicySOAttributes } from '../types'; + +import { useDockerRegistry, waitForFleetSetup } from './helpers'; +import { CLOUD_KIBANA_CONFIG } from './fixtures/cloud_kibana_config'; + +const logFilePath = Path.join(__dirname, 'logs.log'); + +describe('Fleet preconfiguration reset', () => { + let esServer: kbnTestServer.TestElasticsearchUtils; + let kbnServer: kbnTestServer.TestKibanaUtils; + + const registryUrl = useDockerRegistry(); + + const startServers = async () => { + const { startES } = kbnTestServer.createTestServers({ + adjustTimeout: (t) => jest.setTimeout(t), + settings: { + es: { + license: 'trial', + }, + kbn: {}, + }, + }); + + esServer = await startES(); + const startKibana = async () => { + const root = kbnTestServer.createRootWithCorePlugins( + { + ...CLOUD_KIBANA_CONFIG, + 'xpack.fleet.registryUrl': registryUrl, + logging: { + appenders: { + file: { + type: 'file', + fileName: logFilePath, + layout: { + type: 'json', + }, + }, + }, + loggers: [ + { + name: 'root', + appenders: ['file'], + }, + { + name: 'plugins.fleet', + level: 'all', + }, + ], + }, + }, + { oss: false } + ); + + await root.preboot(); + const coreSetup = await root.setup(); + const coreStart = await root.start(); + + return { + root, + coreSetup, + coreStart, + stop: async () => await root.shutdown(), + }; + }; + kbnServer = await startKibana(); + await waitForFleetSetup(kbnServer.root); + }; + + const stopServers = async () => { + if (kbnServer) { + await kbnServer.stop(); + } + + if (esServer) { + await esServer.stop(); + } + + await new Promise((res) => setTimeout(res, 10000)); + }; + + // Share the same servers for all the test to make test a lot faster (but test are not isolated anymore) + beforeAll(async () => { + await startServers(); + }); + + afterAll(async () => { + await stopServers(); + }); + + describe('Preconfigred cloud policy', () => { + it('Works and preconfigure correctly agent policies', async () => { + const agentPolicies = await kbnServer.coreStart.savedObjects + .createInternalRepository() + .find({ + type: 'ingest-agent-policies', + perPage: 10000, + }); + + expect(agentPolicies.total).toBe(2); + expect( + agentPolicies.saved_objects.find((so) => so.id === 'policy-elastic-agent-on-cloud') + ).toBeDefined(); + expect(agentPolicies.saved_objects.find((so) => so.id === 'default-policy')).toBeDefined(); + }); + + it('Create correct .fleet-policies', async () => { + const res = await kbnServer.coreStart.elasticsearch.client.asInternalUser.search({ + index: AGENT_POLICY_INDEX, + q: `policy_id:policy-elastic-agent-on-cloud`, + sort: 'revision_idx:desc', + }); + + expect((res.hits.hits[0]._source as any)!.data).toMatchSnapshot(); + }); + + it('Create correct package policies', async () => { + const packagePolicies = await kbnServer.coreStart.savedObjects + .createInternalRepository() + .find({ + type: 'ingest-package-policies', + perPage: 10000, + }); + + expect(packagePolicies.total).toBe(3); + expect( + packagePolicies.saved_objects.find((so) => so.id === 'elastic-cloud-fleet-server') + ).toBeDefined(); + expect( + packagePolicies.saved_objects.find((so) => so.id === 'elastic-cloud-apm') + ).toBeDefined(); + expect(packagePolicies.saved_objects.find((so) => so.id === 'default-system')).toBeDefined(); + + const fleetServerPackagePolicy = packagePolicies.saved_objects.find( + (so) => so.id === 'elastic-cloud-fleet-server' + ); + expect(fleetServerPackagePolicy?.attributes.vars).toMatchInlineSnapshot(`undefined`); + expect(fleetServerPackagePolicy?.attributes.inputs).toMatchInlineSnapshot(` + Array [ + Object { + "compiled_input": Object { + "server": Object { + "host": "0.0.0.0", + "port": 8220, + }, + "server.runtime": Object { + "gc_percent": 20, + }, + }, + "enabled": true, + "keep_enabled": true, + "policy_template": "fleet_server", + "streams": Array [], + "type": "fleet-server", + "vars": Object { + "custom": Object { + "type": "yaml", + "value": "server.runtime: + gc_percent: 20 # Force the GC to execute more frequently: see https://golang.org/pkg/runtime/debug/#SetGCPercent + ", + }, + "host": Object { + "frozen": true, + "type": "text", + "value": "0.0.0.0", + }, + "max_connections": Object { + "type": "integer", + }, + "port": Object { + "frozen": true, + "type": "integer", + "value": 8220, + }, + }, + }, + ] + `); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/integration_tests/fixtures/cloud_kibana_config.ts b/x-pack/plugins/fleet/server/integration_tests/fixtures/cloud_kibana_config.ts new file mode 100644 index 0000000000000..fa9770a58f44e --- /dev/null +++ b/x-pack/plugins/fleet/server/integration_tests/fixtures/cloud_kibana_config.ts @@ -0,0 +1,148 @@ +/* + * 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 const CLOUD_KIBANA_CONFIG = { + xpack: { + fleet: { + packages: [ + { + name: 'apm', + version: 'latest', + }, + { + name: 'fleet_server', + version: 'latest', + }, + { + name: 'system', + version: 'latest', + }, + ], + outputs: [ + { + name: 'Elastic Cloud internal output', + type: 'elasticsearch', + id: 'es-containerhost', + hosts: ['https://cloudinternales:9200'], + }, + ], + agentPolicies: [ + { + name: 'Elastic Cloud agent policy', + description: 'Default agent policy for agents hosted on Elastic Cloud', + id: 'policy-elastic-agent-on-cloud', + data_output_id: 'es-containerhost', + monitoring_output_id: 'es-containerhost', + is_default: false, + is_managed: true, + is_default_fleet_server: false, + namespace: 'default', + monitoring_enabled: [], + unenroll_timeout: 86400, + package_policies: [ + { + name: 'Fleet Server', + id: 'elastic-cloud-fleet-server', + package: { + name: 'fleet_server', + }, + inputs: [ + { + type: 'fleet-server', + keep_enabled: true, + vars: [ + { + name: 'host', + value: '0.0.0.0', + frozen: true, + }, + { + name: 'port', + value: 8220, + frozen: true, + }, + { + name: 'custom', + value: + 'server.runtime:\n gc_percent: 20 # Force the GC to execute more frequently: see https://golang.org/pkg/runtime/debug/#SetGCPercent\n', + }, + ], + }, + ], + }, + { + name: 'Elastic APM', + id: 'elastic-cloud-apm', + package: { + name: 'apm', + }, + inputs: [ + { + type: 'apm', + keep_enabled: true, + vars: [ + { + name: 'api_key_enabled', + value: true, + }, + { + name: 'host', + value: '0.0.0.0:8200', + frozen: true, + }, + { + name: 'secret_token', + value: 'CLOUD_SECRET_TOKEN', + }, + { + name: 'tls_enabled', + value: true, + frozen: true, + }, + { + name: 'tls_certificate', + value: '/app/config/certs/node.crt', + frozen: true, + }, + { + name: 'tls_key', + value: '/app/config/certs/node.key', + frozen: true, + }, + { + name: 'url', + value: 'CLOUD_APM_URL', + frozen: true, + }, + ], + }, + ], + }, + ], + }, + { + name: 'Default policy', + id: 'default-policy', + description: 'Default agent policy created by Kibana', + is_default: true, + is_managed: false, + namespace: 'default', + monitoring_enabled: ['logs', 'metrics'], + package_policies: [ + { + name: 'system-1', + id: 'default-system', + package: { + name: 'system', + }, + }, + ], + }, + ], + }, + }, +}; diff --git a/x-pack/plugins/fleet/server/integration_tests/ha_setup.test.ts b/x-pack/plugins/fleet/server/integration_tests/ha_setup.test.ts index 8907399adb628..2a3a35072b0b3 100644 --- a/x-pack/plugins/fleet/server/integration_tests/ha_setup.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/ha_setup.test.ts @@ -19,7 +19,7 @@ import type { PackagePolicySOAttributes, } from '../types'; -import { useDockerRegistry } from './docker_registry_helper'; +import { useDockerRegistry } from './helpers'; const logFilePath = Path.join(__dirname, 'logs.log'); diff --git a/x-pack/plugins/fleet/server/integration_tests/docker_registry_helper.ts b/x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts similarity index 100% rename from x-pack/plugins/fleet/server/integration_tests/docker_registry_helper.ts rename to x-pack/plugins/fleet/server/integration_tests/helpers/docker_registry_helper.ts diff --git a/x-pack/plugins/fleet/server/integration_tests/helpers/index.ts b/x-pack/plugins/fleet/server/integration_tests/helpers/index.ts new file mode 100644 index 0000000000000..b413211fe9ae7 --- /dev/null +++ b/x-pack/plugins/fleet/server/integration_tests/helpers/index.ts @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { adminTestUser } from '@kbn/test'; + +import * as kbnTestServer from 'src/core/test_helpers/kbn_server'; +import type { HttpMethod } from 'src/core/test_helpers/kbn_server'; + +type Root = ReturnType; + +export * from './docker_registry_helper'; + +export const waitForFleetSetup = async (root: Root) => { + const isFleetSetupRunning = async () => { + const statusApi = getSupertestWithAdminUser(root, 'get', '/api/status'); + const resp = await statusApi.send(); + const fleetStatus = resp.body?.status?.plugins?.fleet; + if (fleetStatus?.meta?.error) { + throw new Error(`Setup failed: ${JSON.stringify(fleetStatus)}`); + } + + return !fleetStatus || fleetStatus?.summary === 'Fleet is setting up'; + }; + + while (await isFleetSetupRunning()) { + await new Promise((resolve) => setTimeout(resolve, 2000)); + } +}; + +export function getSupertestWithAdminUser(root: Root, method: HttpMethod, path: string) { + const testUserCredentials = Buffer.from(`${adminTestUser.username}:${adminTestUser.password}`); + return kbnTestServer + .getSupertest(root, method, path) + .set('Authorization', `Basic ${testUserCredentials.toString('base64')}`); +} diff --git a/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts b/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts index 3b92102657803..1c387dc628cbb 100644 --- a/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts @@ -7,44 +7,15 @@ import Path from 'path'; -import { adminTestUser } from '@kbn/test'; - import * as kbnTestServer from 'src/core/test_helpers/kbn_server'; -import type { HttpMethod } from 'src/core/test_helpers/kbn_server'; import type { AgentPolicySOAttributes } from '../types'; import { PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE } from '../../common'; -import { useDockerRegistry } from './docker_registry_helper'; +import { useDockerRegistry, waitForFleetSetup, getSupertestWithAdminUser } from './helpers'; const logFilePath = Path.join(__dirname, 'logs.log'); -type Root = ReturnType; - -function getSupertestWithAdminUser(root: Root, method: HttpMethod, path: string) { - const testUserCredentials = Buffer.from(`${adminTestUser.username}:${adminTestUser.password}`); - return kbnTestServer - .getSupertest(root, method, path) - .set('Authorization', `Basic ${testUserCredentials.toString('base64')}`); -} - -const waitForFleetSetup = async (root: Root) => { - const isFleetSetupRunning = async () => { - const statusApi = getSupertestWithAdminUser(root, 'get', '/api/status'); - const resp = await statusApi.send(); - const fleetStatus = resp.body?.status?.plugins?.fleet; - if (fleetStatus?.meta?.error) { - throw new Error(`Setup failed: ${JSON.stringify(fleetStatus)}`); - } - - return !fleetStatus || fleetStatus?.summary === 'Fleet is setting up'; - }; - - while (await isFleetSetupRunning()) { - await new Promise((resolve) => setTimeout(resolve, 2000)); - } -}; - describe('Fleet preconfiguration reset', () => { let esServer: kbnTestServer.TestElasticsearchUtils; let kbnServer: kbnTestServer.TestKibanaUtils; diff --git a/x-pack/plugins/fleet/server/routes/agent/handlers.ts b/x-pack/plugins/fleet/server/routes/agent/handlers.ts index 504e8ed6e0c66..1473b508f1354 100644 --- a/x-pack/plugins/fleet/server/routes/agent/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent/handlers.ts @@ -204,9 +204,7 @@ export const getAgentStatusForAgentPolicyHandler: RequestHandler< TypeOf > = async (context, request, response) => { const esClient = context.core.elasticsearch.client.asInternalUser; - try { - // TODO change path const results = await AgentService.getAgentStatusForAgentPolicy( esClient, request.query.policyId, diff --git a/x-pack/plugins/fleet/server/routes/output/handler.ts b/x-pack/plugins/fleet/server/routes/output/handler.ts index 6de9fe1204f1c..d4372c22f32de 100644 --- a/x-pack/plugins/fleet/server/routes/output/handler.ts +++ b/x-pack/plugins/fleet/server/routes/output/handler.ts @@ -18,10 +18,12 @@ import type { DeleteOutputResponse, GetOneOutputResponse, GetOutputsResponse, + PostLogstashApiKeyResponse, } from '../../../common'; import { outputService } from '../../services/output'; -import { defaultIngestErrorHandler } from '../../errors'; +import { defaultIngestErrorHandler, FleetUnauthorizedError } from '../../errors'; import { agentPolicyService } from '../../services'; +import { generateLogstashApiKey, canCreateLogstashApiKey } from '../../services/api_keys'; export const getOutputsHandler: RequestHandler = async (context, request, response) => { const soClient = context.core.savedObjects.client; @@ -142,3 +144,24 @@ export const deleteOutputHandler: RequestHandler< return defaultIngestErrorHandler({ error, response }); } }; + +export const postLogstashApiKeyHandler: RequestHandler = async (context, request, response) => { + const esClient = context.core.elasticsearch.client.asCurrentUser; + try { + const hasCreatePrivileges = await canCreateLogstashApiKey(esClient); + if (!hasCreatePrivileges) { + throw new FleetUnauthorizedError('Missing permissions to create logstash API key'); + } + + const apiKey = await generateLogstashApiKey(esClient); + + const body: PostLogstashApiKeyResponse = { + // Logstash expect the key to be formatted like this id:key + api_key: `${apiKey.id}:${apiKey.api_key}`, + }; + + return response.ok({ body }); + } catch (error) { + return defaultIngestErrorHandler({ error, response }); + } +}; diff --git a/x-pack/plugins/fleet/server/routes/output/index.ts b/x-pack/plugins/fleet/server/routes/output/index.ts index b9dfb1f7f742b..f74c1bb88aeb0 100644 --- a/x-pack/plugins/fleet/server/routes/output/index.ts +++ b/x-pack/plugins/fleet/server/routes/output/index.ts @@ -21,6 +21,7 @@ import { getOutputsHandler, postOuputHandler, putOuputHandler, + postLogstashApiKeyHandler, } from './handler'; export const registerRoutes = (router: FleetAuthzRouter) => { @@ -76,4 +77,15 @@ export const registerRoutes = (router: FleetAuthzRouter) => { }, deleteOutputHandler ); + + router.post( + { + path: OUTPUT_API_ROUTES.LOGSTASH_API_KEY_PATTERN, + validate: false, + fleetAuthz: { + fleet: { all: true }, + }, + }, + postLogstashApiKeyHandler + ); }; diff --git a/x-pack/plugins/fleet/server/saved_objects/index.ts b/x-pack/plugins/fleet/server/saved_objects/index.ts index e91eaf0bb0569..6b06d28af7042 100644 --- a/x-pack/plugins/fleet/server/saved_objects/index.ts +++ b/x-pack/plugins/fleet/server/saved_objects/index.ts @@ -117,6 +117,7 @@ const getSavedObjectTypes = ( config: { type: 'flattened' }, config_yaml: { type: 'text' }, is_preconfigured: { type: 'boolean', index: false }, + ssl: { type: 'flattened', index: false }, }, }, migrations: { diff --git a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts index 67be0b6914537..c17d67c593229 100644 --- a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.test.ts @@ -352,4 +352,54 @@ ssl.test: 123 } `); }); + + it('should return placeholder ES_USERNAME and ES_PASSWORD for elasticsearch output type in standalone ', () => { + const policyOutput = transformOutputToFullPolicyOutput( + { + id: 'id123', + hosts: ['http://host.fr'], + is_default: false, + is_default_monitoring: false, + name: 'test output', + type: 'elasticsearch', + }, + true + ); + + expect(policyOutput).toMatchInlineSnapshot(` + Object { + "ca_sha256": undefined, + "hosts": Array [ + "http://host.fr", + ], + "password": "{ES_PASSWORD}", + "type": "elasticsearch", + "username": "{ES_USERNAME}", + } + `); + }); + + it('should not return placeholder ES_USERNAME and ES_PASSWORD for logstash output type in standalone ', () => { + const policyOutput = transformOutputToFullPolicyOutput( + { + id: 'id123', + hosts: ['host.fr:3332'], + is_default: false, + is_default_monitoring: false, + name: 'test output', + type: 'logstash', + }, + true + ); + + expect(policyOutput).toMatchInlineSnapshot(` + Object { + "ca_sha256": undefined, + "hosts": Array [ + "host.fr:3332", + ], + "type": "logstash", + } + `); + }); }); diff --git a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts index 9f522875544e1..5d11c91889e25 100644 --- a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts @@ -171,17 +171,18 @@ export function transformOutputToFullPolicyOutput( standalone = false ): FullAgentPolicyOutput { // eslint-disable-next-line @typescript-eslint/naming-convention - const { config_yaml, type, hosts, ca_sha256, ca_trusted_fingerprint } = output; + const { config_yaml, type, hosts, ca_sha256, ca_trusted_fingerprint, ssl } = output; const configJs = config_yaml ? safeLoad(config_yaml) : {}; const newOutput: FullAgentPolicyOutput = { ...configJs, type, hosts, ca_sha256, + ...(ssl ? { ssl } : {}), ...(ca_trusted_fingerprint ? { 'ssl.ca_trusted_fingerprint': ca_trusted_fingerprint } : {}), }; - if (standalone) { + if (output.type === outputType.Elasticsearch && standalone) { newOutput.username = '{ES_USERNAME}'; newOutput.password = '{ES_PASSWORD}'; } diff --git a/x-pack/plugins/fleet/server/services/api_keys/index.ts b/x-pack/plugins/fleet/server/services/api_keys/index.ts index c781b2d01943f..7b96d71c7ac9c 100644 --- a/x-pack/plugins/fleet/server/services/api_keys/index.ts +++ b/x-pack/plugins/fleet/server/services/api_keys/index.ts @@ -5,36 +5,6 @@ * 2.0. */ -import type { KibanaRequest } from 'src/core/server'; - export { invalidateAPIKeys } from './security'; +export { generateLogstashApiKey, canCreateLogstashApiKey } from './logstash_api_keys'; export * from './enrollment_api_key'; - -export function parseApiKeyFromHeaders(headers: KibanaRequest['headers']) { - const authorizationHeader = headers.authorization; - - if (!authorizationHeader) { - throw new Error('Authorization header must be set'); - } - - if (Array.isArray(authorizationHeader)) { - throw new Error('Authorization header must be `string` not `string[]`'); - } - - if (!authorizationHeader.startsWith('ApiKey ')) { - throw new Error('Authorization header is malformed'); - } - - const apiKey = authorizationHeader.split(' ')[1]; - - return parseApiKey(apiKey); -} - -export function parseApiKey(apiKey: string) { - const apiKeyId = Buffer.from(apiKey, 'base64').toString('utf8').split(':')[0]; - - return { - apiKey, - apiKeyId, - }; -} diff --git a/x-pack/plugins/fleet/server/services/api_keys/logstash_api_keys.ts b/x-pack/plugins/fleet/server/services/api_keys/logstash_api_keys.ts new file mode 100644 index 0000000000000..d55aa37fd5150 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/api_keys/logstash_api_keys.ts @@ -0,0 +1,70 @@ +/* + * 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 { ElasticsearchClient } from 'src/core/server'; + +/** + * Check if an esClient has enought permission to create a valid API key for logstash + * + * @param esClient + */ +export async function canCreateLogstashApiKey(esClient: ElasticsearchClient) { + const res = await esClient.security.hasPrivileges({ + cluster: ['monitor', 'manage_own_api_key'], + index: [ + { + names: [ + 'logs-*-*', + 'metrics-*-*', + 'traces-*-*', + 'synthetics-*-*', + '.logs-endpoint.diagnostic.collection-*', + '.logs-endpoint.action.responses-*', + ], + privileges: ['auto_configure', 'create_doc'], + }, + ], + }); + + return res.has_all_requested; +} + +/** + * Generate an Elasticsearch API key to use in logstash ES output + * + * @param esClient + */ +export async function generateLogstashApiKey(esClient: ElasticsearchClient) { + const apiKey = await esClient.security.createApiKey({ + name: 'Fleet Logstash output', + metadata: { + managed_by: 'fleet', + managed: true, + type: 'logstash', + }, + role_descriptors: { + 'logstash-output': { + cluster: ['monitor'], + index: [ + { + names: [ + 'logs-*-*', + 'metrics-*-*', + 'traces-*-*', + 'synthetics-*-*', + '.logs-endpoint.diagnostic.collection-*', + '.logs-endpoint.action.responses-*', + ], + privileges: ['auto_configure', 'create_doc'], + }, + ], + }, + }, + }); + + return apiKey; +} diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ml_model/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ml_model/install.ts index e5c96bea87181..52951377c6e2e 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ml_model/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ml_model/install.ts @@ -74,13 +74,20 @@ async function handleMlModelInstall({ try { await retryTransientEsErrors( () => - esClient.ml.putTrainedModel({ - model_id: mlModel.installationName, - defer_definition_decompression: true, - timeout: '45s', - // @ts-expect-error expects an object not a string - body: mlModel.content, - }), + esClient.ml.putTrainedModel( + { + model_id: mlModel.installationName, + defer_definition_decompression: true, + timeout: '45s', + // @ts-expect-error expects an object not a string + body: mlModel.content, + }, + { + headers: { + 'content-type': 'application/json', + }, + } + ), { logger } ); } catch (err) { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts index 5d144435bbee1..7650caf73d714 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.test.ts @@ -714,42 +714,53 @@ describe('EPM template', () => { expect(mappings).toEqual(expectedMapping); }); - it('processes meta fields', () => { - const metaFieldLiteralYaml = ` -- name: fieldWithMetas - type: integer - unit: byte + it('tests processing metric_type field', () => { + const literalYml = ` +- name: total.norm.pct + type: scaled_float metric_type: gauge - `; - const metaFieldMapping = { + unit: percent + format: percent +`; + const expectedMapping = { properties: { - fieldWithMetas: { - type: 'long', - meta: { - metric_type: 'gauge', - unit: 'byte', + total: { + properties: { + norm: { + properties: { + pct: { + scaling_factor: 1000, + type: 'scaled_float', + meta: { + metric_type: 'gauge', + unit: 'percent', + }, + time_series_metric: 'gauge', + }, + }, + }, }, }, }, }; - const fields: Field[] = safeLoad(metaFieldLiteralYaml); + const fields: Field[] = safeLoad(literalYml); const processedFields = processFields(fields); const mappings = generateMappings(processedFields); - expect(JSON.stringify(mappings)).toEqual(JSON.stringify(metaFieldMapping)); + expect(mappings).toEqual(expectedMapping); }); - it('processes meta fields with only one meta value', () => { + it('processes meta fields', () => { const metaFieldLiteralYaml = ` - name: fieldWithMetas type: integer - metric_type: gauge + unit: byte `; const metaFieldMapping = { properties: { fieldWithMetas: { type: 'long', meta: { - metric_type: 'gauge', + unit: 'byte', }, }, }, @@ -765,16 +776,13 @@ describe('EPM template', () => { - name: groupWithMetas type: group unit: byte - metric_type: gauge fields: - name: fieldA type: integer unit: byte - metric_type: gauge - name: fieldB type: integer unit: byte - metric_type: gauge `; const metaFieldMapping = { properties: { @@ -783,14 +791,12 @@ describe('EPM template', () => { fieldA: { type: 'long', meta: { - metric_type: 'gauge', unit: 'byte', }, }, fieldB: { type: 'long', meta: { - metric_type: 'gauge', unit: 'byte', }, }, diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts index f88f5aeb1c727..73ad218d1a9fd 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts @@ -132,6 +132,9 @@ export function generateMappings(fields: Field[]): IndexTemplateMappings { case 'scaled_float': fieldProps.type = 'scaled_float'; fieldProps.scaling_factor = field.scaling_factor || DEFAULT_SCALING_FACTOR; + if (field.metric_type) { + fieldProps.time_series_metric = field.metric_type; + } break; case 'text': const textMapping = generateTextMapping(field); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/remove.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/remove.ts index 6a2284e0df742..07748c1635b3a 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/remove.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/remove.ts @@ -46,7 +46,6 @@ export const deleteTransforms = async (esClient: ElasticsearchClient, transformI await esClient.transport.request( { method: 'DELETE', - // @ts-expect-error @elastic/elasticsearch Transform is empty interface path: `/${transform?.dest?.index}`, }, { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts index 879c7614fedbf..4a1909cc813e7 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts @@ -106,6 +106,7 @@ describe('test transform install', () => { esClient.transform.getTransform.mockResponseOnce({ count: 1, transforms: [ + // @ts-expect-error incomplete data { dest: { index: 'index', @@ -394,6 +395,7 @@ describe('test transform install', () => { esClient.transform.getTransform.mockResponseOnce({ count: 1, transforms: [ + // @ts-expect-error incomplete data { dest: { index: 'index', diff --git a/x-pack/plugins/fleet/server/services/epm/registry/index.ts b/x-pack/plugins/fleet/server/services/epm/registry/index.ts index c70b064684a96..db6a324352ca1 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/index.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/index.ts @@ -8,6 +8,7 @@ import { URL } from 'url'; import mime from 'mime-types'; +import semverGte from 'semver/functions/gte'; import type { Response } from 'node-fetch'; @@ -74,8 +75,11 @@ async function _fetchFindLatestPackage( packageName: string, options?: FetchFindLatestPackageOptions ) { + const logger = appContextService.getLogger(); const { ignoreConstraints = false } = options ?? {}; + const bundledPackage = await getBundledPackageByName(packageName); + const registryUrl = getRegistryUrl(); const url = new URL(`${registryUrl}/search?package=${packageName}&experimental=true`); @@ -83,55 +87,61 @@ async function _fetchFindLatestPackage( setKibanaVersion(url); } - const res = await fetchUrl(url.toString(), 1); - const searchResults: RegistryPackage[] = JSON.parse(res); - - return searchResults; -} - -export async function fetchFindLatestPackageOrThrow( - packageName: string, - options?: FetchFindLatestPackageOptions -) { try { - const searchResults = await _fetchFindLatestPackage(packageName, options); + const res = await fetchUrl(url.toString(), 1); + const searchResults: RegistryPackage[] = JSON.parse(res); + + const latestPackageFromRegistry = searchResults[0] ?? null; - if (!searchResults.length) { - throw new PackageNotFoundError(`[${packageName}] package not found in registry`); + if (bundledPackage && semverGte(bundledPackage.version, latestPackageFromRegistry.version)) { + return bundledPackage; } - return searchResults[0]; + return latestPackageFromRegistry; } catch (error) { - const bundledPackage = await getBundledPackageByName(packageName); + logger.error( + `Failed to fetch latest version of ${packageName} from registry: ${error.message}` + ); - if (!bundledPackage) { - throw error; + // Fall back to the bundled version of the package if it exists + if (bundledPackage) { + return bundledPackage; } - return bundledPackage; + // Otherwise, return null and allow callers to determine whether they'll consider this an error or not + return null; + } +} + +export async function fetchFindLatestPackageOrThrow( + packageName: string, + options?: FetchFindLatestPackageOptions +) { + const latestPackage = await _fetchFindLatestPackage(packageName, options); + + if (!latestPackage) { + throw new PackageNotFoundError(`[${packageName}] package not found in registry`); } + + return latestPackage; } export async function fetchFindLatestPackageOrUndefined( packageName: string, options?: FetchFindLatestPackageOptions ) { + const logger = appContextService.getLogger(); + try { - const searchResults = await _fetchFindLatestPackage(packageName, options); + const latestPackage = await _fetchFindLatestPackage(packageName, options); - if (!searchResults.length) { + if (!latestPackage) { return undefined; } - - return searchResults[0]; + return latestPackage; } catch (error) { - const bundledPackage = await getBundledPackageByName(packageName); - - if (!bundledPackage) { - return undefined; - } - - return bundledPackage; + logger.warn(`Error fetching latest package for ${packageName}: ${error.message}`); + return undefined; } } diff --git a/x-pack/plugins/fleet/server/services/output.ts b/x-pack/plugins/fleet/server/services/output.ts index 61592420e9116..832cb810f7505 100644 --- a/x-pack/plugins/fleet/server/services/output.ts +++ b/x-pack/plugins/fleet/server/services/output.ts @@ -10,7 +10,7 @@ import uuid from 'uuid/v5'; import type { NewOutput, Output, OutputSOAttributes } from '../types'; import { DEFAULT_OUTPUT, DEFAULT_OUTPUT_ID, OUTPUT_SAVED_OBJECT_TYPE } from '../constants'; -import { decodeCloudId, normalizeHostsForAgents, SO_SEARCH_LIMIT } from '../../common'; +import { decodeCloudId, normalizeHostsForAgents, SO_SEARCH_LIMIT, outputType } from '../../common'; import { OutputUnauthorizedError } from '../errors'; import { appContextService } from './app_context'; @@ -149,7 +149,7 @@ class OutputService { } } - if (data.hosts) { + if (data.type === outputType.Elasticsearch && data.hosts) { data.hosts = data.hosts.map(normalizeHostsForAgents); } @@ -260,7 +260,7 @@ class OutputService { ); } - const updateData = { ...data }; + const updateData = { type: originalOutput.type, ...data }; // ensure only default output exists if (data.is_default) { @@ -287,7 +287,7 @@ class OutputService { } } - if (updateData.hosts) { + if (updateData.type === outputType.Elasticsearch && updateData.hosts) { updateData.hosts = updateData.hosts.map(normalizeHostsForAgents); } const outputSO = await soClient.update( diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index 1acbce4f22cd1..546ae9c6fb9ac 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -28,6 +28,7 @@ import { doesAgentPolicyAlreadyIncludePackage, validatePackagePolicy, validationHasErrors, + SO_SEARCH_LIMIT, } from '../../common'; import type { DeletePackagePoliciesResponse, @@ -369,9 +370,10 @@ class PackagePolicyService implements PackagePolicyServiceInterface { } // Check that the name does not exist already but exclude the current package policy const existingPoliciesWithName = await this.list(soClient, { - perPage: 1, - kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name: "${packagePolicy.name}"`, + perPage: SO_SEARCH_LIMIT, + kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name:"${packagePolicy.name}"`, }); + const filtered = (existingPoliciesWithName?.items || []).filter((p) => p.id !== id); if (filtered.length > 0) { diff --git a/x-pack/plugins/fleet/server/services/preconfiguration.ts b/x-pack/plugins/fleet/server/services/preconfiguration.ts index 2e0c3c7722b13..78769e6836b59 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration.ts @@ -57,6 +57,7 @@ function isPreconfiguredOutputDifferentFromCurrent( existingOutput.hosts?.map(normalizeHostsForAgents), preconfiguredOutput.hosts.map(normalizeHostsForAgents) )) || + (preconfiguredOutput.ssl && !isEqual(preconfiguredOutput.ssl, existingOutput.ssl)) || existingOutput.ca_sha256 !== preconfiguredOutput.ca_sha256 || existingOutput.ca_trusted_fingerprint !== preconfiguredOutput.ca_trusted_fingerprint || existingOutput.config_yaml !== preconfiguredOutput.config_yaml diff --git a/x-pack/plugins/fleet/server/types/models/output.test.ts b/x-pack/plugins/fleet/server/types/models/output.test.ts new file mode 100644 index 0000000000000..8ad2b14299c73 --- /dev/null +++ b/x-pack/plugins/fleet/server/types/models/output.test.ts @@ -0,0 +1,26 @@ +/* + * 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 { validateLogstashHost } from './output'; + +describe('Output model', () => { + describe('validateLogstashHost', () => { + it('should support valid host', () => { + expect(validateLogstashHost('test.fr:5044')).toBeUndefined(); + }); + + it('should return an error for an invalid host', () => { + expect(validateLogstashHost('!@#%&!#!@')).toMatchInlineSnapshot(`"Invalid logstash host"`); + }); + + it('should return an error for an invalid host with http scheme', () => { + expect(validateLogstashHost('https://test.fr:5044')).toMatchInlineSnapshot( + `"Invalid logstash host should not start with http(s)"` + ); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/types/models/output.ts b/x-pack/plugins/fleet/server/types/models/output.ts index 7d9232862092e..ee7854ade30a8 100644 --- a/x-pack/plugins/fleet/server/types/models/output.ts +++ b/x-pack/plugins/fleet/server/types/models/output.ts @@ -9,16 +9,74 @@ import { schema } from '@kbn/config-schema'; import { outputType } from '../../../common/constants'; +export function validateLogstashHost(val: string) { + if (val.match(/^http([s]){0,1}:\/\//)) { + return 'Invalid logstash host should not start with http(s)'; + } + + try { + const url = new URL(`http://${val}`); + + if (url.host !== val) { + return 'Invalid host'; + } + } catch (err) { + return 'Invalid logstash host'; + } +} + const OutputBaseSchema = { + id: schema.maybe(schema.string()), name: schema.string(), - type: schema.oneOf([schema.literal(outputType.Elasticsearch)]), - hosts: schema.maybe(schema.arrayOf(schema.string())), - config: schema.maybe(schema.recordOf(schema.string(), schema.any())), + type: schema.oneOf([ + schema.literal(outputType.Elasticsearch), + schema.literal(outputType.Logstash), + ]), + hosts: schema.conditional( + schema.siblingRef('type'), + schema.literal(outputType.Elasticsearch), + schema.arrayOf(schema.uri({ scheme: ['http', 'https'] })), + schema.arrayOf(schema.string({ validate: validateLogstashHost })) + ), + is_default: schema.boolean({ defaultValue: false }), + is_default_monitoring: schema.boolean({ defaultValue: false }), + ca_sha256: schema.maybe(schema.string()), + ca_trusted_fingerprint: schema.maybe(schema.string()), config_yaml: schema.maybe(schema.string()), + ssl: schema.maybe( + schema.object({ + certificate_authorities: schema.maybe(schema.arrayOf(schema.string())), + certificate: schema.maybe(schema.string()), + key: schema.maybe(schema.string()), + }) + ), }; -export const NewOutputSchema = schema.object({ - ...OutputBaseSchema, +export const NewOutputSchema = schema.object({ ...OutputBaseSchema }); + +export const UpdateOutputSchema = schema.object({ + name: schema.maybe(schema.string()), + type: schema.maybe( + schema.oneOf([schema.literal(outputType.Elasticsearch), schema.literal(outputType.Logstash)]) + ), + hosts: schema.maybe( + schema.oneOf([ + schema.arrayOf(schema.uri({ scheme: ['http', 'https'] })), + schema.arrayOf(schema.string({ validate: validateLogstashHost })), + ]) + ), + is_default: schema.maybe(schema.boolean()), + is_default_monitoring: schema.maybe(schema.boolean()), + ca_sha256: schema.maybe(schema.string()), + ca_trusted_fingerprint: schema.maybe(schema.string()), + config_yaml: schema.maybe(schema.string()), + ssl: schema.maybe( + schema.object({ + certificate_authorities: schema.maybe(schema.arrayOf(schema.string())), + certificate: schema.maybe(schema.string()), + key: schema.maybe(schema.string()), + }) + ), }); export const OutputSchema = schema.object({ diff --git a/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts b/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts index 9cf8626f5fed5..7b71070a504bb 100644 --- a/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts +++ b/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts @@ -17,12 +17,14 @@ describe('Test preconfiguration schema', () => { name: 'Output 1', type: 'elasticsearch', is_default: true, + hosts: ['http://test.fr:9200'], }, { id: 'output-2', name: 'Output 2', type: 'elasticsearch', is_default: true, + hosts: ['http://test.fr:9200'], }, ]); }).toThrowError('preconfigured outputs can only have one default output.'); @@ -35,12 +37,14 @@ describe('Test preconfiguration schema', () => { name: 'Output 1', type: 'elasticsearch', is_default_monitoring: true, + hosts: ['http://test.fr:9200'], }, { id: 'output-2', name: 'Output 2', type: 'elasticsearch', is_default_monitoring: true, + hosts: ['http://test.fr:9200'], }, ]); }).toThrowError('preconfigured outputs can only have one default monitoring output.'); @@ -52,11 +56,13 @@ describe('Test preconfiguration schema', () => { id: 'nonuniqueid', name: 'Output 1', type: 'elasticsearch', + hosts: ['http://test.fr:9200'], }, { id: 'nonuniqueid', name: 'Output 2', type: 'elasticsearch', + hosts: ['http://test.fr:9200'], }, ]); }).toThrowError('preconfigured outputs need to have unique ids.'); @@ -68,11 +74,13 @@ describe('Test preconfiguration schema', () => { id: 'output-1', name: 'nonuniquename', type: 'elasticsearch', + hosts: ['http://test.fr:9200'], }, { id: 'output-2', name: 'nonuniquename', type: 'elasticsearch', + hosts: ['http://test.fr:9200'], }, ]); }).toThrowError('preconfigured outputs need to have unique names.'); diff --git a/x-pack/plugins/fleet/server/types/models/preconfiguration.ts b/x-pack/plugins/fleet/server/types/models/preconfiguration.ts index 960ecbe67d593..b025e6ff5c755 100644 --- a/x-pack/plugins/fleet/server/types/models/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/types/models/preconfiguration.ts @@ -10,10 +10,10 @@ import semverValid from 'semver/functions/valid'; import { PRECONFIGURATION_LATEST_KEYWORD } from '../../constants'; import type { PreconfiguredOutput } from '../../../common'; -import { outputType } from '../../../common'; import { AgentPolicyBaseSchema } from './agent_policy'; import { NamespaceSchema } from './package_policy'; +import { NewOutputSchema } from './output'; const varsSchema = schema.maybe( schema.arrayOf( @@ -74,16 +74,10 @@ function validatePreconfiguredOutputs(outputs: PreconfiguredOutput[]) { } export const PreconfiguredOutputsSchema = schema.arrayOf( - schema.object({ + NewOutputSchema.extends({ id: schema.string(), - is_default: schema.boolean({ defaultValue: false }), - is_default_monitoring: schema.boolean({ defaultValue: false }), - name: schema.string(), - type: schema.oneOf([schema.literal(outputType.Elasticsearch)]), - hosts: schema.maybe(schema.arrayOf(schema.uri({ scheme: ['http', 'https'] }))), - ca_sha256: schema.maybe(schema.string()), - ca_trusted_fingerprint: schema.maybe(schema.string()), config: schema.maybe(schema.object({}, { unknowns: 'allow' })), + config_yaml: schema.never(), }), { defaultValue: [], diff --git a/x-pack/plugins/fleet/server/types/rest_spec/output.ts b/x-pack/plugins/fleet/server/types/rest_spec/output.ts index de2ddeb3a1bfd..21a0b19c0dd20 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/output.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/output.ts @@ -7,6 +7,8 @@ import { schema } from '@kbn/config-schema'; +import { NewOutputSchema, UpdateOutputSchema } from '../models'; + export const GetOneOutputRequestSchema = { params: schema.object({ outputId: schema.string(), @@ -22,31 +24,12 @@ export const DeleteOutputRequestSchema = { export const GetOutputsRequestSchema = {}; export const PostOutputRequestSchema = { - body: schema.object({ - id: schema.maybe(schema.string()), - name: schema.string(), - type: schema.oneOf([schema.literal('elasticsearch')]), - is_default: schema.boolean({ defaultValue: false }), - is_default_monitoring: schema.boolean({ defaultValue: false }), - hosts: schema.maybe(schema.arrayOf(schema.uri({ scheme: ['http', 'https'] }))), - ca_sha256: schema.maybe(schema.string()), - ca_trusted_fingerprint: schema.maybe(schema.string()), - config_yaml: schema.maybe(schema.string()), - }), + body: NewOutputSchema, }; export const PutOutputRequestSchema = { params: schema.object({ outputId: schema.string(), }), - body: schema.object({ - type: schema.maybe(schema.oneOf([schema.literal('elasticsearch')])), - name: schema.maybe(schema.string()), - is_default: schema.maybe(schema.boolean()), - is_default_monitoring: schema.maybe(schema.boolean()), - hosts: schema.maybe(schema.arrayOf(schema.uri({ scheme: ['http', 'https'] }))), - ca_sha256: schema.maybe(schema.string()), - ca_trusted_fingerprint: schema.maybe(schema.string()), - config_yaml: schema.maybe(schema.string()), - }), + body: UpdateOutputSchema, }; diff --git a/x-pack/plugins/graph/public/components/search_bar.test.tsx b/x-pack/plugins/graph/public/components/search_bar.test.tsx index 58a2996fd1e67..c16e661c85bf8 100644 --- a/x-pack/plugins/graph/public/components/search_bar.test.tsx +++ b/x-pack/plugins/graph/public/components/search_bar.test.tsx @@ -6,7 +6,7 @@ */ import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { SearchBar, SearchBarProps } from './search_bar'; +import { SearchBar, SearchBarProps, SearchBarComponent, SearchBarStateProps } from './search_bar'; import React, { Component, ReactElement } from 'react'; import { CoreStart } from 'src/core/public'; import { act } from 'react-dom/test-utils'; @@ -26,8 +26,8 @@ jest.mock('../services/source_modal', () => ({ openSourceModal: jest.fn() })); const waitForIndexPatternFetch = () => new Promise((r) => setTimeout(r)); -function wrapSearchBarInContext(testProps: SearchBarProps) { - const services = { +function getServiceMocks() { + return { uiSettings: { get: (key: string) => { return 10; @@ -56,7 +56,10 @@ function wrapSearchBarInContext(testProps: SearchBarProps) { }, }, }; +} +function wrapSearchBarInContext(testProps: SearchBarProps) { + const services = getServiceMocks(); return ( @@ -120,6 +123,21 @@ describe('search_bar', () => { }); } + async function mountSearchBarWithExplicitContext(props: SearchBarProps & SearchBarStateProps) { + jest.clearAllMocks(); + const services = getServiceMocks(); + + await act(async () => { + instance = mountWithIntl( + + + + + + ); + }); + } + it('should render search bar and fetch index pattern', async () => { await mountSearchBar(); @@ -175,4 +193,44 @@ describe('search_bar', () => { expect(openSourceModal).toHaveBeenCalled(); }); + + it('should disable the graph button when no data view is configured', async () => { + const stateProps = { + submit: jest.fn(), + onIndexPatternSelected: jest.fn(), + currentDatasource: undefined, + selectedFields: [], + }; + await mountSearchBarWithExplicitContext({ + urlQuery: null, + ...defaultProps, + ...stateProps, + }); + + expect( + instance.find('[data-test-subj="graph-explore-button"]').first().prop('disabled') + ).toBeTruthy(); + }); + + it('should disable the graph button when no field is configured', async () => { + const stateProps = { + submit: jest.fn(), + onIndexPatternSelected: jest.fn(), + currentDatasource: { + type: 'indexpattern' as const, + id: '123', + title: 'test-index', + }, + selectedFields: [], + }; + await mountSearchBarWithExplicitContext({ + urlQuery: null, + ...defaultProps, + ...stateProps, + }); + + expect( + instance.find('[data-test-subj="graph-explore-button"]').first().prop('disabled') + ).toBeTruthy(); + }); }); diff --git a/x-pack/plugins/graph/public/components/search_bar.tsx b/x-pack/plugins/graph/public/components/search_bar.tsx index 57e9831d5a656..0760fb4fd2c13 100644 --- a/x-pack/plugins/graph/public/components/search_bar.tsx +++ b/x-pack/plugins/graph/public/components/search_bar.tsx @@ -10,7 +10,7 @@ import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { connect } from 'react-redux'; -import { IndexPatternSavedObject, IndexPatternProvider } from '../types'; +import { IndexPatternSavedObject, IndexPatternProvider, WorkspaceField } from '../types'; import { openSourceModal } from '../services/source_modal'; import { GraphState, @@ -18,6 +18,7 @@ import { requestDatasource, IndexpatternDatasource, submitSearch, + selectedFieldsSelector, } from '../state_management'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; @@ -28,6 +29,7 @@ import { Query, esKuery, } from '../../../../../src/plugins/data/public'; +import { TooltipWrapper } from './tooltip_wrapper'; export interface SearchBarProps { isLoading: boolean; @@ -44,6 +46,7 @@ export interface SearchBarProps { export interface SearchBarStateProps { currentDatasource?: IndexpatternDatasource; + selectedFields: WorkspaceField[]; onIndexPatternSelected: (indexPattern: IndexPatternSavedObject) => void; submit: (searchTerm: string) => void; } @@ -74,6 +77,7 @@ export function SearchBarComponent(props: SearchBarStateProps & SearchBarProps) currentIndexPattern, currentDatasource, indexPatternProvider, + selectedFields, submit, onIndexPatternSelected, confirmWipeWorkspace, @@ -170,14 +174,27 @@ export function SearchBarComponent(props: SearchBarStateProps & SearchBarProps) /> - - {i18n.translate('xpack.graph.bar.exploreLabel', { defaultMessage: 'Graph' })} - + + {i18n.translate('xpack.graph.bar.exploreLabel', { defaultMessage: 'Graph' })} + +
@@ -190,6 +207,7 @@ export const SearchBar = connect( return { currentDatasource: datasource.current.type === 'indexpattern' ? datasource.current : undefined, + selectedFields: selectedFieldsSelector(state), }; }, (dispatch) => ({ diff --git a/x-pack/plugins/graph/public/components/tooltip_wrapper.tsx b/x-pack/plugins/graph/public/components/tooltip_wrapper.tsx new file mode 100644 index 0000000000000..5ab7800e05349 --- /dev/null +++ b/x-pack/plugins/graph/public/components/tooltip_wrapper.tsx @@ -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 React from 'react'; +import { EuiToolTip, EuiToolTipProps } from '@elastic/eui'; + +export type TooltipWrapperProps = Partial> & { + tooltipContent: string; + /** When the condition is truthy, the tooltip will be shown */ + condition: boolean; +}; + +export const TooltipWrapper: React.FunctionComponent = ({ + children, + condition, + tooltipContent, + ...tooltipProps +}) => { + return ( + <> + {condition ? ( + + <>{children} + + ) : ( + children + )} + + ); +}; diff --git a/x-pack/plugins/graph/public/state_management/mocks.ts b/x-pack/plugins/graph/public/state_management/mocks.ts index 5003e550f87a1..906bcde9070fc 100644 --- a/x-pack/plugins/graph/public/state_management/mocks.ts +++ b/x-pack/plugins/graph/public/state_management/mocks.ts @@ -59,9 +59,12 @@ export function createMockGraphStore({ createWorkspace: jest.fn((index, advancedSettings) => workspaceMock), getWorkspace: jest.fn(() => workspaceMock), indexPatternProvider: { - get: jest.fn(() => - Promise.resolve({ id: '123', title: 'test-pattern' } as unknown as IndexPattern) - ), + get: jest.fn(async (id: string) => { + if (id === 'missing-dataview') { + throw Error('No data view with this id'); + } + return { id: '123', title: 'test-pattern' } as unknown as IndexPattern; + }), }, I18nContext: jest .fn() diff --git a/x-pack/plugins/graph/public/state_management/persistence.test.ts b/x-pack/plugins/graph/public/state_management/persistence.test.ts index 2ef68f2198070..9f23fd773d789 100644 --- a/x-pack/plugins/graph/public/state_management/persistence.test.ts +++ b/x-pack/plugins/graph/public/state_management/persistence.test.ts @@ -18,7 +18,11 @@ import { IndexpatternDatasource, datasourceSelector } from './datasource'; import { fieldsSelector } from './fields'; import { metaDataSelector, updateMetaData } from './meta_data'; import { templatesSelector } from './url_templates'; -import { migrateLegacyIndexPatternRef, appStateToSavedWorkspace } from '../services/persistence'; +import { + migrateLegacyIndexPatternRef, + appStateToSavedWorkspace, + lookupIndexPatternId, +} from '../services/persistence'; import { settingsSelector } from './advanced_settings'; import { openSaveModal } from '../services/save_modal'; @@ -96,6 +100,21 @@ describe('persistence sagas', () => { const resultingState = env.store.getState(); expect(datasourceSelector(resultingState).current.type).toEqual('none'); }); + + it('should not crash if the data view goes missing', async () => { + (lookupIndexPatternId as jest.Mock).mockReturnValueOnce('missing-dataview'); + env.store.dispatch( + loadSavedWorkspace({ + savedWorkspace: { + title: 'my workspace', + }, + } as LoadSavedWorkspacePayload) + ); + await waitForPromise(); + expect(env.mockedDeps.notifications.toasts.addDanger).toHaveBeenCalledWith( + 'Data view "missing-dataview" not found' + ); + }); }); describe('saving saga', () => { diff --git a/x-pack/plugins/graph/public/state_management/persistence.ts b/x-pack/plugins/graph/public/state_management/persistence.ts index 27a635d25eeaf..d1e038bbb2102 100644 --- a/x-pack/plugins/graph/public/state_management/persistence.ts +++ b/x-pack/plugins/graph/public/state_management/persistence.ts @@ -66,10 +66,20 @@ export const loadingSaga = ({ } const selectedIndexPatternId = lookupIndexPatternId(savedWorkspace); - const indexPattern = (yield call( - indexPatternProvider.get, - selectedIndexPatternId - )) as IndexPattern; + let indexPattern; + try { + indexPattern = (yield call(indexPatternProvider.get, selectedIndexPatternId)) as IndexPattern; + } catch (e) { + notifications.toasts.addDanger( + i18n.translate('xpack.graph.loadWorkspace.missingDataViewErrorMessage', { + defaultMessage: 'Data view "{name}" not found', + values: { + name: selectedIndexPatternId, + }, + }) + ); + return; + } const initialSettings = settingsSelector((yield select()) as GraphState); const createdWorkspace = createWorkspace(indexPattern.title, initialSettings); diff --git a/x-pack/plugins/index_management/server/lib/fetch_indices.ts b/x-pack/plugins/index_management/server/lib/fetch_indices.ts index 9e8a8b23a7d9d..cec763a247ed7 100644 --- a/x-pack/plugins/index_management/server/lib/fetch_indices.ts +++ b/x-pack/plugins/index_management/server/lib/fetch_indices.ts @@ -51,9 +51,7 @@ async function fetchIndicesCall( const indexStats = indicesStats[indexName]; const aliases = Object.keys(indexData.aliases!); return { - // @ts-expect-error new property https://github.com/elastic/elasticsearch-specification/issues/1253 health: indexStats?.health, - // @ts-expect-error new property https://github.com/elastic/elasticsearch-specification/issues/1253 status: indexStats?.status, name: indexName, uuid: indexStats?.uuid, diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx index 33fe3c7af30c7..c0a475ea8029b 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx @@ -34,7 +34,7 @@ export const AlertFlyout = ({ options, nodeType, filter, visible, setVisible }: consumer: 'infrastructure', onClose: onCloseFlyout, canChangeTrigger: false, - alertTypeId: METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID, + ruleTypeId: METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID, metadata: { options, nodeType, diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_flyout.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_flyout.tsx index bee7f93a538be..d7270aa0ef0e5 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_flyout.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_flyout.tsx @@ -25,7 +25,7 @@ export const AlertFlyout = (props: Props) => { consumer: 'logs', onClose: onCloseFlyout, canChangeTrigger: false, - alertTypeId: LOG_DOCUMENT_COUNT_RULE_TYPE_ID, + ruleTypeId: LOG_DOCUMENT_COUNT_RULE_TYPE_ID, metadata: { isInternal: true, }, diff --git a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/alert_flyout.tsx b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/alert_flyout.tsx index 9d467e1df7e36..e0e9946b1c789 100644 --- a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/alert_flyout.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/alert_flyout.tsx @@ -32,7 +32,7 @@ export const AlertFlyout = ({ metric, nodeType, visible, setVisible }: Props) => consumer: 'infrastructure', onClose: onCloseFlyout, canChangeTrigger: false, - alertTypeId: METRIC_ANOMALY_ALERT_TYPE_ID, + ruleTypeId: METRIC_ANOMALY_ALERT_TYPE_ID, metadata: { metric, nodeType, diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/alert_flyout.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/alert_flyout.tsx index e7e4ade5257fc..642b7dbf079c0 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/alert_flyout.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/alert_flyout.tsx @@ -30,7 +30,7 @@ export const AlertFlyout = (props: Props) => { consumer: 'infrastructure', onClose: onCloseFlyout, canChangeTrigger: false, - alertTypeId: METRIC_THRESHOLD_ALERT_TYPE_ID, + ruleTypeId: METRIC_THRESHOLD_ALERT_TYPE_ID, metadata: { currentOptions: props.options, series: props.series, diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx index 66abef53f021e..8aaac2f1b9a46 100644 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx +++ b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx @@ -6,10 +6,10 @@ */ import { i18n } from '@kbn/i18n'; -import { flowRight } from 'lodash'; import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; import useMount from 'react-use/lib/useMount'; +import { flowRight } from 'lodash'; import { findInventoryFields } from '../../../common/inventory_models'; import { InventoryItemType } from '../../../common/inventory_models/types'; import { LoadingPage } from '../../components/loading_page'; diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts index 674ba977e09c0..2ca97c6b8a35f 100644 --- a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts @@ -333,22 +333,22 @@ const getReducedGroupByResults = ( key: GroupedSearchQueryResponse['aggregations']['groups']['buckets'][0]['key'] ) => Object.values(key).join(', '); + const reducedGroupByResults: ReducedGroupByResults = []; if (isOptimizedGroupedSearchQueryResponse(results)) { - return results.reduce((acc, groupBucket) => { + for (const groupBucket of results) { const groupName = getGroupName(groupBucket.key); - const groupResult = { name: groupName, documentCount: groupBucket.doc_count }; - return [...acc, groupResult]; - }, []); + reducedGroupByResults.push({ name: groupName, documentCount: groupBucket.doc_count }); + } } else { - return results.reduce((acc, groupBucket) => { + for (const groupBucket of results) { const groupName = getGroupName(groupBucket.key); - const groupResult = { + reducedGroupByResults.push({ name: groupName, documentCount: groupBucket.filtered_results.doc_count, - }; - return [...acc, groupResult]; - }, []); + }); + } } + return reducedGroupByResults; }; export const processGroupByResults = ( diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts index 744fd80134aec..81c714b30cb0d 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts @@ -6,8 +6,8 @@ */ import { ElasticsearchClient } from 'kibana/server'; -import { difference, first, has, isNaN, isNumber, isObject, last, mapValues } from 'lodash'; import moment from 'moment'; +import { difference, first, has, isNaN, isNumber, isObject, last, mapValues } from 'lodash'; import { Aggregators, Comparator, diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx index 5f1230f004684..d6a5b4e01a9b7 100644 --- a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx +++ b/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx @@ -66,7 +66,7 @@ describe('', () => { expect(find('pageTitle').text()).toEqual('Create pipeline from CSV'); expect(exists('documentationLink')).toBe(true); - expect(find('documentationLink').text()).toBe('Create pipeline docs'); + expect(find('documentationLink').text()).toBe('CSV to pipeline docs'); }); describe('form validation', () => { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx index 75468f31b1a54..eb93f4ea86449 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx @@ -56,7 +56,7 @@ describe('Processor: Dot Expander', () => { expect(form.getErrorsMessages()).toEqual(['A field value is required.']); }); - test('prevents form submission if field does not contain a . for the dot notation', async () => { + test('prevents form submission if field for the dot notation does not contain a . and not equal to *', async () => { const { actions: { saveNewProcessor }, form, @@ -77,9 +77,28 @@ describe('Processor: Dot Expander', () => { // Expect form error as "field" does not contain '.' expect(form.getErrorsMessages()).toEqual([ - 'A field value requires at least one dot character.', + 'The field name must be an asterisk or contain a dot character.', ]); }); + + test('allows form submission if the field for the dot notation is equal to *', async () => { + const { + actions: { saveNewProcessor }, + form, + } = testBed; + + // Set "field" value to a * for expanding all top-level dotted field names + form.setInputValue('fieldNameField.input', '*'); + + // Save the field + await saveNewProcessor(); + + const processors = getProcessorValue(onUpdate, DOT_EXPANDER_TYPE); + expect(processors[0][DOT_EXPANDER_TYPE]).toEqual({ + field: '*', + }); + }); + test('saves with default parameter values', async () => { const { actions: { saveNewProcessor }, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx index c66633dfd23d5..0d82fadbc026e 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx @@ -40,11 +40,15 @@ export const DotExpander: FunctionComponent = () => { { validator: ({ value }) => { if (typeof value === 'string' && value.length) { - return !value.includes('.') + const allowedPattern = value.includes('.') || value === '*'; + return !allowedPattern ? { message: i18n.translate( 'xpack.ingestPipelines.pipelineEditor.dotExpanderForm.fieldNameRequiresDotError', - { defaultMessage: 'A field value requires at least one dot character.' } + { + defaultMessage: + 'The field name must be an asterisk or contain a dot character.', + } ), } : undefined; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx index d02aa4fc3fc05..d47f90abbd36d 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx @@ -256,13 +256,24 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { defaultMessage: 'Expands a field containing dot notation into an object field. The object field is then accessible by other processors in the pipeline.', }), - getDefaultDescription: ({ field }) => - i18n.translate('xpack.ingestPipelines.processors.defaultDescription.dot_expander', { - defaultMessage: 'Expands "{field}" into an object field', - values: { - field, - }, - }), + getDefaultDescription: ({ field }) => { + return field === '*' + ? i18n.translate( + 'xpack.ingestPipelines.processors.defaultDescription.dot_expander.wildcard', + { + defaultMessage: 'All top-level fields will be expanded', + } + ) + : i18n.translate( + 'xpack.ingestPipelines.processors.defaultDescription.dot_expander.dot_notation', + { + defaultMessage: 'Expands "{field}" into an object field', + values: { + field, + }, + } + ); + }, }, drop: { FieldsComponent: Drop, diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx index 097ec3d98e162..a7fbf6afaebf8 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx @@ -85,7 +85,7 @@ export const PipelinesCreate: React.FunctionComponent , ]} diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx index a902f4a34af29..c927a324b0774 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx @@ -134,7 +134,7 @@ export const PipelinesEdit: React.FunctionComponent { + return filters.map((filter) => { + return { + ...filter, + alias: 'filter_has_been_migrated', + }; + }); +}; + +test('should apply data migrations to data peristed data', () => { + const { mapStateJSON } = migrateDataPersistedState({ attributes }, filterMigrationMock); + const mapState = JSON.parse(mapStateJSON!); + expect(mapState.filters[0].alias).toEqual('filter_has_been_migrated'); +}); diff --git a/x-pack/plugins/maps/common/migrations/migrate_data_persisted_state.ts b/x-pack/plugins/maps/common/migrations/migrate_data_persisted_state.ts new file mode 100644 index 0000000000000..7a933663a60f2 --- /dev/null +++ b/x-pack/plugins/maps/common/migrations/migrate_data_persisted_state.ts @@ -0,0 +1,35 @@ +/* + * 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 { Filter } from '@kbn/es-query'; +import { MapSavedObjectAttributes } from '../map_saved_object_type'; +import { MigrateFunction } from '../../../../../src/plugins/kibana_utils/common'; + +export function migrateDataPersistedState( + { + attributes, + }: { + attributes: MapSavedObjectAttributes; + }, + filterMigration: MigrateFunction +): MapSavedObjectAttributes { + let mapState: { filters: Filter[] } = { filters: [] }; + if (attributes.mapStateJSON) { + try { + mapState = JSON.parse(attributes.mapStateJSON); + } catch (e) { + throw new Error('Unable to parse attribute mapStateJSON'); + } + + mapState.filters = filterMigration(mapState.filters); + } + + return { + ...attributes, + mapStateJSON: JSON.stringify(mapState), + }; +} diff --git a/x-pack/plugins/maps/public/classes/styles/vector/style_meta.ts b/x-pack/plugins/maps/public/classes/styles/vector/style_meta.ts index 5177cdb814833..a9edef4cd15d8 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/style_meta.ts +++ b/x-pack/plugins/maps/public/classes/styles/vector/style_meta.ts @@ -20,7 +20,9 @@ export class StyleMeta { } getCategoryFieldMetaDescriptor(fieldName: string): Category[] { - return this._descriptor.fieldMeta[fieldName].categories; + return this._descriptor.fieldMeta[fieldName] + ? this._descriptor.fieldMeta[fieldName].categories + : []; } isPointsOnly(): boolean { diff --git a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx index f031b3cd22105..0e87651e234bc 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/vector_style.tsx @@ -521,9 +521,11 @@ export class VectorStyle implements IVectorStyle { if (!styleMeta.fieldMeta[name]) { styleMeta.fieldMeta[name] = { categories: [] }; } - styleMeta.fieldMeta[name].categories = + const categories = dynamicProperty.pluckCategoricalStyleMetaFromTileMetaFeatures(metaFeatures); - + if (categories.length) { + styleMeta.fieldMeta[name].categories = categories; + } const ordinalStyleMeta = dynamicProperty.pluckOrdinalStyleMetaFromTileMetaFeatures(metaFeatures); if (ordinalStyleMeta) { @@ -601,8 +603,10 @@ export class VectorStyle implements IVectorStyle { if (!styleMeta.fieldMeta[name]) { styleMeta.fieldMeta[name] = { categories: [] }; } - styleMeta.fieldMeta[name].categories = - dynamicProperty.pluckCategoricalStyleMetaFromFeatures(features); + const categories = dynamicProperty.pluckCategoricalStyleMetaFromFeatures(features); + if (categories.length) { + styleMeta.fieldMeta[name].categories = categories; + } const ordinalStyleMeta = dynamicProperty.pluckOrdinalStyleMetaFromFeatures(features); if (ordinalStyleMeta) { styleMeta.fieldMeta[name].range = ordinalStyleMeta; diff --git a/x-pack/plugins/maps/server/embeddable_migrations.test.ts b/x-pack/plugins/maps/server/embeddable/embeddable_migrations.test.ts similarity index 90% rename from x-pack/plugins/maps/server/embeddable_migrations.test.ts rename to x-pack/plugins/maps/server/embeddable/embeddable_migrations.test.ts index 4cf2642bb545c..58a6716c517a9 100644 --- a/x-pack/plugins/maps/server/embeddable_migrations.test.ts +++ b/x-pack/plugins/maps/server/embeddable/embeddable_migrations.test.ts @@ -7,8 +7,7 @@ import semverGte from 'semver/functions/gte'; import { embeddableMigrations } from './embeddable_migrations'; -// @ts-ignore -import { savedObjectMigrations } from './saved_objects/saved_object_migrations'; +import { savedObjectMigrations } from '../saved_objects/saved_object_migrations'; describe('saved object migrations and embeddable migrations', () => { test('should have same versions registered (>7.12)', () => { diff --git a/x-pack/plugins/maps/server/embeddable_migrations.ts b/x-pack/plugins/maps/server/embeddable/embeddable_migrations.ts similarity index 84% rename from x-pack/plugins/maps/server/embeddable_migrations.ts rename to x-pack/plugins/maps/server/embeddable/embeddable_migrations.ts index 9c17889e0c33c..951877a31f828 100644 --- a/x-pack/plugins/maps/server/embeddable_migrations.ts +++ b/x-pack/plugins/maps/server/embeddable/embeddable_migrations.ts @@ -6,11 +6,11 @@ */ import type { SerializableRecord } from '@kbn/utility-types'; -import { MapSavedObjectAttributes } from '../common/map_saved_object_type'; -import { moveAttribution } from '../common/migrations/move_attribution'; -import { setEmsTmsDefaultModes } from '../common/migrations/set_ems_tms_default_modes'; -import { renameLayerTypes } from '../common/migrations/rename_layer_types'; -import { extractReferences } from '../common/migrations/references'; +import { MapSavedObjectAttributes } from '../../common/map_saved_object_type'; +import { moveAttribution } from '../../common/migrations/move_attribution'; +import { setEmsTmsDefaultModes } from '../../common/migrations/set_ems_tms_default_modes'; +import { renameLayerTypes } from '../../common/migrations/rename_layer_types'; +import { extractReferences } from '../../common/migrations/references'; /* * Embeddables such as Maps, Lens, and Visualize can be embedded by value or by reference on a dashboard. diff --git a/x-pack/plugins/maps/server/embeddable/index.ts b/x-pack/plugins/maps/server/embeddable/index.ts new file mode 100644 index 0000000000000..5061fc03dcfc1 --- /dev/null +++ b/x-pack/plugins/maps/server/embeddable/index.ts @@ -0,0 +1,8 @@ +/* + * 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 { setupEmbeddable } from './setup_embeddable'; diff --git a/x-pack/plugins/maps/server/embeddable/setup_embeddable.ts b/x-pack/plugins/maps/server/embeddable/setup_embeddable.ts new file mode 100644 index 0000000000000..9411869c5ad11 --- /dev/null +++ b/x-pack/plugins/maps/server/embeddable/setup_embeddable.ts @@ -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 { EmbeddableSetup } from '../../../../../src/plugins/embeddable/server'; +import { + mergeMigrationFunctionMaps, + MigrateFunctionsObject, +} from '../../../../../src/plugins/kibana_utils/common'; +import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; +import { extract, inject } from '../../common/embeddable'; +import { embeddableMigrations } from './embeddable_migrations'; +import { getPersistedStateMigrations } from '../saved_objects'; + +export function setupEmbeddable( + embeddable: EmbeddableSetup, + getFilterMigrations: () => MigrateFunctionsObject +) { + embeddable.registerEmbeddableFactory({ + id: MAP_SAVED_OBJECT_TYPE, + migrations: () => { + return mergeMigrationFunctionMaps( + embeddableMigrations, + getPersistedStateMigrations(getFilterMigrations()) + ); + }, + inject, + extract, + }); +} diff --git a/x-pack/plugins/maps/server/plugin.ts b/x-pack/plugins/maps/server/plugin.ts index 92d0f08fb51ab..05051a861d595 100644 --- a/x-pack/plugins/maps/server/plugin.ts +++ b/x-pack/plugins/maps/server/plugin.ts @@ -22,15 +22,14 @@ import { getFlightsSavedObjects } from './sample_data/flights_saved_objects.js'; import { getWebLogsSavedObjects } from './sample_data/web_logs_saved_objects.js'; import { registerMapsUsageCollector } from './maps_telemetry/collectors/register'; import { APP_ID, APP_ICON, MAP_SAVED_OBJECT_TYPE, getFullPath } from '../common/constants'; -import { extract, inject } from '../common/embeddable'; -import { mapSavedObjects, mapsTelemetrySavedObjects } from './saved_objects'; import { MapsXPackConfig } from '../config'; import { setStartServices } from './kibana_server_services'; import { emsBoundariesSpecProvider } from './tutorials/ems'; import { initRoutes } from './routes'; import { HomeServerPluginSetup } from '../../../../src/plugins/home/server'; import type { EMSSettings } from '../../../../src/plugins/maps_ems/server'; -import { embeddableMigrations } from './embeddable_migrations'; +import { setupEmbeddable } from './embeddable'; +import { setupSavedObjects } from './saved_objects'; import { registerIntegrations } from './register_integrations'; import { StartDeps, SetupDeps } from './types'; @@ -146,6 +145,10 @@ export class MapsPlugin implements Plugin { } setup(core: CoreSetup, plugins: SetupDeps) { + const getFilterMigrations = plugins.data.query.filterManager.getAllMigrations.bind( + plugins.data.query.filterManager + ); + const { usageCollection, home, features, customIntegrations } = plugins; const config$ = this._initializerContext.config.create(); @@ -192,16 +195,10 @@ export class MapsPlugin implements Plugin { }, }); - core.savedObjects.registerType(mapsTelemetrySavedObjects); - core.savedObjects.registerType(mapSavedObjects); + setupSavedObjects(core, getFilterMigrations); registerMapsUsageCollector(usageCollection); - plugins.embeddable.registerEmbeddableFactory({ - id: MAP_SAVED_OBJECT_TYPE, - migrations: embeddableMigrations, - inject, - extract, - }); + setupEmbeddable(plugins.embeddable, getFilterMigrations); return { config: config$, diff --git a/x-pack/plugins/maps/server/saved_objects/index.ts b/x-pack/plugins/maps/server/saved_objects/index.ts index f34e20becd437..1b0b129a29299 100644 --- a/x-pack/plugins/maps/server/saved_objects/index.ts +++ b/x-pack/plugins/maps/server/saved_objects/index.ts @@ -5,5 +5,4 @@ * 2.0. */ -export { mapsTelemetrySavedObjects } from './maps_telemetry'; -export { mapSavedObjects } from './map'; +export { getPersistedStateMigrations, setupSavedObjects } from './setup_saved_objects'; diff --git a/x-pack/plugins/maps/server/saved_objects/map.ts b/x-pack/plugins/maps/server/saved_objects/map.ts deleted file mode 100644 index b13f24fc6ba1c..0000000000000 --- a/x-pack/plugins/maps/server/saved_objects/map.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 { SavedObjectsType } from 'src/core/server'; -import { APP_ICON, getFullPath } from '../../common/constants'; -// @ts-ignore -import { savedObjectMigrations } from './saved_object_migrations'; - -export const mapSavedObjects: SavedObjectsType = { - name: 'map', - hidden: false, - namespaceType: 'multiple-isolated', - convertToMultiNamespaceTypeVersion: '8.0.0', - mappings: { - properties: { - description: { type: 'text' }, - title: { type: 'text' }, - version: { type: 'integer' }, - mapStateJSON: { type: 'text' }, - layerListJSON: { type: 'text' }, - uiStateJSON: { type: 'text' }, - bounds: { dynamic: false, properties: {} }, // Disable removed field - }, - }, - management: { - icon: APP_ICON, - defaultSearchField: 'title', - importableAndExportable: true, - getTitle(obj) { - return obj.attributes.title; - }, - getInAppUrl(obj) { - return { - path: getFullPath(obj.id), - uiCapabilitiesPath: 'maps.show', - }; - }, - }, - migrations: savedObjectMigrations, -}; diff --git a/x-pack/plugins/maps/server/saved_objects/maps_telemetry.ts b/x-pack/plugins/maps/server/saved_objects/maps_telemetry.ts deleted file mode 100644 index 35366188f909d..0000000000000 --- a/x-pack/plugins/maps/server/saved_objects/maps_telemetry.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 { SavedObjectsType } from 'src/core/server'; - -/* - * The maps-telemetry saved object type isn't used, but in order to remove these fields from - * the mappings we register this type with `type: 'object', enabled: true` to remove all - * previous fields from the mappings until https://github.com/elastic/kibana/issues/67086 is - * solved. - */ -export const mapsTelemetrySavedObjects: SavedObjectsType = { - name: 'maps-telemetry', - hidden: false, - namespaceType: 'agnostic', - mappings: { - // @ts-ignore Core types don't support this since it's only really valid when removing a previously registered type - type: 'object', - enabled: false, - }, -}; diff --git a/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.js b/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts similarity index 71% rename from x-pack/plugins/maps/server/saved_objects/saved_object_migrations.js rename to x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts index 986878e65eb8b..f8cd06cf60bfc 100644 --- a/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.js +++ b/x-pack/plugins/maps/server/saved_objects/saved_object_migrations.ts @@ -5,11 +5,17 @@ * 2.0. */ +import type { SavedObjectMigrationContext, SavedObjectUnsanitizedDoc } from 'kibana/server'; import { extractReferences } from '../../common/migrations/references'; +// @ts-expect-error import { emsRasterTileToEmsVectorTile } from '../../common/migrations/ems_raster_tile_to_ems_vector_tile'; +// @ts-expect-error import { topHitsTimeToSort } from '../../common/migrations/top_hits_time_to_sort'; +// @ts-expect-error import { moveApplyGlobalQueryToSources } from '../../common/migrations/move_apply_global_query'; +// @ts-expect-error import { addFieldMetaOptions } from '../../common/migrations/add_field_meta_options'; +// @ts-expect-error import { migrateSymbolStyleDescriptor } from '../../common/migrations/migrate_symbol_style_descriptor'; import { migrateUseTopHitsToScalingType } from '../../common/migrations/scaling_type'; import { migrateJoinAggKey } from '../../common/migrations/join_agg_key'; @@ -19,8 +25,13 @@ import { addTypeToTermJoin } from '../../common/migrations/add_type_to_termjoin' import { moveAttribution } from '../../common/migrations/move_attribution'; import { setEmsTmsDefaultModes } from '../../common/migrations/set_ems_tms_default_modes'; import { renameLayerTypes } from '../../common/migrations/rename_layer_types'; +import type { MapSavedObjectAttributes } from '../../common/map_saved_object_type'; -function logMigrationWarning(context, errorMsg, doc) { +function logMigrationWarning( + context: SavedObjectMigrationContext, + errorMsg: string, + doc: SavedObjectUnsanitizedDoc +) { context.log.warning( `map migration failed (${context.migrationVersion}). ${errorMsg}. attributes: ${JSON.stringify( doc @@ -36,7 +47,10 @@ function logMigrationWarning(context, errorMsg, doc) { * This is the saved object migration registry. */ export const savedObjectMigrations = { - '7.2.0': (doc, context) => { + '7.2.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const { attributes, references } = extractReferences(doc); @@ -50,7 +64,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.4.0': (doc, context) => { + '7.4.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = emsRasterTileToEmsVectorTile(doc); @@ -63,7 +80,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.5.0': (doc, context) => { + '7.5.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = topHitsTimeToSort(doc); @@ -76,7 +96,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.6.0': (doc, context) => { + '7.6.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributesPhase1 = moveApplyGlobalQueryToSources(doc); const attributesPhase2 = addFieldMetaOptions({ attributes: attributesPhase1 }); @@ -90,7 +113,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.7.0': (doc, context) => { + '7.7.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributesPhase1 = migrateSymbolStyleDescriptor(doc); const attributesPhase2 = migrateUseTopHitsToScalingType({ attributes: attributesPhase1 }); @@ -104,7 +130,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.8.0': (doc, context) => { + '7.8.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = migrateJoinAggKey(doc); @@ -117,7 +146,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.9.0': (doc, context) => { + '7.9.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = removeBoundsFromSavedObject(doc); @@ -130,7 +162,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.10.0': (doc, context) => { + '7.10.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = setDefaultAutoFitToBounds(doc); @@ -143,7 +178,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.12.0': (doc, context) => { + '7.12.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = addTypeToTermJoin(doc); @@ -156,7 +194,10 @@ export const savedObjectMigrations = { return doc; } }, - '7.14.0': (doc, context) => { + '7.14.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = moveAttribution(doc); @@ -169,7 +210,10 @@ export const savedObjectMigrations = { return doc; } }, - '8.0.0': (doc, context) => { + '8.0.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = setEmsTmsDefaultModes(doc); @@ -182,7 +226,10 @@ export const savedObjectMigrations = { return doc; } }, - '8.1.0': (doc, context) => { + '8.1.0': ( + doc: SavedObjectUnsanitizedDoc, + context: SavedObjectMigrationContext + ) => { try { const attributes = renameLayerTypes(doc); diff --git a/x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts b/x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts new file mode 100644 index 0000000000000..d5c0c0fa6dcf3 --- /dev/null +++ b/x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts @@ -0,0 +1,100 @@ +/* + * 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 { mapValues } from 'lodash'; +import type { CoreSetup, SavedObjectUnsanitizedDoc } from 'kibana/server'; +import type { SavedObjectMigrationMap } from 'src/core/server'; +import { MigrateFunctionsObject } from '../../../../../src/plugins/kibana_utils/common'; +import { mergeSavedObjectMigrationMaps } from '../../../../../src/core/server'; +import { APP_ICON, getFullPath } from '../../common/constants'; +import { migrateDataPersistedState } from '../../common/migrations/migrate_data_persisted_state'; +import type { MapSavedObjectAttributes } from '../../common/map_saved_object_type'; +import { savedObjectMigrations } from './saved_object_migrations'; + +export function setupSavedObjects( + core: CoreSetup, + getFilterMigrations: () => MigrateFunctionsObject +) { + core.savedObjects.registerType({ + name: 'map', + hidden: false, + namespaceType: 'multiple-isolated', + convertToMultiNamespaceTypeVersion: '8.0.0', + mappings: { + properties: { + description: { type: 'text' }, + title: { type: 'text' }, + version: { type: 'integer' }, + mapStateJSON: { type: 'text' }, + layerListJSON: { type: 'text' }, + uiStateJSON: { type: 'text' }, + bounds: { dynamic: false, properties: {} }, // Disable removed field + }, + }, + management: { + icon: APP_ICON, + defaultSearchField: 'title', + importableAndExportable: true, + getTitle(obj) { + return obj.attributes.title; + }, + getInAppUrl(obj) { + return { + path: getFullPath(obj.id), + uiCapabilitiesPath: 'maps.show', + }; + }, + }, + migrations: () => { + return mergeSavedObjectMigrationMaps( + savedObjectMigrations, + getPersistedStateMigrations(getFilterMigrations()) as unknown as SavedObjectMigrationMap + ); + }, + }); + + /* + * The maps-telemetry saved object type isn't used, but in order to remove these fields from + * the mappings we register this type with `type: 'object', enabled: true` to remove all + * previous fields from the mappings until https://github.com/elastic/kibana/issues/67086 is + * solved. + */ + core.savedObjects.registerType({ + name: 'maps-telemetry', + hidden: false, + namespaceType: 'agnostic', + mappings: { + // @ts-ignore Core types don't support this since it's only really valid when removing a previously registered type + type: 'object', + enabled: false, + }, + }); +} + +/** + * This creates a migration map that applies external plugin migrations to persisted state stored in Maps + */ +export const getPersistedStateMigrations = ( + filterMigrations: MigrateFunctionsObject +): MigrateFunctionsObject => + mapValues( + filterMigrations, + (filterMigration) => (doc: SavedObjectUnsanitizedDoc) => { + try { + const attributes = migrateDataPersistedState(doc, filterMigration); + + return { + ...doc, + attributes, + }; + } catch (e) { + // Do not fail migration + // Maps application can display error when saved object is viewed + return doc; + } + } + ); diff --git a/x-pack/plugins/maps/server/types.ts b/x-pack/plugins/maps/server/types.ts index 293964fdb6fee..597b826eee56d 100644 --- a/x-pack/plugins/maps/server/types.ts +++ b/x-pack/plugins/maps/server/types.ts @@ -11,10 +11,14 @@ import { HomeServerPluginSetup } from '../../../../src/plugins/home/server'; import { LicensingPluginSetup } from '../../licensing/server'; import { MapsEmsPluginServerSetup } from '../../../../src/plugins/maps_ems/server'; import { EmbeddableSetup } from '../../../../src/plugins/embeddable/server'; -import { PluginStart as DataPluginStart } from '../../../../src/plugins/data/server'; +import { + PluginSetup as DataPluginSetup, + PluginStart as DataPluginStart, +} from '../../../../src/plugins/data/server'; import { CustomIntegrationsPluginSetup } from '../../../../src/plugins/custom_integrations/server'; export interface SetupDeps { + data: DataPluginSetup; features: FeaturesPluginSetupContract; usageCollection?: UsageCollectionSetup; home?: HomeServerPluginSetup; diff --git a/x-pack/plugins/ml/common/types/annotations.ts b/x-pack/plugins/ml/common/types/annotations.ts index dbc146c1175d8..57b7551c2308a 100644 --- a/x-pack/plugins/ml/common/types/annotations.ts +++ b/x-pack/plugins/ml/common/types/annotations.ts @@ -6,10 +6,10 @@ */ // The Annotation interface is based on annotation documents stored in the -// `.ml-annotations-6` index, accessed via the `.ml-annotations-[read|write]` aliases. +// `.ml-annotations-*` index, accessed via the `.ml-annotations-[read|write]` aliases. // Annotation document mapping: -// PUT .ml-annotations-6 +// PUT .ml-annotations-000001 // { // "mappings": { // "annotation": { @@ -54,8 +54,8 @@ // POST /_aliases // { // "actions" : [ -// { "add" : { "index" : ".ml-annotations-6", "alias" : ".ml-annotations-read" } }, -// { "add" : { "index" : ".ml-annotations-6", "alias" : ".ml-annotations-write" } } +// { "add" : { "index" : ".ml-annotations-000001", "alias" : ".ml-annotations-read" } }, +// { "add" : { "index" : ".ml-annotations-000001", "alias" : ".ml-annotations-write" } } // ] // } diff --git a/x-pack/plugins/ml/public/alerting/ml_alerting_flyout.tsx b/x-pack/plugins/ml/public/alerting/ml_alerting_flyout.tsx index b87a447bd4b15..d06cbbc02f6ed 100644 --- a/x-pack/plugins/ml/public/alerting/ml_alerting_flyout.tsx +++ b/x-pack/plugins/ml/public/alerting/ml_alerting_flyout.tsx @@ -7,6 +7,8 @@ import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; + +import { Rule } from '../../../triggers_actions_ui/public'; import { JobId } from '../../common/types/anomaly_detection_jobs'; import { useMlKibana } from '../application/contexts/kibana'; import { ML_ALERT_TYPES } from '../../common/constants/alerts'; @@ -14,7 +16,7 @@ import { PLUGIN_ID } from '../../common/constants/app'; import { MlAnomalyDetectionAlertRule } from '../../common/types/alerts'; interface MlAnomalyAlertFlyoutProps { - initialAlert?: MlAnomalyDetectionAlertRule; + initialAlert?: MlAnomalyDetectionAlertRule & Rule; jobIds?: JobId[]; onSave?: () => void; onCloseFlyout: () => void; @@ -55,7 +57,10 @@ export const MlAnomalyAlertFlyout: FC = ({ if (initialAlert) { return triggersActionsUi.getEditAlertFlyout({ ...commonProps, - initialAlert, + initialRule: { + ...initialAlert, + ruleTypeId: initialAlert.ruleTypeId ?? initialAlert.alertTypeId, + }, }); } @@ -63,7 +68,7 @@ export const MlAnomalyAlertFlyout: FC = ({ ...commonProps, consumer: PLUGIN_ID, canChangeTrigger: false, - alertTypeId: ML_ALERT_TYPES.ANOMALY_DETECTION, + ruleTypeId: ML_ALERT_TYPES.ANOMALY_DETECTION, metadata: {}, initialValues: { params: { @@ -124,7 +129,7 @@ export const JobListMlAnomalyAlertFlyout: FC = }; interface EditRuleFlyoutProps { - initialAlert: MlAnomalyDetectionAlertRule; + initialAlert: MlAnomalyDetectionAlertRule & Rule; onSave: () => void; } diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/chart_loader.ts b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/chart_loader.ts index ad790b75f0454..790b69f7ebdd0 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/chart_loader.ts +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/chart_loader.ts @@ -19,7 +19,8 @@ export function chartLoaderProvider(mlResultsService: MlResultsService) { ): Promise { const intervalMs = Math.max( Math.floor( - (job.data_counts.latest_record_timestamp - job.data_counts.earliest_record_timestamp) / bars + (job.data_counts.latest_record_timestamp! - job.data_counts.earliest_record_timestamp!) / + bars ), bucketSpanMs ); @@ -27,8 +28,8 @@ export function chartLoaderProvider(mlResultsService: MlResultsService) { job.datafeed_config.indices.join(), job.datafeed_config.query, job.data_description.time_field!, - job.data_counts.earliest_record_timestamp, - job.data_counts.latest_record_timestamp, + job.data_counts.earliest_record_timestamp!, + job.data_counts.latest_record_timestamp!, intervalMs, job.datafeed_config.runtime_mappings, job.datafeed_config.indices_options @@ -60,15 +61,16 @@ export function chartLoaderProvider(mlResultsService: MlResultsService) { ) { const intervalMs = Math.max( Math.floor( - (job.data_counts.latest_record_timestamp - job.data_counts.earliest_record_timestamp) / bars + (job.data_counts.latest_record_timestamp! - job.data_counts.earliest_record_timestamp!) / + bars ), bucketSpanMs ); const resp = await mlResultsService.getScoresByBucket( [job.job_id], - job.data_counts.earliest_record_timestamp, - job.data_counts.latest_record_timestamp, + job.data_counts.earliest_record_timestamp!, + job.data_counts.latest_record_timestamp!, intervalMs, 1 ); diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx index b6b03f879bb57..498a27834d050 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx @@ -231,7 +231,7 @@ export const RevertModelSnapshotFlyout: FC = ({ overlayRanges={[ { start: currentSnapshot.latest_record_time_stamp, - end: job.data_counts.latest_record_timestamp, + end: job.data_counts.latest_record_timestamp!, color: '#ff0000', }, ]} @@ -334,7 +334,7 @@ export const RevertModelSnapshotFlyout: FC = ({ calendarEvents={calendarEvents} setCalendarEvents={setCalendarEvents} minSelectableTimeStamp={snapshot.latest_record_time_stamp} - maxSelectableTimeStamp={job.data_counts.latest_record_timestamp} + maxSelectableTimeStamp={job.data_counts.latest_record_timestamp!} eventRateData={eventRateData} anomalies={anomalies} chartReady={chartReady} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts index 018fb326ba398..b8b8db4c916ae 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts @@ -44,7 +44,10 @@ interface MLEuiDataGridColumn extends EuiDataGridColumn { function getRuntimeFieldColumns(runtimeMappings: RuntimeMappings) { return Object.keys(runtimeMappings).map((id) => { - const field = runtimeMappings[id]; + let field = runtimeMappings[id]; + if (Array.isArray(field)) { + field = field[0]; + } const schema = getDataGridSchemaFromESFieldType( field.type as estypes.MappingRuntimeField['type'] ); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts index 804a368174c76..8c5a45137a8a1 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts @@ -262,6 +262,7 @@ export class JobCreator { this._initModelPlotConfig(); this._job_config.model_plot_config!.enabled = enable; } + public get modelPlot() { return ( this._job_config.model_plot_config !== undefined && @@ -737,7 +738,7 @@ export class JobCreator { ({ id, name: id, - type: runtimeField.type, + type: Array.isArray(runtimeField) ? runtimeField[0].type : runtimeField.type, aggregatable: true, aggs: [], runtimeField, diff --git a/x-pack/plugins/ml/public/maps/anomaly_source_field.ts b/x-pack/plugins/ml/public/maps/anomaly_source_field.ts index bc03363970893..ac60cb3b54fb5 100644 --- a/x-pack/plugins/ml/public/maps/anomaly_source_field.ts +++ b/x-pack/plugins/ml/public/maps/anomaly_source_field.ts @@ -98,6 +98,12 @@ export const ANOMALY_SOURCE_FIELDS: Record> = { }), type: 'string', }, + influencers: { + label: i18n.translate('xpack.ml.maps.anomalyLayerInfluencersLabel', { + defaultMessage: 'Influencers', + }), + type: 'string', + }, }; export class AnomalySourceTooltipProperty implements ITooltipProperty { diff --git a/x-pack/plugins/ml/public/maps/maps_util.test.js b/x-pack/plugins/ml/public/maps/maps_util.test.js new file mode 100644 index 0000000000000..dd6fde9e8b28c --- /dev/null +++ b/x-pack/plugins/ml/public/maps/maps_util.test.js @@ -0,0 +1,90 @@ +/* + * 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 { getInfluencersHtmlString, getResultsForJobId } from './util'; +import { + mlResultsServiceMock, + typicalExpected, + actualExpected, + typicalToActualExpected, +} from './results.test.mock'; + +describe('Maps util', () => { + describe('getInfluencersHtmlString', () => { + const splitField = 'split_field_influencer'; + const valueFour = 'value_four'; + const influencerFour = 'influencer_four'; + const influencers = [ + { + influencer_field_name: 'influencer_one', + influencer_field_values: ['value_one', 'value_two', 'value_three', valueFour], + }, + { + influencer_field_name: 'influencer_two', + influencer_field_values: ['value_one', 'value_two', 'value_three', valueFour], + }, + { + influencer_field_name: splitField, + influencer_field_values: ['value_one', 'value_two'], + }, + { + influencer_field_name: 'influencer_three', + influencer_field_values: ['value_one', 'value_two', 'value_three', valueFour], + }, + { + influencer_field_name: influencerFour, + influencer_field_values: ['value_one', 'value_two', 'value_three', valueFour], + }, + ]; + + test('should create the html string when given an array of influencers', () => { + const expected = + '
  • influencer_one: value_one, value_two, value_three
  • influencer_two: value_one, value_two, value_three
  • influencer_three: value_one, value_two, value_three
'; + const actual = getInfluencersHtmlString(influencers, splitField); + expect(actual).toBe(expected); + // Should not include split field + expect(actual.includes(splitField)).toBe(false); + // should limit to the first three influencer values + expect(actual.includes(valueFour)).toBe(false); + // should limit to the first three influencer names + expect(actual.includes(influencerFour)).toBe(false); + }); + }); + + describe('getResultsForJobId', () => { + const jobId = 'jobId'; + const searchFilters = { + timeFilters: { from: 'now-2y', to: 'now' }, + query: { language: 'kuery', query: '' }, + }; + + test('should get map features from job anomalies results for typical layer', async () => { + const actual = await getResultsForJobId( + mlResultsServiceMock, + jobId, + 'typical', + searchFilters + ); + expect(actual).toEqual(typicalExpected); + }); + + test('should get map features from job anomalies results for actual layer', async () => { + const actual = await getResultsForJobId(mlResultsServiceMock, jobId, 'actual', searchFilters); + expect(actual).toEqual(actualExpected); + }); + + test('should get map features from job anomalies results for "typical to actual" layer', async () => { + const actual = await getResultsForJobId( + mlResultsServiceMock, + jobId, + 'typical to actual', + searchFilters + ); + expect(actual).toEqual(typicalToActualExpected); + }); + }); +}); diff --git a/x-pack/plugins/ml/public/maps/results.test.mock.ts b/x-pack/plugins/ml/public/maps/results.test.mock.ts new file mode 100644 index 0000000000000..f718e818ba73c --- /dev/null +++ b/x-pack/plugins/ml/public/maps/results.test.mock.ts @@ -0,0 +1,160 @@ +/* + * 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. + */ + +const results = { + took: 9, + timed_out: false, + _shards: { + total: 1, + successful: 1, + skipped: 0, + failed: 0, + }, + hits: { + total: { + value: 19, + relation: 'eq', + }, + max_score: 4.4813457, + hits: [ + { + _index: '.ml-anomalies-shared', + _id: 'test-tooltip-one_record_1645974000000_900_0_0_0', + _score: 4.4813457, + _source: { + job_id: 'test-tooltip-one', + result_type: 'record', + probability: 0.00042878057629659614, + multi_bucket_impact: -5, + record_score: 77.74620142126848, + initial_record_score: 77.74620142126848, + bucket_span: 900, + detector_index: 0, + is_interim: false, + timestamp: 1645974000000, + function: 'lat_long', + function_description: 'lat_long', + typical: [39.9864616394043, -97.862548828125], + actual: [29.261693651787937, -121.93940273718908], + field_name: 'geo.coordinates', + influencers: [ + { + influencer_field_name: 'geo.dest', + influencer_field_values: ['CN', 'DO', 'RU', 'US'], + }, + { + influencer_field_name: 'clientip', + influencer_field_values: [ + '108.131.25.207', + '192.41.143.247', + '194.12.201.131', + '41.91.106.242', + ], + }, + { + influencer_field_name: 'agent.keyword', + influencer_field_values: [ + 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)', + 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24', + 'Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1', + ], + }, + ], + geo_results: { + typical_point: '39.986461639404,-97.862548828125', + actual_point: '29.261693651788,-121.939402737189', + }, + 'geo.dest': ['CN', 'DO', 'RU', 'US'], + 'agent.keyword': [ + 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)', + 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24', + 'Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1', + ], + clientip: ['108.131.25.207', '192.41.143.247', '194.12.201.131', '41.91.106.242'], + }, + }, + ], + }, +}; + +export const typicalExpected = { + features: [ + { + geometry: { coordinates: [-97.862548828125, 39.986461639404], type: 'Point' }, + properties: { + actual: [-121.939402737189, 29.261693651788], + actualDisplay: [-121.94, 29.26], + fieldName: 'geo.coordinates', + functionDescription: 'lat_long', + influencers: + '
  • geo.dest: CN, DO, RU
  • clientip: 108.131.25.207, 192.41.143.247, 194.12.201.131
  • agent.keyword: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322), Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24, Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1
', + record_score: 77, + timestamp: 'February 27th 2022, 10:00:00', + typical: [-97.862548828125, 39.986461639404], + typicalDisplay: [-97.86, 39.99], + }, + type: 'Feature', + }, + ], + type: 'FeatureCollection', +}; + +export const actualExpected = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + geometry: { + type: 'Point', + coordinates: [-121.939402737189, 29.261693651788], + }, + properties: { + actual: [-121.939402737189, 29.261693651788], + actualDisplay: [-121.94, 29.26], + typical: [-97.862548828125, 39.986461639404], + typicalDisplay: [-97.86, 39.99], + fieldName: 'geo.coordinates', + functionDescription: 'lat_long', + timestamp: 'February 27th 2022, 10:00:00', + record_score: 77, + influencers: + '
  • geo.dest: CN, DO, RU
  • clientip: 108.131.25.207, 192.41.143.247, 194.12.201.131
  • agent.keyword: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322), Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24, Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1
', + }, + }, + ], +}; +export const typicalToActualExpected = { + type: 'FeatureCollection', + features: [ + { + type: 'Feature', + geometry: { + type: 'LineString', + coordinates: [ + [-97.862548828125, 39.986461639404], + [-121.939402737189, 29.261693651788], + ], + }, + properties: { + actual: [-121.939402737189, 29.261693651788], + actualDisplay: [-121.94, 29.26], + typical: [-97.862548828125, 39.986461639404], + typicalDisplay: [-97.86, 39.99], + fieldName: 'geo.coordinates', + functionDescription: 'lat_long', + timestamp: 'February 27th 2022, 10:00:00', + record_score: 77, + influencers: + '
  • geo.dest: CN, DO, RU
  • clientip: 108.131.25.207, 192.41.143.247, 194.12.201.131
  • agent.keyword: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322), Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24, Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1
', + }, + }, + ], +}; + +export const mlResultsServiceMock = { + anomalySearch: () => results, +}; diff --git a/x-pack/plugins/ml/public/maps/util.ts b/x-pack/plugins/ml/public/maps/util.ts index df731f4bb309a..11e6b6f5a3920 100644 --- a/x-pack/plugins/ml/public/maps/util.ts +++ b/x-pack/plugins/ml/public/maps/util.ts @@ -23,6 +23,34 @@ export const ML_ANOMALY_LAYERS = { } as const; export type MlAnomalyLayersType = typeof ML_ANOMALY_LAYERS[keyof typeof ML_ANOMALY_LAYERS]; +const INFLUENCER_LIMIT = 3; +const INFLUENCER_MAX_VALUES = 3; + +export function getInfluencersHtmlString( + influencers: Array<{ influencer_field_name: string; influencer_field_values: string[] }>, + splitFields: string[] +) { + let htmlString = '
    '; + let influencerCount = 0; + for (let i = 0; i < influencers.length; i++) { + // eslint-disable-next-line @typescript-eslint/naming-convention + const { influencer_field_name, influencer_field_values } = influencers[i]; + // Skip if there are no values or it's a partition field + if (!influencer_field_values.length || splitFields.includes(influencer_field_name)) continue; + + const fieldValuesString = influencer_field_values.slice(0, INFLUENCER_MAX_VALUES).join(', '); + + htmlString += `
  • ${influencer_field_name}: ${fieldValuesString}
  • `; + influencerCount += 1; + + if (influencerCount === INFLUENCER_LIMIT) { + break; + } + } + htmlString += '
'; + + return htmlString; +} // Must reverse coordinates here. Map expects [lon, lat] - anomalies are stored as [lat, lon] for lat_lon jobs function getCoordinates(actualCoordinateStr: string, round: boolean = false): number[] { @@ -136,6 +164,15 @@ export async function getResultsForJobId( coordinates: [typical, actual], }; } + + const splitFields = { + ...(_source.partition_field_name + ? { [_source.partition_field_name]: _source.partition_field_value } + : {}), + ...(_source.by_field_name ? { [_source.by_field_name]: _source.by_field_value } : {}), + ...(_source.over_field_name ? { [_source.over_field_name]: _source.over_field_value } : {}), + }; + return { type: 'Feature', geometry, @@ -148,12 +185,14 @@ export async function getResultsForJobId( functionDescription: _source.function_description, timestamp: formatHumanReadableDateTimeSeconds(_source.timestamp), record_score: Math.floor(_source.record_score), - ...(_source.partition_field_name - ? { [_source.partition_field_name]: _source.partition_field_value } - : {}), - ...(_source.by_field_name ? { [_source.by_field_name]: _source.by_field_value } : {}), - ...(_source.over_field_name - ? { [_source.over_field_name]: _source.over_field_value } + ...(Object.keys(splitFields).length > 0 ? splitFields : {}), + ...(_source.influencers?.length + ? { + influencers: getInfluencersHtmlString( + _source.influencers, + Object.keys(splitFields) + ), + } : {}), }, }; diff --git a/x-pack/plugins/ml/server/models/annotation_service/__mocks__/get_annotations_response.json b/x-pack/plugins/ml/server/models/annotation_service/__mocks__/get_annotations_response.json index a0b8f6b242319..829b9c6581bea 100644 --- a/x-pack/plugins/ml/server/models/annotation_service/__mocks__/get_annotations_response.json +++ b/x-pack/plugins/ml/server/models/annotation_service/__mocks__/get_annotations_response.json @@ -15,8 +15,7 @@ "max_score": 0, "hits": [ { - "_index": ".ml-annotations-6", - "_type": "doc", + "_index": ".ml-annotations-000001", "_id": "T-CNvmgBQUJYQVn7TCPA", "_score": 0, "_source": { @@ -32,8 +31,7 @@ } }, { - "_index": ".ml-annotations-6", - "_type": "doc", + "_index": ".ml-annotations-000001", "_id": "3lVpvmgB5xYzd3PM-MSe", "_score": 0, "_source": { diff --git a/x-pack/plugins/ml/server/models/annotation_service/annotation.test.ts b/x-pack/plugins/ml/server/models/annotation_service/annotation.test.ts index fdeacd148434c..e6aa31501a557 100644 --- a/x-pack/plugins/ml/server/models/annotation_service/annotation.test.ts +++ b/x-pack/plugins/ml/server/models/annotation_service/annotation.test.ts @@ -41,7 +41,7 @@ describe('annotation_service', () => { const annotationMockId = 'mockId'; const deleteParamsMock: DeleteParams = { - index: '.ml-annotations-6', + index: '.ml-annotations-000001', id: annotationMockId, refresh: 'wait_for', }; diff --git a/x-pack/plugins/ml/server/models/annotation_service/annotation.ts b/x-pack/plugins/ml/server/models/annotation_service/annotation.ts index 4717a2ea1ce28..60d633b16097d 100644 --- a/x-pack/plugins/ml/server/models/annotation_service/annotation.ts +++ b/x-pack/plugins/ml/server/models/annotation_service/annotation.ts @@ -78,6 +78,31 @@ export interface AggByJob { } export function annotationProvider({ asInternalUser }: IScopedClusterClient) { + // Find the index the annotation is stored in. + async function fetchAnnotationIndex(id: string) { + const searchParams: estypes.SearchRequest = { + index: ML_ANNOTATIONS_INDEX_ALIAS_READ, + size: 1, + body: { + query: { + ids: { + values: [id], + }, + }, + }, + }; + + const body = await asInternalUser.search(searchParams); + const totalCount = + typeof body.hits.total === 'number' ? body.hits.total : body.hits.total!.value; + + if (totalCount === 0) { + throw Boom.notFound(`Cannot find annotation with ID ${id}`); + } + + return body.hits.hits[0]._index; + } + async function indexAnnotation(annotation: Annotation, username: string) { if (isAnnotation(annotation) === false) { // No need to translate, this will not be exposed in the UI. @@ -101,6 +126,8 @@ export function annotationProvider({ asInternalUser }: IScopedClusterClient) { if (typeof annotation._id !== 'undefined') { params.id = annotation._id; + params.index = await fetchAnnotationIndex(annotation._id); + params.require_alias = false; delete params.body._id; delete params.body.key; } @@ -387,28 +414,7 @@ export function annotationProvider({ asInternalUser }: IScopedClusterClient) { } async function deleteAnnotation(id: string) { - // Find the index the annotation is stored in. - const searchParams: estypes.SearchRequest = { - index: ML_ANNOTATIONS_INDEX_ALIAS_READ, - size: 1, - body: { - query: { - ids: { - values: [id], - }, - }, - }, - }; - - const body = await asInternalUser.search(searchParams); - const totalCount = - typeof body.hits.total === 'number' ? body.hits.total : body.hits.total!.value; - - if (totalCount === 0) { - throw Boom.notFound(`Cannot find annotation with ID ${id}`); - } - - const index = body.hits.hits[0]._index; + const index = await fetchAnnotationIndex(id); const deleteParams: DeleteParams = { index, diff --git a/x-pack/plugins/ml/server/models/data_frame_analytics/models_provider.ts b/x-pack/plugins/ml/server/models/data_frame_analytics/models_provider.ts index aba12ae93fdec..c12f611c011f6 100644 --- a/x-pack/plugins/ml/server/models/data_frame_analytics/models_provider.ts +++ b/x-pack/plugins/ml/server/models/data_frame_analytics/models_provider.ts @@ -34,6 +34,7 @@ const NODE_FIELDS = ['attributes', 'name', 'roles', 'version'] as const; export type RequiredNodeFields = Pick; +// @ts-expect-error TrainedModelDeploymentStatsResponse missing properties from MlTrainedModelDeploymentStats interface TrainedModelStatsResponse extends MlTrainedModelStats { deployment_stats?: Omit; model_size_stats?: TrainedModelModelSizeStats; diff --git a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts index dad1ecb7bc4ba..3df5016f560c0 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts +++ b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts @@ -603,8 +603,8 @@ export class DataRecognizer { } as JobStat; if (job.data_counts) { - jobStat.earliestTimestampMs = job.data_counts.earliest_record_timestamp; - jobStat.latestTimestampMs = job.data_counts.latest_record_timestamp; + jobStat.earliestTimestampMs = job.data_counts.earliest_record_timestamp!; + jobStat.latestTimestampMs = job.data_counts.latest_record_timestamp!; jobStat.latestResultsTimestampMs = getLatestDataOrBucketTimestamp( jobStat.latestTimestampMs, latestBucketTimestampsByJob[job.job_id] as number @@ -781,6 +781,7 @@ export class DataRecognizer { } private async _saveJob(job: ModuleJob) { + // @ts-expect-error type mismatch on MlPutJobRequest.body return this._mlClient.putJob({ job_id: job.id, body: job.config }); } diff --git a/x-pack/plugins/ml/server/models/job_service/jobs.ts b/x-pack/plugins/ml/server/models/job_service/jobs.ts index 81e1b1f693449..2f8e17ce142a7 100644 --- a/x-pack/plugins/ml/server/models/job_service/jobs.ts +++ b/x-pack/plugins/ml/server/models/job_service/jobs.ts @@ -590,7 +590,7 @@ export function jobsProvider( if (body.jobs.length) { const statsForJob = body.jobs[0]; - const time = statsForJob.data_counts.latest_record_timestamp; + const time = statsForJob.data_counts.latest_record_timestamp!; const progress = (time - start) / (end - start); const isJobClosed = statsForJob.state === JOB_STATE.CLOSED; return { @@ -631,6 +631,7 @@ export function jobsProvider( results[job.job_id] = { job: { success: false }, datafeed: { success: false } }; try { + // @ts-expect-error type mismatch on MlPutJobRequest.body await mlClient.putJob({ job_id: job.job_id, body: job }); results[job.job_id].job = { success: true }; } catch (error) { diff --git a/x-pack/plugins/ml/server/models/memory_overview/memory_overview_service.ts b/x-pack/plugins/ml/server/models/memory_overview/memory_overview_service.ts index e7bbc95ded742..d7f6eb584f7fe 100644 --- a/x-pack/plugins/ml/server/models/memory_overview/memory_overview_service.ts +++ b/x-pack/plugins/ml/server/models/memory_overview/memory_overview_service.ts @@ -74,7 +74,7 @@ export function memoryOverviewServiceProvider(mlClient: MlClient) { .filter((v) => v.state === 'opened') .map((jobStats) => { return { - node_id: jobStats.node.id, + node_id: jobStats.node!.id, // @ts-expect-error model_bytes can be string | number, cannot sum it with AD_PROCESS_MEMORY_OVERHEAD model_size: jobStats.model_size_stats.model_bytes + AD_PROCESS_MEMORY_OVERHEAD, job_id: jobStats.job_id, diff --git a/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx b/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx index ff58887c88c12..5effe649bf21a 100644 --- a/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx +++ b/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx @@ -23,7 +23,7 @@ import { GenericValidationResult, RuleTypeModel, } from '../../../triggers_actions_ui/public/types'; -import { AlertForm } from '../../../triggers_actions_ui/public/application/sections/alert_form/alert_form'; +import { RuleForm } from '../../../triggers_actions_ui/public/application/sections/rule_form/rule_form'; import ActionForm from '../../../triggers_actions_ui/public/application/sections/action_connector_form/action_form'; import { Legacy } from '../legacy_shims'; import { I18nProvider } from '@kbn/i18n-react'; @@ -41,7 +41,7 @@ jest.mock('../../../triggers_actions_ui/public/application/lib/action_connector_ loadActionTypes: jest.fn(), })); -jest.mock('../../../triggers_actions_ui/public/application/lib/alert_api', () => ({ +jest.mock('../../../triggers_actions_ui/public/application/lib/rule_api', () => ({ loadAlertTypes: jest.fn(), })); @@ -117,7 +117,7 @@ describe('alert_form', () => { const initialAlert = { name: 'test', - alertTypeId: ruleType.id, + ruleTypeId: ruleType.id, params: {}, consumer: ALERTS_FEATURE_ID, schedule: { @@ -133,10 +133,11 @@ describe('alert_form', () => { wrapper = mountWithIntl( - {}} - errors={{ name: [], interval: [] }} + errors={{ name: [], 'schedule.interval': [] }} operation="create" actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} @@ -152,13 +153,13 @@ describe('alert_form', () => { }); it('renders alert name', async () => { - const alertNameField = wrapper.find('[data-test-subj="alertNameInput"]'); + const alertNameField = wrapper.find('[data-test-subj="ruleNameInput"]'); expect(alertNameField.exists()).toBeTruthy(); expect(alertNameField.first().prop('value')).toBe('test'); }); it('renders registered selected alert type', async () => { - const alertTypeSelectOptions = wrapper.find('[data-test-subj="selectedAlertTypeTitle"]'); + const alertTypeSelectOptions = wrapper.find('[data-test-subj="selectedRuleTypeTitle"]'); expect(alertTypeSelectOptions.exists()).toBeTruthy(); }); diff --git a/x-pack/plugins/monitoring/public/alerts/configuration.tsx b/x-pack/plugins/monitoring/public/alerts/configuration.tsx index 5c5ce8c167341..6dd62a9a1dae6 100644 --- a/x-pack/plugins/monitoring/public/alerts/configuration.tsx +++ b/x-pack/plugins/monitoring/public/alerts/configuration.tsx @@ -86,7 +86,10 @@ export const AlertConfiguration: React.FC = (props: Props) => { () => showFlyout && Legacy.shims.triggersActionsUi.getEditAlertFlyout({ - initialAlert: alert, + initialRule: { + ...alert, + ruleTypeId: alert.alertTypeId, + }, onClose: () => { setShowFlyout(false); showBottomBar(); diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 3eb59effedc3a..3f31eb5f9140c 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -14,6 +14,7 @@ export { maxSuggestions, enableComparisonByDefault, enableInfrastructureView, + defaultApmServiceEnvironment, } from './ui_settings_keys'; export const casesFeatureId = 'observabilityCases'; diff --git a/x-pack/plugins/observability/common/ui_settings_keys.ts b/x-pack/plugins/observability/common/ui_settings_keys.ts index ea8a2f20ea4e7..2557217b2211e 100644 --- a/x-pack/plugins/observability/common/ui_settings_keys.ts +++ b/x-pack/plugins/observability/common/ui_settings_keys.ts @@ -9,3 +9,4 @@ export const enableInspectEsQueries = 'observability:enableInspectEsQueries'; export const maxSuggestions = 'observability:maxSuggestions'; export const enableComparisonByDefault = 'observability:enableComparisonByDefault'; export const enableInfrastructureView = 'observability:enableInfrastructureView'; +export const defaultApmServiceEnvironment = 'observability:apmDefaultServiceEnvironment'; diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index 0fa1469180da5..0ef02fda3fa47 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -27,6 +27,7 @@ export { enableInspectEsQueries, enableComparisonByDefault, enableInfrastructureView, + defaultApmServiceEnvironment, } from '../common/ui_settings_keys'; export { uptimeOverviewLocatorID } from '../common'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx index 82a0313ac711a..89e5c937bacb6 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx @@ -17,7 +17,7 @@ import { observabilityFeatureId } from '../../../../../common'; import { useGetUserCasesPermissions } from '../../../../hooks/use_get_user_cases_permissions'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; -import { loadAlertAggregations as loadRuleAggregations } from '../../../../../../../plugins/triggers_actions_ui/public'; +import { loadRuleAggregations } from '../../../../../../../plugins/triggers_actions_ui/public'; import { AlertStatusFilterButton } from '../../../../../common/typings'; import { ParsedTechnicalFields } from '../../../../../../rule_registry/common/parse_technical_fields'; import { ParsedExperimentalFields } from '../../../../../../rule_registry/common/parse_experimental_fields'; @@ -107,13 +107,12 @@ function AlertsPage() { const response = await loadRuleAggregations({ http, }); - // Note that the API uses the semantics of 'alerts' instead of 'rules' - const { alertExecutionStatus, ruleMutedStatus, ruleEnabledStatus } = response; - if (alertExecutionStatus && ruleMutedStatus && ruleEnabledStatus) { - const total = Object.values(alertExecutionStatus).reduce((acc, value) => acc + value, 0); + const { ruleExecutionStatus, ruleMutedStatus, ruleEnabledStatus } = response; + if (ruleExecutionStatus && ruleMutedStatus && ruleEnabledStatus) { + const total = Object.values(ruleExecutionStatus).reduce((acc, value) => acc + value, 0); const { disabled } = ruleEnabledStatus; const { muted } = ruleMutedStatus; - const { error } = alertExecutionStatus; + const { error } = ruleExecutionStatus; setRuleStats({ ...ruleStats, total, diff --git a/x-pack/plugins/observability/server/ui_settings.ts b/x-pack/plugins/observability/server/ui_settings.ts index 8d37398b8a07b..866c8fe5432d5 100644 --- a/x-pack/plugins/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability/server/ui_settings.ts @@ -14,12 +14,13 @@ import { enableInspectEsQueries, maxSuggestions, enableInfrastructureView, + defaultApmServiceEnvironment, } from '../common/ui_settings_keys'; /** * uiSettings definitions for Observability. */ -export const uiSettings: Record> = { +export const uiSettings: Record> = { [enableInspectEsQueries]: { category: [observabilityFeatureId], name: i18n.translate('xpack.observability.enableInspectEsQueriesExperimentName', { @@ -64,4 +65,16 @@ export const uiSettings: Record> = { }), schema: schema.boolean(), }, + [defaultApmServiceEnvironment]: { + category: [observabilityFeatureId], + name: i18n.translate('xpack.observability.defaultApmServiceEnvironment', { + defaultMessage: 'Default service environment', + }), + description: i18n.translate('xpack.observability.defaultApmServiceEnvironmentDescription', { + defaultMessage: + 'Set the default environment for the APM app. When left empty, data from all environments will be displayed by default.', + }), + value: '', + schema: schema.string(), + }, }; diff --git a/x-pack/plugins/observability/server/utils/create_or_update_index.ts b/x-pack/plugins/observability/server/utils/create_or_update_index.ts index a9d583bbf86af..af7dc670b0be8 100644 --- a/x-pack/plugins/observability/server/utils/create_or_update_index.ts +++ b/x-pack/plugins/observability/server/utils/create_or_update_index.ts @@ -77,7 +77,7 @@ function createNewIndex({ index, body: { // auto_expand_replicas: Allows cluster to not have replicas for this index - settings: { 'index.auto_expand_replicas': '0-1' }, + settings: { index: { auto_expand_replicas: '0-1' } }, mappings, }, }); diff --git a/x-pack/plugins/painless_lab/server/routes/api/execute.ts b/x-pack/plugins/painless_lab/server/routes/api/execute.ts index bc850f9e8043d..58cb9f4328d29 100644 --- a/x-pack/plugins/painless_lab/server/routes/api/execute.ts +++ b/x-pack/plugins/painless_lab/server/routes/api/execute.ts @@ -26,10 +26,17 @@ export function registerExecuteRoute({ router, license }: RouteDependencies) { try { const client = ctx.core.elasticsearch.client.asCurrentUser; - const response = await client.scriptsPainlessExecute({ - // @ts-expect-error `ExecutePainlessScriptRequest.body` does not allow `string` - body, - }); + const response = await client.scriptsPainlessExecute( + { + // @ts-expect-error `ExecutePainlessScriptRequest.body` does not allow `string` + body, + }, + { + headers: { + 'content-type': 'application/json', + }, + } + ); return res.ok({ body: response, diff --git a/x-pack/plugins/reporting/common/types/index.ts b/x-pack/plugins/reporting/common/types/index.ts index 42845297e204e..b9ffe09b5fe5c 100644 --- a/x-pack/plugins/reporting/common/types/index.ts +++ b/x-pack/plugins/reporting/common/types/index.ts @@ -32,7 +32,6 @@ export interface ReportDocumentHead { export interface ReportOutput extends TaskRunResult { content: string | null; - error_code?: string; size: number; } @@ -63,6 +62,16 @@ export interface TaskRunResult { max_size_reached?: boolean; warnings?: string[]; metrics?: TaskRunMetrics; + + /** + * When running a report task we may finish with warnings that were triggered + * by an error. We can pass the error code via the task run result to the + * task runner so that it can be recorded for telemetry. + * + * Alternatively, this field can be populated in the event that the task does + * not complete in the task runner's error handler. + */ + error_code?: string; } export interface ReportSource { diff --git a/x-pack/plugins/reporting/public/lib/stream_handler.ts b/x-pack/plugins/reporting/public/lib/stream_handler.ts index e9645f3bb8735..80932f8ddeeee 100644 --- a/x-pack/plugins/reporting/public/lib/stream_handler.ts +++ b/x-pack/plugins/reporting/public/lib/stream_handler.ts @@ -13,10 +13,11 @@ import { JOB_COMPLETION_NOTIFICATIONS_SESSION_KEY, JOB_STATUSES } from '../../co import { JobId, JobSummary, JobSummarySet } from '../../common/types'; import { getFailureToast, - getGeneralErrorToast, + getWarningToast, getSuccessToast, - getWarningFormulasToast, + getGeneralErrorToast, getWarningMaxSizeToast, + getWarningFormulasToast, } from '../notifier'; import { Job } from './job'; import { ReportingAPIClient } from './reporting_api_client'; @@ -71,6 +72,15 @@ export class ReportingNotifierStreamHandler { this.theme ) ); + } else if (job.status === JOB_STATUSES.WARNINGS) { + this.notifications.toasts.addWarning( + getWarningToast( + job, + this.apiClient.getManagementLink, + this.apiClient.getDownloadLink, + this.theme + ) + ); } else { this.notifications.toasts.addSuccess( getSuccessToast( diff --git a/x-pack/plugins/reporting/public/notifier/index.ts b/x-pack/plugins/reporting/public/notifier/index.ts index b44f1e9169747..d687e7009fb4c 100644 --- a/x-pack/plugins/reporting/public/notifier/index.ts +++ b/x-pack/plugins/reporting/public/notifier/index.ts @@ -10,3 +10,4 @@ export { getGeneralErrorToast } from './general_error'; export { getSuccessToast } from './job_success'; export { getWarningFormulasToast } from './job_warning_formulas'; export { getWarningMaxSizeToast } from './job_warning_max_size'; +export { getWarningToast } from './job_warning'; diff --git a/x-pack/plugins/reporting/public/notifier/job_warning.tsx b/x-pack/plugins/reporting/public/notifier/job_warning.tsx new file mode 100644 index 0000000000000..2ac10216f3f19 --- /dev/null +++ b/x-pack/plugins/reporting/public/notifier/job_warning.tsx @@ -0,0 +1,46 @@ +/* + * 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 { FormattedMessage } from '@kbn/i18n-react'; +import React, { Fragment } from 'react'; +import { ThemeServiceStart, ToastInput } from 'src/core/public'; +import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; +import { JobId, JobSummary } from '../../common/types'; +import { DownloadButton } from './job_download_button'; +import { ReportLink } from './report_link'; + +export const getWarningToast = ( + job: JobSummary, + getReportLink: () => string, + getDownloadLink: (jobId: JobId) => string, + theme: ThemeServiceStart +): ToastInput => ({ + title: toMountPoint( + , + { theme$: theme.theme$ } + ), + text: toMountPoint( + +

+ +

+

+ +

+ +
, + { theme$: theme.theme$ } + ), + 'data-test-subj': 'completeReportWarning', +}); diff --git a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.test.ts b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.test.ts index eb3cbd6118eb9..c525cb7c0def2 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.test.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.test.ts @@ -27,7 +27,7 @@ import { UI_SETTINGS_CSV_SEPARATOR, UI_SETTINGS_DATEFORMAT_TZ, } from '../../../../common/constants'; -import { AuthenticationExpiredError } from '../../../../common/errors'; +import { UnknownError } from '../../../../common/errors'; import { createMockConfig, createMockConfigSchema, @@ -808,25 +808,76 @@ it('can override ignoring frozen indices', async () => { ); }); -it('throws an AuthenticationExpiredError when ES does not accept credentials', async () => { - mockDataClient.search = jest.fn().mockImplementation(() => { - throw new esErrors.ResponseError({ statusCode: 403, meta: {} as any, warnings: [] }); +describe('error codes', () => { + it('returns the expected error code when authentication expires', async () => { + mockDataClient.search = jest.fn().mockImplementation(() => + Rx.of({ + rawResponse: { + _scroll_id: 'test', + hits: { + hits: range(0, 5).map(() => ({ + fields: { + date: ['2020-12-31T00:14:28.000Z'], + ip: ['110.135.176.89'], + message: ['super cali fragile istic XPLA docious'], + }, + })), + total: 10, + }, + }, + }) + ); + + mockEsClient.asCurrentUser.scroll = jest.fn().mockImplementation(() => { + throw new esErrors.ResponseError({ statusCode: 403, meta: {} as any, warnings: [] }); + }); + + const generateCsv = new CsvGenerator( + createMockJob({ columns: ['date', 'ip', 'message'] }), + mockConfig, + { + es: mockEsClient, + data: mockDataClient, + uiSettings: uiSettingsClient, + }, + { + searchSourceStart: mockSearchSourceService, + fieldFormatsRegistry: mockFieldFormatsRegistry, + }, + new CancellationToken(), + logger, + stream + ); + + const { error_code: errorCode, warnings } = await generateCsv.generateData(); + expect(errorCode).toBe('authentication_expired'); + expect(warnings).toMatchInlineSnapshot(` + Array [ + "This report contains partial CSV results because authentication expired before it could finish. Try exporting a smaller amount of data or increase your authentication timeout.", + ] + `); + }); + + it('throws for unknown errors', async () => { + mockDataClient.search = jest.fn().mockImplementation(() => { + throw new esErrors.ResponseError({ statusCode: 500, meta: {} as any, warnings: [] }); + }); + const generateCsv = new CsvGenerator( + createMockJob({ columns: ['date', 'ip', 'message'] }), + mockConfig, + { + es: mockEsClient, + data: mockDataClient, + uiSettings: uiSettingsClient, + }, + { + searchSourceStart: mockSearchSourceService, + fieldFormatsRegistry: mockFieldFormatsRegistry, + }, + new CancellationToken(), + logger, + stream + ); + await expect(generateCsv.generateData()).rejects.toBeInstanceOf(UnknownError); }); - const generateCsv = new CsvGenerator( - createMockJob({ columns: ['date', 'ip', 'message'] }), - mockConfig, - { - es: mockEsClient, - data: mockDataClient, - uiSettings: uiSettingsClient, - }, - { - searchSourceStart: mockSearchSourceService, - fieldFormatsRegistry: mockFieldFormatsRegistry, - }, - new CancellationToken(), - logger, - stream - ); - await expect(generateCsv.generateData()).rejects.toEqual(new AuthenticationExpiredError()); }); diff --git a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts index 5be17f5e6d252..201484af9d7d0 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts @@ -7,7 +7,6 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { errors as esErrors } from '@elastic/elasticsearch'; -import { i18n } from '@kbn/i18n'; import type { IScopedClusterClient, IUiSettingsClient } from 'src/core/server'; import type { IScopedSearchClient } from 'src/plugins/data/server'; import type { Datatable } from 'src/plugins/expressions/server'; @@ -31,13 +30,18 @@ import type { import { KbnServerError } from '../../../../../../../src/plugins/kibana_utils/server'; import type { CancellationToken } from '../../../../common/cancellation_token'; import { CONTENT_TYPE_CSV } from '../../../../common/constants'; -import { AuthenticationExpiredError } from '../../../../common/errors'; +import { + AuthenticationExpiredError, + UnknownError, + ReportingError, +} from '../../../../common/errors'; import { byteSizeValueToNumber } from '../../../../common/schema_utils'; import type { LevelLogger } from '../../../lib'; import type { TaskRunResult } from '../../../lib/tasks'; import type { JobParamsCSV } from '../types'; import { CsvExportSettings, getExportSettings } from './get_export_settings'; import { MaxSizeStringBuilder } from './max_size_string_builder'; +import { i18nTexts } from './i18n_texts'; interface Clients { es: IScopedClusterClient; @@ -257,6 +261,7 @@ export class CsvGenerator { ), this.dependencies.searchSourceStart.create(this.job.searchSource), ]); + let reportingError: undefined | ReportingError; const index = searchSource.getField('index'); @@ -360,19 +365,19 @@ export class CsvGenerator { // Add warnings to be logged if (this.csvContainsFormulas && escapeFormulaValues) { - warnings.push( - i18n.translate('xpack.reporting.exportTypes.csv.generateCsv.escapedFormulaValues', { - defaultMessage: 'CSV may contain formulas whose values have been escaped', - }) - ); + warnings.push(i18nTexts.escapedFormulaValuesMessage); } } catch (err) { this.logger.error(err); if (err instanceof KbnServerError && err.errBody) { throw JSON.stringify(err.errBody.error); } + if (err instanceof esErrors.ResponseError && [401, 403].includes(err.statusCode ?? 0)) { - throw new AuthenticationExpiredError(); + reportingError = new AuthenticationExpiredError(); + warnings.push(i18nTexts.authenticationError.partialResultsMessage); + } else { + throw new UnknownError(err.message); } } finally { // clear scrollID @@ -405,6 +410,7 @@ export class CsvGenerator { csv: { rows: this.csvRowCount }, }, warnings, + error_code: reportingError?.code, }; } } diff --git a/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/i18n_texts.ts b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/i18n_texts.ts new file mode 100644 index 0000000000000..c994226c6a05c --- /dev/null +++ b/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/i18n_texts.ts @@ -0,0 +1,26 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const i18nTexts = { + escapedFormulaValuesMessage: i18n.translate( + 'xpack.reporting.exportTypes.csv.generateCsv.escapedFormulaValues', + { + defaultMessage: 'CSV may contain formulas whose values have been escaped', + } + ), + authenticationError: { + partialResultsMessage: i18n.translate( + 'xpack.reporting.exportTypes.csv.generateCsv.authenticationExpired.partialResultsMessage', + { + defaultMessage: + 'This report contains partial CSV results because authentication expired before it could finish. Try exporting a smaller amount of data or increase your authentication timeout.', + } + ), + }, +}; diff --git a/x-pack/plugins/reporting/server/lib/deprecations/check_ilm_migration_status.ts b/x-pack/plugins/reporting/server/lib/deprecations/check_ilm_migration_status.ts index a7b9ecc7dc437..c3aea64171444 100644 --- a/x-pack/plugins/reporting/server/lib/deprecations/check_ilm_migration_status.ts +++ b/x-pack/plugins/reporting/server/lib/deprecations/check_ilm_migration_status.ts @@ -29,6 +29,7 @@ export const checkIlmMigrationStatus = async ({ const hasUnmanagedIndices = Object.values(reportingIndicesSettings).some((settings) => { return ( settings?.settings?.index?.lifecycle?.name !== ILM_POLICY_NAME && + // @ts-expect-error index.lifecycle not present on type def settings?.settings?.['index.lifecycle']?.name !== ILM_POLICY_NAME ); }); diff --git a/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts b/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts index aeeb79a85ce98..449f3b8da7671 100644 --- a/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts +++ b/x-pack/plugins/reporting/server/lib/tasks/execute_report.ts @@ -227,6 +227,7 @@ export class ExecuteReportTask implements ReportingTask { docOutput.size = output.size; docOutput.warnings = output.warnings && output.warnings.length > 0 ? output.warnings : undefined; + docOutput.error_code = output.error_code; } else { const defaultOutput = null; docOutput.content = output.toString() || defaultOutput; @@ -369,7 +370,7 @@ export class ExecuteReportTask implements ReportingTask { report._primary_term = stream.getPrimaryTerm()!; eventLog.logExecutionComplete({ - ...(report.metrics ?? {}), + ...(output.metrics ?? {}), byteSize: stream.bytesWritten, }); diff --git a/x-pack/plugins/reporting/server/routes/deprecations/deprecations.ts b/x-pack/plugins/reporting/server/routes/deprecations/deprecations.ts index b369a5758fcb5..4c368337cd482 100644 --- a/x-pack/plugins/reporting/server/routes/deprecations/deprecations.ts +++ b/x-pack/plugins/reporting/server/routes/deprecations/deprecations.ts @@ -126,8 +126,10 @@ export const registerDeprecationsRoutes = (reporting: ReportingCore, logger: Log await client.indices.putSettings({ index: indexPattern, body: { - 'index.lifecycle': { - name: ILM_POLICY_NAME, + index: { + lifecycle: { + name: ILM_POLICY_NAME, + }, }, }, }); diff --git a/x-pack/plugins/rollup/server/routes/api/jobs/register_create_route.ts b/x-pack/plugins/rollup/server/routes/api/jobs/register_create_route.ts index a13bf4936a77f..ca067d0833981 100644 --- a/x-pack/plugins/rollup/server/routes/api/jobs/register_create_route.ts +++ b/x-pack/plugins/rollup/server/routes/api/jobs/register_create_route.ts @@ -35,6 +35,7 @@ export const registerCreateRoute = ({ // Create job. await clusterClient.asCurrentUser.rollup.putJob({ id, + // @ts-expect-error type mismatch on RollupPutJobRequest.body body: rest, }); // Then request the newly created job. diff --git a/x-pack/plugins/rule_registry/common/constants.ts b/x-pack/plugins/rule_registry/common/constants.ts index 72793b1087e7b..1c5fad0e2215f 100644 --- a/x-pack/plugins/rule_registry/common/constants.ts +++ b/x-pack/plugins/rule_registry/common/constants.ts @@ -6,3 +6,4 @@ */ export const BASE_RAC_ALERTS_API_PATH = '/internal/rac/alerts'; +export const MAX_ALERT_SEARCH_SIZE = 1000; diff --git a/x-pack/plugins/rule_registry/common/index.ts b/x-pack/plugins/rule_registry/common/index.ts index 5d36cd8cad7be..2dd7f6bbc456e 100644 --- a/x-pack/plugins/rule_registry/common/index.ts +++ b/x-pack/plugins/rule_registry/common/index.ts @@ -4,4 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -export { parseTechnicalFields } from './parse_technical_fields'; +export { parseTechnicalFields, type ParsedTechnicalFields } from './parse_technical_fields'; +export type { RuleRegistrySearchRequest, RuleRegistrySearchResponse } from './search_strategy'; +export { BASE_RAC_ALERTS_API_PATH } from './constants'; diff --git a/x-pack/plugins/rule_registry/common/search_strategy/index.ts b/x-pack/plugins/rule_registry/common/search_strategy/index.ts new file mode 100644 index 0000000000000..efb8a3478263e --- /dev/null +++ b/x-pack/plugins/rule_registry/common/search_strategy/index.ts @@ -0,0 +1,58 @@ +/* + * 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 { ValidFeatureId } from '@kbn/rule-data-utils'; +import { Ecs } from 'kibana/server'; +import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { IEsSearchRequest, IEsSearchResponse } from 'src/plugins/data/common'; + +export type RuleRegistrySearchRequest = IEsSearchRequest & { + featureIds: ValidFeatureId[]; + query?: { bool: estypes.QueryDslBoolQuery }; +}; + +type Prev = [ + never, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + ...Array<0> +]; + +type Join = K extends string | number + ? P extends string | number + ? `${K}${'' extends P ? '' : '.'}${P}` + : never + : never; + +type DotNestedKeys = [D] extends [never] + ? never + : T extends object + ? { [K in keyof T]-?: Join> }[keyof T] + : ''; + +type EcsFieldsResponse = { + [Property in DotNestedKeys]: string[]; +}; +export type RuleRegistrySearchResponse = IEsSearchResponse; diff --git a/x-pack/plugins/rule_registry/kibana.json b/x-pack/plugins/rule_registry/kibana.json index 75e0c2c8c0bac..9603cb0a2640b 100644 --- a/x-pack/plugins/rule_registry/kibana.json +++ b/x-pack/plugins/rule_registry/kibana.json @@ -8,6 +8,6 @@ "kibanaVersion": "kibana", "configPath": ["xpack", "ruleRegistry"], "requiredPlugins": ["alerting", "data", "triggersActionsUi"], - "optionalPlugins": ["security"], + "optionalPlugins": ["security", "spaces"], "server": true } diff --git a/x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts b/x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts index 1f8cfb4b78c85..a97b43332e0a9 100644 --- a/x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts +++ b/x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts @@ -21,7 +21,7 @@ import { InlineScript, QueryDslQueryContainer, } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { AlertTypeParams, AlertingAuthorizationFilterType } from '../../../alerting/server'; +import { AlertTypeParams } from '../../../alerting/server'; import { ReadOperations, AlertingAuthorization, @@ -39,6 +39,7 @@ import { } from '../../common/technical_rule_data_field_names'; import { ParsedTechnicalFields } from '../../common/parse_technical_fields'; import { Dataset, IRuleDataService } from '../rule_data_plugin_service'; +import { getAuthzFilter, getSpacesFilter } from '../lib'; // TODO: Fix typings https://github.com/elastic/kibana/issues/101776 type NonNullableProps = Omit & { @@ -369,14 +370,8 @@ export class AlertsClient { config: EsQueryConfig ) { try { - const { filter: authzFilter } = await this.authorization.getAuthorizationFilter( - AlertingAuthorizationEntity.Alert, - { - type: AlertingAuthorizationFilterType.ESDSL, - fieldNames: { consumer: ALERT_RULE_CONSUMER, ruleTypeId: ALERT_RULE_TYPE_ID }, - }, - operation - ); + const authzFilter = (await getAuthzFilter(this.authorization, operation)) as Filter; + const spacesFilter = getSpacesFilter(alertSpaceId) as unknown as Filter; let esQuery; if (id != null) { esQuery = { query: `_id:${id}`, language: 'kuery' }; @@ -388,10 +383,7 @@ export class AlertsClient { const builtQuery = buildEsQuery( undefined, esQuery == null ? { query: ``, language: 'kuery' } : esQuery, - [ - authzFilter as unknown as Filter, - { query: { term: { [SPACE_IDS]: alertSpaceId } } } as unknown as Filter, - ], + [authzFilter, spacesFilter], config ); if (query != null && typeof query === 'object') { diff --git a/x-pack/plugins/rule_registry/server/lib/get_authz_filter.test.ts b/x-pack/plugins/rule_registry/server/lib/get_authz_filter.test.ts new file mode 100644 index 0000000000000..3b79c7a5bad8a --- /dev/null +++ b/x-pack/plugins/rule_registry/server/lib/get_authz_filter.test.ts @@ -0,0 +1,20 @@ +/* + * 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 { alertingAuthorizationMock } from '../../../alerting/server/authorization/alerting_authorization.mock'; +import { ReadOperations } from '../../../alerting/server'; +import { getAuthzFilter } from './get_authz_filter'; + +describe('getAuthzFilter()', () => { + it('should call `getAuthorizationFilter`', async () => { + const authorization = alertingAuthorizationMock.create(); + authorization.getAuthorizationFilter.mockImplementationOnce(async () => { + return { filter: { test: true }, ensureRuleTypeIsAuthorized: () => {} }; + }); + const filter = await getAuthzFilter(authorization, ReadOperations.Find); + expect(filter).toStrictEqual({ test: true }); + }); +}); diff --git a/x-pack/plugins/rule_registry/server/lib/get_authz_filter.ts b/x-pack/plugins/rule_registry/server/lib/get_authz_filter.ts new file mode 100644 index 0000000000000..88b8feb2ca97c --- /dev/null +++ b/x-pack/plugins/rule_registry/server/lib/get_authz_filter.ts @@ -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 { PublicMethodsOf } from '@kbn/utility-types'; +import { + ReadOperations, + WriteOperations, + AlertingAuthorization, + AlertingAuthorizationEntity, + AlertingAuthorizationFilterType, +} from '../../../alerting/server'; +import { + ALERT_RULE_CONSUMER, + ALERT_RULE_TYPE_ID, +} from '../../common/technical_rule_data_field_names'; + +export async function getAuthzFilter( + authorization: PublicMethodsOf, + operation: WriteOperations.Update | ReadOperations.Get | ReadOperations.Find +) { + const { filter } = await authorization.getAuthorizationFilter( + AlertingAuthorizationEntity.Alert, + { + type: AlertingAuthorizationFilterType.ESDSL, + fieldNames: { consumer: ALERT_RULE_CONSUMER, ruleTypeId: ALERT_RULE_TYPE_ID }, + }, + operation + ); + return filter; +} diff --git a/x-pack/plugins/rule_registry/server/lib/get_spaces_filter.test.ts b/x-pack/plugins/rule_registry/server/lib/get_spaces_filter.test.ts new file mode 100644 index 0000000000000..7fd5f00fd99b1 --- /dev/null +++ b/x-pack/plugins/rule_registry/server/lib/get_spaces_filter.test.ts @@ -0,0 +1,20 @@ +/* + * 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 { getSpacesFilter } from '.'; +describe('getSpacesFilter()', () => { + it('should return a spaces filter', () => { + expect(getSpacesFilter('1')).toStrictEqual({ + term: { + 'kibana.space_ids': '1', + }, + }); + }); + + it('should return undefined if no space id is provided', () => { + expect(getSpacesFilter()).toBeUndefined(); + }); +}); diff --git a/x-pack/plugins/rule_registry/server/lib/get_spaces_filter.ts b/x-pack/plugins/rule_registry/server/lib/get_spaces_filter.ts new file mode 100644 index 0000000000000..2756b3d600f18 --- /dev/null +++ b/x-pack/plugins/rule_registry/server/lib/get_spaces_filter.ts @@ -0,0 +1,11 @@ +/* + * 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 { SPACE_IDS } from '../../common/technical_rule_data_field_names'; + +export function getSpacesFilter(spaceId?: string) { + return spaceId ? { term: { [SPACE_IDS]: spaceId } } : undefined; +} diff --git a/x-pack/plugins/rule_registry/server/lib/index.ts b/x-pack/plugins/rule_registry/server/lib/index.ts new file mode 100644 index 0000000000000..c9ed157e7c18a --- /dev/null +++ b/x-pack/plugins/rule_registry/server/lib/index.ts @@ -0,0 +1,8 @@ +/* + * 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 { getAuthzFilter } from './get_authz_filter'; +export { getSpacesFilter } from './get_spaces_filter'; diff --git a/x-pack/plugins/rule_registry/server/plugin.ts b/x-pack/plugins/rule_registry/server/plugin.ts index 713e7862207b8..292e987879d58 100644 --- a/x-pack/plugins/rule_registry/server/plugin.ts +++ b/x-pack/plugins/rule_registry/server/plugin.ts @@ -17,6 +17,11 @@ import { import { PluginStartContract as AlertingStart } from '../../alerting/server'; import { SecurityPluginSetup } from '../../security/server'; +import { SpacesPluginStart } from '../../spaces/server'; +import { + PluginStart as DataPluginStart, + PluginSetup as DataPluginSetup, +} from '../../../../src/plugins/data/server'; import { RuleRegistryPluginConfig } from './config'; import { IRuleDataService, RuleDataService } from './rule_data_plugin_service'; @@ -24,13 +29,17 @@ import { AlertsClientFactory } from './alert_data_client/alerts_client_factory'; import { AlertsClient } from './alert_data_client/alerts_client'; import { RacApiRequestHandlerContext, RacRequestHandlerContext } from './types'; import { defineRoutes } from './routes'; +import { ruleRegistrySearchStrategyProvider } from './search_strategy'; export interface RuleRegistryPluginSetupDependencies { security?: SecurityPluginSetup; + data: DataPluginSetup; } export interface RuleRegistryPluginStartDependencies { alerting: AlertingStart; + data: DataPluginStart; + spaces?: SpacesPluginStart; } export interface RuleRegistryPluginSetupContract { @@ -95,6 +104,22 @@ export class RuleRegistryPlugin this.ruleDataService.initializeService(); + core.getStartServices().then(([_, depsStart]) => { + const ruleRegistrySearchStrategy = ruleRegistrySearchStrategyProvider( + depsStart.data, + this.ruleDataService!, + depsStart.alerting, + logger, + plugins.security, + depsStart.spaces + ); + + plugins.data.search.registerSearchStrategy( + 'ruleRegistryAlertsSearchStrategy', + ruleRegistrySearchStrategy + ); + }); + // ALERTS ROUTES const router = core.http.createRouter(); core.http.registerRouteHandlerContext( diff --git a/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts b/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts index 2bda23ca3c46f..8e7d13b0dc210 100644 --- a/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts +++ b/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts @@ -309,10 +309,9 @@ export class ResourceInstaller { template: { settings: { hidden: true, + // @ts-expect-error type only defines nested structure 'index.lifecycle': { name: ilmPolicyName, - // TODO: fix the types in the ES package, they don't include rollover_alias??? - // @ts-expect-error rollover_alias: primaryNamespacedAlias, }, 'index.mapping.total_fields.limit': 1700, diff --git a/x-pack/plugins/rule_registry/server/search_strategy/index.ts b/x-pack/plugins/rule_registry/server/search_strategy/index.ts new file mode 100644 index 0000000000000..63f39430a5522 --- /dev/null +++ b/x-pack/plugins/rule_registry/server/search_strategy/index.ts @@ -0,0 +1,8 @@ +/* + * 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 { ruleRegistrySearchStrategyProvider } from './search_strategy'; diff --git a/x-pack/plugins/rule_registry/server/search_strategy/search_strategy.test.ts b/x-pack/plugins/rule_registry/server/search_strategy/search_strategy.test.ts new file mode 100644 index 0000000000000..9f83930dadc69 --- /dev/null +++ b/x-pack/plugins/rule_registry/server/search_strategy/search_strategy.test.ts @@ -0,0 +1,202 @@ +/* + * 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 { of } from 'rxjs'; +import { merge } from 'lodash'; +import { loggerMock } from '@kbn/logging-mocks'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import { ruleRegistrySearchStrategyProvider, EMPTY_RESPONSE } from './search_strategy'; +import { ruleDataServiceMock } from '../rule_data_plugin_service/rule_data_plugin_service.mock'; +import { dataPluginMock } from '../../../../../src/plugins/data/server/mocks'; +import { SearchStrategyDependencies } from '../../../../../src/plugins/data/server'; +import { alertsMock } from '../../../alerting/server/mocks'; +import { securityMock } from '../../../security/server/mocks'; +import { spacesMock } from '../../../spaces/server/mocks'; +import { RuleRegistrySearchRequest } from '../../common/search_strategy'; +import { IndexInfo } from '../rule_data_plugin_service/index_info'; +import * as getAuthzFilterImport from '../lib/get_authz_filter'; + +const getBasicResponse = (overwrites = {}) => { + return merge( + { + isPartial: false, + isRunning: false, + total: 0, + loaded: 0, + rawResponse: { + took: 1, + timed_out: false, + _shards: { + failed: 0, + successful: 1, + total: 1, + }, + hits: { + max_score: 0, + hits: [], + total: 0, + }, + }, + }, + overwrites + ); +}; + +describe('ruleRegistrySearchStrategyProvider()', () => { + const data = dataPluginMock.createStartContract(); + const ruleDataService = ruleDataServiceMock.create(); + const alerting = alertsMock.createStart(); + const security = securityMock.createSetup(); + const spaces = spacesMock.createStart(); + const logger = loggerMock.create(); + + const response = getBasicResponse({ + rawResponse: { + hits: { + hits: [ + { + _source: { + foo: 1, + }, + }, + ], + }, + }, + }); + + let getAuthzFilterSpy: jest.SpyInstance; + + beforeEach(() => { + ruleDataService.findIndicesByFeature.mockImplementation(() => { + return [ + { + baseName: 'test', + } as IndexInfo, + ]; + }); + + data.search.getSearchStrategy.mockImplementation(() => { + return { + search: () => of(response), + }; + }); + + getAuthzFilterSpy = jest + .spyOn(getAuthzFilterImport, 'getAuthzFilter') + .mockImplementation(async () => { + return {}; + }); + }); + + afterEach(() => { + ruleDataService.findIndicesByFeature.mockClear(); + data.search.getSearchStrategy.mockClear(); + getAuthzFilterSpy.mockClear(); + }); + + it('should handle a basic search request', async () => { + const request: RuleRegistrySearchRequest = { + featureIds: [AlertConsumers.LOGS], + }; + const options = {}; + const deps = { + request: {}, + }; + + const strategy = ruleRegistrySearchStrategyProvider( + data, + ruleDataService, + alerting, + logger, + security, + spaces + ); + + const result = await strategy + .search(request, options, deps as unknown as SearchStrategyDependencies) + .toPromise(); + expect(result).toBe(response); + }); + + it('should use the active space in siem queries', async () => { + const request: RuleRegistrySearchRequest = { + featureIds: [AlertConsumers.SIEM], + }; + const options = {}; + const deps = { + request: {}, + }; + + spaces.spacesService.getActiveSpace.mockImplementation(async () => { + return { + id: 'testSpace', + name: 'Test Space', + disabledFeatures: [], + }; + }); + + ruleDataService.findIndicesByFeature.mockImplementation(() => { + return [ + { + baseName: 'myTestIndex', + } as unknown as IndexInfo, + ]; + }); + + let searchRequest: RuleRegistrySearchRequest = {} as unknown as RuleRegistrySearchRequest; + data.search.getSearchStrategy.mockImplementation(() => { + return { + search: (_request) => { + searchRequest = _request as unknown as RuleRegistrySearchRequest; + return of(response); + }, + }; + }); + + const strategy = ruleRegistrySearchStrategyProvider( + data, + ruleDataService, + alerting, + logger, + security, + spaces + ); + + await strategy + .search(request, options, deps as unknown as SearchStrategyDependencies) + .toPromise(); + spaces.spacesService.getActiveSpace.mockClear(); + expect(searchRequest?.params?.index).toStrictEqual(['myTestIndex-testSpace*']); + }); + + it('should return an empty response if no valid indices are found', async () => { + const request: RuleRegistrySearchRequest = { + featureIds: [AlertConsumers.LOGS], + }; + const options = {}; + const deps = { + request: {}, + }; + + ruleDataService.findIndicesByFeature.mockImplementationOnce(() => { + return []; + }); + + const strategy = ruleRegistrySearchStrategyProvider( + data, + ruleDataService, + alerting, + logger, + security, + spaces + ); + + const result = await strategy + .search(request, options, deps as unknown as SearchStrategyDependencies) + .toPromise(); + expect(result).toBe(EMPTY_RESPONSE); + }); +}); diff --git a/x-pack/plugins/rule_registry/server/search_strategy/search_strategy.ts b/x-pack/plugins/rule_registry/server/search_strategy/search_strategy.ts new file mode 100644 index 0000000000000..dd7f392b0a268 --- /dev/null +++ b/x-pack/plugins/rule_registry/server/search_strategy/search_strategy.ts @@ -0,0 +1,149 @@ +/* + * 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 { map, mergeMap, catchError } from 'rxjs/operators'; +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { Logger } from 'src/core/server'; +import { from, of } from 'rxjs'; +import { isValidFeatureId } from '@kbn/rule-data-utils'; +import { ENHANCED_ES_SEARCH_STRATEGY } from '../../../../../src/plugins/data/common'; +import { ISearchStrategy, PluginStart } from '../../../../../src/plugins/data/server'; +import { + RuleRegistrySearchRequest, + RuleRegistrySearchResponse, +} from '../../common/search_strategy'; +import { ReadOperations, PluginStartContract as AlertingStart } from '../../../alerting/server'; +import { SecurityPluginSetup } from '../../../security/server'; +import { SpacesPluginStart } from '../../../spaces/server'; +import { IRuleDataService } from '..'; +import { Dataset } from '../rule_data_plugin_service/index_options'; +import { MAX_ALERT_SEARCH_SIZE } from '../../common/constants'; +import { AlertAuditAction, alertAuditEvent } from '../'; +import { getSpacesFilter, getAuthzFilter } from '../lib'; + +export const EMPTY_RESPONSE: RuleRegistrySearchResponse = { + rawResponse: {} as RuleRegistrySearchResponse['rawResponse'], +}; + +export const ruleRegistrySearchStrategyProvider = ( + data: PluginStart, + ruleDataService: IRuleDataService, + alerting: AlertingStart, + logger: Logger, + security?: SecurityPluginSetup, + spaces?: SpacesPluginStart +): ISearchStrategy => { + const es = data.search.getSearchStrategy(ENHANCED_ES_SEARCH_STRATEGY); + + return { + search: (request, options, deps) => { + const securityAuditLogger = security?.audit.asScoped(deps.request); + const getActiveSpace = async () => spaces?.spacesService.getActiveSpace(deps.request); + const getAsync = async () => { + const [space, authorization] = await Promise.all([ + getActiveSpace(), + alerting.getAlertingAuthorizationWithRequest(deps.request), + ]); + const authzFilter = (await getAuthzFilter( + authorization, + ReadOperations.Find + )) as estypes.QueryDslQueryContainer; + return { space, authzFilter }; + }; + return from(getAsync()).pipe( + mergeMap(({ space, authzFilter }) => { + const indices: string[] = request.featureIds.reduce((accum: string[], featureId) => { + if (!isValidFeatureId(featureId)) { + logger.warn( + `Found invalid feature '${featureId}' while using rule registry search strategy. No alert data from this feature will be searched.` + ); + return accum; + } + + return [ + ...accum, + ...ruleDataService + .findIndicesByFeature(featureId, Dataset.alerts) + .map((indexInfo) => { + return featureId === 'siem' + ? `${indexInfo.baseName}-${space?.id ?? ''}*` + : `${indexInfo.baseName}*`; + }), + ]; + }, []); + + if (indices.length === 0) { + return of(EMPTY_RESPONSE); + } + + const filter = request.query?.bool?.filter + ? Array.isArray(request.query?.bool?.filter) + ? request.query?.bool?.filter + : [request.query?.bool?.filter] + : []; + if (authzFilter) { + filter.push(authzFilter); + } + if (space?.id) { + filter.push(getSpacesFilter(space.id) as estypes.QueryDslQueryContainer); + } + + const query = { + bool: { + ...request.query?.bool, + filter, + }, + }; + const params = { + index: indices, + body: { + _source: false, + fields: ['*'], + size: MAX_ALERT_SEARCH_SIZE, + query, + }, + }; + return es.search({ ...request, params }, options, deps); + }), + map((response) => { + // Do we have to loop over each hit? Yes. + // ecs auditLogger requires that we log each alert independently + if (securityAuditLogger != null) { + response.rawResponse.hits?.hits?.forEach((hit) => { + securityAuditLogger.log( + alertAuditEvent({ + action: AlertAuditAction.FIND, + id: hit._id, + outcome: 'success', + }) + ); + }); + } + return response; + }), + catchError((err) => { + // check if auth error, if yes, write to ecs logger + if (securityAuditLogger != null && err?.output?.statusCode === 403) { + securityAuditLogger.log( + alertAuditEvent({ + action: AlertAuditAction.FIND, + outcome: 'failure', + error: err, + }) + ); + } + + throw err; + }) + ); + }, + cancel: async (id, options, deps) => { + if (es.cancel) { + return es.cancel(id, options, deps); + } + }, + }; +}; diff --git a/x-pack/plugins/rule_registry/tsconfig.json b/x-pack/plugins/rule_registry/tsconfig.json index 384ffa0ee3428..810524a7a8122 100644 --- a/x-pack/plugins/rule_registry/tsconfig.json +++ b/x-pack/plugins/rule_registry/tsconfig.json @@ -19,6 +19,5 @@ { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../security/tsconfig.json" }, - { "path": "../triggers_actions_ui/tsconfig.json" } ] } diff --git a/x-pack/plugins/screenshotting/server/layouts/preserve_layout.css b/x-pack/plugins/screenshotting/server/layouts/preserve_layout.css index 60513c417165f..7b692881d5bde 100644 --- a/x-pack/plugins/screenshotting/server/layouts/preserve_layout.css +++ b/x-pack/plugins/screenshotting/server/layouts/preserve_layout.css @@ -1,12 +1,5 @@ -/* - ****** - ****** This is a collection of CSS overrides that make Kibana look better for - ****** generating PDF reports with headless browser - ****** - */ - /** - * global + * Global utilities */ /* elements can hide themselves when shared */ @@ -14,26 +7,9 @@ display: none !important; } -/* hide unusable controls */ -kbn-top-nav, -filter-bar, -.kbnTopNavMenu__wrapper, -::-webkit-scrollbar, -.euiNavDrawer { - display: none !important; -} - /** - * Discover Tweaks - */ - -/* hide unusable controls */ -discover-app .dscTimechart, -discover-app .dscSidebar__container, -discover-app .dscCollapsibleSidebar__collapseButton, -discover-app .discover-table-footer { - display: none; -} +* Global overrides +*/ /** * The global banner (e.g. "Help us improve Elastic...") should not print. @@ -41,53 +17,3 @@ discover-app .discover-table-footer { #globalBannerList { display: none; } - -/** - * Visualize Editor Tweaks - */ - -/* hide unusable controls -* !important is required to override resizable panel inline display */ -.visEditor__content .visEditor--default > :not(.visEditor__visualization__wrapper) { - display: none !important; -} - -/** THIS IS FOR TSVB UNTIL REFACTOR **/ -.tvbEditorVisualization { - position: static !important; -} -.visualize .tvbVisTimeSeries__legendToggle, -.tvbEditor--hideForReporting { - /* all non-content rows in interface */ - display: none; -} -/** END TSVB BAD BAD HACKS **/ - -/* remove left padding from visualizations so that map lines up with .leaflet-container and -* setting the position to be fixed and to take up the entire screen, because some zoom levels/viewports -* are triggering the media breakpoints that cause the .visEditor__canvas to take up more room than the viewport */ -.visEditor .visEditor__canvas { - padding-left: 0px; - position: fixed; - width: 100%; - height: 100%; - top: 0; - left: 0; -} - -/** - * Visualization tweaks - */ - -/* hide unusable controls */ -.visualize .visLegend__toggle, -.visualize .kbnAggTable__controls/* export raw, export formatted, etc. */ , -.visualize .leaflet-container .leaflet-top.leaflet-left/* tilemap controls */ , -.visualize paginate-controls /* page numbers */ { - display: none; -} - -/* Ensure the min-height of the small breakpoint isn't used */ -.vis-editor visualization { - min-height: 0 !important; -} diff --git a/x-pack/plugins/security_solution/common/ecs/event/index.ts b/x-pack/plugins/security_solution/common/ecs/event/index.ts index f38ebdc29c1fe..56f7d3e84dfa0 100644 --- a/x-pack/plugins/security_solution/common/ecs/event/index.ts +++ b/x-pack/plugins/security_solution/common/ecs/event/index.ts @@ -62,7 +62,6 @@ export enum EventCategory { PROCESS = 'process', FILE = 'file', NETWORK = 'network', - DNS = 'dns', REGISTRY = 'registry', MALWARE = 'malware', } diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts index f15e3f418427a..5789db692eb45 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts @@ -14,10 +14,11 @@ import { ENDPOINT_EVENT_FILTERS_LIST_ID, ENDPOINT_TRUSTED_APPS_LIST_ID, ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID, + ENDPOINT_BLOCKLISTS_LIST_ID, } from '@kbn/securitysolution-list-constants'; import { BaseDataGenerator } from './base_data_generator'; import { ConditionEntryField } from '../types'; -import { BY_POLICY_ARTIFACT_TAG_PREFIX } from '../service/artifacts/constants'; +import { BY_POLICY_ARTIFACT_TAG_PREFIX, GLOBAL_ARTIFACT_TAG } from '../service/artifacts/constants'; /** Utility that removes null and undefined from a Type's property value */ type NonNullableTypeProperties = { @@ -87,6 +88,11 @@ const exceptionItemToUpdateExceptionItem = ( }; }; +const EFFECTIVE_SCOPE: readonly string[] = [ + `${BY_POLICY_ARTIFACT_TAG_PREFIX}123-456`, // Policy Specific + GLOBAL_ARTIFACT_TAG, +]; + export class ExceptionsListItemGenerator extends BaseDataGenerator { generate(overrides: Partial = {}): ExceptionListItemSchema { const exceptionItem: ExceptionListItemSchema = { @@ -110,7 +116,7 @@ export class ExceptionsListItemGenerator extends BaseDataGenerator = {}): ExceptionListItemSchema { + return this.generate({ + name: `Blocklist ${this.randomString(5)}`, + list_id: ENDPOINT_BLOCKLISTS_LIST_ID, + item_id: `generator_endpoint_blocklist_${this.randomUUID()}`, + os_types: ['windows'], + entries: [ + this.randomChoice([ + { + field: 'process.executable.caseless', + value: ['/some/path', 'some/other/path', 'yet/another/path'], + type: 'match_any', + operator: 'included', + }, + { + field: 'process.hash.sha256', + value: [ + 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3', + '2C26B46B68FFC68FF99B453C1D30413413422D706483BFA0F98A5E886266E7AE', + 'FCDE2B2EDBA56BF408601FB721FE9B5C338D10EE429EA04FAE5511B68FBF8FB9', + ], + type: 'match_any', + operator: 'included', + }, + { + field: 'process.Ext.code_signature', + entries: [ + { + field: 'trusted', + value: 'true', + type: 'match', + operator: 'included', + }, + { + field: 'subject_name', + value: ['notsus.exe', 'verynotsus.exe', 'superlegit.exe'], + type: 'match_any', + operator: 'included', + }, + ], + type: 'nested', + }, + ]), + ], + ...overrides, + }); + } + + generateBlocklistForCreate( + overrides: Partial = {} + ): CreateExceptionListItemSchemaWithNonNullProps { + return { + ...exceptionItemToCreateExceptionItem(this.generateBlocklist()), + ...overrides, + }; + } + + generateBlocklistForUpdate( + overrides: Partial = {} + ): UpdateExceptionListItemSchemaWithNonNullProps { + return { + ...exceptionItemToUpdateExceptionItem(this.generateBlocklist()), + ...overrides, + }; + } } diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/constants.ts b/x-pack/plugins/security_solution/common/endpoint/service/artifacts/constants.ts index c62e9e15621be..13054a231a450 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/constants.ts +++ b/x-pack/plugins/security_solution/common/endpoint/service/artifacts/constants.ts @@ -20,3 +20,11 @@ export const ALL_ENDPOINT_ARTIFACT_LIST_IDS: readonly string[] = [ ENDPOINT_EVENT_FILTERS_LIST_ID, ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID, ]; + +export const DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS: Readonly = [ + `name`, + `description`, + `entries.value`, + `entries.entries.value`, + `item_id`, +]; diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts b/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts new file mode 100644 index 0000000000000..75076e191dcdc --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts @@ -0,0 +1,93 @@ +/* + * 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 { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { BY_POLICY_ARTIFACT_TAG_PREFIX, GLOBAL_ARTIFACT_TAG } from './constants'; +import { + createExceptionListItemForCreate, + getPolicyIdsFromArtifact, + isArtifactByPolicy, + isArtifactGlobal, +} from './utils'; + +describe('Endpoint artifact utilities', () => { + let globalEntry: Pick; + let perPolicyWithPolicy: Pick; + let perPolicyNoPolicies: Pick; + + beforeEach(() => { + globalEntry = { + tags: [GLOBAL_ARTIFACT_TAG], + }; + + perPolicyWithPolicy = { + tags: [`${BY_POLICY_ARTIFACT_TAG_PREFIX}123`, `${BY_POLICY_ARTIFACT_TAG_PREFIX}456`], + }; + + perPolicyNoPolicies = { + tags: [], + }; + }); + + describe('when using `isArtifactGlobal()', () => { + it('should return `true` if artifact is global', () => { + expect(isArtifactGlobal(globalEntry)).toBe(true); + }); + + it('should return `false` if artifact is per-policy', () => { + expect(isArtifactGlobal(perPolicyWithPolicy)).toBe(false); + }); + + it('should return `false` if artifact is per-policy but not assigned to any policy', () => { + expect(isArtifactGlobal(perPolicyNoPolicies)).toBe(false); + }); + }); + + describe('when using `isArtifactByPolicy()', () => { + it('should return `true` if artifact is per-policy', () => { + expect(isArtifactByPolicy(perPolicyWithPolicy)).toBe(true); + }); + + it('should return `true` if artifact is per-policy but not assigned to any policy', () => { + expect(isArtifactByPolicy(perPolicyNoPolicies)).toBe(true); + }); + + it('should return `false` if artifact is global', () => { + expect(isArtifactByPolicy(globalEntry)).toBe(false); + }); + }); + + describe('when using `getPolicyIdsFromArtifact()`', () => { + it('should return array of policies', () => { + expect(getPolicyIdsFromArtifact(perPolicyWithPolicy)).toEqual(['123', '456']); + }); + + it('should return empty array if there are none', () => { + expect(getPolicyIdsFromArtifact(perPolicyNoPolicies)).toEqual([]); + }); + }); + + describe('when using `createExceptionListItemForCreate()`', () => { + it('should return an empty exception list ready for create', () => { + expect(createExceptionListItemForCreate('abc')).toEqual({ + comments: [], + description: '', + entries: [], + item_id: undefined, + list_id: 'abc', + meta: { + temporaryUuid: expect.any(String), + }, + name: '', + namespace_type: 'agnostic', + tags: [GLOBAL_ARTIFACT_TAG], + type: 'simple', + os_types: ['windows'], + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.ts b/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.ts index 4cc39e9fb8980..332667064a605 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.ts +++ b/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.ts @@ -5,7 +5,11 @@ * 2.0. */ -import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { + ExceptionListItemSchema, + CreateExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import uuid from 'uuid'; import { BY_POLICY_ARTIFACT_TAG_PREFIX, GLOBAL_ARTIFACT_TAG } from './constants'; const POLICY_ID_START_POSITION = BY_POLICY_ARTIFACT_TAG_PREFIX.length; @@ -30,3 +34,21 @@ export const getPolicyIdsFromArtifact = (item: Pick { + return { + comments: [], + description: '', + entries: [], + item_id: undefined, + list_id: listId, + meta: { + temporaryUuid: uuid.v4(), + }, + name: '', + namespace_type: 'agnostic', + tags: [GLOBAL_ARTIFACT_TAG], + type: 'simple', + os_types: ['windows'], + }; +}; diff --git a/x-pack/plugins/security_solution/cypress/ccs_integration/detection_alerts/alerts_details.spec.ts b/x-pack/plugins/security_solution/cypress/ccs_integration/detection_alerts/alerts_details.spec.ts index 7e07693cb078a..3fb239198a65f 100644 --- a/x-pack/plugins/security_solution/cypress/ccs_integration/detection_alerts/alerts_details.spec.ts +++ b/x-pack/plugins/security_solution/cypress/ccs_integration/detection_alerts/alerts_details.spec.ts @@ -9,7 +9,7 @@ import { JSON_TEXT } from '../../screens/alerts_details'; import { expandFirstAlert, waitForAlertsPanelToBeLoaded } from '../../tasks/alerts'; import { openJsonView } from '../../tasks/alerts_details'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { esArchiverCCSLoad } from '../../tasks/es_archiver'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; @@ -23,7 +23,7 @@ describe('Alert details with unmapped fields', () => { cleanKibana(); esArchiverCCSLoad('unmapped_fields'); loginAndWaitForPageWithoutDateRange(ALERTS_URL); - createCustomRuleActivated(getUnmappedCCSRule()); + createCustomRuleEnabled(getUnmappedCCSRule()); loginAndWaitForPageWithoutDateRange(ALERTS_URL); waitForAlertsPanelToBeLoaded(); expandFirstAlert(); diff --git a/x-pack/plugins/security_solution/cypress/integration/data_sources/create_runtime_field.spec.ts b/x-pack/plugins/security_solution/cypress/integration/data_sources/create_runtime_field.spec.ts index 1b9c63dd2dbcb..152147b1844be 100644 --- a/x-pack/plugins/security_solution/cypress/integration/data_sources/create_runtime_field.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/data_sources/create_runtime_field.spec.ts @@ -13,7 +13,7 @@ import { openTimelineFieldsBrowser, populateTimeline } from '../../tasks/timelin import { HOSTS_URL, ALERTS_URL } from '../../urls/navigation'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { getNewRule } from '../../objects/rule'; import { refreshPage } from '../../tasks/security_header'; @@ -29,7 +29,7 @@ describe('Create DataView runtime field', () => { it.skip('adds field to alert table', () => { const fieldName = 'field.name.alert.page'; loginAndWaitForPage(ALERTS_URL); - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); refreshPage(); waitForAlertsToPopulate(500); openEventsViewerFieldsBrowser(); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/acknowledged.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/acknowledged.spec.ts index 32ce0bebda225..06ff1938d5d4f 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/acknowledged.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/acknowledged.spec.ts @@ -18,7 +18,7 @@ import { markAcknowledgedFirstAlert, goToAcknowledgedAlerts, } from '../../tasks/alerts'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { loginAndWaitForPage } from '../../tasks/login'; @@ -30,7 +30,7 @@ describe.skip('Marking alerts as acknowledged', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPage(ALERTS_URL); - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); refreshPage(); waitForAlertsToPopulate(500); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts index 2d5a676646688..6a8bf9cd42ea9 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/alerts_details.spec.ts @@ -15,7 +15,7 @@ import { import { expandFirstAlert } from '../../tasks/alerts'; import { openJsonView, openTable } from '../../tasks/alerts_details'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { esArchiverLoad } from '../../tasks/es_archiver'; @@ -31,7 +31,7 @@ describe.skip('Alert details with unmapped fields', () => { cleanKibana(); esArchiverLoad('unmapped_fields'); loginAndWaitForPageWithoutDateRange(ALERTS_URL); - createCustomRuleActivated(getUnmappedRule()); + createCustomRuleEnabled(getUnmappedRule()); refreshPage(); waitForAlertsToPopulate(); expandFirstAlert(); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/attach_to_case.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/attach_to_case.spec.ts index 436ef0975ef02..03cac07ac8b72 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/attach_to_case.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/attach_to_case.spec.ts @@ -9,7 +9,7 @@ import { getNewRule } from '../../objects/rule'; import { ROLES } from '../../../common/test'; import { expandFirstAlertActions } from '../../tasks/alerts'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { login, loginAndWaitForPage, waitForPageWithoutDateRange } from '../../tasks/login'; @@ -28,7 +28,7 @@ describe.skip('Alerts timeline', () => { // First we login as a privileged user to create alerts. cleanKibana(); loginAndWaitForPage(ALERTS_URL, ROLES.platform_engineer); - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); refreshPage(); waitForAlertsToPopulate(500); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/building_block_alerts.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/building_block_alerts.spec.ts index 288d16dc22fb6..d9cf959219120 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/building_block_alerts.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/building_block_alerts.spec.ts @@ -9,7 +9,7 @@ import { getBuildingBlockRule } from '../../objects/rule'; import { OVERVIEW_ALERTS_HISTOGRAM } from '../../screens/overview'; import { OVERVIEW } from '../../screens/security_header'; import { goToRuleDetails } from '../../tasks/alerts_detection_rules'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate, waitForTheRuleToBeExecuted } from '../../tasks/create_new_rule'; import { loginAndWaitForPage, loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; @@ -25,7 +25,7 @@ describe.skip('Alerts generated by building block rules', () => { }); it('Alerts should be visible on the Rule Detail page and not visible on the Overview page', () => { - createCustomRuleActivated(getBuildingBlockRule()); + createCustomRuleEnabled(getBuildingBlockRule()); loginAndWaitForPage(DETECTIONS_RULE_MANAGEMENT_URL); goToRuleDetails(); waitForTheRuleToBeExecuted(); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/closing.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/closing.spec.ts index af2772b98a790..a46502687d3ad 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/closing.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/closing.spec.ts @@ -23,7 +23,7 @@ import { selectNumberOfAlerts, waitForAlerts, } from '../../tasks/alerts'; -import { createCustomRuleActivated, deleteCustomRule } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled, deleteCustomRule } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { loginAndWaitForPage } from '../../tasks/login'; @@ -35,7 +35,7 @@ describe.skip('Closing alerts', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPage(ALERTS_URL); - createCustomRuleActivated(getNewRule(), '1', '100m', 100); + createCustomRuleEnabled(getNewRule(), '1', '100m', 100); refreshPage(); waitForAlertsToPopulate(100); deleteCustomRule(); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/investigate_in_timeline.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/investigate_in_timeline.spec.ts index e8873de412f4c..7ea11017dd6e8 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/investigate_in_timeline.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/investigate_in_timeline.spec.ts @@ -9,7 +9,7 @@ import { getNewRule } from '../../objects/rule'; import { PROVIDER_BADGE } from '../../screens/timeline'; import { investigateFirstAlertInTimeline } from '../../tasks/alerts'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { loginAndWaitForPage } from '../../tasks/login'; @@ -21,7 +21,7 @@ describe.skip('Alerts timeline', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPage(ALERTS_URL); - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); refreshPage(); waitForAlertsToPopulate(500); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/opening.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/opening.spec.ts index ece7dbe559672..6ad8c28595c6a 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_alerts/opening.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_alerts/opening.spec.ts @@ -21,7 +21,7 @@ import { selectNumberOfAlerts, waitForAlerts, } from '../../tasks/alerts'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { loginAndWaitForPage } from '../../tasks/login'; @@ -33,7 +33,7 @@ describe.skip('Opening alerts', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPage(ALERTS_URL); - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); refreshPage(); waitForAlertsToPopulate(500); selectNumberOfAlerts(5); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts index b98f626c6356c..73b915dfff648 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts @@ -83,11 +83,11 @@ import { selectNumberOfRules, waitForRulesTableToBeRefreshed, } from '../../tasks/alerts_detection_rules'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { createTimeline } from '../../tasks/api_calls/timelines'; import { cleanKibana, reload } from '../../tasks/common'; import { - createAndActivateRule, + createAndEnableRule, fillAboutRule, fillAboutRuleAndContinue, fillDefineCustomRuleWithImportedQueryAndContinue, @@ -101,7 +101,7 @@ import { } from '../../tasks/create_new_rule'; import { saveEditedRule, waitForKibana } from '../../tasks/edit_rule'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; -import { activatesRule, getDetails } from '../../tasks/rule_details'; +import { enablesRule, getDetails } from '../../tasks/rule_details'; import { RULE_CREATION, DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation'; @@ -125,7 +125,7 @@ describe.skip('Custom detection rules creation', () => { }); }); - it('Creates and activates a new rule', function () { + it('Creates and enables a new rule', function () { loginAndWaitForPageWithoutDateRange(RULE_CREATION); fillDefineCustomRuleWithImportedQueryAndContinue(this.rule); fillAboutRuleAndContinue(this.rule); @@ -143,7 +143,7 @@ describe.skip('Custom detection rules creation', () => { cy.get(ABOUT_CONTINUE_BTN).should('exist').click({ force: true }); cy.get(ABOUT_CONTINUE_BTN).should('not.exist'); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); @@ -209,10 +209,10 @@ describe('Custom detection rules deletion and edition', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - createCustomRuleActivated(getNewRule(), 'rule1'); + createCustomRuleEnabled(getNewRule(), 'rule1'); - createCustomRuleActivated(getNewOverrideRule(), 'rule2'); - createCustomRuleActivated(getExistingRule(), 'rule3'); + createCustomRuleEnabled(getNewOverrideRule(), 'rule2'); + createCustomRuleEnabled(getExistingRule(), 'rule3'); reload(); }); @@ -309,12 +309,12 @@ describe('Custom detection rules deletion and edition', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - createCustomRuleActivated(getExistingRule(), 'rule1'); + createCustomRuleEnabled(getExistingRule(), 'rule1'); reload(); }); it('Only modifies rule active status on enable/disable', () => { - activatesRule(); + enablesRule(); cy.intercept('GET', `/api/detection_engine/rules?id=*`).as('fetchRuleDetails'); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts index 8384c879d8110..0ae68553f50c6 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts @@ -51,7 +51,7 @@ import { import { createTimeline } from '../../tasks/api_calls/timelines'; import { cleanKibana } from '../../tasks/common'; import { - createAndActivateRule, + createAndEnableRule, fillAboutRuleAndContinue, fillDefineEqlRuleAndContinue, fillScheduleRuleAndContinue, @@ -84,13 +84,13 @@ describe.skip('Detection rules, EQL', () => { }); }); - it('Creates and activates a new EQL rule', function () { + it('Creates and enables a new EQL rule', function () { loginAndWaitForPageWithoutDateRange(RULE_CREATION); selectEqlRuleType(); fillDefineEqlRuleAndContinue(this.rule); fillAboutRuleAndContinue(this.rule); fillScheduleRuleAndContinue(this.rule); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); @@ -176,13 +176,13 @@ describe.skip('Detection rules, sequence EQL', () => { }); }); - it('Creates and activates a new EQL rule with a sequence', function () { + it('Creates and enables a new EQL rule with a sequence', function () { loginAndWaitForPageWithoutDateRange(RULE_CREATION); selectEqlRuleType(); fillDefineEqlRuleAndContinue(this.rule); fillAboutRuleAndContinue(this.rule); fillScheduleRuleAndContinue(this.rule); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts index d34d9bd4fc171..9978045835f48 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts @@ -75,7 +75,7 @@ import { createCustomIndicatorRule } from '../../tasks/api_calls/rules'; import { loadPrepackagedTimelineTemplates } from '../../tasks/api_calls/timelines'; import { cleanKibana, reload } from '../../tasks/common'; import { - createAndActivateRule, + createAndEnableRule, fillAboutRuleAndContinue, fillDefineIndicatorMatchRuleAndContinue, fillIndexAndIndicatorIndexPattern, @@ -408,7 +408,7 @@ describe.skip('indicator match', () => { loginAndWaitForPageWithoutDateRange(ALERTS_URL); }); - it('Creates and activates a new Indicator Match rule', () => { + it('Creates and enables a new Indicator Match rule', () => { goToManageAlertsDetectionRules(); waitForRulesTableToBeLoaded(); goToCreateNewRule(); @@ -416,7 +416,7 @@ describe.skip('indicator match', () => { fillDefineIndicatorMatchRuleAndContinue(getNewThreatIndicatorRule()); fillAboutRuleAndContinue(getNewThreatIndicatorRule()); fillScheduleRuleAndContinue(getNewThreatIndicatorRule()); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/links.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/links.spec.ts index 469c77e1c3c17..4e6a5352aee9d 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/links.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/links.spec.ts @@ -7,7 +7,7 @@ import { getNewRule } from '../../objects/rule'; import { RULES_MONITORING_TABLE, RULE_NAME } from '../../screens/alerts_detection_rules'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana, reload } from '../../tasks/common'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; import { DETECTIONS_RULE_MANAGEMENT_URL } from '../../urls/navigation'; @@ -16,7 +16,7 @@ describe('Rules talbes links', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - createCustomRuleActivated(getNewRule(), 'rule1'); + createCustomRuleEnabled(getNewRule(), 'rule1'); reload(); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/machine_learning_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/machine_learning_rule.spec.ts index bf8d753a8161c..d47ff6f98cd19 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/machine_learning_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/machine_learning_rule.spec.ts @@ -47,7 +47,7 @@ import { } from '../../tasks/alerts_detection_rules'; import { cleanKibana } from '../../tasks/common'; import { - createAndActivateRule, + createAndEnableRule, fillAboutRuleAndContinue, fillDefineMachineLearningRuleAndContinue, fillScheduleRuleAndContinue, @@ -68,13 +68,13 @@ describe.skip('Detection rules, machine learning', () => { cleanKibana(); }); - it('Creates and activates a new ml rule', () => { + it('Creates and enables a new ml rule', () => { loginAndWaitForPageWithoutDateRange(RULE_CREATION); selectMachineLearningRuleType(); fillDefineMachineLearningRuleAndContinue(getMachineLearningRule()); fillAboutRuleAndContinue(getMachineLearningRule()); fillScheduleRuleAndContinue(getMachineLearningRule()); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts index 694036d8a1678..2dcfae29b615b 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts @@ -61,7 +61,7 @@ import { import { createTimeline } from '../../tasks/api_calls/timelines'; import { cleanKibana } from '../../tasks/common'; import { - createAndActivateRule, + createAndEnableRule, fillAboutRuleWithOverrideAndContinue, fillDefineCustomRuleWithImportedQueryAndContinue, fillScheduleRuleAndContinue, @@ -92,12 +92,12 @@ describe.skip('Detection rules, override', () => { }); }); - it('Creates and activates a new custom rule with override option', function () { + it('Creates and enables a new custom rule with override option', function () { loginAndWaitForPageWithoutDateRange(RULE_CREATION); fillDefineCustomRuleWithImportedQueryAndContinue(this.rule); fillAboutRuleWithOverrideAndContinue(this.rule); fillScheduleRuleAndContinue(this.rule); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/prebuilt_rules.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/prebuilt_rules.spec.ts index 3081d7c966eb6..ea83b66ffb95d 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/prebuilt_rules.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/prebuilt_rules.spec.ts @@ -27,9 +27,9 @@ import { waitForPrebuiltDetectionRulesToBeLoaded, selectAllRules, confirmRulesDelete, - activateSelectedRules, + enableSelectedRules, waitForRuleToChangeStatus, - deactivateSelectedRules, + disableSelectedRules, changeRowsPerPageTo, } from '../../tasks/alerts_detection_rules'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; @@ -77,14 +77,14 @@ describe('Actions with prebuilt rules', () => { }); context('Rules table', () => { - it('Allows to activate/deactivate all rules at once', () => { + it('Allows to enable/disable all rules at once', () => { selectAllRules(); - activateSelectedRules(); + enableSelectedRules(); waitForRuleToChangeStatus(); cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); selectAllRules(); - deactivateSelectedRules(); + disableSelectedRules(); waitForRuleToChangeStatus(); cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'false'); }); @@ -174,16 +174,16 @@ describe('Actions with prebuilt rules', () => { }); context('Rule monitoring table', () => { - it('Allows to activate/deactivate all rules at once', () => { + it('Allows to enable/disable all rules at once', () => { cy.get(RULES_MONITORING_TABLE).click(); cy.get(SELECT_ALL_RULES_ON_PAGE_CHECKBOX).click(); - activateSelectedRules(); + enableSelectedRules(); waitForRuleToChangeStatus(); cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true'); selectAllRules(); - deactivateSelectedRules(); + disableSelectedRules(); waitForRuleToChangeStatus(); cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'false'); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts index 921128ce3303d..80fbfc6a7bf13 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts @@ -59,11 +59,11 @@ import { goToRuleDetails, waitForRulesTableToBeLoaded, } from '../../tasks/alerts_detection_rules'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { createTimeline } from '../../tasks/api_calls/timelines'; import { cleanKibana } from '../../tasks/common'; import { - createAndActivateRule, + createAndEnableRule, fillAboutRuleAndContinue, fillDefineThresholdRuleAndContinue, fillDefineThresholdRule, @@ -93,12 +93,12 @@ describe.skip('Detection rules, threshold', () => { loginAndWaitForPageWithoutDateRange(RULE_CREATION); }); - it('Creates and activates a new threshold rule', () => { + it('Creates and enables a new threshold rule', () => { selectThresholdRuleType(); fillDefineThresholdRuleAndContinue(rule); fillAboutRuleAndContinue(rule); fillScheduleRuleAndContinue(rule); - createAndActivateRule(); + createAndEnableRule(); cy.get(CUSTOM_RULES_BTN).should('have.text', 'Custom rules (1)'); @@ -168,7 +168,7 @@ describe.skip('Detection rules, threshold', () => { it.skip('Preview results of keyword using "host.name"', () => { rule.index = [...rule.index, '.siem-signals*']; - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); goToManageAlertsDetectionRules(); waitForRulesTableToBeLoaded(); goToCreateNewRule(); @@ -187,7 +187,7 @@ describe.skip('Detection rules, threshold', () => { }; previewRule.index = [...previewRule.index, '.siem-signals*']; - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); goToManageAlertsDetectionRules(); waitForRulesTableToBeLoaded(); goToCreateNewRule(); diff --git a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts index 9887eb1e8612b..189b95754e839 100644 --- a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts @@ -18,7 +18,7 @@ import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; import { - activatesRule, + enablesRule, addsException, goToAlertsTab, goToExceptionsTab, @@ -35,14 +35,14 @@ describe.skip('From alert', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing', '10s'); + createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing'); reload(); goToRuleDetails(); cy.get(RULE_STATUS).should('have.text', '—'); esArchiverLoad('auditbeat_for_exceptions'); - activatesRule(); + enablesRule(); waitForTheRuleToBeExecuted(); waitForAlertsToPopulate(); diff --git a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts index d9661324aee6d..cc4d6ec0b2e50 100644 --- a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts @@ -18,7 +18,7 @@ import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; import { - activatesRule, + enablesRule, addsExceptionFromRuleSettings, goToAlertsTab, goToExceptionsTab, @@ -35,14 +35,14 @@ describe.skip('From rule', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL); - createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing', '10s'); + createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing'); reload(); goToRuleDetails(); cy.get(RULE_STATUS).should('have.text', '—'); esArchiverLoad('auditbeat_for_exceptions'); - activatesRule(); + enablesRule(); waitForTheRuleToBeExecuted(); waitForAlertsToPopulate(); refreshPage(); diff --git a/x-pack/plugins/security_solution/cypress/integration/users/user_details.spec.ts b/x-pack/plugins/security_solution/cypress/integration/users/user_details.spec.ts index a30b651bfba39..9e3446a7d071f 100644 --- a/x-pack/plugins/security_solution/cypress/integration/users/user_details.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/users/user_details.spec.ts @@ -6,7 +6,7 @@ */ import { ALERT_FLYOUT } from '../../screens/alerts_details'; -import { createCustomRuleActivated } from '../../tasks/api_calls/rules'; +import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; import { cleanKibana } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; @@ -24,7 +24,7 @@ describe.skip('user details flyout', () => { beforeEach(() => { cleanKibana(); loginAndWaitForPageWithoutDateRange(ALERTS_URL); - createCustomRuleActivated(getNewRule()); + createCustomRuleEnabled(getNewRule()); refreshPage(); waitForAlertsToPopulate(); }); diff --git a/x-pack/plugins/security_solution/cypress/objects/rule.ts b/x-pack/plugins/security_solution/cypress/objects/rule.ts index 6a1c13b51509f..2f81c160f2801 100644 --- a/x-pack/plugins/security_solution/cypress/objects/rule.ts +++ b/x-pack/plugins/security_solution/cypress/objects/rule.ts @@ -163,6 +163,8 @@ const getSeverityOverride4 = (): SeverityOverride => ({ sourceValue: 'auditbeat', }); +// Default interval is 1m, our tests config overwrite this to 1s +// See https://github.com/elastic/kibana/pull/125396 for details const getRunsEvery = (): Interval => ({ interval: '1', timeType: 'Seconds', diff --git a/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts b/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts index fa8271a158984..f72f613d99e8c 100644 --- a/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts +++ b/x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts @@ -23,9 +23,9 @@ export const DUPLICATE_RULE_ACTION_BTN = '[data-test-subj="duplicateRuleAction"] export const DUPLICATE_RULE_MENU_PANEL_BTN = '[data-test-subj="rules-details-duplicate-rule"]'; -export const ACTIVATE_RULE_BULK_BTN = '[data-test-subj="activateRuleBulk"]'; +export const ENABLE_RULE_BULK_BTN = '[data-test-subj="enableRuleBulk"]'; -export const DEACTIVATE_RULE_BULK_BTN = '[data-test-subj="deactivateRuleBulk"]'; +export const DISABLE_RULE_BULK_BTN = '[data-test-subj="disableRuleBulk"]'; export const DELETE_RULE_BULK_BTN = '[data-test-subj="deleteRuleBulk"]'; diff --git a/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts index a3e5e8af3f598..bb87a0fe12620 100644 --- a/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts +++ b/x-pack/plugins/security_solution/cypress/screens/create_new_rule.ts @@ -58,7 +58,7 @@ export const COMBO_BOX_CLEAR_BTN = '[data-test-subj="comboBoxClearButton"]'; export const COMBO_BOX_INPUT = '[data-test-subj="comboBoxInput"]'; -export const CREATE_AND_ACTIVATE_BTN = '[data-test-subj="create-activate"]'; +export const CREATE_AND_ENABLE_BTN = '[data-test-subj="create-enable"]'; export const CUSTOM_QUERY_INPUT = '[data-test-subj="queryInput"]'; diff --git a/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts b/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts index e2b187a6b51de..8475ef7247c2c 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts @@ -36,8 +36,8 @@ import { SELECT_ALL_RULES_BTN, MODAL_CONFIRMATION_BTN, RULES_DELETE_CONFIRMATION_MODAL, - ACTIVATE_RULE_BULK_BTN, - DEACTIVATE_RULE_BULK_BTN, + ENABLE_RULE_BULK_BTN, + DISABLE_RULE_BULK_BTN, RULE_DETAILS_DELETE_BTN, RULE_IMPORT_MODAL_BUTTON, RULE_IMPORT_MODAL, @@ -87,7 +87,7 @@ export const duplicateRuleFromMenu = () => { /** * Check that the duplicated rule is on the table - * and it is deactivated (default) + * and it is disabled (default) */ export const checkDuplicatedRule = () => { cy.contains(RULE_NAME, duplicatedRuleName) @@ -126,14 +126,14 @@ export const duplicateSelectedRules = () => { cy.get(DUPLICATE_RULE_BULK_BTN).click(); }; -export const activateSelectedRules = () => { +export const enableSelectedRules = () => { cy.get(BULK_ACTIONS_BTN).click({ force: true }); - cy.get(ACTIVATE_RULE_BULK_BTN).click(); + cy.get(ENABLE_RULE_BULK_BTN).click(); }; -export const deactivateSelectedRules = () => { +export const disableSelectedRules = () => { cy.get(BULK_ACTIONS_BTN).click({ force: true }); - cy.get(DEACTIVATE_RULE_BULK_BTN).click(); + cy.get(DISABLE_RULE_BULK_BTN).click(); }; export const exportFirstRule = () => { diff --git a/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts b/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts index 0e6f4e6851a1b..13ba3af59be9a 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/api_calls/rules.ts @@ -58,6 +58,8 @@ export const createCustomIndicatorRule = (rule: ThreatIndicatorRule, ruleId = 'r rule_id: ruleId, risk_score: parseInt(rule.riskScore, 10), description: rule.description, + // Default interval is 1m, our tests config overwrite this to 1s + // See https://github.com/elastic/kibana/pull/125396 for details interval: '10s', name: rule.name, severity: rule.severity.toLocaleLowerCase(), @@ -90,7 +92,7 @@ export const createCustomIndicatorRule = (rule: ThreatIndicatorRule, ruleId = 'r failOnStatusCode: false, }); -export const createCustomRuleActivated = ( +export const createCustomRuleEnabled = ( rule: CustomRule, ruleId = '1', interval = '100m', diff --git a/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts index 068839ad576dc..4ea8f4ce0ff91 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts @@ -27,7 +27,7 @@ import { BACK_TO_ALL_RULES_LINK, COMBO_BOX_CLEAR_BTN, COMBO_BOX_INPUT, - CREATE_AND_ACTIVATE_BTN, + CREATE_AND_ENABLE_BTN, CUSTOM_QUERY_INPUT, CUSTOM_QUERY_REQUIRED, DEFAULT_RISK_SCORE_INPUT, @@ -98,10 +98,10 @@ import { SERVER_SIDE_EVENT_COUNT } from '../screens/timeline'; import { TIMELINE } from '../screens/timelines'; import { refreshPage } from './security_header'; -export const createAndActivateRule = () => { +export const createAndEnableRule = () => { cy.get(SCHEDULE_CONTINUE_BUTTON).click({ force: true }); - cy.get(CREATE_AND_ACTIVATE_BTN).click({ force: true }); - cy.get(CREATE_AND_ACTIVATE_BTN).should('not.exist'); + cy.get(CREATE_AND_ENABLE_BTN).click({ force: true }); + cy.get(CREATE_AND_ENABLE_BTN).should('not.exist'); cy.get(BACK_TO_ALL_RULES_LINK).click({ force: true }); cy.get(BACK_TO_ALL_RULES_LINK).should('not.exist'); }; diff --git a/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts b/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts index 5094d469907bf..e69c217c4a764 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/rule_details.ts @@ -31,7 +31,7 @@ import { } from '../screens/rule_details'; import { addsFields, closeFieldsBrowser, filterFieldsBrowser } from './fields_browser'; -export const activatesRule = () => { +export const enablesRule = () => { cy.intercept('PATCH', '/api/detection_engine/rules/_bulk_update').as('bulk_update'); cy.get(RULE_SWITCH).should('be.visible'); cy.get(RULE_SWITCH).click(); diff --git a/x-pack/plugins/security_solution/cypress/tasks/sourcerer.ts b/x-pack/plugins/security_solution/cypress/tasks/sourcerer.ts index 7309b374810eb..95a2d01cd2f5a 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/sourcerer.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/sourcerer.ts @@ -11,7 +11,7 @@ import { HOSTS_URL } from '../urls/navigation'; import { waitForPage } from './login'; import { openTimelineUsingToggle } from './security_main'; import { DEFAULT_ALERTS_INDEX } from '../../common/constants'; -import { createCustomRuleActivated } from './api_calls/rules'; +import { createCustomRuleEnabled } from './api_calls/rules'; import { getNewRule } from '../objects/rule'; export const openSourcerer = (sourcererScope?: string) => { @@ -176,6 +176,6 @@ export const refreshUntilAlertsIndexExists = async () => { }; export const waitForAlertsIndexToExist = () => { - createCustomRuleActivated(getNewRule(), '1', '100m', 100); + createCustomRuleEnabled(getNewRule(), '1', '100m', 100); refreshUntilAlertsIndexExists(); }; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx index 4bb4c4809764a..53c0d143600fb 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx @@ -129,7 +129,7 @@ describe('AlertSummaryView', () => { }); }); - test('DNS event renders the correct summary rows', () => { + test('DNS network event renders the correct summary rows', () => { const renderProps = { ...props, data: [ @@ -137,8 +137,8 @@ describe('AlertSummaryView', () => { if (item.category === 'event' && item.field === 'event.category') { return { ...item, - values: ['dns'], - originalValue: ['dns'], + values: ['network'], + originalValue: ['network'], }; } return item; @@ -324,6 +324,39 @@ describe('AlertSummaryView', () => { }); }); + test('[legacy] Machine learning events show correct fields', () => { + const enhancedData = [ + ...mockAlertDetailsData.map((item) => { + if (item.category === 'kibana' && item.field === 'kibana.alert.rule.type') { + return { + ...item, + values: ['machine_learning'], + originalValue: ['machine_learning'], + }; + } + return item; + }), + { + category: 'signal', + field: 'signal.rule.machine_learning_job_id', + values: ['i_am_the_ml_job_id'], + }, + { category: 'signal', field: 'signal.rule.anomaly_threshold', values: [2] }, + ] as TimelineEventsDetailsItem[]; + const renderProps = { + ...props, + data: enhancedData, + }; + const { getByText } = render( + + + + ); + ['i_am_the_ml_job_id', 'signal.rule.anomaly_threshold'].forEach((fieldId) => { + expect(getByText(fieldId)); + }); + }); + test('Threat match events show correct fields', () => { const enhancedData = [ ...mockAlertDetailsData.map((item) => { @@ -338,10 +371,51 @@ describe('AlertSummaryView', () => { }), { category: 'kibana', - field: 'kibana.alert.rule.threat_index', + field: 'kibana.alert.rule.parameters.threat_index', + values: ['threat_index*'], + }, + { + category: 'kibana', + field: 'kibana.alert.rule.parameters.threat_query', + values: ['*query*'], + }, + ] as TimelineEventsDetailsItem[]; + const renderProps = { + ...props, + data: enhancedData, + }; + const { getByText } = render( + + + + ); + ['threat_index*', '*query*'].forEach((fieldId) => { + expect(getByText(fieldId)); + }); + }); + + test('[legacy] Threat match events show correct fields', () => { + const enhancedData = [ + ...mockAlertDetailsData.map((item) => { + if (item.category === 'kibana' && item.field === 'kibana.alert.rule.type') { + return { + ...item, + values: ['threat_match'], + originalValue: ['threat_match'], + }; + } + return item; + }), + { + category: 'signal', + field: 'signal.rule.threat_index', values: ['threat_index*'], }, - { category: 'kibana', field: 'kibana.alert.rule.threat_query', values: ['*query*'] }, + { + category: 'signal', + field: 'signal.rule.threat_query', + values: ['*query*'], + }, ] as TimelineEventsDetailsItem[]; const renderProps = { ...props, diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx index 9f0dfb53a5c4b..8550cd8435124 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx @@ -6,7 +6,7 @@ */ import { find, isEmpty, uniqBy } from 'lodash/fp'; -import { ALERT_RULE_NAMESPACE, ALERT_RULE_PARAMETERS, ALERT_RULE_TYPE } from '@kbn/rule-data-utils'; +import { ALERT_RULE_PARAMETERS, ALERT_RULE_TYPE } from '@kbn/rule-data-utils'; import * as i18n from './translations'; import { BrowserFields } from '../../../../common/search_strategy/index_fields'; @@ -62,10 +62,9 @@ function getFieldsByCategory({ { id: 'destination.port' }, { id: 'source.address' }, { id: 'source.port' }, + { id: 'dns.question.name' }, { id: 'process.name' }, ]; - case EventCategory.DNS: - return [{ id: 'dns.question.name' }, { id: 'process.name' }]; case EventCategory.REGISTRY: return [{ id: 'registry.key' }, { id: 'registry.value' }, { id: 'process.name' }]; case EventCategory.MALWARE: @@ -146,18 +145,22 @@ function getFieldsByRuleType(ruleType?: string): EventSummaryField[] { return [ { id: `${ALERT_RULE_PARAMETERS}.machine_learning_job_id`, + legacyId: 'signal.rule.machine_learning_job_id', }, { id: `${ALERT_RULE_PARAMETERS}.anomaly_threshold`, + legacyId: 'signal.rule.anomaly_threshold', }, ]; case 'threat_match': return [ { - id: `${ALERT_RULE_NAMESPACE}.threat_index`, + id: `${ALERT_RULE_PARAMETERS}.threat_index`, + legacyId: 'signal.rule.threat_index', }, { - id: `${ALERT_RULE_NAMESPACE}.threat_query`, + id: `${ALERT_RULE_PARAMETERS}.threat_query`, + legacyId: 'signal.rule.threat_query', }, ]; default: @@ -251,11 +254,18 @@ export const getSummaryRows = ({ return data != null ? tableFields.reduce((acc, field) => { - const item = data.find((d) => d.field === field.id); - if (!item || isEmpty(item?.values)) { + const item = data.find( + (d) => d.field === field.id || (field.legacyId && d.field === field.legacyId) + ); + if (!item || isEmpty(item.values)) { return acc; } + // If we found the data by its legacy id we swap the ids to display the correct one + if (item.field === field.legacyId) { + field.id = field.legacyId; + } + const linkValueField = field.linkField != null && data.find((d) => d.field === field.linkField); const description = { diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/types.ts b/x-pack/plugins/security_solution/public/common/components/event_details/types.ts index 0e2eef882594a..9b64ddd4db5d0 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/types.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/types.ts @@ -30,6 +30,7 @@ export type EnrichedFieldInfoWithValues = EnrichedFieldInfo & { values: string[] export interface EventSummaryField { id: string; + legacyId?: string; label?: string; linkField?: string; fieldType?: string; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts b/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts index 05a75a69909bd..f1cab9c2f441d 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts @@ -6,7 +6,7 @@ */ import { useState, useEffect, useMemo } from 'react'; - +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { DEFAULT_ANOMALY_SCORE } from '../../../../../common/constants'; import { anomaliesTableData } from '../api/anomalies_table_data'; import { InfluencerInput, Anomalies, CriteriaFields } from '../types'; @@ -23,6 +23,7 @@ interface Args { threshold?: number; skip?: boolean; criteriaFields?: CriteriaFields[]; + filterQuery?: estypes.QueryDslQueryContainer; } type Return = [boolean, Anomalies | null]; @@ -55,6 +56,7 @@ export const useAnomaliesTableData = ({ endDate, threshold = -1, skip = false, + filterQuery, }: Args): Return => { const [tableData, setTableData] = useState(null); const { isMlUser, jobs } = useInstalledSecurityJobs(); @@ -84,6 +86,7 @@ export const useAnomaliesTableData = ({ { jobIds, criteriaFields: criteriaFieldsInput, + influencersFilterQuery: filterQuery, aggregationInterval: 'auto', threshold: getThreshold(anomalyScore, threshold), earliestMs, diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts b/x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts index 2c83cb2e2d5b9..01ed306d08318 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { Anomalies, InfluencerInput, CriteriaFields } from '../types'; import { KibanaServices } from '../../../lib/kibana'; @@ -19,6 +20,7 @@ export interface Body { dateFormatTz: string; maxRecords: number; maxExamples: number; + influencersFilterQuery?: estypes.QueryDslQueryContainer; } export const anomaliesTableData = async (body: Body, signal: AbortSignal): Promise => { diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts new file mode 100644 index 0000000000000..89a38bf34f9b8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts @@ -0,0 +1,26 @@ +/* + * 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 { UsersType } from '../../../../users/store/model'; +import { getCriteriaFromUsersType } from './get_criteria_from_users_type'; + +describe('get_criteria_from_user_type', () => { + test('returns user name from criteria if the user type is details', () => { + const criteria = getCriteriaFromUsersType(UsersType.details, 'admin'); + expect(criteria).toEqual([{ fieldName: 'user.name', fieldValue: 'admin' }]); + }); + + test('returns empty array from criteria if the user type is page but rather an empty array', () => { + const criteria = getCriteriaFromUsersType(UsersType.page, 'admin'); + expect(criteria).toEqual([]); + }); + + test('returns empty array from criteria if the user name is undefined and user type is details', () => { + const criteria = getCriteriaFromUsersType(UsersType.details, undefined); + expect(criteria).toEqual([]); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts b/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts new file mode 100644 index 0000000000000..4f3fa93c8fe2f --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts @@ -0,0 +1,20 @@ +/* + * 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 { UsersType } from '../../../../users/store/model'; +import { CriteriaFields } from '../types'; + +export const getCriteriaFromUsersType = ( + type: UsersType, + userName: string | undefined +): CriteriaFields[] => { + if (type === UsersType.details && userName != null) { + return [{ fieldName: 'user.name', fieldValue: userName }]; + } else { + return []; + } +}; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts index 31edb613d5b25..db15d725b31b5 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts @@ -5,42 +5,31 @@ * 2.0. */ -import { cloneDeep } from 'lodash/fp'; import { getHostNameFromInfluencers } from './get_host_name_from_influencers'; import { mockAnomalies } from '../mock'; describe('get_host_name_from_influencers', () => { - let anomalies = cloneDeep(mockAnomalies); - - beforeEach(() => { - anomalies = cloneDeep(mockAnomalies); - }); - test('returns host names from influencers from the mock', () => { - const hostName = getHostNameFromInfluencers(anomalies.anomalies[0].influencers); - expect(hostName).toEqual('zeek-iowa'); + expect(getHostNameFromInfluencers(mockAnomalies.anomalies[0].influencers)).toEqual('zeek-iowa'); }); test('returns null if there are no influencers from the mock', () => { - anomalies.anomalies[0].influencers = []; - const hostName = getHostNameFromInfluencers(anomalies.anomalies[0].influencers); - expect(hostName).toEqual(null); + expect(getHostNameFromInfluencers([])).toEqual(null); }); test('returns null if it is given undefined influencers', () => { - const hostName = getHostNameFromInfluencers(); - expect(hostName).toEqual(null); + expect(getHostNameFromInfluencers()).toEqual(null); }); test('returns null if there influencers is an empty object', () => { - anomalies.anomalies[0].influencers = [{}]; - const hostName = getHostNameFromInfluencers(anomalies.anomalies[0].influencers); - expect(hostName).toEqual(null); + expect(getHostNameFromInfluencers([{}])).toEqual(null); }); test('returns host name mixed with other data', () => { - anomalies.anomalies[0].influencers = [{ 'host.name': 'name-1' }, { 'source.ip': '127.0.0.1' }]; - const hostName = getHostNameFromInfluencers(anomalies.anomalies[0].influencers); + const hostName = getHostNameFromInfluencers([ + { 'host.name': 'name-1' }, + { 'source.ip': '127.0.0.1' }, + ]); expect(hostName).toEqual('name-1'); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts index 16a7af42ad961..9160377b27e63 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts @@ -5,38 +5,27 @@ * 2.0. */ -import { cloneDeep } from 'lodash/fp'; import { getNetworkFromInfluencers } from './get_network_from_influencers'; -import { mockAnomalies } from '../mock'; import { DestinationOrSource } from '../types'; describe('get_network_from_influencers', () => { - let anomalies = cloneDeep(mockAnomalies); - - beforeEach(() => { - anomalies = cloneDeep(mockAnomalies); - }); - - test('returns null if there are no influencers from the mock', () => { - anomalies.anomalies[0].influencers = []; - const network = getNetworkFromInfluencers(anomalies.anomalies[0].influencers); - expect(network).toEqual(null); + test('returns null if there are no influencers', () => { + expect(getNetworkFromInfluencers([])).toEqual(null); }); test('returns null if the influencers is an empty object', () => { - anomalies.anomalies[0].influencers = [{}]; - const network = getNetworkFromInfluencers(anomalies.anomalies[0].influencers); - expect(network).toEqual(null); + expect(getNetworkFromInfluencers([{}])).toEqual(null); }); test('returns null if the influencers are undefined', () => { - const network = getNetworkFromInfluencers(); - expect(network).toEqual(null); + expect(getNetworkFromInfluencers()).toEqual(null); }); test('returns network name of source mixed with other data', () => { - anomalies.anomalies[0].influencers = [{ 'host.name': 'name-1' }, { 'source.ip': '127.0.0.1' }]; - const network = getNetworkFromInfluencers(anomalies.anomalies[0].influencers); + const network = getNetworkFromInfluencers([ + { 'host.name': 'name-1' }, + { 'source.ip': '127.0.0.1' }, + ]); const expected: { ip: string; type: DestinationOrSource } = { ip: '127.0.0.1', type: 'source.ip', @@ -45,11 +34,10 @@ describe('get_network_from_influencers', () => { }); test('returns network name mixed with other data', () => { - anomalies.anomalies[0].influencers = [ + const network = getNetworkFromInfluencers([ { 'host.name': 'name-1' }, { 'destination.ip': '127.0.0.1' }, - ]; - const network = getNetworkFromInfluencers(anomalies.anomalies[0].influencers); + ]); const expected: { ip: string; type: DestinationOrSource } = { ip: '127.0.0.1', type: 'destination.ip', diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts new file mode 100644 index 0000000000000..8e5042c8fd855 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts @@ -0,0 +1,35 @@ +/* + * 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 { getUserNameFromInfluencers } from './get_user_name_from_influencers'; +import { mockAnomalies } from '../mock'; + +describe('get_user_name_from_influencers', () => { + test('returns user names from influencers from the mock', () => { + expect(getUserNameFromInfluencers(mockAnomalies.anomalies[0].influencers)).toEqual('root'); + }); + + test('returns null if there are no influencers from the mock', () => { + expect(getUserNameFromInfluencers([])).toEqual(null); + }); + + test('returns null if it is given undefined influencers', () => { + expect(getUserNameFromInfluencers()).toEqual(null); + }); + + test('returns null if there influencers is an empty object', () => { + expect(getUserNameFromInfluencers([{}])).toEqual(null); + }); + + test('returns user name mixed with other data', () => { + const userName = getUserNameFromInfluencers([ + { 'user.name': 'root' }, + { 'source.ip': '127.0.0.1' }, + ]); + expect(userName).toEqual('root'); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts new file mode 100644 index 0000000000000..da27c10aeaf85 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts @@ -0,0 +1,31 @@ +/* + * 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 { getEntries } from '../get_entries'; + +export const getUserNameFromInfluencers = ( + influencers: Array> = [], + userName?: string +): string | null => { + const recordFound = influencers.find((influencer) => { + const [influencerName, influencerValue] = getEntries(influencer); + if (influencerName === 'user.name') { + if (userName == null) { + return true; + } else { + return influencerValue === userName; + } + } else { + return false; + } + }); + if (recordFound != null) { + return Object.values(recordFound)[0]; + } else { + return null; + } +}; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx index b4db5f6798860..e8575e19575c1 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx @@ -15,13 +15,12 @@ import * as i18n from './translations'; import { getAnomaliesHostTableColumnsCurated } from './get_anomalies_host_table_columns'; import { convertAnomaliesToHosts } from './convert_anomalies_to_hosts'; import { Loader } from '../../loader'; -import { getIntervalFromAnomalies } from '../anomaly/get_interval_from_anomalies'; import { AnomaliesHostTableProps } from '../types'; import { useMlCapabilities } from '../hooks/use_ml_capabilities'; import { BasicTable } from './basic_table'; -import { hostEquality } from './host_equality'; import { getCriteriaFromHostType } from '../criteria/get_criteria_from_host_type'; import { Panel } from '../../panel'; +import { anomaliesTableDefaultEquality } from './default_equality'; const sorting = { sort: { @@ -33,7 +32,6 @@ const sorting = { const AnomaliesHostTableComponent: React.FC = ({ startDate, endDate, - narrowDateRange, hostName, skip, type, @@ -44,18 +42,14 @@ const AnomaliesHostTableComponent: React.FC = ({ endDate, skip, criteriaFields: getCriteriaFromHostType(type, hostName), + filterQuery: { + exists: { field: 'host.name' }, + }, }); const hosts = convertAnomaliesToHosts(tableData, hostName); - const interval = getIntervalFromAnomalies(tableData); - const columns = getAnomaliesHostTableColumnsCurated( - type, - startDate, - endDate, - interval, - narrowDateRange - ); + const columns = getAnomaliesHostTableColumnsCurated(type, startDate, endDate); const pagination = { initialPageIndex: 0, initialPageSize: 10, @@ -94,4 +88,7 @@ const AnomaliesHostTableComponent: React.FC = ({ } }; -export const AnomaliesHostTable = React.memo(AnomaliesHostTableComponent, hostEquality); +export const AnomaliesHostTable = React.memo( + AnomaliesHostTableComponent, + anomaliesTableDefaultEquality +); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx new file mode 100644 index 0000000000000..f3ee7bb89e4c8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx @@ -0,0 +1,97 @@ +/* + * 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 React from 'react'; + +import { useAnomaliesTableData } from '../anomaly/use_anomalies_table_data'; +import { HeaderSection } from '../../header_section'; + +import { hasMlUserPermissions } from '../../../../../common/machine_learning/has_ml_user_permissions'; +import * as i18n from './translations'; + +import { Loader } from '../../loader'; +import { AnomaliesUserTableProps } from '../types'; +import { useMlCapabilities } from '../hooks/use_ml_capabilities'; +import { BasicTable } from './basic_table'; + +import { getCriteriaFromUsersType } from '../criteria/get_criteria_from_users_type'; +import { Panel } from '../../panel'; +import { anomaliesTableDefaultEquality } from './default_equality'; +import { convertAnomaliesToUsers } from './convert_anomalies_to_users'; +import { getAnomaliesUserTableColumnsCurated } from './get_anomalies_user_table_columns'; + +const sorting = { + sort: { + field: 'anomaly.severity', + direction: 'desc', + }, +} as const; + +const AnomaliesUserTableComponent: React.FC = ({ + startDate, + endDate, + userName, + skip, + type, +}) => { + const capabilities = useMlCapabilities(); + + const [loading, tableData] = useAnomaliesTableData({ + startDate, + endDate, + skip, + criteriaFields: getCriteriaFromUsersType(type, userName), + filterQuery: { + exists: { field: 'user.name' }, + }, + }); + + const users = convertAnomaliesToUsers(tableData, userName); + + const columns = getAnomaliesUserTableColumnsCurated(type, startDate, endDate); + const pagination = { + initialPageIndex: 0, + initialPageSize: 10, + totalItemCount: users.length, + pageSizeOptions: [5, 10, 20, 50], + hidePerPageOptions: false, + }; + + if (!hasMlUserPermissions(capabilities)) { + return null; + } else { + return ( + + + + type is not as specific as EUI's... + columns={columns} + items={users} + pagination={pagination} + sorting={sorting} + /> + + {loading && ( + + )} + + ); + } +}; + +export const AnomaliesUserTable = React.memo( + AnomaliesUserTableComponent, + anomaliesTableDefaultEquality +); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts new file mode 100644 index 0000000000000..b3c3aa64c9214 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts @@ -0,0 +1,167 @@ +/* + * 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 { mockAnomalies } from '../mock'; +import { convertAnomaliesToUsers, getUserNameFromEntity } from './convert_anomalies_to_users'; +import { AnomaliesByUser } from '../types'; + +describe('convert_anomalies_to_users', () => { + test('it returns expected anomalies from a user', () => { + const entities = convertAnomaliesToUsers(mockAnomalies); + + const expected: AnomaliesByUser[] = [ + { + anomaly: mockAnomalies.anomalies[0], + userName: 'root', + }, + { + anomaly: mockAnomalies.anomalies[1], + userName: 'root', + }, + ]; + expect(entities).toEqual(expected); + }); + + test('it returns empty anomalies if sent in a null', () => { + const entities = convertAnomaliesToUsers(null); + const expected: AnomaliesByUser[] = []; + expect(entities).toEqual(expected); + }); + + test('it returns a specific anomaly if sent in the user name of an anomaly', () => { + const anomalies = { + ...mockAnomalies, + anomalies: [ + { + ...mockAnomalies.anomalies[0], + entityName: 'something-else', + entityValue: 'something-else', + influencers: [ + { 'host.name': 'zeek-iowa' }, + { 'process.name': 'du' }, + { 'user.name': 'something-else' }, + ], + }, + mockAnomalies.anomalies[1], + ], + }; + + const entities = convertAnomaliesToUsers(anomalies, 'root'); + const expected: AnomaliesByUser[] = [ + { + anomaly: anomalies.anomalies[1], + userName: 'root', + }, + ]; + expect(entities).toEqual(expected); + }); + + test('it returns a specific anomaly if an influencer has the user name', () => { + const anomalies = { + ...mockAnomalies, + anomalies: [ + { + ...mockAnomalies.anomalies[0], + entityName: 'something-else', + entityValue: 'something-else', + influencers: [ + { 'host.name': 'zeek-iowa' }, + { 'process.name': 'du' }, + { 'user.name': 'something-else' }, + ], + }, + { + ...mockAnomalies.anomalies[1], + entityName: 'something-else', + entityValue: 'something-else', + }, + ], + }; + + const entities = convertAnomaliesToUsers(anomalies, 'root'); + const expected: AnomaliesByUser[] = [ + { + anomaly: anomalies.anomalies[1], + userName: 'root', + }, + ]; + expect(entities).toEqual(expected); + }); + + test('it returns empty anomalies if sent in the name of one that does not exist', () => { + const entities = convertAnomaliesToUsers(mockAnomalies, 'some-made-up-name-here-for-you'); + const expected: AnomaliesByUser[] = []; + expect(entities).toEqual(expected); + }); + + test('it returns true for a found entity name passed in', () => { + const anomalies = { + ...mockAnomalies, + anomalies: [ + { + ...mockAnomalies.anomalies[0], + entityName: 'user.name', + entityValue: 'admin', + }, + mockAnomalies.anomalies[1], + ], + }; + + const found = getUserNameFromEntity(anomalies.anomalies[0], 'admin'); + expect(found).toEqual(true); + }); + + test('it returns false for an entity name that does not exist', () => { + const anomalies = { + ...mockAnomalies, + anomalies: [ + { + ...mockAnomalies.anomalies[0], + entityName: 'user.name', + entityValue: 'admin', + }, + mockAnomalies.anomalies[1], + ], + }; + + const found = getUserNameFromEntity(anomalies.anomalies[0], 'some-made-up-entity-name'); + expect(found).toEqual(false); + }); + + test('it returns true for an entity that has user.name within it if no name is passed in', () => { + const anomalies = { + ...mockAnomalies, + anomalies: [ + { + ...mockAnomalies.anomalies[0], + entityName: 'user.name', + entityValue: 'something-made-up', + }, + mockAnomalies.anomalies[1], + ], + }; + + const found = getUserNameFromEntity(anomalies.anomalies[0]); + expect(found).toEqual(true); + }); + + test('it returns false for an entity that is not user.name and no name is passed in', () => { + const anomalies = { + ...mockAnomalies, + anomalies: [ + { + ...mockAnomalies.anomalies[0], + entityValue: 'made-up', + }, + mockAnomalies.anomalies[1], + ], + }; + + const found = getUserNameFromEntity(anomalies.anomalies[0]); + expect(found).toEqual(false); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts new file mode 100644 index 0000000000000..8f69604fc5510 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts @@ -0,0 +1,41 @@ +/* + * 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 { Anomalies, AnomaliesByUser, Anomaly } from '../types'; +import { getUserNameFromInfluencers } from '../influencers/get_user_name_from_influencers'; + +export const convertAnomaliesToUsers = ( + anomalies: Anomalies | null, + userName?: string +): AnomaliesByUser[] => { + if (anomalies == null) { + return []; + } else { + return anomalies.anomalies.reduce((accum, item) => { + if (getUserNameFromEntity(item, userName)) { + return [...accum, { userName: item.entityValue, anomaly: item }]; + } else { + const userNameFromInfluencers = getUserNameFromInfluencers(item.influencers, userName); + if (userNameFromInfluencers != null) { + return [...accum, { userName: userNameFromInfluencers, anomaly: item }]; + } else { + return accum; + } + } + }, []); + } +}; + +export const getUserNameFromEntity = (anomaly: Anomaly, userName?: string): boolean => { + if (anomaly.entityName !== 'user.name') { + return false; + } else if (userName == null) { + return true; + } else { + return anomaly.entityValue === userName; + } +}; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts index 8c80cf7901960..c70d38ca51b12 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts @@ -7,8 +7,7 @@ import { mockAnomalies } from '../mock'; import { cloneDeep } from 'lodash/fp'; -import { createCompoundHostKey, createCompoundNetworkKey } from './create_compound_key'; -import { AnomaliesByHost, AnomaliesByNetwork } from '../types'; +import { createCompoundAnomalyKey } from './create_compound_key'; describe('create_explorer_link', () => { let anomalies = cloneDeep(mockAnomalies); @@ -17,22 +16,8 @@ describe('create_explorer_link', () => { anomalies = cloneDeep(mockAnomalies); }); - test('it creates a compound host key', () => { - const anomaliesByHost: AnomaliesByHost = { - hostName: 'some-host-name', - anomaly: anomalies.anomalies[0], - }; - const key = createCompoundHostKey(anomaliesByHost); - expect(key).toEqual('some-host-name-process.name-du-16.193669439507826-job-1'); - }); - - test('it creates a compound network key', () => { - const anomaliesByNetwork: AnomaliesByNetwork = { - type: 'destination.ip', - ip: '127.0.0.1', - anomaly: anomalies.anomalies[0], - }; - const key = createCompoundNetworkKey(anomaliesByNetwork); - expect(key).toEqual('127.0.0.1-process.name-du-16.193669439507826-job-1'); + test('it creates a compound anomaly key', () => { + const key = createCompoundAnomalyKey(anomalies.anomalies[0]); + expect(key).toEqual('process.name-du-16.193669439507826-job-1'); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts index c6e0773f0ab0c..f9ef0ff9285fe 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts @@ -5,10 +5,7 @@ * 2.0. */ -import { AnomaliesByHost, AnomaliesByNetwork } from '../types'; +import { Anomaly } from '../types'; -export const createCompoundHostKey = (anomaliesByHost: AnomaliesByHost): string => - `${anomaliesByHost.hostName}-${anomaliesByHost.anomaly.entityName}-${anomaliesByHost.anomaly.entityValue}-${anomaliesByHost.anomaly.severity}-${anomaliesByHost.anomaly.jobId}`; - -export const createCompoundNetworkKey = (anomaliesByNetwork: AnomaliesByNetwork): string => - `${anomaliesByNetwork.ip}-${anomaliesByNetwork.anomaly.entityName}-${anomaliesByNetwork.anomaly.entityValue}-${anomaliesByNetwork.anomaly.severity}-${anomaliesByNetwork.anomaly.jobId}`; +export const createCompoundAnomalyKey = (anomaly: Anomaly): string => + `${anomaly.entityName}-${anomaly.entityValue}-${anomaly.severity}-${anomaly.jobId}`; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/host_equality.test.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/default_equality.test.ts similarity index 89% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/host_equality.test.ts rename to x-pack/plugins/security_solution/public/common/components/ml/tables/default_equality.test.ts index 475ed4f579c4d..bbc2a9251c41d 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/host_equality.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/default_equality.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { hostEquality } from './host_equality'; +import { anomaliesTableDefaultEquality } from './default_equality'; import { AnomaliesHostTableProps } from '../types'; import { HostsType } from '../../../../hosts/store/model'; @@ -25,7 +25,7 @@ describe('host_equality', () => { skip: false, type: HostsType.details, }; - const equal = hostEquality(prev, next); + const equal = anomaliesTableDefaultEquality(prev, next); expect(equal).toEqual(true); }); @@ -44,7 +44,7 @@ describe('host_equality', () => { skip: false, type: HostsType.details, }; - const equal = hostEquality(prev, next); + const equal = anomaliesTableDefaultEquality(prev, next); expect(equal).toEqual(false); }); @@ -63,7 +63,7 @@ describe('host_equality', () => { skip: false, type: HostsType.details, }; - const equal = hostEquality(prev, next); + const equal = anomaliesTableDefaultEquality(prev, next); expect(equal).toEqual(false); }); @@ -82,7 +82,7 @@ describe('host_equality', () => { skip: false, type: HostsType.details, }; - const equal = hostEquality(prev, next); + const equal = anomaliesTableDefaultEquality(prev, next); expect(equal).toEqual(false); }); @@ -101,7 +101,7 @@ describe('host_equality', () => { skip: false, type: HostsType.details, }; - const equal = hostEquality(prev, next); + const equal = anomaliesTableDefaultEquality(prev, next); expect(equal).toEqual(false); }); @@ -120,7 +120,7 @@ describe('host_equality', () => { skip: false, type: HostsType.details, }; - const equal = hostEquality(prev, next); + const equal = anomaliesTableDefaultEquality(prev, next); expect(equal).toEqual(false); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/host_equality.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/default_equality.ts similarity index 68% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/host_equality.ts rename to x-pack/plugins/security_solution/public/common/components/ml/tables/default_equality.ts index 69c67fc4ca2c1..213bd922b51f3 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/host_equality.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/default_equality.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { AnomaliesHostTableProps } from '../types'; +import { AnomaliesTableCommonProps } from '../types'; -export const hostEquality = ( - prevProps: AnomaliesHostTableProps, - nextProps: AnomaliesHostTableProps +export const anomaliesTableDefaultEquality = ( + prevProps: AnomaliesTableCommonProps, + nextProps: AnomaliesTableCommonProps ): boolean => prevProps.startDate === nextProps.startDate && prevProps.endDate === nextProps.endDate && diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx index 45883019b9ff8..364c24f000905 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx @@ -5,121 +5,35 @@ * 2.0. */ -import React from 'react'; - import '../../../mock/match_media'; import { getAnomaliesHostTableColumnsCurated } from './get_anomalies_host_table_columns'; import { HostsType } from '../../../../hosts/store/model'; import * as i18n from './translations'; -import { AnomaliesByHost, Anomaly } from '../types'; -import { Columns } from '../../paginated_table'; -import { TestProviders } from '../../../mock'; -import { useMountAppended } from '../../../utils/use_mount_appended'; jest.mock('../../../lib/kibana'); const startDate = new Date(2001).toISOString(); const endDate = new Date(3000).toISOString(); -const interval = 'days'; -const narrowDateRange = jest.fn(); -describe('get_anomalies_host_table_columns', () => { - const mount = useMountAppended(); +describe('get_anomalies_host_table_columns', () => { test('on hosts page, we expect to get all columns', () => { - expect( - getAnomaliesHostTableColumnsCurated( - HostsType.page, - startDate, - endDate, - interval, - narrowDateRange - ).length - ).toEqual(6); + expect(getAnomaliesHostTableColumnsCurated(HostsType.page, startDate, endDate).length).toEqual( + 6 + ); }); test('on host details page, we expect to remove one columns', () => { - const columns = getAnomaliesHostTableColumnsCurated( - HostsType.details, - startDate, - endDate, - interval, - narrowDateRange - ); + const columns = getAnomaliesHostTableColumnsCurated(HostsType.details, startDate, endDate); expect(columns.length).toEqual(5); }); test('on host page, we should have Host Name', () => { - const columns = getAnomaliesHostTableColumnsCurated( - HostsType.page, - startDate, - endDate, - interval, - narrowDateRange - ); + const columns = getAnomaliesHostTableColumnsCurated(HostsType.page, startDate, endDate); expect(columns.some((col) => col.name === i18n.HOST_NAME)).toEqual(true); }); test('on host details page, we should not have Host Name', () => { - const columns = getAnomaliesHostTableColumnsCurated( - HostsType.details, - startDate, - endDate, - interval, - narrowDateRange - ); + const columns = getAnomaliesHostTableColumnsCurated(HostsType.details, startDate, endDate); expect(columns.some((col) => col.name === i18n.HOST_NAME)).toEqual(false); }); - - test('on host page, undefined influencers should turn into an empty column string', () => { - const columns = getAnomaliesHostTableColumnsCurated( - HostsType.page, - startDate, - endDate, - interval, - narrowDateRange - ); - const column = columns.find((col) => col.name === i18n.INFLUENCED_BY) as Columns< - Anomaly['influencers'], - AnomaliesByHost - >; - const anomaly: AnomaliesByHost = { - hostName: 'host.name', - anomaly: { - detectorIndex: 0, - entityName: 'entity-name-1', - entityValue: 'entity-value-1', - jobId: 'job-1', - rowId: 'row-1', - severity: 100, - time: new Date('01/01/2000').valueOf(), - source: { - job_id: 'job-1', - result_type: 'result-1', - probability: 50, - multi_bucket_impact: 0, - record_score: 0, - initial_record_score: 0, - bucket_span: 0, - detector_index: 0, - is_interim: true, - timestamp: new Date('01/01/2000').valueOf(), - by_field_name: 'some field name', - by_field_value: 'some field value', - partition_field_name: 'partition field name', - partition_field_value: 'partition field value', - function: 'function-1', - function_description: 'description-1', - typical: [5, 3], - actual: [7, 4], - influencers: [], - }, - }, - }; - if (column != null && column.render != null) { - const wrapper = mount({column.render(undefined, anomaly)}); - expect(wrapper.text()).toEqual(''); - } else { - expect(column).not.toBe(null); - } - }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx index 468cb416a2f9b..7ee0b3ca88469 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx @@ -6,27 +6,18 @@ */ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Columns } from '../../paginated_table'; -import { AnomaliesByHost, Anomaly, NarrowDateRange } from '../types'; +import { AnomaliesByHost, Anomaly } from '../types'; import { getRowItemDraggable } from '../../tables/helpers'; -import { EntityDraggable } from '../entity_draggable'; -import { createCompoundHostKey } from './create_compound_key'; +import { createCompoundAnomalyKey } from './create_compound_key'; import { HostDetailsLink } from '../../links'; - import * as i18n from './translations'; -import { getEntries } from '../get_entries'; -import { DraggableScore } from '../score/draggable_score'; -import { ExplorerLink } from '../links/create_explorer_link'; import { HostsType } from '../../../../hosts/store/model'; -import { escapeDataProviderId } from '../../drag_and_drop/helpers'; -import { FormattedRelativePreferenceDate } from '../../formatted_date'; +import { getAnomaliesDefaultTableColumns } from './get_anomalies_table_columns'; export const getAnomaliesHostTableColumns = ( startDate: string, - endDate: string, - interval: string, - narrowDateRange: NarrowDateRange + endDate: string ): [ Columns, Columns, @@ -43,100 +34,21 @@ export const getAnomaliesHostTableColumns = ( getRowItemDraggable({ rowItem: hostName, attrName: 'host.name', - idPrefix: `anomalies-host-table-hostName-${createCompoundHostKey( - anomaliesByHost + idPrefix: `anomalies-host-table-hostName-${createCompoundAnomalyKey( + anomaliesByHost.anomaly )}-hostName`, render: (item) => , }), }, - { - name: i18n.DETECTOR, - field: 'anomaly.jobId', - sortable: true, - render: (jobId, anomaliesByHost) => ( - - ), - }, - { - name: i18n.SCORE, - field: 'anomaly.severity', - sortable: true, - render: (_, anomaliesByHost) => ( - - ), - }, - { - name: i18n.ENTITY, - field: 'anomaly.entityValue', - sortable: true, - render: (entityValue, anomaliesByHost) => ( - - ), - }, - { - name: i18n.INFLUENCED_BY, - field: 'anomaly.influencers', - render: (influencers, anomaliesByHost) => ( - - {influencers && - influencers.map((influencer) => { - const [key, value] = getEntries(influencer); - const entityName = key != null ? key : ''; - const entityValue = value != null ? value : ''; - return ( - - - - - - - - ); - })} - - ), - }, - { - name: i18n.TIME_STAMP, - field: 'anomaly.time', - sortable: true, - render: (time) => , - }, + ...getAnomaliesDefaultTableColumns(startDate, endDate), ]; export const getAnomaliesHostTableColumnsCurated = ( pageType: HostsType, startDate: string, - endDate: string, - interval: string, - narrowDateRange: NarrowDateRange + endDate: string ) => { - const columns = getAnomaliesHostTableColumns(startDate, endDate, interval, narrowDateRange); + const columns = getAnomaliesHostTableColumns(startDate, endDate); // Columns to exclude from host details pages if (pageType === HostsType.details) { diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx index 817205ce22808..96917bb8ed739 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx @@ -9,19 +9,12 @@ import '../../../mock/match_media'; import { getAnomaliesNetworkTableColumnsCurated } from './get_anomalies_network_table_columns'; import { NetworkType } from '../../../../network/store/model'; import * as i18n from './translations'; -import { AnomaliesByNetwork, Anomaly } from '../types'; -import { Columns } from '../../paginated_table'; -import React from 'react'; -import { TestProviders } from '../../../mock'; -import { useMountAppended } from '../../../utils/use_mount_appended'; jest.mock('../../../../common/lib/kibana'); const startDate = new Date(2001).toISOString(); const endDate = new Date(3000).toISOString(); describe('get_anomalies_network_table_columns', () => { - const mount = useMountAppended(); - test('on network page, we expect to get all columns', () => { expect( getAnomaliesNetworkTableColumnsCurated(NetworkType.page, startDate, endDate).length @@ -42,52 +35,4 @@ describe('get_anomalies_network_table_columns', () => { const columns = getAnomaliesNetworkTableColumnsCurated(NetworkType.details, startDate, endDate); expect(columns.some((col) => col.name === i18n.NETWORK_NAME)).toEqual(false); }); - - test('on network page, undefined influencers should turn into an empty column string', () => { - const columns = getAnomaliesNetworkTableColumnsCurated(NetworkType.page, startDate, endDate); - const column = columns.find((col) => col.name === i18n.INFLUENCED_BY) as Columns< - Anomaly['influencers'], - AnomaliesByNetwork - >; - const anomaly: AnomaliesByNetwork = { - type: 'source.ip', - ip: '127.0.0.1', - anomaly: { - detectorIndex: 0, - entityName: 'entity-name-1', - entityValue: 'entity-value-1', - jobId: 'job-1', - rowId: 'row-1', - severity: 100, - time: new Date('01/01/2000').valueOf(), - source: { - job_id: 'job-1', - result_type: 'result-1', - probability: 50, - multi_bucket_impact: 0, - record_score: 0, - initial_record_score: 0, - bucket_span: 0, - detector_index: 0, - is_interim: true, - timestamp: new Date('01/01/2000').valueOf(), - by_field_name: 'some field name', - by_field_value: 'some field value', - partition_field_name: 'partition field name', - partition_field_value: 'partition field value', - function: 'function-1', - function_description: 'description-1', - typical: [5, 3], - actual: [7, 4], - influencers: [], - }, - }, - }; - if (column != null && column.render != null) { - const wrapper = mount({column.render(undefined, anomaly)}); - expect(wrapper.text()).toEqual(''); - } else { - expect(column).not.toBe(null); - } - }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx index 4c4e131a9d467..44c6a193c30fd 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx @@ -6,23 +6,17 @@ */ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Columns } from '../../paginated_table'; import { Anomaly, AnomaliesByNetwork } from '../types'; import { getRowItemDraggable } from '../../tables/helpers'; -import { EntityDraggable } from '../entity_draggable'; -import { createCompoundNetworkKey } from './create_compound_key'; +import { createCompoundAnomalyKey } from './create_compound_key'; import { NetworkDetailsLink } from '../../links'; import * as i18n from './translations'; -import { getEntries } from '../get_entries'; -import { DraggableScore } from '../score/draggable_score'; -import { ExplorerLink } from '../links/create_explorer_link'; -import { FormattedRelativePreferenceDate } from '../../formatted_date'; import { NetworkType } from '../../../../network/store/model'; -import { escapeDataProviderId } from '../../drag_and_drop/helpers'; import { FlowTarget } from '../../../../../common/search_strategy'; +import { getAnomaliesDefaultTableColumns } from './get_anomalies_table_columns'; export const getAnomaliesNetworkTableColumns = ( startDate: string, @@ -44,84 +38,13 @@ export const getAnomaliesNetworkTableColumns = ( getRowItemDraggable({ rowItem: ip, attrName: anomaliesByNetwork.type, - idPrefix: `anomalies-network-table-ip-${createCompoundNetworkKey(anomaliesByNetwork)}`, + idPrefix: `anomalies-network-table-ip-${createCompoundAnomalyKey( + anomaliesByNetwork.anomaly + )}`, render: (item) => , }), }, - { - name: i18n.DETECTOR, - field: 'anomaly.jobId', - sortable: true, - render: (jobId, anomaliesByHost) => ( - - ), - }, - { - name: i18n.SCORE, - field: 'anomaly.severity', - sortable: true, - render: (_, anomaliesByNetwork) => ( - - ), - }, - { - name: i18n.ENTITY, - field: 'anomaly.entityValue', - sortable: true, - render: (entityValue, anomaliesByNetwork) => ( - - ), - }, - { - name: i18n.INFLUENCED_BY, - field: 'anomaly.influencers', - render: (influencers, anomaliesByNetwork) => ( - - {influencers && - influencers.map((influencer) => { - const [key, value] = getEntries(influencer); - const entityName = key != null ? key : ''; - const entityValue = value != null ? value : ''; - return ( - - - - ); - })} - - ), - }, - { - name: i18n.TIME_STAMP, - field: 'anomaly.time', - sortable: true, - render: (time) => , - }, + ...getAnomaliesDefaultTableColumns(startDate, endDate), ]; export const getAnomaliesNetworkTableColumnsCurated = ( diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx new file mode 100644 index 0000000000000..3df8d545d2871 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx @@ -0,0 +1,73 @@ +/* + * 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 '../../../mock/match_media'; +import * as i18n from './translations'; +import { AnomaliesBy, Anomaly } from '../types'; +import { Columns } from '../../paginated_table'; +import React from 'react'; +import { TestProviders } from '../../../mock'; +import { useMountAppended } from '../../../utils/use_mount_appended'; +import { getAnomaliesDefaultTableColumns } from './get_anomalies_table_columns'; + +jest.mock('../../../../common/lib/kibana'); + +const startDate = new Date(2001).toISOString(); +const endDate = new Date(3000).toISOString(); +describe('getAnomaliesDefaultTableColumns', () => { + const mount = useMountAppended(); + + test('it should return all columns', () => { + expect(getAnomaliesDefaultTableColumns(startDate, endDate).length).toEqual(5); + }); + + test('it should return an empty column string for undefined influencers', () => { + const columns = getAnomaliesDefaultTableColumns(startDate, endDate); + const column = columns.find((col) => col.name === i18n.INFLUENCED_BY) as Columns< + Anomaly['influencers'], + AnomaliesBy + >; + const anomaly: AnomaliesBy = { + anomaly: { + detectorIndex: 0, + entityName: 'entity-name-1', + entityValue: 'entity-value-1', + jobId: 'job-1', + rowId: 'row-1', + severity: 100, + time: new Date('01/01/2000').valueOf(), + source: { + job_id: 'job-1', + result_type: 'result-1', + probability: 50, + multi_bucket_impact: 0, + record_score: 0, + initial_record_score: 0, + bucket_span: 0, + detector_index: 0, + is_interim: true, + timestamp: new Date('01/01/2000').valueOf(), + by_field_name: 'some field name', + by_field_value: 'some field value', + partition_field_name: 'partition field name', + partition_field_value: 'partition field value', + function: 'function-1', + function_description: 'description-1', + typical: [5, 3], + actual: [7, 4], + influencers: [], + }, + }, + }; + if (column != null && column.render != null) { + const wrapper = mount({column.render(undefined, anomaly)}); + expect(wrapper.text()).toEqual(''); + } else { + expect(column).not.toBe(null); + } + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx new file mode 100644 index 0000000000000..eb3d7aac2ae2f --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx @@ -0,0 +1,111 @@ +/* + * 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 React from 'react'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { Columns } from '../../paginated_table'; +import { AnomaliesBy, Anomaly } from '../types'; + +import { EntityDraggable } from '../entity_draggable'; +import { createCompoundAnomalyKey } from './create_compound_key'; + +import * as i18n from './translations'; +import { getEntries } from '../get_entries'; +import { DraggableScore } from '../score/draggable_score'; +import { ExplorerLink } from '../links/create_explorer_link'; +import { escapeDataProviderId } from '../../drag_and_drop/helpers'; +import { FormattedRelativePreferenceDate } from '../../formatted_date'; + +export const getAnomaliesDefaultTableColumns = ( + startDate: string, + endDate: string +): [ + Columns, + Columns, + Columns, + Columns, + Columns +] => [ + { + name: i18n.DETECTOR, + field: 'anomaly.jobId', + sortable: true, + render: (jobId, anomalyBy) => ( + + ), + }, + { + name: i18n.SCORE, + field: 'anomaly.severity', + sortable: true, + render: (_, anomalyBy) => ( + + ), + }, + { + name: i18n.ENTITY, + field: 'anomaly.entityValue', + sortable: true, + render: (entityValue, anomalyBy) => ( + + ), + }, + { + name: i18n.INFLUENCED_BY, + field: 'anomaly.influencers', + render: (influencers, anomalyBy) => ( + + {influencers && + influencers.map((influencer) => { + const [key, value] = getEntries(influencer); + const entityName = key != null ? key : ''; + const entityValue = value != null ? value : ''; + return ( + + + + + + + + ); + })} + + ), + }, + { + name: i18n.TIME_STAMP, + field: 'anomaly.time', + sortable: true, + render: (time) => , + }, +]; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx new file mode 100644 index 0000000000000..5905a7ceaa114 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx @@ -0,0 +1,40 @@ +/* + * 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 { UsersType } from '../../../../users/store/model'; +import '../../../mock/match_media'; +import { getAnomaliesUserTableColumnsCurated } from './get_anomalies_user_table_columns'; + +import * as i18n from './translations'; + +jest.mock('../../../lib/kibana'); + +const startDate = new Date(2001).toISOString(); +const endDate = new Date(3000).toISOString(); + +describe('get_anomalies_user_table_columns', () => { + test('on users page, we expect to get all columns', () => { + expect(getAnomaliesUserTableColumnsCurated(UsersType.page, startDate, endDate).length).toEqual( + 6 + ); + }); + + test('on user details page, we expect to remove one columns', () => { + const columns = getAnomaliesUserTableColumnsCurated(UsersType.details, startDate, endDate); + expect(columns.length).toEqual(5); + }); + + test('on users page, we should have User Name', () => { + const columns = getAnomaliesUserTableColumnsCurated(UsersType.page, startDate, endDate); + expect(columns.some((col) => col.name === i18n.USER_NAME)).toEqual(true); + }); + + test('on user details page, we should not have User Name', () => { + const columns = getAnomaliesUserTableColumnsCurated(UsersType.details, startDate, endDate); + expect(columns.some((col) => col.name === i18n.USER_NAME)).toEqual(false); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx new file mode 100644 index 0000000000000..6bc9aefecfae1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx @@ -0,0 +1,60 @@ +/* + * 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 React from 'react'; +import { Columns } from '../../paginated_table'; +import { AnomaliesByUser, Anomaly } from '../types'; +import { getRowItemDraggable } from '../../tables/helpers'; +import { createCompoundAnomalyKey } from './create_compound_key'; +import { UserDetailsLink } from '../../links'; + +import * as i18n from './translations'; +import { UsersType } from '../../../../users/store/model'; +import { getAnomaliesDefaultTableColumns } from './get_anomalies_table_columns'; + +export const getAnomaliesUserTableColumns = ( + startDate: string, + endDate: string +): [ + Columns, + Columns, + Columns, + Columns, + Columns, + Columns +] => [ + { + name: i18n.USER_NAME, + field: 'userName', + sortable: true, + render: (userName, anomaliesByUser) => + getRowItemDraggable({ + rowItem: userName, + attrName: 'user.name', + idPrefix: `anomalies-user-table-userName-${createCompoundAnomalyKey( + anomaliesByUser.anomaly + )}-userName`, + render: (item) => , + }), + }, + ...getAnomaliesDefaultTableColumns(startDate, endDate), +]; + +export const getAnomaliesUserTableColumnsCurated = ( + pageType: UsersType, + startDate: string, + endDate: string +) => { + const columns = getAnomaliesUserTableColumns(startDate, endDate); + + // Columns to exclude from user details pages + if (pageType === UsersType.details) { + return columns.filter((column) => column.name !== i18n.USER_NAME); + } else { + return columns; + } +}; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/network_equality.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/network_equality.ts index 080720bd99808..4354fa75f5f91 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/network_equality.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/network_equality.ts @@ -6,12 +6,11 @@ */ import { AnomaliesNetworkTableProps } from '../types'; +import { anomaliesTableDefaultEquality } from './default_equality'; export const networkEquality = ( prevProps: AnomaliesNetworkTableProps, nextProps: AnomaliesNetworkTableProps ): boolean => - prevProps.startDate === nextProps.startDate && - prevProps.endDate === nextProps.endDate && - prevProps.skip === nextProps.skip && + anomaliesTableDefaultEquality(prevProps, nextProps) && prevProps.flowTarget === nextProps.flowTarget; diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/translations.ts b/x-pack/plugins/security_solution/public/common/components/ml/tables/translations.ts index 20e2896170c5c..e0c7a169bf9e3 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/tables/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/tables/translations.ts @@ -42,6 +42,10 @@ export const HOST_NAME = i18n.translate('xpack.securitySolution.ml.table.hostNam defaultMessage: 'Host name', }); +export const USER_NAME = i18n.translate('xpack.securitySolution.ml.table.userNameTitle', { + defaultMessage: 'User name', +}); + export const INFLUENCED_BY = i18n.translate('xpack.securitySolution.ml.table.influencedByTitle', { defaultMessage: 'Influenced by', }); diff --git a/x-pack/plugins/security_solution/public/common/components/ml/types.ts b/x-pack/plugins/security_solution/public/common/components/ml/types.ts index 494c8a522ffac..c5be26fb57648 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/types.ts +++ b/x-pack/plugins/security_solution/public/common/components/ml/types.ts @@ -10,6 +10,7 @@ import { FlowTarget } from '../../../../common/search_strategy'; import { HostsType } from '../../../hosts/store/model'; import { NetworkType } from '../../../network/store/model'; +import { UsersType } from '../../../users/store/model'; export interface Source { job_id: string; @@ -62,37 +63,48 @@ export interface Anomalies { export type NarrowDateRange = (score: Anomaly, interval: string) => void; -export interface AnomaliesByHost { - hostName: string; +export interface AnomaliesBy { anomaly: Anomaly; } +export interface AnomaliesByHost extends AnomaliesBy { + hostName: string; +} + export type DestinationOrSource = 'source.ip' | 'destination.ip'; -export interface AnomaliesByNetwork { +export interface AnomaliesByNetwork extends AnomaliesBy { type: DestinationOrSource; ip: string; - anomaly: Anomaly; } -export interface HostOrNetworkProps { +export interface AnomaliesByUser extends AnomaliesBy { + userName: string; +} + +export interface AnomaliesTableCommonProps { startDate: string; endDate: string; narrowDateRange: NarrowDateRange; skip: boolean; } -export type AnomaliesHostTableProps = HostOrNetworkProps & { +export type AnomaliesHostTableProps = AnomaliesTableCommonProps & { hostName?: string; type: HostsType; }; -export type AnomaliesNetworkTableProps = HostOrNetworkProps & { +export type AnomaliesNetworkTableProps = AnomaliesTableCommonProps & { ip?: string; type: NetworkType; flowTarget?: FlowTarget; }; +export type AnomaliesUserTableProps = AnomaliesTableCommonProps & { + userName?: string; + type: UsersType; +}; + const sourceOrDestination = ['source.ip', 'destination.ip']; export const isDestinationOrSource = (value: string | null): value is DestinationOrSource => diff --git a/x-pack/plugins/security_solution/public/common/components/page/index.tsx b/x-pack/plugins/security_solution/public/common/components/page/index.tsx index d17f5ceb4f9b1..c85e7b9f36ac1 100644 --- a/x-pack/plugins/security_solution/public/common/components/page/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/page/index.tsx @@ -35,12 +35,13 @@ export const AppGlobalStyle = createGlobalStyle<{ theme: { eui: { euiColorPrimar z-index: 9950 !important; } - .euiDataGridRowCell__expandButton .euiDataGridRowCell__actionButtonIcon { + .euiDataGridRowCell .euiDataGridRowCell__expandActions .euiDataGridRowCell__actionButtonIcon { display: none; &:first-child, &:nth-child(2), - &:nth-child(3) { + &:nth-child(3), + &:last-child { display: inline-flex; } diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts index 2d3bb00501da5..ee3ace3819fd3 100644 --- a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts +++ b/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts @@ -12,9 +12,10 @@ import { GlobalTimeArgs } from '../../use_global_time'; import { HostsType } from '../../../../hosts/store/model'; import { NetworkType } from '../../../../network/store//model'; import { FlowTarget } from '../../../../../common/search_strategy'; +import { UsersType } from '../../../../users/store/model'; interface QueryTabBodyProps { - type: HostsType | NetworkType; + type: HostsType | NetworkType | UsersType; filterQuery?: string | ESTermQuery; } diff --git a/x-pack/plugins/security_solution/public/common/mock/global_state.ts b/x-pack/plugins/security_solution/public/common/mock/global_state.ts index 39e65a8c4e364..b65a8ece16c03 100644 --- a/x-pack/plugins/security_solution/public/common/mock/global_state.ts +++ b/x-pack/plugins/security_solution/public/common/mock/global_state.ts @@ -205,6 +205,7 @@ export const mockGlobalState: State = { limit: 10, // TODO sort: { field: RiskScoreFields.riskScore, direction: Direction.desc }, }, + [usersModel.UsersTableType.anomalies]: null, }, }, details: { @@ -214,6 +215,7 @@ export const mockGlobalState: State = { limit: 10, // TODO sort: { field: HostRulesFields.riskScore, direction: Direction.desc }, }, + [usersModel.UsersTableType.anomalies]: null, }, }, }, diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx index 0a4c5ce76c785..ee4b5061e8499 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx @@ -42,7 +42,7 @@ const HelpTextComponent: React.FC<{ href: string; notRunningJobIds: string[] }> {notRunningJobIds.length === 1 ? ( ) : ( acc + (i < array.length - 1 ? ', ' : ', and ') + value diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts b/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts index 847e73f0bf19d..5b66b4611c03d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts +++ b/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts @@ -18,7 +18,7 @@ export const PRE_BUILT_MSG = i18n.translate( 'xpack.securitySolution.detectionEngine.rules.prePackagedRules.emptyPromptMessage', { defaultMessage: - 'Elastic Security comes with prebuilt detection rules that run in the background and create alerts when their conditions are met. By default, all prebuilt rules except the Endpoint Security rule are disabled. You can select additional rules you want to activate.', + 'Elastic Security comes with prebuilt detection rules that run in the background and create alerts when their conditions are met. By default, all prebuilt rules except the Endpoint Security rule are disabled. You can select additional rules you want to enable.', } ); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx index 72730deec6a19..94a883e6bae19 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx @@ -230,7 +230,7 @@ const StepRuleActionsComponent: FC = ({ isLoading={isLoading} onClick={() => handleSubmit(false)} > - {I18n.COMPLETE_WITHOUT_ACTIVATING} + {I18n.COMPLETE_WITHOUT_ENABLING} @@ -239,9 +239,9 @@ const StepRuleActionsComponent: FC = ({ isDisabled={isLoading} isLoading={isLoading} onClick={() => handleSubmit(true)} - data-test-subj="create-activate" + data-test-subj="create-enable" > - {I18n.COMPLETE_WITH_ACTIVATING} + {I18n.COMPLETE_WITH_ENABLING} diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/schema.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/schema.tsx index 955c357673689..936dd283793cb 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/schema.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/schema.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { - AlertAction, + RuleAction, ActionTypeRegistryContract, } from '../../../../../../triggers_actions_ui/public'; import { @@ -23,7 +23,7 @@ import { ActionsStepRule } from '../../../pages/detection_engine/rules/types'; import { getActionTypeName, validateMustache, validateActionParams } from './utils'; export const validateSingleAction = async ( - actionItem: AlertAction, + actionItem: RuleAction, actionTypeRegistry: ActionTypeRegistryContract ): Promise => { const actionParamsErrors = await validateActionParams(actionItem, actionTypeRegistry); @@ -37,7 +37,7 @@ export const validateRuleActionsField = async ( ...data: Parameters ): Promise | void | undefined> => { - const [{ value, path }] = data as [{ value: AlertAction[]; path: string }]; + const [{ value, path }] = data as [{ value: RuleAction[]; path: string }]; const errors = []; for (const actionItem of value) { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx index fcd04c2bfc1ec..dadb3d4229734 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/translations.tsx @@ -8,17 +8,17 @@ import { i18n } from '@kbn/i18n'; import { startCase } from 'lodash/fp'; -export const COMPLETE_WITHOUT_ACTIVATING = i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithoutActivatingTitle', +export const COMPLETE_WITHOUT_ENABLING = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithoutEnablingTitle', { - defaultMessage: 'Create rule without activating it', + defaultMessage: 'Create rule without enabling it', } ); -export const COMPLETE_WITH_ACTIVATING = i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithActivatingTitle', +export const COMPLETE_WITH_ENABLING = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithEnablingTitle', { - defaultMessage: 'Create & activate rule', + defaultMessage: 'Create & enable rule', } ); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/utils.ts b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/utils.ts index fc9562af83525..4826a10e978bd 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/utils.ts +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/utils.ts @@ -9,12 +9,12 @@ import mustache from 'mustache'; import { uniq, startCase, flattenDeep, isArray, isString } from 'lodash/fp'; import { - AlertAction, + RuleAction, ActionTypeRegistryContract, } from '../../../../../../triggers_actions_ui/public'; import * as I18n from './translations'; -export const getActionTypeName = (actionTypeId: AlertAction['actionTypeId']) => { +export const getActionTypeName = (actionTypeId: RuleAction['actionTypeId']) => { if (!actionTypeId) return ''; const actionType = actionTypeId.split('.')[1]; @@ -23,7 +23,7 @@ export const getActionTypeName = (actionTypeId: AlertAction['actionTypeId']) => return startCase(actionType); }; -export const validateMustache = (params: AlertAction['params']) => { +export const validateMustache = (params: RuleAction['params']) => { const errors: string[] = []; Object.entries(params).forEach(([paramKey, paramValue]) => { if (!isString(paramValue)) return; @@ -38,7 +38,7 @@ export const validateMustache = (params: AlertAction['params']) => { }; export const validateActionParams = async ( - actionItem: AlertAction, + actionItem: RuleAction, actionTypeRegistry: ActionTypeRegistryContract ): Promise => { const actionErrors = await actionTypeRegistry diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_schedule_rule/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_schedule_rule/translations.tsx deleted file mode 100644 index c1de42c708849..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_schedule_rule/translations.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { i18n } from '@kbn/i18n'; - -export const COMPLETE_WITHOUT_ACTIVATING = i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithoutActivatingTitle', - { - defaultMessage: 'Create rule without activating it', - } -); - -export const COMPLETE_WITH_ACTIVATING = i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithActivatingTitle', - { - defaultMessage: 'Create & activate rule', - } -); diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts index 47778be0d9c91..6e212cebc85d1 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts @@ -87,7 +87,7 @@ export const useInvalidateRules = () => { /** * We should use this hook to update the rules cache when modifying rules * without changing the rules collection size. Use it with the new rules data - * after operations like bulk or single rule edit or rule activation, but not + * after operations like bulk or single rule edit or rule enabling, but not * when adding or removing rules. When adding/removing rules, we should * invalidate the cache instead. * diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/actions.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/actions.ts index 29b374f3fb26e..8e98d24b17246 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/actions.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/actions.ts @@ -138,8 +138,8 @@ export const enableRulesAction = async ( setLoadingRules?: RulesTableActions['setLoadingRules'] ) => { const errorTitle = enabled - ? i18n.BATCH_ACTION_ACTIVATE_SELECTED_ERROR(ids.length) - : i18n.BATCH_ACTION_DEACTIVATE_SELECTED_ERROR(ids.length); + ? i18n.BATCH_ACTION_ENABLE_SELECTED_ERROR(ids.length) + : i18n.BATCH_ACTION_DISABLE_SELECTED_ERROR(ids.length); try { setLoadingRules?.({ ids, action: enabled ? 'enable' : 'disable' }); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions.tsx index 7058b95bf5fc9..fd12f9a71bf29 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions.tsx @@ -110,19 +110,19 @@ export const useBulkActions = ({ !hasActionsPrivileges && selectedRules.some((rule) => !canEditRuleWithActions(rule, hasActionsPrivileges)); - const handleActivateAction = async () => { + const handleEnableAction = async () => { closePopover(); - const deactivatedRules = selectedRules.filter(({ enabled }) => !enabled); - const deactivatedRulesNoML = deactivatedRules.filter(({ type }) => !isMlRule(type)); + const disabledRules = selectedRules.filter(({ enabled }) => !enabled); + const disabledRulesNoML = disabledRules.filter(({ type }) => !isMlRule(type)); - const mlRuleCount = deactivatedRules.length - deactivatedRulesNoML.length; + const mlRuleCount = disabledRules.length - disabledRulesNoML.length; if (!hasMlPermissions && mlRuleCount > 0) { displayWarningToast(detectionI18n.ML_RULES_UNAVAILABLE(mlRuleCount), dispatchToaster); } const ruleIds = hasMlPermissions - ? deactivatedRules.map(({ id }) => id) - : deactivatedRulesNoML.map(({ id }) => id); + ? disabledRules.map(({ id }) => id) + : disabledRulesNoML.map(({ id }) => id); if (isAllSelected) { const rulesBulkAction = initRulesBulkAction({ @@ -139,12 +139,12 @@ export const useBulkActions = ({ invalidateRules(); }; - const handleDeactivateActions = async () => { + const handleDisableActions = async () => { closePopover(); - const activatedIds = selectedRules.filter(({ enabled }) => enabled).map(({ id }) => id); + const enabledIds = selectedRules.filter(({ enabled }) => enabled).map(({ id }) => id); if (isAllSelected) { const rulesBulkAction = initRulesBulkAction({ - visibleRuleIds: activatedIds, + visibleRuleIds: enabledIds, action: BulkAction.disable, setLoadingRules, toasts, @@ -152,7 +152,7 @@ export const useBulkActions = ({ await rulesBulkAction.byQuery(filterQuery); } else { - await enableRulesAction(activatedIds, false, dispatchToaster, setLoadingRules); + await enableRulesAction(enabledIds, false, dispatchToaster, setLoadingRules); } invalidateRules(); }; @@ -345,10 +345,10 @@ export const useBulkActions = ({ { key: i18n.BULK_ACTION_ENABLE, name: i18n.BULK_ACTION_ENABLE, - 'data-test-subj': 'activateRuleBulk', + 'data-test-subj': 'enableRuleBulk', disabled: missingActionPrivileges || containsLoading || (!containsDisabled && !isAllSelected), - onClick: handleActivateAction, + onClick: handleEnableAction, toolTipContent: missingActionPrivileges ? i18n.EDIT_RULE_SETTINGS_TOOLTIP : undefined, toolTipPosition: 'right', icon: undefined, @@ -391,10 +391,10 @@ export const useBulkActions = ({ { key: i18n.BULK_ACTION_DISABLE, name: i18n.BULK_ACTION_DISABLE, - 'data-test-subj': 'deactivateRuleBulk', + 'data-test-subj': 'disableRuleBulk', disabled: missingActionPrivileges || containsLoading || (!containsEnabled && !isAllSelected), - onClick: handleDeactivateActions, + onClick: handleDisableActions, toolTipContent: missingActionPrivileges ? i18n.EDIT_RULE_SETTINGS_TOOLTIP : undefined, toolTipPosition: 'right', icon: undefined, diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx index c3f3131e65519..7ddc97ccbfdc4 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx @@ -274,7 +274,7 @@ const RuleDetailsPageComponent: React.FC = ({ spacesApi.ui.redirectLegacyUrl( path, i18nTranslate.translate( - 'xpack.triggersActionsUI.sections.alertDetails.redirectObjectNoun', + 'xpack.triggersActionsUI.sections.ruleDetails.redirectObjectNoun', { defaultMessage: 'rule', } @@ -295,7 +295,7 @@ const RuleDetailsPageComponent: React.FC = ({ {spacesApi.ui.components.getLegacyUrlConflict({ objectNoun: i18nTranslate.translate( - 'xpack.triggersActionsUI.sections.alertDetails.redirectObjectNoun', + 'xpack.triggersActionsUI.sections.ruleDetails.redirectObjectNoun', { defaultMessage: 'rule', } @@ -677,7 +677,7 @@ const RuleDetailsPageComponent: React.FC = ({ enabled={isExistingRule && (rule?.enabled ?? false)} onChange={handleOnChangeEnabledRule} /> - {i18n.ACTIVATE_RULE} + {i18n.ENABLE_RULE} diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/translations.ts index 32745f39d27a8..9a51952d17a91 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/translations.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/translations.ts @@ -28,10 +28,10 @@ export const EXPERIMENTAL = i18n.translate( } ); -export const ACTIVATE_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleDetails.activateRuleLabel', +export const ENABLE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDetails.enableRuleLabel', { - defaultMessage: 'Activate', + defaultMessage: 'Enable', } ); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts index c336b588f12b8..b1cc2e4f0388c 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts @@ -454,18 +454,18 @@ export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_TITLE = i18n.translate( } ); -export const BATCH_ACTION_ACTIVATE_SELECTED_ERROR = (totalRules: number) => +export const BATCH_ACTION_ENABLE_SELECTED_ERROR = (totalRules: number) => i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.activateSelectedErrorTitle', + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.enableSelectedErrorTitle', { values: { totalRules }, defaultMessage: 'Error enabling {totalRules, plural, =1 {rule} other {rules}}', } ); -export const BATCH_ACTION_DEACTIVATE_SELECTED_ERROR = (totalRules: number) => +export const BATCH_ACTION_DISABLE_SELECTED_ERROR = (totalRules: number) => i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deactivateSelectedErrorTitle', + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActions.disableSelectedErrorTitle', { values: { totalRules }, defaultMessage: 'Error disabling {totalRules, plural, =1 {rule} other {rules}}', diff --git a/x-pack/plugins/security_solution/public/management/common/utils.ts b/x-pack/plugins/security_solution/public/management/common/utils.ts index 12da54a992bec..8b88fcaff8a78 100644 --- a/x-pack/plugins/security_solution/public/management/common/utils.ts +++ b/x-pack/plugins/security_solution/public/management/common/utils.ts @@ -7,7 +7,10 @@ import { isEmpty } from 'lodash/fp'; -export const parseQueryFilterToKQL = (filter: string, fields: Readonly): string => { +export const parseQueryFilterToKQL = ( + filter: string | undefined, + fields: Readonly +): string => { if (!filter) return ''; const kuery = fields .map( @@ -66,7 +69,7 @@ export const parsePoliciesAndFilterToKql = ({ kuery?: string; }): string | undefined => { if (policies?.length === 0 && excludedPolicies?.length === 0) { - return kuery; + return kuery ? kuery : undefined; } const policiesKQL = parsePoliciesToKQL(policies, excludedPolicies); diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/index.ts b/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/index.ts index 71a1230889559..d8e2eeb956c11 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/index.ts +++ b/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/index.ts @@ -11,3 +11,4 @@ export * from './artifact_entry_collapsible_card'; export * from './components/card_section_panel'; export * from './types'; export { CardCompressedHeaderLayout } from './components/card_compressed_header'; +export { useEndpointPoliciesToArtifactPolicies } from './hooks/use_endpoint_policies_to_artifact_policies'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx new file mode 100644 index 0000000000000..87673cf5c1e47 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx @@ -0,0 +1,290 @@ +/* + * 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 React, { memo, useCallback, useMemo, useState } from 'react'; + +import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; +import { EuiFlyoutSize } from '@elastic/eui/src/components/flyout/flyout'; +import { useLocation } from 'react-router-dom'; +import { AdministrationListPage } from '../administration_list_page'; + +import { PaginatedContent, PaginatedContentProps } from '../paginated_content'; + +import { ArtifactEntryCard } from '../artifact_entry_card'; + +import { ArtifactListPageLabels, artifactListPageLabels } from './translations'; +import { useTestIdGenerator } from '../hooks/use_test_id_generator'; +import { ManagementPageLoader } from '../management_page_loader'; +import { SearchExceptions } from '../search_exceptions'; +import { + useArtifactCardPropsProvider, + UseArtifactCardPropsProviderProps, +} from './hooks/use_artifact_card_props_provider'; +import { NoDataEmptyState } from './components/no_data_empty_state'; +import { ArtifactFlyoutProps, MaybeArtifactFlyout } from './components/artifact_flyout'; +import { useIsFlyoutOpened } from './hooks/use_is_flyout_opened'; +import { useSetUrlParams } from './hooks/use_set_url_params'; +import { useWithArtifactListData } from './hooks/use_with_artifact_list_data'; +import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +import { ArtifactListPageUrlParams } from './types'; +import { useUrlParams } from './hooks/use_url_params'; +import { ListPageRouteState, MaybeImmutable } from '../../../../common/endpoint/types'; +import { DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS } from '../../../../common/endpoint/service/artifacts/constants'; +import { ArtifactDeleteModal } from './components/artifact_delete_modal'; +import { useGetEndpointSpecificPolicies } from '../../services/policies/hooks'; +import { getLoadPoliciesError } from '../../common/translations'; +import { useToasts } from '../../../common/lib/kibana'; +import { useMemoizedRouteState } from '../../common/hooks'; +import { BackToExternalAppSecondaryButton } from '../back_to_external_app_secondary_button'; +import { BackToExternalAppButton } from '../back_to_external_app_button'; + +type ArtifactEntryCardType = typeof ArtifactEntryCard; + +type ArtifactListPagePaginatedContentComponent = PaginatedContentProps< + ExceptionListItemSchema, + ArtifactEntryCardType +>; + +export interface ArtifactListPageProps { + apiClient: ExceptionsListApiClient; + /** The artifact Component that will be displayed in the Flyout for Create and Edit flows */ + ArtifactFormComponent: ArtifactFlyoutProps['FormComponent']; + /** A list of labels for the given artifact page. Not all have to be defined, only those that should override the defaults */ + labels: ArtifactListPageLabels; + /** A list of fields that will be used by the search functionality when a user enters a value in the searchbar */ + searchableFields?: MaybeImmutable; + flyoutSize?: EuiFlyoutSize; + 'data-test-subj'?: string; +} + +export const ArtifactListPage = memo( + ({ + apiClient, + ArtifactFormComponent, + searchableFields = DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS, + labels: _labels = {}, + 'data-test-subj': dataTestSubj, + }) => { + const { state: routeState } = useLocation(); + const getTestId = useTestIdGenerator(dataTestSubj); + const toasts = useToasts(); + const isFlyoutOpened = useIsFlyoutOpened(); + const setUrlParams = useSetUrlParams(); + const { + urlParams: { filter, includedPolicies }, + } = useUrlParams(); + + const { + isPageInitializing, + isFetching: isLoading, + data: listDataResponse, + uiPagination, + doesDataExist, + error, + refetch: refetchListData, + } = useWithArtifactListData(apiClient, searchableFields); + + const items = useMemo(() => { + return listDataResponse?.data ?? []; + }, [listDataResponse?.data]); + + const [selectedItemForDelete, setSelectedItemForDelete] = useState< + undefined | ExceptionListItemSchema + >(undefined); + + const [selectedItemForEdit, setSelectedItemForEdit] = useState< + undefined | ExceptionListItemSchema + >(undefined); + + const labels = useMemo(() => { + return { + ...artifactListPageLabels, + ..._labels, + }; + }, [_labels]); + + const handleOnCardActionClick = useCallback( + ({ type, item }) => { + switch (type) { + case 'edit': + setSelectedItemForEdit(item); + setUrlParams({ show: 'edit', itemId: item.item_id }); + break; + + case 'delete': + setSelectedItemForDelete(item); + break; + } + }, + [setUrlParams] + ); + + const handleCardProps = useArtifactCardPropsProvider({ + items, + onAction: handleOnCardActionClick, + cardActionDeleteLabel: labels.cardActionDeleteLabel, + cardActionEditLabel: labels.cardActionEditLabel, + dataTestSubj: getTestId('card'), + }); + + const policiesRequest = useGetEndpointSpecificPolicies({ + onError: (err) => { + toasts.addWarning(getLoadPoliciesError(err)); + }, + }); + + const memoizedRouteState = useMemoizedRouteState(routeState); + + const backButtonEmptyComponent = useMemo(() => { + if (memoizedRouteState && memoizedRouteState.onBackButtonNavigateTo) { + return ; + } + }, [memoizedRouteState]); + + const backButtonHeaderComponent = useMemo(() => { + if (memoizedRouteState && memoizedRouteState.onBackButtonNavigateTo) { + return ; + } + }, [memoizedRouteState]); + + const handleOpenCreateFlyoutClick = useCallback(() => { + setUrlParams({ show: 'create' }); + }, [setUrlParams]); + + const handlePaginationChange: ArtifactListPagePaginatedContentComponent['onChange'] = + useCallback( + ({ pageIndex, pageSize }) => { + setUrlParams({ + page: pageIndex + 1, + pageSize, + }); + + // Scroll to the top to ensure that when new set of data is received and list updated, + // the user is back at the top of the list + window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); + }, + [setUrlParams] + ); + + const handleOnSearch = useCallback( + (filterValue: string, selectedPolicies: string, doHardRefresh) => { + setUrlParams({ + // `undefined` will drop the param from the url + filter: filterValue.trim() === '' ? undefined : filterValue, + includedPolicies: selectedPolicies.trim() === '' ? undefined : selectedPolicies, + }); + + if (doHardRefresh) { + refetchListData(); + } + }, + [refetchListData, setUrlParams] + ); + + const handleArtifactDeleteModalOnSuccess = useCallback(() => { + setSelectedItemForDelete(undefined); + refetchListData(); + }, [refetchListData]); + + const handleArtifactDeleteModalOnCancel = useCallback(() => { + setSelectedItemForDelete(undefined); + }, []); + + const handleArtifactFlyoutOnSuccess = useCallback(() => { + refetchListData(); + }, [refetchListData]); + + if (isPageInitializing) { + return ; + } + + return ( + + {labels.pageAddButtonTitle} + + } + > + {/* Flyout component is driven by URL params and may or may not be displayed based on those */} + + + {selectedItemForDelete && ( + + )} + + {!doesDataExist ? ( + + ) : ( + <> + + + + + + {labels.getShowingCountLabel(uiPagination.totalItemCount)} + + + + + + items={items} + ItemComponent={ArtifactEntryCard} + itemComponentProps={handleCardProps} + onChange={handlePaginationChange} + error={error} + loading={isLoading} + pagination={uiPagination} + contentClassName="card-container" + data-test-subj={getTestId('cardContent')} + /> + + )} + + ); + } +); +ArtifactListPage.displayName = 'ArtifactListPage'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx new file mode 100644 index 0000000000000..4228d923a9ab3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx @@ -0,0 +1,151 @@ +/* + * 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 React, { memo, useCallback } from 'react'; +import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { i18n } from '@kbn/i18n'; +import { + EuiButtonEmpty, + EuiCallOut, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + EuiSpacer, + EuiText, +} from '@elastic/eui'; +import { AutoFocusButton } from '../../../../common/components/autofocus_button/autofocus_button'; +import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; +import { + getPolicyIdsFromArtifact, + isArtifactGlobal, +} from '../../../../../common/endpoint/service/artifacts'; +import { + ARTIFACT_DELETE_ACTION_LABELS, + useArtifactDeleteItem, +} from '../hooks/use_artifact_delete_item'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; + +export const ARTIFACT_DELETE_LABELS = Object.freeze({ + deleteModalTitle: (itemName: string): string => + i18n.translate('xpack.securitySolution.artifactListPage.deleteModalTitle', { + defaultMessage: 'Delete {itemName}', + values: { itemName }, + }), + + deleteModalImpactTitle: i18n.translate( + 'xpack.securitySolution.artifactListPage.deleteModalImpactTitle', + { + defaultMessage: 'Warning', + } + ), + + deleteModalImpactInfo: (item: ExceptionListItemSchema): string => { + return i18n.translate('xpack.securitySolution.artifactListPage.deleteModalImpactInfo', { + defaultMessage: + 'Deleting this entry will remove it from {count} associated {count, plural, one {policy} other {policies}}.', + values: { + count: isArtifactGlobal(item) + ? i18n.translate('xpack.securitySolution.artifactListPage.deleteModalImpactInfoAll', { + defaultMessage: 'all', + }) + : getPolicyIdsFromArtifact(item).length, + }, + }); + }, + + deleteModalConfirmInfo: i18n.translate( + 'xpack.securitySolution.artifactListPage.deleteModalConfirmInfo', + { + defaultMessage: 'This action cannot be undone. Are you sure you wish to continue?', + } + ), + + deleteModalSubmitButtonTitle: i18n.translate( + 'xpack.securitySolution.artifactListPage.deleteModalSubmitButtonTitle', + { defaultMessage: 'Delete' } + ), + + deleteModalCancelButtonTitle: i18n.translate( + 'xpack.securitySolution.artifactListPage.deleteModalCancelButtonTitle', + { defaultMessage: 'Cancel' } + ), +}); + +interface DeleteArtifactModalProps { + apiClient: ExceptionsListApiClient; + item: ExceptionListItemSchema; + onCancel: () => void; + onSuccess: () => void; + labels: typeof ARTIFACT_DELETE_LABELS & typeof ARTIFACT_DELETE_ACTION_LABELS; + 'data-test-subj'?: string; +} + +export const ArtifactDeleteModal = memo( + ({ apiClient, item, onCancel, onSuccess, 'data-test-subj': dataTestSubj, labels }) => { + const getTestId = useTestIdGenerator(dataTestSubj); + + const { deleteArtifactItem, isLoading: isDeleting } = useArtifactDeleteItem(apiClient, labels); + + const onConfirm = useCallback(() => { + deleteArtifactItem(item).then(() => onSuccess()); + }, [deleteArtifactItem, item, onSuccess]); + + const handleOnCancel = useCallback(() => { + if (!isDeleting) { + onCancel(); + } + }, [isDeleting, onCancel]); + + return ( + + + {labels.deleteModalTitle(item.name)} + + + + + +

+ {labels.deleteModalImpactInfo(item)} +

+
+ +

{labels.deleteModalConfirmInfo}

+
+
+ + + + {labels.deleteModalCancelButtonTitle} + + + + {labels.deleteModalSubmitButtonTitle} + + +
+ ); + } +); +ArtifactDeleteModal.displayName = 'ArtifactDeleteModal'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx new file mode 100644 index 0000000000000..483695de73824 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx @@ -0,0 +1,354 @@ +/* + * 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 React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { + EuiButton, + EuiButtonEmpty, + EuiCallOut, + EuiFlexGroup, + EuiFlexItem, + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutFooter, + EuiFlyoutHeader, + EuiTitle, +} from '@elastic/eui'; +import { EuiFlyoutSize } from '@elastic/eui/src/components/flyout/flyout'; +import { useUrlParams } from '../hooks/use_url_params'; +import { useIsFlyoutOpened } from '../hooks/use_is_flyout_opened'; +import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; +import { useSetUrlParams } from '../hooks/use_set_url_params'; +import { useArtifactGetItem } from '../hooks/use_artifact_get_item'; +import { + ArtifactFormComponentOnChangeCallbackProps, + ArtifactFormComponentProps, + ArtifactListPageUrlParams, +} from '../types'; +import { ManagementPageLoader } from '../../management_page_loader'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; +import { useToasts } from '../../../../common/lib/kibana'; +import { createExceptionListItemForCreate } from '../../../../../common/endpoint/service/artifacts/utils'; +import { useWithArtifactSubmitData } from '../hooks/use_with_artifact_submit_data'; +import { useIsArtifactAllowedPerPolicyUsage } from '../hooks/use_is_artifact_allowed_per_policy_usage'; + +export const ARTIFACT_FLYOUT_LABELS = Object.freeze({ + flyoutEditTitle: i18n.translate('xpack.securitySolution.artifactListPage.flyoutEditTitle', { + defaultMessage: 'Add artifact', + }), + + flyoutCreateTitle: i18n.translate('xpack.securitySolution.artifactListPage.flyoutCreateTitle', { + defaultMessage: 'Create artifact', + }), + flyoutCancelButtonLabel: i18n.translate( + 'xpack.securitySolution.artifactListPage.flyoutCancelButtonLabel', + { + defaultMessage: 'Cancel', + } + ), + flyoutCreateSubmitButtonLabel: i18n.translate( + 'xpack.securitySolution.artifactListPage.flyoutCreateSubmitButtonLabel', + { defaultMessage: 'Add' } + ), + flyoutEditSubmitButtonLabel: i18n.translate( + 'xpack.securitySolution.artifactListPage.flyoutEditSubmitButtonLabel', + { defaultMessage: 'Save' } + ), + flyoutDowngradedLicenseTitle: i18n.translate( + 'xpack.securitySolution.artifactListPage.expiredLicenseTitle', + { + defaultMessage: 'Expired License', + } + ), + flyoutDowngradedLicenseInfo: i18n.translate( + 'xpack.securitySolution.artifactListPage.flyoutDowngradedLicenseInfo', + { + defaultMessage: + 'Your Kibana license has been downgraded. Future policy configurations will now be globally assigned to all policies.', + } + ), + /** + * This should be set to a sentence that includes a link to the documentation page for this specific artifact type. + * + * @example + * // in a component + * () => { + * const { docLinks } = useKibana().services; + * return ( + * + * + * + * }} + * /> + * ); + * } + */ + flyoutDowngradedLicenseDocsInfo: (): React.ReactNode => + i18n.translate('xpack.securitySolution.artifactListPage.flyoutDowngradedLicenseDocsInfo', { + defaultMessage: 'For more information, see our documentation.', + }), + + flyoutEditItemLoadFailure: (errorMessage: string) => + i18n.translate('xpack.securitySolution.artifactListPage.flyoutEditItemLoadFailure', { + defaultMessage: 'Failed to retrieve item for edit. Reason: {errorMessage}', + values: { errorMessage }, + }), + + /** + * A function returning the label for the success message toast + * @param itemName + * @example + * ({ name }) => i18n.translate('xpack.securitySolution.some_page.flyoutCreateSubmitSuccess', { + * defaultMessage: '"{name}" has been added.', + * values: { name }, + * }) + */ + flyoutCreateSubmitSuccess: ({ name }: ExceptionListItemSchema) => + i18n.translate('xpack.securitySolution.some_page.flyoutCreateSubmitSuccess', { + defaultMessage: '"{name}" has been added to your event filters.', + values: { name }, + }), + + /** + * Returns the edit success message for the toast + * @param item + * @example + * ({ name }) => + * i18n.translate('xpack.securitySolution.some_page.flyoutEditSubmitSuccess', { + * defaultMessage: '"{name}" has been updated.', + * values: { name }, + * }) + */ + flyoutEditSubmitSuccess: ({ name }: ExceptionListItemSchema) => + i18n.translate('xpack.securitySolution.artifactListPage.flyoutEditSubmitSuccess', { + defaultMessage: '"{name}" has been updated.', + values: { name }, + }), +}); + +const createFormInitialState = ( + listId: string, + item: ArtifactFormComponentOnChangeCallbackProps['item'] | undefined +): ArtifactFormComponentOnChangeCallbackProps => { + return { + isValid: false, + item: item ?? createExceptionListItemForCreate(listId), + }; +}; + +export interface ArtifactFlyoutProps { + apiClient: ExceptionsListApiClient; + FormComponent: React.ComponentType; + onSuccess(): void; + /** + * If the artifact data is provided and it matches the id in the URL, then it will not be + * retrieved again via the API + */ + item?: ExceptionListItemSchema; + /** Any label overrides */ + labels?: Partial; + 'data-test-subj'?: string; + size?: EuiFlyoutSize; +} + +/** + * Show the flyout based on URL params + */ +export const MaybeArtifactFlyout = memo( + ({ + apiClient, + item, + FormComponent, + onSuccess, + labels: _labels = {}, + 'data-test-subj': dataTestSubj, + size = 'm', + }) => { + const getTestId = useTestIdGenerator(dataTestSubj); + const toasts = useToasts(); + const isFlyoutOpened = useIsFlyoutOpened(); + const setUrlParams = useSetUrlParams(); + const { urlParams } = useUrlParams(); + const labels = useMemo(() => { + return { + ...ARTIFACT_FLYOUT_LABELS, + ..._labels, + }; + }, [_labels]); + + const isEditFlow = urlParams.show === 'edit'; + const formMode: ArtifactFormComponentProps['mode'] = isEditFlow ? 'edit' : 'create'; + + const { + isLoading: isSubmittingData, + mutateAsync: submitData, + error: submitError, + } = useWithArtifactSubmitData(apiClient, formMode); + + const { + isLoading: isLoadingItemForEdit, + error, + refetch: fetchItemForEdit, + } = useArtifactGetItem(apiClient, urlParams.itemId ?? '', false); + + const [formState, setFormState] = useState( + createFormInitialState.bind(null, apiClient.listId, item) + ); + const showExpiredLicenseBanner = useIsArtifactAllowedPerPolicyUsage( + { tags: formState.item.tags ?? [] }, + formMode + ); + + const hasItemDataForEdit = useMemo(() => { + // `item_id` will not be defined for a `create` flow, so we use it below to determine if we + // are still attempting to load the item for edit from the api + return !!item || !!formState.item.item_id; + }, [formState.item.item_id, item]); + + const isInitializing = useMemo(() => { + return isEditFlow && !hasItemDataForEdit; + }, [hasItemDataForEdit, isEditFlow]); + + const handleFlyoutClose = useCallback(() => { + if (isSubmittingData) { + return; + } + + // `undefined` will cause params to be dropped from url + setUrlParams({ id: undefined, show: undefined }, true); + }, [isSubmittingData, setUrlParams]); + + const handleFormComponentOnChange: ArtifactFormComponentProps['onChange'] = useCallback( + ({ item: updatedItem, isValid }) => { + setFormState({ + item: updatedItem, + isValid, + }); + }, + [] + ); + + const handleSubmitClick = useCallback(() => { + submitData(formState.item).then((result) => { + toasts.addSuccess( + isEditFlow + ? labels.flyoutEditSubmitSuccess(result) + : labels.flyoutCreateSubmitSuccess(result) + ); + + // Close the flyout + // `undefined` will cause params to be dropped from url + setUrlParams({ id: undefined, show: undefined }, true); + }); + }, [formState.item, isEditFlow, labels, setUrlParams, submitData, toasts]); + + // If we don't have the actual Artifact data yet for edit (in initialization phase - ex. came in with an + // ID in the url that was not in the list), then retrieve it now + useEffect(() => { + if (isEditFlow && !hasItemDataForEdit && !error && isInitializing && !isLoadingItemForEdit) { + fetchItemForEdit().then(({ data: editItemData }) => { + if (editItemData) { + setFormState(createFormInitialState(apiClient.listId, editItemData)); + } + }); + } + }, [ + apiClient.listId, + error, + fetchItemForEdit, + isEditFlow, + isInitializing, + isLoadingItemForEdit, + hasItemDataForEdit, + ]); + + // If we got an error while trying ot retrieve the item for edit, then show a toast message + useEffect(() => { + if (isEditFlow && error) { + toasts.addWarning(labels.flyoutEditItemLoadFailure(error?.body?.message || error.message)); + + // Blank out the url params for id and show (will close out the flyout) + setUrlParams({ id: undefined, show: undefined }); + } + }, [error, isEditFlow, labels, setUrlParams, toasts, urlParams.itemId]); + + if (!isFlyoutOpened || error) { + return null; + } + + return ( + + + +

{isEditFlow ? labels.flyoutEditTitle : labels.flyoutCreateTitle}

+
+
+ + {!isInitializing && showExpiredLicenseBanner && ( + + {`${labels.flyoutDowngradedLicenseInfo} ${labels.flyoutDowngradedLicenseDocsInfo()}`} + + )} + + + {isInitializing && } + + {!isInitializing && ( + + )} + + + {!isInitializing && ( + + + + + {labels.flyoutCancelButtonLabel} + + + + + {isEditFlow + ? labels.flyoutEditSubmitButtonLabel + : labels.flyoutCreateSubmitButtonLabel} + + + + + )} +
+ ); + } +); +MaybeArtifactFlyout.displayName = 'MaybeArtifactFlyout'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx new file mode 100644 index 0000000000000..cbb6bd8c5454e --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx @@ -0,0 +1,65 @@ +/* + * 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 React, { memo } from 'react'; +import styled, { css } from 'styled-components'; +import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; +import { ManagementEmptyStateWrapper } from '../../management_empty_state_wrapper'; +import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; + +const EmptyPrompt = styled(EuiEmptyPrompt)` + ${() => css` + max-width: 100%; + `} +`; + +export const NoDataEmptyState = memo<{ + onAdd: () => void; + titleLabel: string; + aboutInfo: string; + primaryButtonLabel: string; + /** Should the Add button be disabled */ + isAddDisabled?: boolean; + backComponent?: React.ReactNode; + 'data-test-subj'?: string; +}>( + ({ + onAdd, + isAddDisabled = false, + backComponent, + 'data-test-subj': dataTestSubj, + titleLabel, + aboutInfo, + primaryButtonLabel, + }) => { + const getTestId = useTestIdGenerator(dataTestSubj); + + return ( + + {titleLabel}} + body={
{aboutInfo}
} + actions={[ + + {primaryButtonLabel} + , + ...(backComponent ? [backComponent] : []), + ]} + /> +
+ ); + } +); + +NoDataEmptyState.displayName = 'NoDataEmptyState'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts new file mode 100644 index 0000000000000..58a0f59feaa38 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts @@ -0,0 +1,106 @@ +/* + * 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 { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { useCallback, useMemo } from 'react'; +import { + AnyArtifact, + ArtifactEntryCardProps, + useEndpointPoliciesToArtifactPolicies, +} from '../../artifact_entry_card'; +import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; +import { useGetEndpointSpecificPolicies } from '../../../services/policies/hooks'; +import { getLoadPoliciesError } from '../../../common/translations'; +import { useToasts } from '../../../../common/lib/kibana'; + +type CardActionType = 'edit' | 'delete'; + +export interface UseArtifactCardPropsProviderProps { + items: ExceptionListItemSchema[]; + onAction: (action: { type: CardActionType; item: ExceptionListItemSchema }) => void; + cardActionEditLabel: string; + cardActionDeleteLabel: string; + dataTestSubj?: string; +} + +type ArtifactCardPropsProvider = (artifactItem: ExceptionListItemSchema) => ArtifactEntryCardProps; + +/** + * Return a function that can be used to retrieve props for an `ArtifactCardEntry` component given an + * `ExceptionListItemSchema` on input + */ +export const useArtifactCardPropsProvider = ({ + items, + onAction, + cardActionDeleteLabel, + cardActionEditLabel, + dataTestSubj, +}: UseArtifactCardPropsProviderProps): ArtifactCardPropsProvider => { + const getTestId = useTestIdGenerator(dataTestSubj); + const toasts = useToasts(); + + const { data: policyData } = useGetEndpointSpecificPolicies({ + onError: (error) => { + toasts.addDanger(getLoadPoliciesError(error)); + }, + }); + + const policies: ArtifactEntryCardProps['policies'] = useEndpointPoliciesToArtifactPolicies( + policyData?.items + ); + + const artifactCardPropsPerItem = useMemo(() => { + const cachedCardProps: Record = {}; + + // Casting `listItems` below to remove the `Immutable<>` from it in order to prevent errors + // with common component's props + for (const artifactItem of items as ExceptionListItemSchema[]) { + cachedCardProps[artifactItem.id] = { + item: artifactItem as AnyArtifact, + policies, + 'data-test-subj': dataTestSubj, + actions: [ + { + icon: 'controlsHorizontal', + onClick: () => { + onAction({ type: 'edit', item: artifactItem }); + }, + 'data-test-subj': getTestId('cardEditAction'), + children: cardActionEditLabel, + }, + { + icon: 'trash', + onClick: () => { + onAction({ type: 'delete', item: artifactItem }); + }, + 'data-test-subj': getTestId('cardDeleteAction'), + children: cardActionDeleteLabel, + }, + ], + hideDescription: !artifactItem.description, + hideComments: !artifactItem.comments.length, + }; + } + + return cachedCardProps; + }, [ + items, + policies, + dataTestSubj, + getTestId, + cardActionEditLabel, + cardActionDeleteLabel, + onAction, + ]); + + return useCallback( + (artifactItem: ExceptionListItemSchema) => { + return artifactCardPropsPerItem[artifactItem.id]; + }, + [artifactCardPropsPerItem] + ); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_create_item.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_create_item.ts new file mode 100644 index 0000000000000..4252d66f2a510 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_create_item.ts @@ -0,0 +1,46 @@ +/* + * 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 { + CreateExceptionListItemSchema, + ExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { useMutation } from 'react-query'; +import { HttpFetchError } from 'kibana/public'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; + +// FIXME: delete entire file once PR# 125198 is merged. This entire file was copied from that pr + +export interface CallbackTypes { + onSuccess?: (updatedException: ExceptionListItemSchema) => void; + onError?: (error?: HttpFetchError) => void; + onSettled?: () => void; +} + +export function useCreateArtifact( + exceptionListApiClient: ExceptionsListApiClient, + callbacks: CallbackTypes = {} +) { + const { onSuccess = () => {}, onError = () => {}, onSettled = () => {} } = callbacks; + + return useMutation< + ExceptionListItemSchema, + HttpFetchError, + CreateExceptionListItemSchema, + () => void + >( + async (exception: CreateExceptionListItemSchema) => { + return exceptionListApiClient.create(exception); + }, + { + onSuccess, + onError, + onSettled: () => { + onSettled(); + }, + } + ); +} diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_delete_item.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_delete_item.ts new file mode 100644 index 0000000000000..feac0c2b0c599 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_delete_item.ts @@ -0,0 +1,89 @@ +/* + * 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 { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { useMutation, UseMutationResult } from 'react-query'; +import { i18n } from '@kbn/i18n'; +import { useMemo } from 'react'; +import type { HttpFetchError } from 'kibana/public'; +import { useToasts } from '../../../../common/lib/kibana'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; + +export const ARTIFACT_DELETE_ACTION_LABELS = Object.freeze({ + /** + * Message to be displayed in toast when deletion fails + * @param itemName + * @param errorMessage + * @example + * (itemsName, errorMessage) => i18n.translate( + * 'xpack.securitySolution.artifactListPage.deleteActionFailure', + * { + * defaultMessage: 'Unable to remove "{itemName}" . Reason: {errorMessage}', + * values: { itemName, errorMessage }, + * }) + */ + deleteActionFailure: (itemName: string, errorMessage: string) => + i18n.translate('xpack.securitySolution.artifactListPage.deleteActionFailure', { + defaultMessage: 'Unable to remove "{itemName}" . Reason: {errorMessage}', + values: { itemName, errorMessage }, + }), + + /** + * Message to be displayed in the toast after a successful delete + * @param itemName + * @example + * (itemName) => i18n.translate('xpack.securitySolution.some_page.deleteSuccess', { + * defaultMessage: '"{itemName}" has been removed', + * values: { itemName }, + * }) + */ + deleteActionSuccess: (itemName: string) => + i18n.translate('xpack.securitySolution.artifactListPage.deleteActionSuccess', { + defaultMessage: '"{itemName}" has been removed', + values: { itemName }, + }), +}); + +type UseArtifactDeleteItemMutationResult = UseMutationResult< + ExceptionListItemSchema, + HttpFetchError, + ExceptionListItemSchema +>; + +export type UseArtifactDeleteItemInterface = UseArtifactDeleteItemMutationResult & { + deleteArtifactItem: UseArtifactDeleteItemMutationResult['mutateAsync']; +}; + +export const useArtifactDeleteItem = ( + apiClient: ExceptionsListApiClient, + labels: typeof ARTIFACT_DELETE_ACTION_LABELS +): UseArtifactDeleteItemInterface => { + const toasts = useToasts(); + + const mutation = useMutation( + async (item: ExceptionListItemSchema) => { + return apiClient.delete(item.item_id); + }, + { + onError: (error: HttpFetchError, item) => { + toasts.addDanger( + labels.deleteActionFailure(item.name, error.body?.message || error.message) + ); + }, + onSuccess: (response) => { + toasts.addSuccess(labels.deleteActionSuccess(response.name)); + }, + } + ); + + return useMemo(() => { + return { + ...mutation, + deleteArtifactItem: mutation.mutateAsync, + }; + }, [mutation]); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_get_item.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_get_item.ts new file mode 100644 index 0000000000000..21b13aa285376 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_get_item.ts @@ -0,0 +1,28 @@ +/* + * 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 { useQuery } from 'react-query'; +import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { HttpFetchError } from 'kibana/public'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; + +export const useArtifactGetItem = ( + apiClient: ExceptionsListApiClient, + itemId: string, + enabled: boolean = true +) => { + return useQuery( + ['item', apiClient, itemId], + () => apiClient.get(itemId), + { + enabled, + refetchOnWindowFocus: false, + keepPreviousData: true, + retry: false, + } + ); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_update_item.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_update_item.ts new file mode 100644 index 0000000000000..a217da0159ed8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_update_item.ts @@ -0,0 +1,49 @@ +/* + * 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 { + UpdateExceptionListItemSchema, + ExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { useQueryClient, useMutation } from 'react-query'; +import { HttpFetchError } from 'kibana/public'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; + +// FIXME: delete entire file once PR# 125198 is merged. This entire file was copied from that pr + +export interface CallbackTypes { + onSuccess?: (updatedException: ExceptionListItemSchema) => void; + onError?: (error?: HttpFetchError) => void; + onSettled?: () => void; +} + +export function useUpdateArtifact( + exceptionListApiClient: ExceptionsListApiClient, + callbacks: CallbackTypes = {} +) { + const queryClient = useQueryClient(); + const { onSuccess = () => {}, onError = () => {}, onSettled = () => {} } = callbacks; + + return useMutation< + ExceptionListItemSchema, + HttpFetchError, + UpdateExceptionListItemSchema, + () => void + >( + async (exception: UpdateExceptionListItemSchema) => { + return exceptionListApiClient.update(exception); + }, + { + onSuccess, + onError, + onSettled: () => { + queryClient.invalidateQueries(['list', exceptionListApiClient]); + queryClient.invalidateQueries(['get', exceptionListApiClient]); + onSettled(); + }, + } + ); +} diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts new file mode 100644 index 0000000000000..08a51ca061fe0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts @@ -0,0 +1,23 @@ +/* + * 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 { useMemo } from 'react'; +import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { ArtifactFormComponentProps } from '../types'; +import { useUserPrivileges } from '../../../../common/components/user_privileges'; +import { isArtifactByPolicy } from '../../../../../common/endpoint/service/artifacts'; + +export const useIsArtifactAllowedPerPolicyUsage = ( + item: Pick, + mode: ArtifactFormComponentProps['mode'] +): boolean => { + const endpointAuthz = useUserPrivileges().endpointPrivileges; + + return useMemo(() => { + return mode === 'edit' && !endpointAuthz.canCreateArtifactsByPolicy && isArtifactByPolicy(item); + }, [endpointAuthz.canCreateArtifactsByPolicy, item, mode]); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts new file mode 100644 index 0000000000000..dc53a58924e83 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts @@ -0,0 +1,17 @@ +/* + * 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 { useMemo } from 'react'; +import { useUrlParams } from './use_url_params'; +import { ArtifactListPageUrlParams } from '../types'; + +const SHOW_VALUES: readonly string[] = ['create', 'edit']; + +export const useIsFlyoutOpened = (): boolean => { + const showUrlParamValue = useUrlParams().urlParams.show ?? ''; + return useMemo(() => SHOW_VALUES.includes(showUrlParamValue), [showUrlParamValue]); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts new file mode 100644 index 0000000000000..60923a26c694f --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts @@ -0,0 +1,23 @@ +/* + * 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 { useMemo } from 'react'; +import { parsePoliciesAndFilterToKql, parseQueryFilterToKQL } from '../../../common/utils'; +import { MaybeImmutable } from '../../../../../common/endpoint/types'; + +export const useKueryFromExceptionsSearchFilter = ( + filter: string | undefined, + fields: MaybeImmutable, + policies: string | undefined +): string | undefined => { + return useMemo(() => { + return parsePoliciesAndFilterToKql({ + kuery: parseQueryFilterToKQL(filter, fields), + policies: policies ? policies.split(',') : [], + }); + }, [fields, filter, policies]); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts new file mode 100644 index 0000000000000..80ffdeb253946 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts @@ -0,0 +1,36 @@ +/* + * 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 { useHistory, useLocation } from 'react-router-dom'; +import { useCallback } from 'react'; +import { pickBy } from 'lodash'; +import { useUrlParams } from './use_url_params'; + +// FIXME:PT delete/change once we get the common hook from @parkiino PR +export const useSetUrlParams = (): (( + /** Any param whose value is `undefined` will be removed from the URl when in append mode */ + params: Record, + replace?: boolean +) => void) => { + const location = useLocation(); + const history = useHistory(); + const { toUrlParams, urlParams: currentUrlParams } = useUrlParams(); + + return useCallback( + (params, replace = false) => { + history.push({ + ...location, + search: toUrlParams( + replace + ? params + : pickBy({ ...currentUrlParams, ...params }, (value) => value !== undefined) + ), + }); + }, + [currentUrlParams, history, location, toUrlParams] + ); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_url_params.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_url_params.ts new file mode 100644 index 0000000000000..7e1b8d16b3771 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_url_params.ts @@ -0,0 +1,25 @@ +/* + * 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 { useMemo } from 'react'; +import { useLocation } from 'react-router-dom'; +import { parse, stringify } from 'query-string'; + +// FIXME:PT delete and use common hook once @parkiino merges +export function useUrlParams>(): { + urlParams: T; + toUrlParams: (params?: T) => string; +} { + const { search } = useLocation(); + return useMemo(() => { + const urlParams = parse(search) as unknown as T; + return { + urlParams, + toUrlParams: (params: T = urlParams) => stringify(params as unknown as object), + }; + }, [search]); +} diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts new file mode 100644 index 0000000000000..3eca6c60bc711 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts @@ -0,0 +1,171 @@ +/* + * 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 { QueryObserverResult } from 'react-query'; +import type { FoundExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { useEffect, useMemo, useState } from 'react'; +import { Pagination } from '@elastic/eui'; +import { useQuery } from 'react-query'; +import type { ServerApiError } from '../../../../common/types'; +import { useIsMounted } from '../../hooks/use_is_mounted'; +import { + MANAGEMENT_DEFAULT_PAGE_SIZE, + MANAGEMENT_PAGE_SIZE_OPTIONS, +} from '../../../common/constants'; +import { useUrlParams } from './use_url_params'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; +import { ArtifactListPageUrlParams } from '../types'; +import { MaybeImmutable } from '../../../../../common/endpoint/types'; +import { useKueryFromExceptionsSearchFilter } from './use_kuery_from_exceptions_search_filter'; + +type WithArtifactListDataInterface = QueryObserverResult< + FoundExceptionListItemSchema, + ServerApiError +> & { + /** + * Set to true during initialization of the page until it can be determined if either data exists. + * This should drive the showing of the overall page loading state if set to `true` + */ + isPageInitializing: boolean; + + /** + * Indicates if the exception list has any data at all (regardless of filters the user might have used) + */ + doesDataExist: boolean; + + /** + * The UI pagination data based on the data retrieved for the list + */ + uiPagination: Pagination; +}; + +export const useWithArtifactListData = ( + apiClient: ExceptionsListApiClient, + searchableFields: MaybeImmutable +): WithArtifactListDataInterface => { + const isMounted = useIsMounted(); + + const { + urlParams: { + page = 1, + pageSize = MANAGEMENT_DEFAULT_PAGE_SIZE, + sortOrder, + sortField, + filter, + includedPolicies, + }, + } = useUrlParams(); + + const kuery = useKueryFromExceptionsSearchFilter(filter, searchableFields, includedPolicies); + + const { + data: doesDataExist, + isFetching: isLoadingDataExists, + refetch: checkIfDataExists, + } = useQuery( + ['does-data-exists', apiClient], + async () => apiClient.hasData(), + { + enabled: true, + keepPreviousData: true, + refetchOnWindowFocus: false, + } + ); + + const [uiPagination, setUiPagination] = useState({ + totalItemCount: 0, + pageSize, + pageSizeOptions: [...MANAGEMENT_PAGE_SIZE_OPTIONS], + pageIndex: page - 1, + }); + + const [isPageInitializing, setIsPageInitializing] = useState(true); + + const listDataRequest = useQuery( + ['list', apiClient, page, pageSize, sortField, sortField, kuery], + async () => apiClient.find({ page, perPage: pageSize, filter: kuery, sortField, sortOrder }), + { + enabled: true, + keepPreviousData: true, + refetchOnWindowFocus: false, + } + ); + + const { + data: listData, + isFetching: isLoadingListData, + error: listDataError, + isSuccess: isSuccessListData, + } = listDataRequest; + + // Once we know if data exists, update the page initializing state. + // This should only ever happen at most once; + useEffect(() => { + if (isMounted) { + if (isPageInitializing === true && !isLoadingDataExists) { + setIsPageInitializing(false); + } + } + }, [isLoadingDataExists, isMounted, isPageInitializing]); + + // Update the uiPagination once the query succeeds + useEffect(() => { + if (isMounted && listData && !isLoadingListData && isSuccessListData) { + setUiPagination((prevState) => { + return { + ...prevState, + pageIndex: listData.page - 1, + pageSize: listData.per_page, + totalItemCount: listData.total, + }; + }); + } + }, [isLoadingListData, isMounted, isSuccessListData, listData]); + + // Keep the `doesDataExist` updated if we detect that list data result total is zero. + // Anytime: + // 1. the list data total is 0 + // 2. and page is 1 + // 3. and filter is empty + // 4. and doesDataExists is currently set to true + // check if data exists again + useEffect(() => { + if ( + isMounted && + !isLoadingListData && + !listDataError && + listData && + listData.total === 0 && + String(page) === '1' && + !kuery && + doesDataExist + ) { + checkIfDataExists(); + } + }, [ + checkIfDataExists, + doesDataExist, + filter, + includedPolicies, + isLoadingListData, + isMounted, + kuery, + listData, + listDataError, + page, + ]); + + return useMemo( + () => ({ + isPageInitializing, + doesDataExist: doesDataExist ?? false, + uiPagination, + ...listDataRequest, + }), + [doesDataExist, isPageInitializing, listDataRequest, uiPagination] + ); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts new file mode 100644 index 0000000000000..59a2739c9d3af --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts @@ -0,0 +1,21 @@ +/* + * 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 { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; +import { ArtifactFormComponentProps } from '../types'; +import { useUpdateArtifact } from './use_artifact_update_item'; +import { useCreateArtifact } from './use_artifact_create_item'; + +export const useWithArtifactSubmitData = ( + apiClient: ExceptionsListApiClient, + mode: ArtifactFormComponentProps['mode'] +) => { + const artifactUpdater = useUpdateArtifact(apiClient); + const artifactCreator = useCreateArtifact(apiClient); + + return mode === 'create' ? artifactCreator : artifactUpdater; +}; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/index.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/index.ts new file mode 100644 index 0000000000000..ba26a44259021 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { ArtifactListPage } from './artifact_list_page'; +export type { ArtifactListPageProps } from './artifact_list_page'; +export * from './types'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/translations.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/translations.ts new file mode 100644 index 0000000000000..ba6acf8a359aa --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/translations.ts @@ -0,0 +1,123 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { ARTIFACT_FLYOUT_LABELS } from './components/artifact_flyout'; +import { ARTIFACT_DELETE_LABELS } from './components/artifact_delete_modal'; +import { ARTIFACT_DELETE_ACTION_LABELS } from './hooks/use_artifact_delete_item'; + +export const artifactListPageLabels = Object.freeze({ + // ------------------------------ + // PAGE labels + // ------------------------------ + pageTitle: i18n.translate('xpack.securitySolution.artifactListPage.pageTitle', { + defaultMessage: 'Artifact', + }), + pageAboutInfo: i18n.translate('xpack.securitySolution.artifactListPage.aboutInfo', { + defaultMessage: 'A list of artifacts for endpoint', + }), + pageAddButtonTitle: i18n.translate('xpack.securitySolution.artifactListPage.addButtonTitle', { + defaultMessage: 'Add artifact', + }), + + // ------------------------------ + // EMPTY state labels + // ------------------------------ + emptyStateTitle: i18n.translate('xpack.securitySolution.artifactListPage.emptyStateTitle', { + defaultMessage: 'Add your first artifact', + }), + emptyStateInfo: i18n.translate('xpack.securitySolution.artifactListPage.emptyStateInfo', { + defaultMessage: 'Add an artifact', + }), + emptyStatePrimaryButtonLabel: i18n.translate( + 'xpack.securitySolution.artifactListPage.emptyStatePrimaryButtonLabel', + { defaultMessage: 'Add' } + ), + + // ------------------------------ + // SEARCH BAR labels + // ------------------------------ + searchPlaceholderInfo: i18n.translate( + 'xpack.securitySolution.artifactListPage.searchPlaceholderInfo', + { + defaultMessage: 'Search on the fields below: name, description, comments, value', + } + ), + /** + * Return the label to show under the search bar with the total number of items that match the current filter (or all) + * @param total + * + * @example: + * (total) => i18n.translate('xpack.securitySolution.somepage.showingTotal', { + * defaultMessage: 'Showing {total} {total, plural, one {event filter} other {event filters}}', + * values: { total }, + * }) + */ + getShowingCountLabel: (total: number) => { + return i18n.translate('xpack.securitySolution.artifactListPage.showingTotal', { + defaultMessage: 'Showing {total, plural, one {# artifact} other {# artifacts}}', + values: { total }, + }); + }, + + // ------------------------------ + // CARD ACTIONS labels + // ------------------------------ + cardActionEditLabel: i18n.translate( + 'xpack.securitySolution.artifactListPage.cardActionEditLabel', + { + defaultMessage: 'Edit artifact', + } + ), + cardActionDeleteLabel: i18n.translate( + 'xpack.securitySolution.artifactListPage.cardActionDeleteLabel', + { + defaultMessage: 'Delete event filter', + } + ), + + // ------------------------------ + // ARTIFACT FLYOUT + // ------------------------------ + ...ARTIFACT_FLYOUT_LABELS, + + // ------------------------------ + // ARTIFACT DELETE MODAL + // ------------------------------ + ...ARTIFACT_DELETE_LABELS, + ...ARTIFACT_DELETE_ACTION_LABELS, +}); + +type IAllLabels = typeof artifactListPageLabels; + +/** + * The set of labels that normally have the artifact specific name in it, thus must be set for every page + */ +export type ArtifactListPageRequiredLabels = Pick< + IAllLabels, + | 'pageTitle' + | 'pageAboutInfo' + | 'pageAddButtonTitle' + | 'getShowingCountLabel' + | 'cardActionEditLabel' + | 'cardActionDeleteLabel' + | 'flyoutCreateTitle' + | 'flyoutEditTitle' + | 'flyoutCreateSubmitButtonLabel' + | 'flyoutCreateSubmitSuccess' + | 'flyoutEditSubmitSuccess' + | 'flyoutDowngradedLicenseDocsInfo' + | 'deleteActionSuccess' + | 'emptyStateTitle' + | 'emptyStateInfo' + | 'emptyStatePrimaryButtonLabel' +>; + +export type ArtifactListPageOptionalLabels = Omit; + +export type ArtifactListPageLabels = ArtifactListPageRequiredLabels & + Partial; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/types.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/types.ts new file mode 100644 index 0000000000000..fa63ebb863ce5 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/types.ts @@ -0,0 +1,40 @@ +/* + * 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 { HttpFetchError } from 'kibana/public'; +import type { + ExceptionListItemSchema, + CreateExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; + +export interface ArtifactListPageUrlParams { + page?: number; + pageSize?: number; + filter?: string; + includedPolicies?: string; + show?: 'create' | 'edit'; + itemId?: string; + sortField?: string; + sortOrder?: string; +} + +export interface ArtifactFormComponentProps { + item: ExceptionListItemSchema | CreateExceptionListItemSchema; + mode: 'edit' | 'create'; + /** signals that the form should be made disabled (ex. while an update/create api call is in flight) */ + disabled: boolean; + /** Error will be set if the submission of the form to the api results in an API error. Form can use it to provide feedback to the user */ + error: HttpFetchError | undefined; + + /** reports the state of the form data and the current updated item */ + onChange(formStatus: ArtifactFormComponentOnChangeCallbackProps): void; +} + +export interface ArtifactFormComponentOnChangeCallbackProps { + isValid: boolean; + item: ExceptionListItemSchema | CreateExceptionListItemSchema; +} diff --git a/x-pack/plugins/security_solution/public/management/components/hooks/use_is_mounted.ts b/x-pack/plugins/security_solution/public/management/components/hooks/use_is_mounted.ts new file mode 100644 index 0000000000000..c3ab4472cf429 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/components/hooks/use_is_mounted.ts @@ -0,0 +1,26 @@ +/* + * 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 { useEffect, useRef } from 'react'; + +/** + * Track when a comonent is mounted/unmounted. Good for use in async processing that may update + * a component's internal state. + */ +export const useIsMounted = (): boolean => { + const isMounted = useRef(false); + + useEffect(() => { + isMounted.current = true; + + return () => { + isMounted.current = false; + }; + }, []); + + return isMounted.current; +}; diff --git a/x-pack/plugins/security_solution/public/management/components/management_page_loader.tsx b/x-pack/plugins/security_solution/public/management/components/management_page_loader.tsx index cc1104127871f..20941c11b1593 100644 --- a/x-pack/plugins/security_solution/public/management/components/management_page_loader.tsx +++ b/x-pack/plugins/security_solution/public/management/components/management_page_loader.tsx @@ -9,7 +9,7 @@ import React, { memo } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; import { ManagementEmptyStateWrapper } from './management_empty_state_wrapper'; -export const ManagementPageLoader = memo<{ 'data-test-subj': string }>( +export const ManagementPageLoader = memo<{ 'data-test-subj'?: string }>( ({ 'data-test-subj': dataTestSubj }) => { return ( diff --git a/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx b/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx index b6a15c04b3b06..6e86c69c49750 100644 --- a/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx @@ -83,7 +83,7 @@ describe('Search exceptions', () => { }); expect(onSearchMock).toHaveBeenCalledTimes(1); - expect(onSearchMock).toHaveBeenCalledWith(expectedDefaultValue, ''); + expect(onSearchMock).toHaveBeenCalledWith(expectedDefaultValue, '', false); }); it('should dispatch search action when click on button', () => { @@ -96,7 +96,7 @@ describe('Search exceptions', () => { }); expect(onSearchMock).toHaveBeenCalledTimes(1); - expect(onSearchMock).toHaveBeenCalledWith(expectedDefaultValue, ''); + expect(onSearchMock).toHaveBeenCalledWith(expectedDefaultValue, '', true); }); it('should hide refresh button', () => { diff --git a/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx b/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx index 52eb8d1e7d4f1..7a7a28b4b0647 100644 --- a/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx +++ b/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx @@ -19,7 +19,14 @@ export interface SearchExceptionsProps { policyList?: ImmutableArray; defaultIncludedPolicies?: string; hideRefreshButton?: boolean; - onSearch(query: string, includedPolicies?: string): void; + onSearch( + /** The query string the user entered into the text field */ + query: string, + /** A list of policy id's comma delimited */ + includedPolicies: string | undefined, + /** Will be `true` if the user clicked the `refresh` button */ + refresh: boolean + ): void; } export const SearchExceptions = memo( @@ -45,7 +52,7 @@ export const SearchExceptions = memo( setIncludedPolicies(includePoliciesNew); - onSearch(query, includePoliciesNew); + onSearch(query, includePoliciesNew, false); }, [onSearch, query] ); @@ -55,13 +62,13 @@ export const SearchExceptions = memo( [setQuery] ); const handleOnSearch = useCallback( - () => onSearch(query, includedPolicies), + () => onSearch(query, includedPolicies, true), [onSearch, query, includedPolicies] ); const handleOnSearchQuery = useCallback( (value) => { - onSearch(value, includedPolicies); + onSearch(value, includedPolicies, false); }, [onSearch, includedPolicies] ); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx index a7bae8c1f37d6..152b2c3f0d690 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx @@ -51,19 +51,21 @@ describe('Bulk delete artifact hook', () => { expect(fakeHttpServices.delete).toHaveBeenCalledTimes(0); await act(async () => { - const res = await result.mutateAsync(['fakeId-1', 'fakeId-2']); + const res = await result.mutateAsync([{ id: 'fakeId-1' }, { itemId: 'fakeId-2' }]); expect(res).toEqual([exceptionItem1, exceptionItem2]); expect(onSuccessMock).toHaveBeenCalledTimes(1); expect(fakeHttpServices.delete).toHaveBeenCalledTimes(2); expect(fakeHttpServices.delete).toHaveBeenNthCalledWith(1, '/api/exception_lists/items', { query: { id: 'fakeId-1', + item_id: undefined, namespace_type: 'agnostic', }, }); expect(fakeHttpServices.delete).toHaveBeenNthCalledWith(2, '/api/exception_lists/items', { query: { - id: 'fakeId-2', + id: undefined, + item_id: 'fakeId-2', namespace_type: 'agnostic', }, }); @@ -90,7 +92,7 @@ describe('Bulk delete artifact hook', () => { await act(async () => { try { - await result.mutateAsync(['fakeId-1', 'fakeId-2']); + await result.mutateAsync([{ id: 'fakeId-1' }, { id: 'fakeId-2' }]); } catch (err) { expect(err).toBe(error); expect(fakeHttpServices.delete).toHaveBeenCalledTimes(2); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx index 5feda65996ea1..9957ff27d4bf9 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx @@ -10,25 +10,34 @@ import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types' import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +const DEFAULT_OPTIONS = Object.freeze({}); + export function useBulkDeleteArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions, + customOptions: UseQueryOptions = DEFAULT_OPTIONS, options: { concurrency: number; } = { concurrency: 5, } -): UseMutationResult void> { - return useMutation void>( - (exceptionIds: string[]) => { - return pMap( - exceptionIds, - (id) => { - return exceptionListApiClient.delete(id); - }, - options - ); - }, - customOptions - ); +): UseMutationResult< + ExceptionListItemSchema[], + HttpFetchError, + Array<{ itemId?: string; id?: string }>, + () => void +> { + return useMutation< + ExceptionListItemSchema[], + HttpFetchError, + Array<{ itemId?: string; id?: string }>, + () => void + >((exceptionIds: Array<{ itemId?: string; id?: string }>) => { + return pMap( + exceptionIds, + ({ itemId, id }) => { + return exceptionListApiClient.delete(itemId, id); + }, + options + ); + }, customOptions); } diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx index 181fe6dc9d7d5..b4854209fa07b 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx @@ -13,9 +13,11 @@ import { import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +const DEFAULT_OPTIONS = Object.freeze({}); + export function useBulkUpdateArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions, + customOptions: UseQueryOptions = DEFAULT_OPTIONS, options: { concurrency: number; } = { diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx index 346c4f7b42a87..74aa6752f371c 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx @@ -12,9 +12,11 @@ import { HttpFetchError } from 'kibana/public'; import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +const DEFAULT_OPTIONS = Object.freeze({}); + export function useCreateArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions + customOptions: UseQueryOptions = DEFAULT_OPTIONS ): UseMutationResult< ExceptionListItemSchema, HttpFetchError, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx index 8d31ce8f059bb..bed3faf237b9f 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx @@ -49,7 +49,7 @@ describe('Delete artifact hook', () => { expect(fakeHttpServices.delete).toHaveBeenCalledTimes(0); await act(async () => { - const res = await result.mutateAsync('fakeId'); + const res = await result.mutateAsync({ id: 'fakeId' }); expect(res).toBe(exceptionItem); expect(onSuccessMock).toHaveBeenCalledTimes(1); expect(fakeHttpServices.delete).toHaveBeenCalledTimes(1); @@ -82,7 +82,7 @@ describe('Delete artifact hook', () => { await act(async () => { try { - await result.mutateAsync('fakeId'); + await result.mutateAsync({ itemId: 'fakeId' }); } catch (err) { expect(err).toBe(error); expect(fakeHttpServices.delete).toHaveBeenCalledTimes(1); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx index 27820c73b740a..e072eecb06130 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx @@ -9,11 +9,23 @@ import { HttpFetchError } from 'kibana/public'; import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +const DEFAULT_OPTIONS = Object.freeze({}); + export function useDeleteArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions -): UseMutationResult void> { - return useMutation void>((id: string) => { - return exceptionListApiClient.delete(id); + customOptions: UseQueryOptions = DEFAULT_OPTIONS +): UseMutationResult< + ExceptionListItemSchema, + HttpFetchError, + { itemId?: string; id?: string }, + () => void +> { + return useMutation< + ExceptionListItemSchema, + HttpFetchError, + { itemId?: string; id?: string }, + () => void + >(({ itemId, id }) => { + return exceptionListApiClient.delete(itemId, id); }, customOptions); } diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx index 70f9620c6edc9..470f29b563f67 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx @@ -39,7 +39,7 @@ describe('Get artifact hook', () => { result = await renderQuery( () => - useGetArtifact(instance, 'fakeId', { + useGetArtifact(instance, 'fakeId', undefined, { onSuccess: onSuccessMock, retry: false, }), @@ -50,7 +50,7 @@ describe('Get artifact hook', () => { expect(fakeHttpServices.get).toHaveBeenCalledTimes(1); expect(fakeHttpServices.get).toHaveBeenCalledWith('/api/exception_lists/items', { query: { - id: 'fakeId', + item_id: 'fakeId', namespace_type: 'agnostic', }, }); @@ -69,7 +69,7 @@ describe('Get artifact hook', () => { result = await renderQuery( () => - useGetArtifact(instance, 'fakeId', { + useGetArtifact(instance, undefined, 'fakeId', { onError: onErrorMock, retry: false, }), diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx index bc27ba285ccb3..676c424e1a278 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx @@ -9,15 +9,18 @@ import { HttpFetchError } from 'kibana/public'; import { QueryObserverResult, useQuery, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +const DEFAULT_OPTIONS = Object.freeze({}); + export function useGetArtifact( exceptionListApiClient: ExceptionsListApiClient, - id: string, - customQueryOptions: UseQueryOptions + itemId?: string, + id?: string, + customQueryOptions: UseQueryOptions = DEFAULT_OPTIONS ): QueryObserverResult { return useQuery( - ['get', exceptionListApiClient, id], + ['get', exceptionListApiClient, itemId, id], () => { - return exceptionListApiClient.get(id); + return exceptionListApiClient.get(itemId, id); }, { refetchIntervalInBackground: false, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx index a972096bb600c..54acea6489574 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx @@ -12,9 +12,11 @@ import { HttpFetchError } from 'kibana/public'; import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; +const DEFAULT_OPTIONS = Object.freeze({}); + export function useUpdateArtifact( exceptionListApiClient: ExceptionsListApiClient, - customQueryOptions: UseQueryOptions + customQueryOptions: UseQueryOptions = DEFAULT_OPTIONS ): UseMutationResult< ExceptionListItemSchema, HttpFetchError, diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts b/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts new file mode 100644 index 0000000000000..3fb68e4171597 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts @@ -0,0 +1,26 @@ +/* + * 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 { + ExceptionListType, + ExceptionListTypeEnum, + CreateExceptionListSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION, + ENDPOINT_BLOCKLISTS_LIST_ID, + ENDPOINT_BLOCKLISTS_LIST_NAME, +} from '@kbn/securitysolution-list-constants'; + +export const BLOCKLISTS_LIST_TYPE: ExceptionListType = ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS; + +export const BLOCKLISTS_LIST_DEFINITION: CreateExceptionListSchema = { + name: ENDPOINT_BLOCKLISTS_LIST_NAME, + namespace_type: 'agnostic', + description: ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION, + list_id: ENDPOINT_BLOCKLISTS_LIST_ID, + type: BLOCKLISTS_LIST_TYPE, +}; diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts b/x-pack/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts new file mode 100644 index 0000000000000..fa0451d9363ad --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts @@ -0,0 +1,26 @@ +/* + * 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 { ENDPOINT_BLOCKLISTS_LIST_ID } from '@kbn/securitysolution-list-constants'; +import { HttpStart } from 'kibana/public'; +import { ExceptionsListApiClient } from '../../../services/exceptions_list/exceptions_list_api_client'; +import { BLOCKLISTS_LIST_DEFINITION } from '../constants'; + +/** + * Blocklist exceptions Api client class using ExceptionsListApiClient as base class + * It follow the Singleton pattern. + * Please, use the getInstance method instead of creating a new instance when using this implementation. + */ +export class BlocklistsApiClient extends ExceptionsListApiClient { + constructor(http: HttpStart) { + super(http, ENDPOINT_BLOCKLISTS_LIST_ID, BLOCKLISTS_LIST_DEFINITION); + } + + public static getInstance(http: HttpStart): ExceptionsListApiClient { + return super.getInstance(http, ENDPOINT_BLOCKLISTS_LIST_ID, BLOCKLISTS_LIST_DEFINITION); + } +} diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/services/index.ts b/x-pack/plugins/security_solution/public/management/pages/blocklist/services/index.ts new file mode 100644 index 0000000000000..002093007329d --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/services/index.ts @@ -0,0 +1,8 @@ +/* + * 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 './blocklists_api_client'; diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx index 37f4004ba9174..2dab6a8fd497a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx @@ -5,10 +5,9 @@ * 2.0. */ -import { act } from '@testing-library/react'; +import { act, waitFor } from '@testing-library/react'; import React from 'react'; import { BLOCKLIST_PATH } from '../../../../../common/constants'; -import { useUserPrivileges as _useUserPrivileges } from '../../../../common/components/user_privileges'; import { AppContextTestRender, createAppRootMockRenderer } from '../../../../common/mock/endpoint'; import { Blocklist } from './blocklist'; @@ -28,12 +27,12 @@ describe('When on the blocklist page', () => { }); }); - describe('When on the blocklist list page', () => { - describe('And no data exists', () => { - it('should show the Empty message', async () => { - render(); - expect(renderResult.getByTestId('blocklistEmpty')).toBeTruthy(); - }); + describe('And no data exists', () => { + it('should show the Empty message', async () => { + render(); + await waitFor(() => + expect(renderResult.getByTestId('blocklistPage-emptyState')).toBeTruthy() + ); }); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx index ab96451f0cd25..8d98b401102f1 100644 --- a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx @@ -5,80 +5,128 @@ * 2.0. */ -import React, { memo, useMemo } from 'react'; -import { useLocation } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiButton } from '@elastic/eui'; -import { AdministrationListPage } from '../../../components/administration_list_page'; -import { ListPageRouteState } from '../../../../../common/endpoint/types'; -import { useMemoizedRouteState } from '../../../common/hooks'; -import { BackToExternalAppButton } from '../../../components/back_to_external_app_button'; -import { BlocklistEmptyState } from './components/empty'; -import { BackToExternalAppSecondaryButton } from '../../../components/back_to_external_app_secondary_button'; +import React, { memo } from 'react'; +import { i18n } from '@kbn/i18n'; +import { useHttp } from '../../../../common/lib/kibana'; +import { ArtifactListPage, ArtifactListPageProps } from '../../../components/artifact_list_page'; +import { BlocklistsApiClient } from '../services'; -export const Blocklist = memo(() => { - const { state: routeState } = useLocation(); - const memoizedRouteState = useMemoizedRouteState(routeState); +// FIXME:PT delete this when real component is implemented +const TempDevFormComponent: ArtifactListPageProps['ArtifactFormComponent'] = (props) => { + // For Dev. Delete once we implement this component + // @ts-ignore + if (!window._dev_artifact_form_props) { + // @ts-ignore + window._dev_artifact_form_props = []; + // @ts-ignore + window.console.log(window._dev_artifact_form_props); + } + // @ts-ignore + window._dev_artifact_form_props.push(props); - const backButtonEmptyComponent = useMemo(() => { - if (memoizedRouteState && memoizedRouteState.onBackButtonNavigateTo) { - return ; - } - }, [memoizedRouteState]); + return ( +
+
+ {props.error ? props.error?.body?.message || props.error : ''} +
+ {`TODO: ${props.mode} Form here`} +
+ ); +}; - const backButtonHeaderComponent = useMemo(() => { - if (memoizedRouteState && memoizedRouteState.onBackButtonNavigateTo) { - return ; - } - }, [memoizedRouteState]); +const BLOCKLIST_PAGE_LABELS: ArtifactListPageProps['labels'] = { + pageTitle: i18n.translate('xpack.securitySolution.blocklist.pageTitle', { + defaultMessage: 'Blocklist', + }), + pageAboutInfo: i18n.translate('xpack.securitySolution.blocklist.pageAboutInfo', { + defaultMessage: 'Add a blocklist to block applications or files from running.', + }), + pageAddButtonTitle: i18n.translate('xpack.securitySolution.blocklist.pageAddButtonTitle', { + defaultMessage: 'Add blocklist entry', + }), + getShowingCountLabel: (total) => + i18n.translate('xpack.securitySolution.blocklist.showingTotal', { + defaultMessage: 'Showing {total} {total, plural, one {blocklist} other {blocklists}}', + values: { total }, + }), + cardActionEditLabel: i18n.translate('xpack.securitySolution.blocklist.cardActionEditLabel', { + defaultMessage: 'Edit blocklist', + }), + cardActionDeleteLabel: i18n.translate('xpack.securitySolution.blocklist.cardActionDeleteLabel', { + defaultMessage: 'Delete blocklist', + }), + flyoutCreateTitle: i18n.translate('xpack.securitySolution.blocklist.flyoutCreateTitle', { + defaultMessage: 'Add blocklist', + }), + flyoutEditTitle: i18n.translate('xpack.securitySolution.blocklist.flyoutEditTitle', { + defaultMessage: 'Edit blocklist', + }), + flyoutCreateSubmitButtonLabel: i18n.translate( + 'xpack.securitySolution.blocklist.flyoutCreateSubmitButtonLabel', + { defaultMessage: 'Add blocklist' } + ), + flyoutCreateSubmitSuccess: ({ name }) => + i18n.translate('xpack.securitySolution.blocklist.flyoutCreateSubmitSuccess', { + defaultMessage: '"{name}" has been added to your blocklist.', // FIXME: match this to design (needs count of items) + values: { name }, + }), + flyoutEditSubmitSuccess: ({ name }) => + i18n.translate('xpack.securitySolution.blocklist.flyoutEditSubmitSuccess', { + defaultMessage: '"{name}" has been updated.', + values: { name }, + }), + flyoutDowngradedLicenseDocsInfo: () => { + return 'tbd...'; + // FIXME: define docs link for license downgrade message. sample code below - const hasDataToShow = false; + // const { docLinks } = useKibana().services; + // return ( + // + // {' '} + // {' '} + // + // ), + // }} + // /> + // ); + }, + deleteActionSuccess: (itemName) => + i18n.translate('xpack.securitySolution.blocklist.deleteSuccess', { + defaultMessage: '"{itemName}" has been removed from blocklist.', + values: { itemName }, + }), + emptyStateTitle: i18n.translate('xpack.securitySolution.blocklist.emptyStateTitle', { + defaultMessage: 'Add your first blocklist', + }), + emptyStateInfo: i18n.translate( + 'xpack.securitySolution.blocklist.emptyStateInfo', + { defaultMessage: 'Add a blocklist to prevent execution on the endpoint' } // FIXME: need wording here form PM + ), + emptyStatePrimaryButtonLabel: i18n.translate( + 'xpack.securitySolution.blocklist.emptyStatePrimaryButtonLabel', + { defaultMessage: 'Add blocklist' } + ), +}; - const handleAddButtonClick = () => {}; +export const Blocklist = memo(() => { + const http = useHttp(); + const blocklistsApiClient = BlocklistsApiClient.getInstance(http); return ( - - } - subtitle={ - - } - actions={ - hasDataToShow ? ( - - - - ) : ( - [] - ) - } - hideHeader={!hasDataToShow} - > - {hasDataToShow ? ( -

{'Data, search bar, etc here'}

- ) : ( - - )} -
+ ); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/empty.tsx b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/empty.tsx deleted file mode 100644 index bd1d01b73ec8d..0000000000000 --- a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/empty.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 React, { memo } from 'react'; -import styled, { css } from 'styled-components'; -import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { ManagementEmptyStateWrapper } from '../../../../components/management_empty_state_wrapper'; - -const EmptyPrompt = styled(EuiEmptyPrompt)` - ${() => css` - max-width: 100%; - `} -`; - -export const BlocklistEmptyState = memo<{ - onAdd: () => void; - backComponent?: React.ReactNode; -}>(({ onAdd, backComponent }) => { - return ( - - - - - } - body={ - - } - actions={[ - - - , - - ...(backComponent ? [backComponent] : []), - ]} - /> - - ); -}); - -BlocklistEmptyState.displayName = 'BlocklistEmptyState'; diff --git a/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts b/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts index 347f1dc088c10..c92dcc0bd7cc4 100644 --- a/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts +++ b/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts @@ -33,7 +33,10 @@ import { fleetGetEndpointPackagePolicyListHttpMock, FleetGetEndpointPackagePolicyListHttpMockInterface, } from './fleet_mocks'; -import { BY_POLICY_ARTIFACT_TAG_PREFIX } from '../../../../common/endpoint/service/artifacts/constants'; +import { + BY_POLICY_ARTIFACT_TAG_PREFIX, + GLOBAL_ARTIFACT_TAG, +} from '../../../../common/endpoint/service/artifacts/constants'; interface FindExceptionListItemSchemaQueryParams extends Omit { @@ -58,7 +61,11 @@ export const trustedAppsGetListHttpMocks = const generator = new ExceptionsListItemGenerator('seed'); const perPage = apiQueryParams.per_page ?? 10; const data = Array.from({ length: Math.min(perPage, 50) }, () => - generator.generate({ list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, os_types: ['windows'] }) + generator.generate({ + list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, + os_types: ['windows'], + tags: [GLOBAL_ARTIFACT_TAG], + }) ); // FIXME: remove hard-coded IDs below adn get them from the new FleetPackagePolicyGenerator (#2262) @@ -130,6 +137,7 @@ export const trustedAppsGetOneHttpMocks = const apiQueryParams = query as ReadExceptionListItemSchema; const exceptionItem = new ExceptionsListItemGenerator('seed').generate({ os_types: ['windows'], + tags: [GLOBAL_ARTIFACT_TAG], }); exceptionItem.item_id = apiQueryParams.item_id ?? exceptionItem.item_id; @@ -157,7 +165,10 @@ export const trustedAppPostHttpMocks = httpHandlerMockFactory { mockedApis = trustedAppsAllHttpMocks(mockedContext.coreStart.http); getState = () => mockedContext.store.getState().management.policyDetails; render = () => mockedContext.render(); + + const getTaListApiResponseMock = + mockedApis.responseProvider.trustedAppsList.getMockImplementation(); + mockedApis.responseProvider.trustedAppsList.mockImplementation((options) => { + const response = getTaListApiResponseMock!(options); + response.data = response.data.filter((ta) => isArtifactByPolicy(ta)); + return response; + }); }); afterEach(() => reactTestingLibrary.cleanup()); @@ -97,7 +106,7 @@ describe('Policy trusted apps flyout', () => { }); expect(component.getByTestId('confirmPolicyTrustedAppsFlyout')).not.toBeNull(); - expect(component.getByTestId('Generated Exception (u6kh2)_checkbox')).not.toBeNull(); + expect(component.getByTestId('Generated Exception (nng74)_checkbox')).not.toBeNull(); }); it('should confirm flyout action', async () => { @@ -111,7 +120,7 @@ describe('Policy trusted apps flyout', () => { }); // TA name below in the selector matches the 3rd generated trusted app which is policy specific - const tACardCheckbox = component.getByTestId('Generated Exception (3xnng)_checkbox'); + const tACardCheckbox = component.getByTestId('Generated Exception (nng74)_checkbox'); act(() => { fireEvent.click(tACardCheckbox); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx index 172b5218188c6..676080d180a6a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx @@ -214,7 +214,7 @@ describe('When using the RemoveTrustedAppFromPolicyModal component', () => { await clickConfirmButton(true, true); expect(appTestContext.coreStart.notifications.toasts.addSuccess).toHaveBeenCalledWith({ - text: '"Generated Exception (3xnng)" has been removed from Endpoint Policy policy', + text: '"Generated Exception (nng74)" has been removed from Endpoint Policy policy', title: 'Successfully removed', }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx index 73d85077e9579..82169fcd19c10 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx @@ -219,7 +219,7 @@ describe('When on the Trusted Apps Page', () => { it('should persist edit params to url', () => { expect(history.location.search).toEqual( - '?show=edit&id=2d95bec3-b48f-4db7-9622-a2b061cc031d' + '?show=edit&id=bec3b48f-ddb7-4622-a2b0-61cc031d17eb' ); }); @@ -251,7 +251,7 @@ describe('When on the Trusted Apps Page', () => { 'addTrustedAppFlyout-createForm-descriptionField' ) as HTMLTextAreaElement; - expect(formNameInput.value).toEqual('Generated Exception (3xnng)'); + expect(formNameInput.value).toEqual('Generated Exception (nng74)'); expect(formDescriptionInput.value).toEqual('created by ExceptionListItemGenerator'); }); @@ -276,8 +276,8 @@ describe('When on the Trusted Apps Page', () => { expect(lastCallToPut[0]).toEqual('/api/exception_lists/items'); expect(JSON.parse(lastCallToPut[1].body as string)).toEqual({ - _version: '3o9za', - name: 'Generated Exception (3xnng)', + _version: '9zawi', + name: 'Generated Exception (nng74)', description: 'created by ExceptionListItemGenerator', entries: [ { @@ -300,7 +300,7 @@ describe('When on the Trusted Apps Page', () => { ], id: '05b5e350-0cad-4dc3-a61d-6e6796b0af39', comments: [], - item_id: '2d95bec3-b48f-4db7-9622-a2b061cc031d', + item_id: 'bec3b48f-ddb7-4622-a2b0-61cc031d17eb', namespace_type: 'agnostic', type: 'simple', }); diff --git a/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts b/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts index 21a50079a1f1f..e5c8d110b63f2 100644 --- a/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts +++ b/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts @@ -165,7 +165,8 @@ describe('Exceptions List Api Client', () => { expect(fakeHttpServices.get).toHaveBeenCalledTimes(1); expect(fakeHttpServices.get).toHaveBeenCalledWith(EXCEPTION_LIST_ITEM_URL, { query: { - id: fakeItemId, + item_id: fakeItemId, + id: undefined, namespace_type: 'agnostic', }, }); @@ -222,7 +223,8 @@ describe('Exceptions List Api Client', () => { expect(fakeHttpServices.delete).toHaveBeenCalledTimes(1); expect(fakeHttpServices.delete).toHaveBeenCalledWith(EXCEPTION_LIST_ITEM_URL, { query: { - id: fakeItemId, + item_id: fakeItemId, + id: undefined, namespace_type: 'agnostic', }, }); @@ -243,5 +245,32 @@ describe('Exceptions List Api Client', () => { }, }); }); + + it('hasData method returns true when list has data', async () => { + fakeHttpServices.get.mockResolvedValue({ + total: 1, + }); + + const exceptionsListApiClientInstance = getInstance(); + + await expect(exceptionsListApiClientInstance.hasData()).resolves.toBe(true); + + expect(fakeHttpServices.get).toHaveBeenCalledWith(`${EXCEPTION_LIST_ITEM_URL}/_find`, { + query: expect.objectContaining({ + page: 1, + per_page: 1, + }), + }); + }); + + it('hasData method returns false when list has no data', async () => { + fakeHttpServices.get.mockResolvedValue({ + total: 0, + }); + + const exceptionsListApiClientInstance = getInstance(); + + await expect(exceptionsListApiClientInstance.hasData()).resolves.toBe(false); + }); }); }); diff --git a/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts b/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts index 6edf55e569d35..c995754dd1907 100644 --- a/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts +++ b/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts @@ -30,7 +30,7 @@ export class ExceptionsListApiClient { constructor( private readonly http: HttpStart, - private readonly listId: ListId, + public readonly listId: ListId, private readonly listDefinition: CreateExceptionListSchema ) { this.ensureListExists = this.createExceptionList(); @@ -166,14 +166,19 @@ export class ExceptionsListApiClient { } /** - * Returns an item filtered by id - * It requires an id in order to get the desired item + * Returns an item for the given `itemId` or `id`. Exception List Items have both an `item_id` + * and `id`, and at least one of these two is required to be provided. */ - async get(id: string): Promise { + async get(itemId?: string, id?: string): Promise { + if (!itemId && !id) { + throw TypeError('either `itemId` or `id` argument must be set'); + } + await this.ensureListExists; return this.http.get(EXCEPTION_LIST_ITEM_URL, { query: { id, + item_id: itemId, namespace_type: 'agnostic', }, }); @@ -204,14 +209,19 @@ export class ExceptionsListApiClient { } /** - * It deletes an existing item. - * It requires a valid item id. + * It deletes an existing item by `itemId` or `id`. Exception List Items have both an `item_id` + * and `id`, and at least one of these two is required to be provided. */ - async delete(id: string): Promise { + async delete(itemId?: string, id?: string): Promise { + if (!itemId && !id) { + throw TypeError('either `itemId` or `id` argument must be set'); + } + await this.ensureListExists; return this.http.delete(EXCEPTION_LIST_ITEM_URL, { query: { id, + item_id: itemId, namespace_type: 'agnostic', }, }); @@ -231,4 +241,11 @@ export class ExceptionsListApiClient { }, }); } + + /** + * Checks if the given list has any data in it + */ + async hasData(): Promise { + return (await this.find({ perPage: 1, page: 1 })).total > 0; + } } diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx b/x-pack/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx index ee12c12536af5..b85a4509206b2 100644 --- a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx @@ -15,6 +15,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; +import styled from 'styled-components'; import { RecentTimelineHeader } from './header'; import { OnOpenTimeline, @@ -32,6 +33,15 @@ interface RecentTimelinesItemProps { isLastItem: boolean; } +const ClampText = styled.div` + /* Clamp text content to 3 lines */ + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + word-break: break-word; +`; + const RecentTimelinesItem = React.memo( ({ timeline, onOpenTimeline, isLastItem }) => { const handleClick = useCallback( @@ -55,7 +65,7 @@ const RecentTimelinesItem = React.memo( {timeline.description && timeline.description.length && ( - {timeline.description} + {timeline.description} )} diff --git a/x-pack/plugins/security_solution/public/users/jest.config.js b/x-pack/plugins/security_solution/public/users/jest.config.js new file mode 100644 index 0000000000000..563491dd5befe --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/plugins/security_solution/public/users'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/users', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/security_solution/public/users/**/*.{ts,tsx}'], + // See: https://github.com/elastic/kibana/issues/117255, the moduleNameMapper creates mocks to avoid memory leaks from kibana core. + moduleNameMapper: { + 'core/server$': '/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts', + 'task_manager/server$': + '/x-pack/plugins/security_solution/server/__mocks__/task_manager.mock.ts', + 'alerting/server$': '/x-pack/plugins/security_solution/server/__mocks__/alert.mock.ts', + 'actions/server$': '/x-pack/plugins/security_solution/server/__mocks__/action.mock.ts', + }, +}; diff --git a/x-pack/plugins/security_solution/public/users/pages/constants.ts b/x-pack/plugins/security_solution/public/users/pages/constants.ts index bb273bf479aec..48c2937657721 100644 --- a/x-pack/plugins/security_solution/public/users/pages/constants.ts +++ b/x-pack/plugins/security_solution/public/users/pages/constants.ts @@ -10,6 +10,6 @@ import { UsersTableType } from '../store/model'; export const usersDetailsPagePath = `${USERS_PATH}/:detailName`; -export const usersTabPath = `${USERS_PATH}/:tabName(${UsersTableType.allUsers})`; +export const usersTabPath = `${USERS_PATH}/:tabName(${UsersTableType.allUsers}|${UsersTableType.anomalies})`; export const usersDetailsTabPath = `${usersDetailsPagePath}/:tabName(${UsersTableType.allUsers})`; diff --git a/x-pack/plugins/security_solution/public/users/pages/details/nav_tabs.tsx b/x-pack/plugins/security_solution/public/users/pages/details/nav_tabs.tsx index 2eff1efb85789..ddff8109daf24 100644 --- a/x-pack/plugins/security_solution/public/users/pages/details/nav_tabs.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/details/nav_tabs.tsx @@ -17,7 +17,7 @@ export const navTabsUsersDetails = (hostName: string): UsersDetailsNavTab => { return { [UsersTableType.allUsers]: { id: UsersTableType.allUsers, - name: i18n.ALL_USERS_TITLE, + name: i18n.NAVIGATION_ALL_USERS_TITLE, href: getTabsOnUsersDetailsUrl(hostName, UsersTableType.allUsers), disabled: false, }, diff --git a/x-pack/plugins/security_solution/public/users/pages/details/utils.ts b/x-pack/plugins/security_solution/public/users/pages/details/utils.ts index d69cac731df3e..f490e3e46914e 100644 --- a/x-pack/plugins/security_solution/public/users/pages/details/utils.ts +++ b/x-pack/plugins/security_solution/public/users/pages/details/utils.ts @@ -21,7 +21,8 @@ import { SecurityPageName } from '../../../app/types'; export const type = usersModel.UsersType.details; const TabNameMappedToI18nKey: Record = { - [UsersTableType.allUsers]: i18n.ALL_USERS_TITLE, + [UsersTableType.allUsers]: i18n.NAVIGATION_ALL_USERS_TITLE, + [UsersTableType.anomalies]: i18n.NAVIGATION_ANOMALIES_TITLE, }; export const getBreadcrumbs = ( diff --git a/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx b/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx index efe8447b9b71b..beffcb879cea0 100644 --- a/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx @@ -15,8 +15,14 @@ const getTabsOnUsersUrl = (tabName: UsersTableType) => `${USERS_PATH}/${tabName} export const navTabsUsers: UsersNavTab = { [UsersTableType.allUsers]: { id: UsersTableType.allUsers, - name: i18n.ALL_USERS_TITLE, + name: i18n.NAVIGATION_ALL_USERS_TITLE, href: getTabsOnUsersUrl(UsersTableType.allUsers), disabled: false, }, + [UsersTableType.anomalies]: { + id: UsersTableType.anomalies, + name: i18n.NAVIGATION_ANOMALIES_TITLE, + href: getTabsOnUsersUrl(UsersTableType.anomalies), + disabled: false, + }, }; diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/types.ts b/x-pack/plugins/security_solution/public/users/pages/navigation/types.ts index b965dc914d513..53f7c74871084 100644 --- a/x-pack/plugins/security_solution/public/users/pages/navigation/types.ts +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/types.ts @@ -10,7 +10,7 @@ import { ESTermQuery } from '../../../../common/typed_json'; import { DocValueFields } from '../../../../../timelines/common'; import { NavTab } from '../../../common/components/navigation/types'; -type KeyUsersNavTab = UsersTableType.allUsers; +type KeyUsersNavTab = UsersTableType.allUsers | UsersTableType.anomalies; export type UsersNavTab = Record; export interface QueryTabBodyProps { diff --git a/x-pack/plugins/security_solution/public/users/pages/translations.ts b/x-pack/plugins/security_solution/public/users/pages/translations.ts index bfcd29be4236c..4bcfc01e41706 100644 --- a/x-pack/plugins/security_solution/public/users/pages/translations.ts +++ b/x-pack/plugins/security_solution/public/users/pages/translations.ts @@ -11,6 +11,16 @@ export const PAGE_TITLE = i18n.translate('xpack.securitySolution.users.pageTitle defaultMessage: 'Users', }); -export const ALL_USERS_TITLE = i18n.translate('xpack.securitySolution.users.allUsers', { - defaultMessage: 'All users', -}); +export const NAVIGATION_ALL_USERS_TITLE = i18n.translate( + 'xpack.securitySolution.users.navigation.allUsersTitle', + { + defaultMessage: 'All users', + } +); + +export const NAVIGATION_ANOMALIES_TITLE = i18n.translate( + 'xpack.securitySolution.users.navigation.anomaliesTitle', + { + defaultMessage: 'Anomalies', + } +); diff --git a/x-pack/plugins/security_solution/public/users/pages/users_tabs.test.tsx b/x-pack/plugins/security_solution/public/users/pages/users_tabs.test.tsx new file mode 100644 index 0000000000000..bd4ce3cbae1e3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/pages/users_tabs.test.tsx @@ -0,0 +1,79 @@ +/* + * 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 { mount } from 'enzyme'; +import React from 'react'; +import { Router } from 'react-router-dom'; + +import '../../common/mock/match_media'; +import { TestProviders } from '../../common/mock'; +import { SecuritySolutionTabNavigation } from '../../common/components/navigation'; +import { Users } from './users'; +import { useSourcererDataView } from '../../common/containers/sourcerer'; + +jest.mock('../../common/containers/sourcerer'); +jest.mock('../../common/components/search_bar', () => ({ + SiemSearchBar: () => null, +})); +jest.mock('../../common/components/query_bar', () => ({ + QueryBar: () => null, +})); + +type Action = 'PUSH' | 'POP' | 'REPLACE'; +const pop: Action = 'POP'; +const location = { + pathname: '/network', + search: '', + state: '', + hash: '', +}; +const mockHistory = { + length: 2, + location, + action: pop, + push: jest.fn(), + replace: jest.fn(), + go: jest.fn(), + goBack: jest.fn(), + goForward: jest.fn(), + block: jest.fn(), + createHref: jest.fn(), + listen: jest.fn(), +}; +const mockUseSourcererDataView = useSourcererDataView as jest.Mock; +describe('Users - rendering', () => { + test('it renders the Setup Instructions text when no index is available', async () => { + mockUseSourcererDataView.mockReturnValue({ + indicesExist: false, + }); + + const wrapper = mount( + + + + + + ); + expect(wrapper.find('[data-test-subj="empty-page"]').exists()).toBe(true); + }); + + test('it should render tab navigation', async () => { + mockUseSourcererDataView.mockReturnValue({ + indicesExist: true, + indexPattern: {}, + }); + + const wrapper = mount( + + + + + + ); + expect(wrapper.find(SecuritySolutionTabNavigation).exists()).toBe(true); + }); +}); diff --git a/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx b/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx index a2de4d2f49ea7..2db83c5d75aea 100644 --- a/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx @@ -5,18 +5,22 @@ * 2.0. */ -import React, { memo } from 'react'; +import React, { memo, useCallback } from 'react'; import { Route, Switch } from 'react-router-dom'; import { UsersTabsProps } from './types'; import { UsersTableType } from '../store/model'; import { USERS_PATH } from '../../../common/constants'; import { AllUsersQueryTabBody } from './navigation'; +import { AnomaliesQueryTabBody } from '../../common/containers/anomalies/anomalies_query_tab_body'; +import { AnomaliesUserTable } from '../../common/components/ml/tables/anomalies_user_table'; +import { Anomaly } from '../../common/components/ml/types'; +import { scoreIntervalToDateTime } from '../../common/components/ml/score/score_interval_to_datetime'; +import { UpdateDateRange } from '../../common/components/charts/common'; export const UsersTabs = memo( ({ deleteQuery, - docValueFields, filterQuery, from, indexNames, @@ -24,21 +28,55 @@ export const UsersTabs = memo( setQuery, to, type, + setAbsoluteRangeDatePicker, }) => { + const narrowDateRange = useCallback( + (score: Anomaly, interval: string) => { + const fromTo = scoreIntervalToDateTime(score, interval); + setAbsoluteRangeDatePicker({ + id: 'global', + from: fromTo.from, + to: fromTo.to, + }); + }, + [setAbsoluteRangeDatePicker] + ); + + const updateDateRange = useCallback( + ({ x }) => { + if (!x) { + return; + } + const [min, max] = x; + setAbsoluteRangeDatePicker({ + id: 'global', + from: new Date(min).toISOString(), + to: new Date(max).toISOString(), + }); + }, + [setAbsoluteRangeDatePicker] + ); + + const tabProps = { + deleteQuery, + endDate: to, + filterQuery, + indexNames, + skip: isInitializing || filterQuery === undefined, + setQuery, + startDate: from, + type, + narrowDateRange, + updateDateRange, + }; + return ( - + + + + ); diff --git a/x-pack/plugins/security_solution/public/users/store/model.ts b/x-pack/plugins/security_solution/public/users/store/model.ts index 8a3e4b983dbb9..57d9c4b6c62f2 100644 --- a/x-pack/plugins/security_solution/public/users/store/model.ts +++ b/x-pack/plugins/security_solution/public/users/store/model.ts @@ -12,6 +12,7 @@ export enum UsersType { export enum UsersTableType { allUsers = 'allUsers', + anomalies = 'anomalies', } export type AllUsersTables = UsersTableType; @@ -32,6 +33,7 @@ export interface TableUpdates { export interface UsersQueries { [UsersTableType.allUsers]: AllUsersQuery; + [UsersTableType.anomalies]: null | undefined; } export interface UsersPageModel { diff --git a/x-pack/plugins/security_solution/public/users/store/reducer.ts b/x-pack/plugins/security_solution/public/users/store/reducer.ts index 1ca0cf5cabb8a..3f4cd69d7f9e8 100644 --- a/x-pack/plugins/security_solution/public/users/store/reducer.ts +++ b/x-pack/plugins/security_solution/public/users/store/reducer.ts @@ -17,6 +17,7 @@ import { } from './actions'; import { setUsersPageQueriesActivePageToZero } from './helpers'; import { UsersTableType, UsersModel } from './model'; +import { HostsTableType } from '../../hosts/store/model'; export const initialUsersState: UsersModel = { page: { @@ -24,12 +25,8 @@ export const initialUsersState: UsersModel = { [UsersTableType.allUsers]: { activePage: DEFAULT_TABLE_ACTIVE_PAGE, limit: DEFAULT_TABLE_LIMIT, - // TODO Fix me - // sort: { - // field: AllUsersFields.allUsers, - // direction: Direction.desc, - // }, }, + [HostsTableType.anomalies]: null, }, }, details: { @@ -37,12 +34,8 @@ export const initialUsersState: UsersModel = { [UsersTableType.allUsers]: { activePage: DEFAULT_TABLE_ACTIVE_PAGE, limit: DEFAULT_TABLE_LIMIT, - // TODO Fix me - // sort: { - // field: HostRulesFields.riskScore, - // direction: Direction.desc, - // }, }, + [HostsTableType.anomalies]: null, }, }, }; @@ -75,7 +68,6 @@ export const usersReducer = reducerWithInitialState(initialUsersState) queries: { ...state[usersType].queries, [tableType]: { - // TODO: Steph/users fix active page/limit on users tables. is broken because multiple UsersTableType.userRules tables ...state[usersType].queries[tableType], activePage, }, @@ -89,7 +81,6 @@ export const usersReducer = reducerWithInitialState(initialUsersState) queries: { ...state[usersType].queries, [tableType]: { - // TODO: Steph/users fix active page/limit on users tables. is broken because multiple UsersTableType.userRules tables ...state[usersType].queries[tableType], limit, }, diff --git a/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts new file mode 100644 index 0000000000000..81a18bb89c354 --- /dev/null +++ b/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts @@ -0,0 +1,124 @@ +/* + * 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 { run, RunFn, createFailError } from '@kbn/dev-utils'; +import { KbnClient } from '@kbn/test'; +import { AxiosError } from 'axios'; +import pMap from 'p-map'; +import type { CreateExceptionListSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { + ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION, + ENDPOINT_BLOCKLISTS_LIST_ID, + ENDPOINT_BLOCKLISTS_LIST_NAME, + EXCEPTION_LIST_ITEM_URL, + EXCEPTION_LIST_URL, +} from '@kbn/securitysolution-list-constants'; +import { randomPolicyIdGenerator } from '../common/random_policy_id_generator'; +import { ExceptionsListItemGenerator } from '../../../common/endpoint/data_generators/exceptions_list_item_generator'; +import { isArtifactByPolicy } from '../../../common/endpoint/service/artifacts'; + +export const cli = () => { + run( + async (options) => { + try { + await createBlocklists(options); + options.log.success(`${options.flags.count} endpoint blocklists created`); + } catch (e) { + options.log.error(e); + throw createFailError(e.message); + } + }, + { + description: 'Load Endpoint Blocklists', + flags: { + string: ['kibana'], + default: { + count: 10, + kibana: 'http://elastic:changeme@localhost:5601', + }, + help: ` + --count Number of blocklists to create. Default: 10 + --kibana The URL to kibana including credentials. Default: http://elastic:changeme@localhost:5601 + `, + }, + } + ); +}; + +class BlocklistDataLoaderError extends Error { + constructor(message: string, public readonly meta: unknown) { + super(message); + } +} + +const handleThrowAxiosHttpError = (err: AxiosError): never => { + let message = err.message; + + if (err.response) { + message = `[${err.response.status}] ${err.response.data.message ?? err.message} [ ${String( + err.response.config.method + ).toUpperCase()} ${err.response.config.url} ]`; + } + throw new BlocklistDataLoaderError(message, err.toJSON()); +}; + +const createBlocklists: RunFn = async ({ flags, log }) => { + const eventGenerator = new ExceptionsListItemGenerator(); + const kbn = new KbnClient({ log, url: flags.kibana as string }); + + await ensureCreateEndpointBlocklistsList(kbn); + + const randomPolicyId = await randomPolicyIdGenerator(kbn, log); + + await pMap( + Array.from({ length: flags.count as unknown as number }), + () => { + const body = eventGenerator.generateBlocklistForCreate(); + + if (isArtifactByPolicy(body)) { + const nmExceptions = Math.floor(Math.random() * 3) || 1; + body.tags = Array.from({ length: nmExceptions }, () => { + return `policy:${randomPolicyId()}`; + }); + } + return kbn + .request({ + method: 'POST', + path: EXCEPTION_LIST_ITEM_URL, + body, + }) + .catch((e) => handleThrowAxiosHttpError(e)); + }, + { concurrency: 10 } + ); +}; + +const ensureCreateEndpointBlocklistsList = async (kbn: KbnClient) => { + const newListDefinition: CreateExceptionListSchema = { + description: ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION, + list_id: ENDPOINT_BLOCKLISTS_LIST_ID, + meta: undefined, + name: ENDPOINT_BLOCKLISTS_LIST_NAME, + os_types: [], + tags: [], + type: 'endpoint', + namespace_type: 'agnostic', + }; + + await kbn + .request({ + method: 'POST', + path: EXCEPTION_LIST_URL, + body: newListDefinition, + }) + .catch((e) => { + // Ignore if list was already created + if (e.response.status !== 409) { + handleThrowAxiosHttpError(e); + } + }); +}; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts index 70801e08ea335..7f18c0b40fed7 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts @@ -17,8 +17,9 @@ import { EXCEPTION_LIST_ITEM_URL, EXCEPTION_LIST_URL, } from '@kbn/securitysolution-list-constants'; -import { EventFilterGenerator } from '../../../common/endpoint/data_generators/event_filter_generator'; import { randomPolicyIdGenerator } from '../common/random_policy_id_generator'; +import { ExceptionsListItemGenerator } from '../../../common/endpoint/data_generators/exceptions_list_item_generator'; +import { isArtifactByPolicy } from '../../../common/endpoint/service/artifacts'; export const cli = () => { run( @@ -66,7 +67,7 @@ const handleThrowAxiosHttpError = (err: AxiosError): never => { }; const createEventFilters: RunFn = async ({ flags, log }) => { - const eventGenerator = new EventFilterGenerator(); + const eventGenerator = new ExceptionsListItemGenerator(); const kbn = new KbnClient({ log, url: flags.kibana as string }); await ensureCreateEndpointEventFiltersList(kbn); @@ -76,8 +77,9 @@ const createEventFilters: RunFn = async ({ flags, log }) => { await pMap( Array.from({ length: flags.count as unknown as number }), () => { - const body = eventGenerator.generate(); - if (body.tags?.length && body.tags[0] !== 'policy:all') { + const body = eventGenerator.generateEventFilterForCreate(); + + if (isArtifactByPolicy(body)) { const nmExceptions = Math.floor(Math.random() * 3) || 1; body.tags = Array.from({ length: nmExceptions }, () => { return `policy:${randomPolicyId()}`; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_blocklists.js b/x-pack/plugins/security_solution/scripts/endpoint/load_blocklists.js new file mode 100644 index 0000000000000..46777ae8ccf7f --- /dev/null +++ b/x-pack/plugins/security_solution/scripts/endpoint/load_blocklists.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +/* + * 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. + */ + +require('../../../../../src/setup_node_env'); +require('./blocklists').cli(); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_saved_object_references/README.md b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_saved_object_references/README.md index da9ccd30cfdac..22e1da8dff5b3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_saved_object_references/README.md +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/legacy_saved_object_references/README.md @@ -10,7 +10,7 @@ until we have all users moved away from the legacy system. ## How to create a legacy notification -* Create a rule and activate it normally within security_solution +* Create a rule and enable it normally within security_solution * Do not add actions to the rule at this point as we are exercising the older legacy system. However, you want at least one action configured such as a slack notification. * Within dev tools do a query for all your actions and grab one of the `_id` of them without their prefix: diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.test.ts index c57a446207873..9cf57ff0018be 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.test.ts @@ -757,12 +757,12 @@ describe('utils', () => { expect(res).toBeTruthy(); expect(mockLogger.warn).toHaveBeenCalledWith( - 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is de-activated. If you have recently enrolled agents enabled with Endpoint Security through Fleet, this warning should stop once an alert is sent from an agent. name: "fake name" id: "fake id" rule id: "fake rule id" signals index: "fakeindex"' + 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is disabled. If you have recently enrolled agents enabled with Endpoint Security through Fleet, this warning should stop once an alert is sent from an agent. name: "fake name" id: "fake id" rule id: "fake rule id" signals index: "fakeindex"' ); expect(ruleExecutionLogger.logStatusChange).toHaveBeenCalledWith({ newStatus: RuleExecutionStatus['partial failure'], message: - 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is de-activated. If you have recently enrolled agents enabled with Endpoint Security through Fleet, this warning should stop once an alert is sent from an agent.', + 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is disabled. If you have recently enrolled agents enabled with Endpoint Security through Fleet, this warning should stop once an alert is sent from an agent.', }); }); @@ -797,12 +797,12 @@ describe('utils', () => { expect(res).toBeTruthy(); expect(mockLogger.warn).toHaveBeenCalledWith( - 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is de-activated. name: "fake name" id: "fake id" rule id: "fake rule id" signals index: "fakeindex"' + 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is disabled. name: "fake name" id: "fake id" rule id: "fake rule id" signals index: "fakeindex"' ); expect(ruleExecutionLogger.logStatusChange).toHaveBeenCalledWith({ newStatus: RuleExecutionStatus['partial failure'], message: - 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is de-activated.', + 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["logs-endpoint.alerts-*"] was found. This warning will continue to appear until a matching index is created or this rule is disabled.', }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts index cb1db88f78d31..b7a06d618162e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts @@ -143,7 +143,7 @@ export const hasTimestampFields = async (args: { if (isEmpty(timestampFieldCapsResponse.body.indices)) { const errorString = `This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ${JSON.stringify( inputIndices - )} was found. This warning will continue to appear until a matching index is created or this rule is de-activated. ${ + )} was found. This warning will continue to appear until a matching index is created or this rule is disabled. ${ ruleName === 'Endpoint Security' ? 'If you have recently enrolled agents enabled with Endpoint Security through Fleet, this warning should stop once an alert is sent from an agent.' : '' diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/constants.ts b/x-pack/plugins/security_solution/server/lib/telemetry/constants.ts index af02c98f32c55..ec363568cafd2 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/constants.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/constants.ts @@ -9,7 +9,7 @@ export const TELEMETRY_MAX_BUFFER_SIZE = 100; export const MAX_SECURITY_LIST_TELEMETRY_BATCH = 100; -export const MAX_ENDPOINT_TELEMETRY_BATCH = 1_000; +export const MAX_ENDPOINT_TELEMETRY_BATCH = 300; export const MAX_DETECTION_RULE_TELEMETRY_BATCH = 1_000; diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts index 6be174cdf33e7..e9cc36bbff907 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts @@ -212,7 +212,15 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) { } } - const { cpu, memory, uptime } = endpoint.endpoint_metrics.Endpoint.metrics; + const { + cpu, + memory, + uptime, + documents_volume: documentsVolume, + malicious_behavior_rules: maliciousBehaviorRules, + system_impact: systemImpact, + threads, + } = endpoint.endpoint_metrics.Endpoint.metrics; const endpointPolicyDetail = extractEndpointPolicyConfig(policyConfig); return { @@ -227,6 +235,10 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) { cpu: cpu.endpoint, memory: memory.endpoint.private, uptime, + documentsVolume, + maliciousBehaviorRules, + systemImpact, + threads, }, endpoint_meta: { os: endpoint.endpoint_metrics.host.os, @@ -242,6 +254,8 @@ export function createTelemetryEndpointTaskConfig(maxTelemetryBatch: number) { actions: failedPolicy._source.Endpoint.policy.applied.actions .map((action) => (action.status !== 'success' ? action : null)) .filter((action) => action !== null), + configuration: failedPolicy._source.Endpoint.configuration, + state: failedPolicy._source.Endpoint.state, } : {}, telemetry_meta: { diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts b/x-pack/plugins/security_solution/server/lib/telemetry/types.ts index d7ba5fa34cf09..35b701552b6ba 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/types.ts @@ -84,6 +84,10 @@ interface EndpointPolicyResponseHits { }; } +interface NonPolicyConfiguration { + isolation: boolean; +} + export interface EndpointPolicyResponseDocument { _source: { '@timestamp': string; @@ -109,6 +113,8 @@ export interface EndpointPolicyResponseDocument { status: string; }; }; + configuration: NonPolicyConfiguration; + state: NonPolicyConfiguration; }; }; } @@ -157,6 +163,17 @@ interface EndpointMetricDocument { }; } +interface DocumentsVolumeMetrics { + suppressed_count: number; + suppressed_bytes: number; + sent_count: number; + sent_bytes: number; +} + +interface SystemImpactEventsMetrics { + week_ms: number; +} + export interface EndpointMetrics { memory: { endpoint: { @@ -180,6 +197,34 @@ export interface EndpointMetrics { endpoint: number; system: number; }; + documents_volume: { + file_events: DocumentsVolumeMetrics; + library_events: DocumentsVolumeMetrics; + process_events: DocumentsVolumeMetrics; + registry_events: DocumentsVolumeMetrics; + network_events: DocumentsVolumeMetrics; + overall: DocumentsVolumeMetrics; + }; + malicious_behavior_rules: Array<{ id: string; endpoint_uptime_percent: number }>; + system_impact: Array<{ + process: { + code_signature: Array<{ + trusted: boolean; + subject_name: string; + exists: boolean; + status: string; + }>; + executable: string; + }; + malware?: SystemImpactEventsMetrics; + process_events?: SystemImpactEventsMetrics; + registry_events?: SystemImpactEventsMetrics; + dns_events?: SystemImpactEventsMetrics; + network_events?: SystemImpactEventsMetrics; + overall?: SystemImpactEventsMetrics; + library_load_events?: SystemImpactEventsMetrics; + }>; + threads: Array<{ name: string; cpu: { mean: number } }>; } interface EndpointMetricOS { diff --git a/x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts b/x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts index f85c9c33756b7..7425ad0c272c6 100644 --- a/x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts +++ b/x-pack/plugins/snapshot_restore/server/routes/api/snapshots.ts @@ -127,8 +127,6 @@ export function registerSnapshotsRoutes({ operator: searchOperator, }) : '_all', - // @ts-expect-error @elastic/elasticsearch new API params - // https://github.com/elastic/elasticsearch-specification/issues/845 slm_policy_filter: searchField === 'policyName' ? getSnapshotSearchWildcard({ @@ -139,6 +137,7 @@ export function registerSnapshotsRoutes({ }) : '*,_none', order: sortDirection, + // @ts-expect-error sortField: string is not compatible with SnapshotSnapshotSort type sort: sortField, size: pageSize, offset: pageIndex * pageSize, diff --git a/x-pack/plugins/stack_alerts/kibana.json b/x-pack/plugins/stack_alerts/kibana.json index acd9dcb374d10..f70ad679deefd 100644 --- a/x-pack/plugins/stack_alerts/kibana.json +++ b/x-pack/plugins/stack_alerts/kibana.json @@ -1,8 +1,8 @@ { "id": "stackAlerts", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "server": true, "version": "8.2.0", diff --git a/x-pack/plugins/task_manager/kibana.json b/x-pack/plugins/task_manager/kibana.json index 3c28df441a0ab..98ca8e115f767 100644 --- a/x-pack/plugins/task_manager/kibana.json +++ b/x-pack/plugins/task_manager/kibana.json @@ -3,8 +3,8 @@ "server": true, "version": "8.2.0", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "kibanaVersion": "kibana", "configPath": ["xpack", "task_manager"], diff --git a/x-pack/plugins/transform/public/alerting/transform_alerting_flyout.tsx b/x-pack/plugins/transform/public/alerting/transform_alerting_flyout.tsx index 63d00f280f3f3..259bd917b5cea 100644 --- a/x-pack/plugins/transform/public/alerting/transform_alerting_flyout.tsx +++ b/x-pack/plugins/transform/public/alerting/transform_alerting_flyout.tsx @@ -46,7 +46,10 @@ export const TransformAlertFlyout: FC = ({ if (initialAlert) { return triggersActionsUi.getEditAlertFlyout({ ...commonProps, - initialAlert, + initialRule: { + ...initialAlert, + ruleTypeId: initialAlert.alertTypeId, + }, }); } @@ -54,7 +57,7 @@ export const TransformAlertFlyout: FC = ({ ...commonProps, consumer: 'stackAlerts', canChangeTrigger: false, - alertTypeId: TRANSFORM_RULE_TYPE.TRANSFORM_HEALTH, + ruleTypeId: TRANSFORM_RULE_TYPE.TRANSFORM_HEALTH, metadata: {}, initialValues: { params: ruleParams!, diff --git a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts index e2512bfac2c55..7aebf83b27cca 100644 --- a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts +++ b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts @@ -29,7 +29,11 @@ interface TestResult { context: TransformHealthAlertContext; } -type Transform = estypes.Transform & { id: string; description?: string; sync: object }; +type Transform = estypes.TransformGetTransformTransformSummary & { + id: string; + description?: string; + sync: object; +}; type TransformWithAlertingRules = Transform & { alerting_rules: TransformHealthAlertRule[] }; diff --git a/x-pack/plugins/transform/server/routes/api/transforms.ts b/x-pack/plugins/transform/server/routes/api/transforms.ts index 09fab2b45909e..2f82b9a70389b 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms.ts @@ -508,12 +508,9 @@ async function deleteTransforms( transform_id: transformId, }); const transformConfig = body.transforms[0]; - // @ts-expect-error @elastic/elasticsearch doesn't provide typings for Transform destinationIndex = Array.isArray(transformConfig.dest.index) - ? // @ts-expect-error @elastic/elasticsearch doesn't provide typings for Transform - transformConfig.dest.index[0] - : // @ts-expect-error @elastic/elasticsearch doesn't provide typings for Transform - transformConfig.dest.index; + ? transformConfig.dest.index[0] + : transformConfig.dest.index; } catch (getTransformConfigError) { transformDeleted.error = getTransformConfigError.meta.body.error; results[transformId] = { diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 94cf3008d4719..3a5bc5edfbb79 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -3226,7 +3226,6 @@ "expressions.functions.mathColumn.args.nameHelpText": "結果の列の名前です。名前は一意である必要はありません。", "expressions.functions.mathColumn.arrayValueError": "{name}で配列値に対する演算を実行できません", "expressions.functions.mathColumn.uniqueIdError": "IDは一意でなければなりません", - "expressions.functions.mathColumnHelpText": "他の列の結果として計算された列を追加します。引数が指定された場合のみ変更が加えられます。{alterColumnFn}と{staticColumnFn}もご参照ください。", "expressions.functions.mathHelpText": "{TYPE_NUMBER}または{DATATABLE}を{CONTEXT}として使用して、{TINYMATH}数式を解釈します。{DATATABLE}列は列名で表示されます。{CONTEXT}が数字の場合は、{value}と表示されます。", "expressions.functions.movingAverage.args.byHelpText": "移動平均計算を分割する列", "expressions.functions.movingAverage.args.inputColumnIdHelpText": "移動平均を計算する列", @@ -6727,7 +6726,6 @@ "xpack.alerting.ruleTypeRegistry.register.customRecoveryActionGroupUsageError": "ルールタイプ[id=\"{id}\"]を登録できません。アクショングループ [{actionGroup}] は、復元とアクティブなアクショングループの両方として使用できません。", "xpack.alerting.ruleTypeRegistry.register.duplicateRuleTypeError": "ルールタイプ\"{id}\"はすでに登録されています。", "xpack.alerting.ruleTypeRegistry.register.invalidDefaultTimeoutRuleTypeError": "ルールタイプ\"{id}\"のデフォルト間隔が無効です:{errorMessage}。", - "xpack.alerting.ruleTypeRegistry.register.invalidMinimumTimeoutRuleTypeError": "ルールタイプ\"{id}\"の最低間隔が無効です:{errorMessage}。", "xpack.alerting.ruleTypeRegistry.register.invalidTimeoutRuleTypeError": "ルールタイプ\"{id}\"のタイムアウトが無効です:{errorMessage}。", "xpack.alerting.savedObjects.goToRulesButtonText": "ルールに移動", "xpack.alerting.savedObjects.onImportText": "インポート後に、{rulesSavedObjectsLength} {rulesSavedObjectsLength, plural, other {ルール}}を有効にする必要があります。", @@ -7296,8 +7294,6 @@ "xpack.apm.serviceIcons.serverless": "サーバーレス", "xpack.apm.serviceIcons.service": "サービス", "xpack.apm.serviceIcons.serviceDetails.cloud.availabilityZoneLabel": "{zones, plural, other {可用性ゾーン}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.betaLabel": "ベータ", - "xpack.apm.serviceIcons.serviceDetails.cloud.betaTooltip": "AWS Lambdaサポートは一般公開されていません。不具合を報告して支援してください。", "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, other {トリガータイプ}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.functionNameLabel": "{functionNames, plural, other {関数名}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.machineTypesLabel": "{machineTypes, plural, other {コンピュータータイプ} }\n ", @@ -7315,9 +7311,6 @@ "xpack.apm.serviceIcons.serviceDetails.service.frameworkLabel": "フレームワーク名", "xpack.apm.serviceIcons.serviceDetails.service.runtimeLabel": "ランタイム名・バージョン", "xpack.apm.serviceIcons.serviceDetails.service.versionLabel": "サービスバージョン", - "xpack.apm.serviceInventory.toastText": "現在 Elastic Stack 7.0+ を実行中で、以前のバージョン 6.x からの互換性のないデータを検知しました。このデータを APM で表示するには、移行が必要です。詳細 ", - "xpack.apm.serviceInventory.toastTitle": "選択された時間範囲内にレガシーデータが検知されました。", - "xpack.apm.serviceInventory.upgradeAssistantLinkText": "アップグレードアシスタント", "xpack.apm.serviceLogs.noInfrastructureMessage": "表示するログメッセージがありません。", "xpack.apm.serviceMap.anomalyDetectionPopoverDisabled": "APM 設定で異常検知を有効にすると、サービス正常性インジケーターが表示されます。", "xpack.apm.serviceMap.anomalyDetectionPopoverLink": "異常を表示", @@ -8092,7 +8085,6 @@ "xpack.canvas.functions.alterColumn.args.typeHelpText": "列の変換語のタイプです。タイプを変更しない場合は未入力のままにします。", "xpack.canvas.functions.alterColumn.cannotConvertTypeErrorMessage": "「{type}」に変換できません", "xpack.canvas.functions.alterColumn.columnNotFoundErrorMessage": "列が見つかりません。'{column}'", - "xpack.canvas.functions.alterColumnHelpText": "{list}、{end}などのコアタイプを変換し、列名を変更します。{mapColumnFn}および{staticColumnFn}も参照してください。", "xpack.canvas.functions.any.args.conditionHelpText": "確認する条件です。", "xpack.canvas.functions.anyHelpText": "少なくとも 1 つの条件が満たされている場合、{BOOLEAN_TRUE} が返されます。{all_fn} もご参照ください。", "xpack.canvas.functions.as.args.nameHelpText": "列に付ける名前です。", @@ -8293,7 +8285,6 @@ "xpack.canvas.functions.sortHelpText": "{DATATABLE}を指定された列で並べ替えます。", "xpack.canvas.functions.staticColumn.args.nameHelpText": "新しい列の名前です。", "xpack.canvas.functions.staticColumn.args.valueHelpText": "新しい列の各行に挿入する値です。ヒント:部分式を使用して他の列を静的値にロールアップします。", - "xpack.canvas.functions.staticColumnHelpText": "すべての行に同じ静的値の列を追加します。{alterColumnFn}および{mapColumnFn}も参照してください。", "xpack.canvas.functions.string.args.valueHelpText": "1 つの文字列に結合する値です。必要な場所にスペースを入れてください。", "xpack.canvas.functions.stringHelpText": "すべての引数を 1 つの文字列に連結させます。", "xpack.canvas.functions.switch.args.caseHelpText": "確認する条件です。", @@ -15716,7 +15707,6 @@ "xpack.ingestPipelines.processors.defaultDescription.dateIndexName.indexNamePrefixDefault.noPrefixValueLabel": "プレフィックスなし", "xpack.ingestPipelines.processors.defaultDescription.dateIndexName.indexNamePrefixDefault.prefixValueLabel": "プレフィックス\"{prefix}\"を使用", "xpack.ingestPipelines.processors.defaultDescription.dissect": "分離したパターンと一致する値を\"{field}\"から抽出します", - "xpack.ingestPipelines.processors.defaultDescription.dot_expander": "\"{field}\"をオブジェクトフィールドに拡張します", "xpack.ingestPipelines.processors.defaultDescription.drop": "エラーを返さずにドキュメントを破棄します", "xpack.ingestPipelines.processors.defaultDescription.enrich": "\"{policy_name}\"ポリシーが\"{field}\"と一致した場合に、データを\"{target_field}\"に改善します", "xpack.ingestPipelines.processors.defaultDescription.fail": "実行を停止する例外を発生させます", @@ -23120,8 +23110,6 @@ "xpack.securitySolution.detectionEngine.components.importRuleModal.overwriteExceptionLabel": "競合する「list_id」で既存の例外リストを上書き", "xpack.securitySolution.detectionEngine.components.importRuleModal.selectRuleDescription": "インポートするルールを選択します。関連付けられたルールアクションと例外を含めることができます。", "xpack.securitySolution.detectionEngine.components.importRuleModal.successfullyImportedRulesTitle": "{totalRules} {totalRules, plural, other {ルール}}を正常にインポートしました", - "xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithActivatingTitle": "ルールの作成と有効化", - "xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithoutActivatingTitle": "有効化せずにルールを作成", "xpack.securitySolution.detectionEngine.createRule.backToRulesButton": "ルール", "xpack.securitySolution.detectionEngine.createRule.editRuleButton": "編集", "xpack.securitySolution.detectionEngine.createRule.eqlRuleTypeDescription": "イベント相関関係", @@ -23223,8 +23211,6 @@ "xpack.securitySolution.detectionEngine.createRule.stepRuleActions.invalidMustacheTemplateErrorMessage": "{key}は有効なmustacheテンプレートではありません", "xpack.securitySolution.detectionEngine.createRule.stepRuleActions.noConnectorSelectedErrorMessage": "コネクターを選択していません", "xpack.securitySolution.detectionEngine.createRule.stepRuleActions.noReadActionsPrivileges": "ルールアクションを作成できません。「Actions」プラグインの「読み取り」アクセス権がありません。", - "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithActivatingTitle": "ルールの作成と有効化", - "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithoutActivatingTitle": "有効化せずにルールを作成", "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackHelpText": "ルックバック期間に時間を追加してアラートの見落としを防ぎます。", "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackLabel": "追加のルックバック時間", "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldIntervalHelpText": "ルールを定期的に実行し、指定の時間枠内でアラートを検出します。", @@ -23906,7 +23892,6 @@ "xpack.securitySolution.detectionEngine.ruleDescription.mlJobStoppedDescription": "停止", "xpack.securitySolution.detectionEngine.ruleDescription.thresholdResultsAggregatedByDescription": "結果集約条件", "xpack.securitySolution.detectionEngine.ruleDescription.thresholdResultsAllDescription": "すべての結果", - "xpack.securitySolution.detectionEngine.ruleDetails.activateRuleLabel": "有効化", "xpack.securitySolution.detectionEngine.ruleDetails.backToRulesButton": "ルール", "xpack.securitySolution.detectionEngine.ruleDetails.deletedRule": "削除されたルール", "xpack.securitySolution.detectionEngine.ruleDetails.exceptionsTab": "例外", @@ -23949,8 +23934,6 @@ "xpack.securitySolution.detectionEngine.rules.allRules.actions.editRuleSettingsToolTip": "Kibana アクション特権がありません", "xpack.securitySolution.detectionEngine.rules.allRules.actions.exportRuleDescription": "ルールのエクスポート", "xpack.securitySolution.detectionEngine.rules.allRules.activeRuleDescription": "アクティブ", - "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.activateSelectedErrorTitle": "{totalRules, plural, other {個のルール}}の有効化エラー", - "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deactivateSelectedErrorTitle": "{totalRules, plural, other {個のルール}}の無効化エラー", "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedErrorTitle": "{totalRules, plural, other {ルール}}の削除エラー", "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedImmutableTitle": "選択には削除できないイミュータブルルールがあります", "xpack.securitySolution.detectionEngine.rules.allRules.batchActionsTitle": "一斉アクション", @@ -27598,7 +27581,7 @@ "xpack.triggersActionsUI.cases.configureCases.mappingFieldSummary": "まとめ", "xpack.triggersActionsUI.checkActionTypeEnabled.actionTypeDisabledByConfigMessage": "このコネクターは Kibana の構成で無効になっています。", "xpack.triggersActionsUI.checkActionTypeEnabled.actionTypeDisabledByLicenseMessage": "このコネクターには {minimumLicenseRequired} ライセンスが必要です。", - "xpack.triggersActionsUI.checkAlertTypeEnabled.ruleTypeDisabledByLicenseMessage": "このルールタイプには{minimumLicenseRequired}ライセンスが必要です。", + "xpack.triggersActionsUI.checkRuleTypeEnabled.ruleTypeDisabledByLicenseMessage": "このルールタイプには{minimumLicenseRequired}ライセンスが必要です。", "xpack.triggersActionsUI.common.constants.comparators.groupByTypes.allDocumentsLabel": "すべてのドキュメント", "xpack.triggersActionsUI.common.constants.comparators.groupByTypes.topLabel": "トップ", "xpack.triggersActionsUI.common.constants.comparators.isAboveLabel": "より大:", @@ -28046,152 +28029,135 @@ "xpack.triggersActionsUI.sections.addModalConnectorForm.flyoutTitle": "{actionTypeName}コネクター", "xpack.triggersActionsUI.sections.addModalConnectorForm.saveButtonLabel": "保存", "xpack.triggersActionsUI.sections.addModalConnectorForm.updateSuccessNotificationText": "「{connectorName}」を作成しました", - "xpack.triggersActionsUI.sections.alertAdd.flyoutTitle": "ルールを作成", - "xpack.triggersActionsUI.sections.alertAdd.indexControls.timeFieldOptionLabel": "フィールドを選択", - "xpack.triggersActionsUI.sections.alertAdd.operationName": "作成", - "xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText": "ルールを作成できません。", - "xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText": "ルール\"{ruleName}\"を作成しました", - "xpack.triggersActionsUI.sections.alertAddFooter.cancelButtonLabel": "キャンセル", - "xpack.triggersActionsUI.sections.alertAddFooter.saveButtonLabel": "保存", - "xpack.triggersActionsUI.sections.alertDetails.actionWithBrokenConnectorWarningBannerEditText": "ルールを編集", - "xpack.triggersActionsUI.sections.alertDetails.actionWithBrokenConnectorWarningBannerTitle": "このルールに関連付けられたコネクターの1つで問題が発生しています。", - "xpack.triggersActionsUI.sections.alertDetails.alertDetailsTitle": "{alertName}", - "xpack.triggersActionsUI.sections.alertDetails.alertInstances.disabledRule": "このルールは無効になっていて再表示できません。", - "xpack.triggersActionsUI.sections.alertDetails.alerts.disabledRuleTitle": "無効なルール", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.avgDurationDescription": "平均時間", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.alert": "アラート", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.duration": "期間", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.mute": "ミュート", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.start": "開始", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.status": "ステータス", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.ruleLastExecutionDescription": "前回の応答", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.ruleTypeExcessDurationMessage": "期間がルールの想定実行時間を超えています。", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.status.active": "アクティブ", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.status.inactive": "回復済み", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.enableLoadingTitle": "有効にする", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.enableTitle": "有効にする", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.muteLoadingTitle": "ミュート", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.muteTitle": "ミュート", - "xpack.triggersActionsUI.sections.alertDetails.dismissButtonTitle": "閉じる", - "xpack.triggersActionsUI.sections.alertDetails.editAlertButtonLabel": "編集", - "xpack.triggersActionsUI.sections.alertDetails.manageLicensePlanBannerLinkTitle": "ライセンスの管理", - "xpack.triggersActionsUI.sections.alertDetails.redirectObjectNoun": "ルール", - "xpack.triggersActionsUI.sections.alertDetails.unableToLoadAlertMessage": "ルールを読み込めません:{message}", - "xpack.triggersActionsUI.sections.alertDetails.unableToLoadAlertsMessage": "アラートを読み込めません:{message}", - "xpack.triggersActionsUI.sections.alertDetails.viewAlertInAppButtonLabel": "アプリで表示", - "xpack.triggersActionsUI.sections.alertEdit.cancelButtonLabel": "キャンセル", - "xpack.triggersActionsUI.sections.alertEdit.disabledActionsWarningTitle": "このアラートには無効なアクションがあります", - "xpack.triggersActionsUI.sections.alertEdit.flyoutTitle": "ルールを編集", - "xpack.triggersActionsUI.sections.alertEdit.saveButtonLabel": "保存", - "xpack.triggersActionsUI.sections.alertEdit.saveErrorNotificationText": "ルールを更新できません", - "xpack.triggersActionsUI.sections.alertEdit.saveSuccessNotificationText": "'{ruleName}'を更新しました", - "xpack.triggersActionsUI.sections.alertForm.alertNameLabel": "名前", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.label": "毎", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.description": "アラートステータスが変更されるときにアクションを実行します。", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.display": "ステータス変更時のみ", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.label": "ステータス変更時のみ", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.description": "アラートがアクティブなときは、ルール間隔でアクションが繰り返されます。", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.display": "アラートがアクティブになるたびに実行", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.label": "アラートがアクティブになるたびに実行", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.description": "設定した間隔を使用してアクションを実行します。", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.display": "カスタムアクション間隔", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.label": "カスタムアクション間隔", - "xpack.triggersActionsUI.sections.alertForm.changeAlertTypeAriaLabel": "削除", - "xpack.triggersActionsUI.sections.alertForm.checkFieldLabel": "確認間隔", - "xpack.triggersActionsUI.sections.alertForm.checkWithTooltip": "条件を評価する頻度を定義します。チェックはキューに登録されています。可能なかぎり定義された値に近づくように実行されます。", - "xpack.triggersActionsUI.sections.alertForm.conditions.addConditionLabel": "追加:", - "xpack.triggersActionsUI.sections.alertForm.conditions.removeConditionLabel": "削除", - "xpack.triggersActionsUI.sections.alertForm.conditions.title": "条件:", - "xpack.triggersActionsUI.sections.alertForm.documentationLabel": "ドキュメント", - "xpack.triggersActionsUI.sections.alertForm.error.belowMinimumText": "間隔はこのルールタイプの最小値({minimum})未満です", - "xpack.triggersActionsUI.sections.alertForm.error.noAuthorizedRuleTypes": "ルールを{operation}するには、適切な権限が付与されている必要があります。", - "xpack.triggersActionsUI.sections.alertForm.error.noAuthorizedRuleTypesTitle": "ルールタイプを{operation}する権限がありません。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredActionConnector": "{actionTypeId}コネクターのアクションが必要です。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredIntervalText": "確認間隔が必要です。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredNameText": "名前が必要です。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredRuleTypeIdText": "ルールタイプは必須です。", - "xpack.triggersActionsUI.sections.alertForm.loadingRuleTypeParamsDescription": "ルールタイプパラメーターを読み込んでいます…", - "xpack.triggersActionsUI.sections.alertForm.loadingRuleTypesDescription": "ルールタイプを読み込んでいます…", - "xpack.triggersActionsUI.sections.alertForm.renotifyFieldLabel": "通知", - "xpack.triggersActionsUI.sections.alertForm.renotifyWithTooltip": "ルールがアクティブな間にアクションを繰り返す頻度を定義します。", - "xpack.triggersActionsUI.sections.alertForm.ruleTypeSelectLabel": "ルールタイプを選択", - "xpack.triggersActionsUI.sections.alertForm.searchPlaceholderTitle": "検索", - "xpack.triggersActionsUI.sections.alertForm.solutionFilterLabel": "ユースケースでフィルタリング", - "xpack.triggersActionsUI.sections.alertForm.tagsFieldLabel": "タグ(任意)", - "xpack.triggersActionsUI.sections.alertForm.unableToLoadRuleTypesMessage": "ルールタイプを読み込めません", - "xpack.triggersActionsUI.sections.alertsList.actionTypeFilterLabel": "アクションタイプ", - "xpack.triggersActionsUI.sections.alertsList.addRuleButtonLabel": "ルールを作成", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonDecrypting": "ルールの復号中にエラーが発生しました。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonDisabled": "ルールを実行できませんでした。ルールは無効化された後に実行されました。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonLicense": "ルールを実行できません", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonReading": "ルールの読み取り中にエラーが発生しました。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonRunning": "ルールの実行中にエラーが発生しました。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonTimeout": "タイムアウトのためルール実行がキャンセルされました。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonUnknown": "不明な理由でエラーが発生しました。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.actionsTex": "アクション", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.actionsWarningTooltip": "このルールに関連付けられたコネクターの1つを読み込めません。ルールを編集して、新しいコネクターを選択します。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.alertTypeTitle": "型", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.deleteAriaLabel": "削除", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.deleteButtonTooltip": "削除", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.durationTitle": "ルールを実行するのにかかる時間。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.editAriaLabel": "編集", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.editButtonTooltip": "編集", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.enabledTitle": "有効", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.lastExecutionDateTitle": "前回の実行の開始時間。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.mutedBadge": "ミュート", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.nameTitle": "名前", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.ruleExecutionPercentileSelectButton": "パーセンタイルを選択", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.ruleExecutionPercentileTooltip": "このルールの過去{sampleLimit}実行期間の{percentileOrdinal}パーセンタイル", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.scheduleTitle": "間隔", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.statusTitle": "ステータス", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.successRatioTitle": "このルールが正常に実行される頻度", - "xpack.triggersActionsUI.sections.alertsList.alertStatusActive": "アクティブ", - "xpack.triggersActionsUI.sections.alertsList.alertStatusError": "エラー", - "xpack.triggersActionsUI.sections.alertsList.alertStatusFilterLabel": "ステータス", - "xpack.triggersActionsUI.sections.alertsList.alertStatusLicenseError": "ライセンスエラー", - "xpack.triggersActionsUI.sections.alertsList.alertStatusOk": "OK", - "xpack.triggersActionsUI.sections.alertsList.alertStatusPending": "保留中", - "xpack.triggersActionsUI.sections.alertsList.alertStatusUnknown": "不明", - "xpack.triggersActionsUI.sections.alertsList.attentionBannerTitle": "{totalStatusesError, plural, other {# 件のルール}}でエラーが見つかりました。", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.buttonTitle": "ルールの管理", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.deleteAllTitle": "削除", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.disableAllTitle": "無効にする", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.enableAllTitle": "有効にする", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToDeleteRulesMessage": "ルールを削除できませんでした", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToDisableRulesMessage": "ルールを無効にできませんでした", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToEnableRulesMessage": "ルールを有効にできませんでした", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToMuteRulesMessage": "ルールをミュートできませんでした", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToUnmuteRulesMessage": "ルールをミュート解除できませんでした", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.muteAllTitle": "ミュート", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.unmuteAllTitle": "ミュート解除", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteRuleTitle": "ルールの削除", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.disableTitle": "無効にする", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.editTitle": "ルールを編集", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle": "有効にする", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle": "ミュート", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle": "アクション", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.unmuteTitle": "ミュート解除", - "xpack.triggersActionsUI.sections.alertsList.dismissBunnerButtonLabel": "閉じる", - "xpack.triggersActionsUI.sections.alertsList.fixLicenseLink": "修正", - "xpack.triggersActionsUI.sections.alertsList.multipleTitle": "ルール", - "xpack.triggersActionsUI.sections.alertsList.noPermissionToCreateDescription": "システム管理者にお問い合わせください。", - "xpack.triggersActionsUI.sections.alertsList.noPermissionToCreateTitle": "ルールを作成する権限がありません", - "xpack.triggersActionsUI.sections.alertsList.refreshAlertsButtonLabel": "更新", - "xpack.triggersActionsUI.sections.alertsList.resetDefaultIndexLabel": "デフォルトのインデックスをリセット", - "xpack.triggersActionsUI.sections.alertsList.ruleTypeExcessDurationMessage": "期間がルールの想定実行時間を超えています。", - "xpack.triggersActionsUI.sections.alertsList.searchPlaceholderTitle": "検索", - "xpack.triggersActionsUI.sections.alertsList.singleTitle": "ルール", - "xpack.triggersActionsUI.sections.alertsList.totalItemsCountDescription": "{pageSize}/{totalItemCount}件のルールを表示しています。", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesActiveDescription": "アクティブ:{totalStatusesActive}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesErrorDescription": "エラー:{totalStatusesError}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesOkDescription": "Ok:{totalStatusesOk}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesPendingDescription": "保留:{totalStatusesPending}", - "xpack.triggersActionsUI.sections.alertsList.typeFilterLabel": "型", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadConnectorTypesMessage": "コネクタータイプを読み込めません", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadRulesMessage": "ルールを読み込めません", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadRuleStatusInfoMessage": "ルールステータス情報を読み込めません", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadRuleTypesMessage": "ルールタイプを読み込めません", - "xpack.triggersActionsUI.sections.alertsList.viewBunnerButtonLabel": "表示", + "xpack.triggersActionsUI.sections.ruleAdd.flyoutTitle": "ルールを作成", + "xpack.triggersActionsUI.sections.ruleAdd.indexControls.timeFieldOptionLabel": "フィールドを選択", + "xpack.triggersActionsUI.sections.ruleAdd.operationName": "作成", + "xpack.triggersActionsUI.sections.ruleAdd.saveErrorNotificationText": "ルールを作成できません。", + "xpack.triggersActionsUI.sections.ruleAdd.saveSuccessNotificationText": "ルール\"{ruleName}\"を作成しました", + "xpack.triggersActionsUI.sections.ruleAddFooter.cancelButtonLabel": "キャンセル", + "xpack.triggersActionsUI.sections.ruleAddFooter.saveButtonLabel": "保存", + "xpack.triggersActionsUI.sections.ruleDetails.actionWithBrokenConnectorWarningBannerEditText": "ルールを編集", + "xpack.triggersActionsUI.sections.ruleDetails.actionWithBrokenConnectorWarningBannerTitle": "このルールに関連付けられたコネクターの1つで問題が発生しています。", + "xpack.triggersActionsUI.sections.ruleDetails.ruleDetailsTitle": "{ruleName}", + "xpack.triggersActionsUI.sections.ruleDetails.alertInstances.disabledRule": "このルールは無効になっていて再表示できません。", + "xpack.triggersActionsUI.sections.ruleDetails.alertInstances.disabledRuleTitle": "無効なルール", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.enableLoadingTitle": "有効にする", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.enableTitle": "有効にする", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.muteLoadingTitle": "ミュート", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.muteTitle": "ミュート", + "xpack.triggersActionsUI.sections.ruleDetails.dismissButtonTitle": "閉じる", + "xpack.triggersActionsUI.sections.ruleDetails.editRuleButtonLabel": "編集", + "xpack.triggersActionsUI.sections.ruleDetails.manageLicensePlanBannerLinkTitle": "ライセンスの管理", + "xpack.triggersActionsUI.sections.ruleDetails.redirectObjectNoun": "ルール", + "xpack.triggersActionsUI.sections.ruleDetails.unableToLoadRuleMessage": "ルールを読み込めません:{message}", + "xpack.triggersActionsUI.sections.ruleDetails.unableToLoadRulesMessage": "アラートを読み込めません:{message}", + "xpack.triggersActionsUI.sections.ruleDetails.viewRuleInAppButtonLabel": "アプリで表示", + "xpack.triggersActionsUI.sections.ruleEdit.cancelButtonLabel": "キャンセル", + "xpack.triggersActionsUI.sections.ruleEdit.disabledActionsWarningTitle": "このアラートには無効なアクションがあります", + "xpack.triggersActionsUI.sections.ruleEdit.flyoutTitle": "ルールを編集", + "xpack.triggersActionsUI.sections.ruleEdit.saveButtonLabel": "保存", + "xpack.triggersActionsUI.sections.ruleEdit.saveErrorNotificationText": "ルールを更新できません", + "xpack.triggersActionsUI.sections.ruleEdit.saveSuccessNotificationText": "'{ruleName}'を更新しました", + "xpack.triggersActionsUI.sections.ruleForm.ruleNameLabel": "名前", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.label": "毎", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.description": "アラートステータスが変更されるときにアクションを実行します。", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.display": "ステータス変更時のみ", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.label": "ステータス変更時のみ", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.description": "アラートがアクティブなときは、ルール間隔でアクションが繰り返されます。", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.display": "アラートがアクティブになるたびに実行", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.label": "アラートがアクティブになるたびに実行", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.description": "設定した間隔を使用してアクションを実行します。", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.display": "カスタムアクション間隔", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.label": "カスタムアクション間隔", + "xpack.triggersActionsUI.sections.ruleForm.changeRuleTypeAriaLabel": "削除", + "xpack.triggersActionsUI.sections.ruleForm.checkFieldLabel": "確認間隔", + "xpack.triggersActionsUI.sections.ruleForm.checkWithTooltip": "条件を評価する頻度を定義します。", + "xpack.triggersActionsUI.sections.ruleForm.conditions.addConditionLabel": "追加:", + "xpack.triggersActionsUI.sections.ruleForm.conditions.removeConditionLabel": "削除", + "xpack.triggersActionsUI.sections.ruleForm.conditions.title": "条件:", + "xpack.triggersActionsUI.sections.ruleForm.documentationLabel": "ドキュメント", + "xpack.triggersActionsUI.sections.ruleForm.error.noAuthorizedRuleTypes": "ルールを{operation}するには、適切な権限が付与されている必要があります。", + "xpack.triggersActionsUI.sections.ruleForm.error.noAuthorizedRuleTypesTitle": "ルールタイプを{operation}する権限がありません。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredActionConnector": "{actionTypeId}コネクターのアクションが必要です。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredIntervalText": "確認間隔が必要です。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredNameText": "名前が必要です。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredRuleTypeIdText": "ルールタイプは必須です。", + "xpack.triggersActionsUI.sections.ruleForm.loadingRuleTypeParamsDescription": "ルールタイプパラメーターを読み込んでいます…", + "xpack.triggersActionsUI.sections.ruleForm.loadingRuleTypesDescription": "ルールタイプを読み込んでいます…", + "xpack.triggersActionsUI.sections.ruleForm.renotifyFieldLabel": "通知", + "xpack.triggersActionsUI.sections.ruleForm.renotifyWithTooltip": "ルールがアクティブな間にアクションを繰り返す頻度を定義します。", + "xpack.triggersActionsUI.sections.ruleForm.ruleTypeSelectLabel": "ルールタイプを選択", + "xpack.triggersActionsUI.sections.ruleForm.searchPlaceholderTitle": "検索", + "xpack.triggersActionsUI.sections.ruleForm.solutionFilterLabel": "ユースケースでフィルタリング", + "xpack.triggersActionsUI.sections.ruleForm.tagsFieldLabel": "タグ(任意)", + "xpack.triggersActionsUI.sections.ruleForm.unableToLoadRuleTypesMessage": "ルールタイプを読み込めません", + "xpack.triggersActionsUI.sections.rulesList.actionTypeFilterLabel": "アクションタイプ", + "xpack.triggersActionsUI.sections.rulesList.addRuleButtonLabel": "ルールを作成", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonDecrypting": "ルールの復号中にエラーが発生しました。", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonLicense": "ルールを実行できません", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonReading": "ルールの読み取り中にエラーが発生しました。", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonRunning": "ルールの実行中にエラーが発生しました。", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonUnknown": "不明な理由でエラーが発生しました。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.actionsTex": "アクション", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.actionsWarningTooltip": "このルールに関連付けられたコネクターの1つを読み込めません。ルールを編集して、新しいコネクターを選択します。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.ruleTypeTitle": "型", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.deleteAriaLabel": "削除", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.deleteButtonTooltip": "削除", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.durationTitle": "ルールを実行するのにかかる時間。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.editAriaLabel": "編集", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.editButtonTooltip": "編集", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.enabledTitle": "有効", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.lastExecutionDateTitle": "前回の実行の開始時間。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.mutedBadge": "ミュート", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.nameTitle": "名前", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.scheduleTitle": "間隔", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.statusTitle": "ステータス", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusActive": "アクティブ", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusError": "エラー", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusFilterLabel": "ステータス", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusLicenseError": "ライセンスエラー", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusOk": "OK", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusPending": "保留中", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusUnknown": "不明", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.buttonTitle": "ルールの管理", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.deleteAllTitle": "削除", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.disableAllTitle": "無効にする", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.enableAllTitle": "有効にする", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToDeleteRulesMessage": "ルールを削除できませんでした", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToDisableRulesMessage": "ルールを無効にできませんでした", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToEnableRulesMessage": "ルールを有効にできませんでした", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToMuteRulesMessage": "ルールをミュートできませんでした", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToUnmuteRulesMessage": "ルールをミュート解除できませんでした", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.muteAllTitle": "ミュート", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.unmuteAllTitle": "ミュート解除", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.deleteRuleTitle": "ルールの削除", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.disableTitle": "無効にする", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.editTitle": "ルールを編集", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.enableTitle": "有効にする", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.muteTitle": "ミュート", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.popoverButtonTitle": "アクション", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.unmuteTitle": "ミュート解除", + "xpack.triggersActionsUI.sections.rulesList.dismissBunnerButtonLabel": "閉じる", + "xpack.triggersActionsUI.sections.rulesList.fixLicenseLink": "修正", + "xpack.triggersActionsUI.sections.rulesList.multipleTitle": "ルール", + "xpack.triggersActionsUI.sections.rulesList.noPermissionToCreateDescription": "システム管理者にお問い合わせください。", + "xpack.triggersActionsUI.sections.rulesList.noPermissionToCreateTitle": "ルールを作成する権限がありません", + "xpack.triggersActionsUI.sections.rulesList.refreshRulesButtonLabel": "更新", + "xpack.triggersActionsUI.sections.rulesList.resetDefaultIndexLabel": "デフォルトのインデックスをリセット", + "xpack.triggersActionsUI.sections.rulesList.ruleTypeExcessDurationMessage": "期間がルールの想定実行時間を超えています。", + "xpack.triggersActionsUI.sections.rulesList.searchPlaceholderTitle": "検索", + "xpack.triggersActionsUI.sections.rulesList.singleTitle": "ルール", + "xpack.triggersActionsUI.sections.rulesList.totalItemsCountDescription": "{pageSize}/{totalItemCount}件のルールを表示しています。", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesActiveDescription": "アクティブ:{totalStatusesActive}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesErrorDescription": "エラー:{totalStatusesError}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesOkDescription": "Ok:{totalStatusesOk}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesPendingDescription": "保留:{totalStatusesPending}", + "xpack.triggersActionsUI.sections.rulesList.typeFilterLabel": "型", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadConnectorTypesMessage": "コネクタータイプを読み込めません", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadRulesMessage": "ルールを読み込めません", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadRuleStatusInfoMessage": "ルールステータス情報を読み込めません", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadRuleTypesMessage": "ルールタイプを読み込めません", + "xpack.triggersActionsUI.sections.rulesList.viewBunnerButtonLabel": "表示", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.addBccButton": "Bcc", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.addCcButton": "Cc", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.authenticationLabel": "認証", @@ -28211,20 +28177,20 @@ "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.subjectTextFieldLabel": "件名", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.tenantIdFieldLabel": "テナントID", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.userTextFieldLabel": "ユーザー名", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseCancelButtonText": "キャンセル", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseConfirmButtonText": "変更を破棄", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseMessage": "保存されていない変更は回復できません。", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseTitle": "ルールの保存されていない変更を破棄しますか?", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveCancelButtonText": "キャンセル", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveConfirmButtonText": "ルールを保存", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveTitle": "アクションがないルールを保存しますか?", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveWithoutActionsMessage": "いつでもアクションを追加できます。", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseCancelButtonText": "キャンセル", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseConfirmButtonText": "変更を破棄", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseMessage": "保存されていない変更は回復できません。", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseTitle": "ルールの保存されていない変更を破棄しますか?", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveCancelButtonText": "キャンセル", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveConfirmButtonText": "ルールを保存", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveTitle": "アクションがないルールを保存しますか?", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveWithoutActionsMessage": "いつでもアクションを追加できます。", "xpack.triggersActionsUI.sections.connectorAddInline.accordion.deleteIconAriaLabel": "削除", "xpack.triggersActionsUI.sections.connectorAddInline.addConnectorButtonLabel": "コネクターを作成する", "xpack.triggersActionsUI.sections.connectorAddInline.connectorAddInline.actionIdLabel": "別の{connectorInstance}コネクターを使用", "xpack.triggersActionsUI.sections.connectorAddInline.connectorAddInline.addNewConnectorEmptyButton": "コネクターの追加", "xpack.triggersActionsUI.sections.connectorAddInline.emptyConnectorsLabel": "{actionTypeName}コネクターがありません", - "xpack.triggersActionsUI.sections.connectorAddInline.newAlertActionTypeEditTitle": "{actionConnectorName}", + "xpack.triggersActionsUI.sections.connectorAddInline.newRuleActionTypeEditTitle": "{actionConnectorName}", "xpack.triggersActionsUI.sections.connectorAddInline.unableToLoadConnectorTitle": "コネクターを読み込めません", "xpack.triggersActionsUI.sections.connectorAddInline.unableToLoadConnectorTitle'": "コネクターを読み込めません", "xpack.triggersActionsUI.sections.connectorAddInline.unauthorizedToCreateForEmptyConnectors": "許可されたユーザーのみがコネクターを構成できます。管理者にお問い合わせください。", @@ -28248,7 +28214,7 @@ "xpack.triggersActionsUI.sections.isDeprecatedDescription": "このコネクターは廃止予定です。更新するか新しく作成してください。", "xpack.triggersActionsUI.sections.manageLicense.manageLicenseCancelButtonText": "キャンセル", "xpack.triggersActionsUI.sections.manageLicense.manageLicenseConfirmButtonText": "ライセンスの管理", - "xpack.triggersActionsUI.sections.manageLicense.manageLicenseMessage": "ルールタイプ{alertTypeId}は無効です。{licenseRequired}ライセンスが必要です。アップグレードオプションを表示するには、[ライセンス管理]に移動してください。", + "xpack.triggersActionsUI.sections.manageLicense.manageLicenseMessage": "ルールタイプ{ruleTypeId}は無効です。{licenseRequired}ライセンスが必要です。アップグレードオプションを表示するには、[ライセンス管理]に移動してください。", "xpack.triggersActionsUI.sections.manageLicense.manageLicenseTitle": "{licenseRequired}ライセンスが必要です", "xpack.triggersActionsUI.sections.preconfiguredConnectorForm.flyoutTitle": "{connectorName}", "xpack.triggersActionsUI.sections.preconfiguredConnectorForm.tooltipContent": "このコネクターはあらかじめ構成されているため、編集できません。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8efa16af5e1c3..cd88c2b4b6a52 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -3234,7 +3234,6 @@ "expressions.functions.mathColumn.args.nameHelpText": "结果列的名称。名称不需要唯一。", "expressions.functions.mathColumn.arrayValueError": "无法对 {name} 的数组值执行数学运算", "expressions.functions.mathColumn.uniqueIdError": "ID 必须唯一", - "expressions.functions.mathColumnHelpText": "添加计算为其他列的结果的列。只有提供参数时,才会执行更改。另请参见 {alterColumnFn} 和 {staticColumnFn}。", "expressions.functions.mathHelpText": "使用 {TYPE_NUMBER} 或 {DATATABLE} 作为 {CONTEXT} 来解释 {TINYMATH} 数学表达式。{DATATABLE} 列按列名使用。如果 {CONTEXT} 是数字,则作为 {value} 使用。", "expressions.functions.movingAverage.args.byHelpText": "用于移动平均值计算拆分依据的列", "expressions.functions.movingAverage.args.inputColumnIdHelpText": "要计算移动平均值的列", @@ -6738,7 +6737,6 @@ "xpack.alerting.ruleTypeRegistry.register.customRecoveryActionGroupUsageError": "无法注册规则类型 [id=\"{id}\"]。操作组 [{actionGroup}] 无法同时用作恢复和活动操作组。", "xpack.alerting.ruleTypeRegistry.register.duplicateRuleTypeError": "已注册规则类型“{id}”。", "xpack.alerting.ruleTypeRegistry.register.invalidDefaultTimeoutRuleTypeError": "规则类型“{id}”的默认时间间隔无效:{errorMessage}。", - "xpack.alerting.ruleTypeRegistry.register.invalidMinimumTimeoutRuleTypeError": "规则类型“{id}”的最小时间间隔无效:{errorMessage}。", "xpack.alerting.ruleTypeRegistry.register.invalidTimeoutRuleTypeError": "规则类型“{id}”的超时无效:{errorMessage}。", "xpack.alerting.ruleTypeRegistry.register.reservedActionGroupUsageError": "无法注册规则类型 [id=\"{id}\"]。操作组 [{actionGroups}] 由框架保留。", "xpack.alerting.savedObjects.goToRulesButtonText": "前往规则", @@ -7313,8 +7311,6 @@ "xpack.apm.serviceIcons.serverless": "无服务器", "xpack.apm.serviceIcons.service": "服务", "xpack.apm.serviceIcons.serviceDetails.cloud.availabilityZoneLabel": "{zones, plural, other {可用性区域}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.betaLabel": "公测版", - "xpack.apm.serviceIcons.serviceDetails.cloud.betaTooltip": "AWS Lambda 支持不是 GA 版。请通过报告错误来帮助我们。", "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, other {触发类型}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.functionNameLabel": "{functionNames, plural, other {功能名称}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.machineTypesLabel": "{machineTypes, plural, other {机器类型}} ", @@ -7332,9 +7328,6 @@ "xpack.apm.serviceIcons.serviceDetails.service.frameworkLabel": "框架名称", "xpack.apm.serviceIcons.serviceDetails.service.runtimeLabel": "运行时名称和版本", "xpack.apm.serviceIcons.serviceDetails.service.versionLabel": "服务版本", - "xpack.apm.serviceInventory.toastText": "您正在运行 Elastic Stack 7.0+,我们检测到来自以前 6.x 版本的数据不兼容。如果想在 APM 中查看此数据,您应迁移数据。在以下位置查看更多内容: ", - "xpack.apm.serviceInventory.toastTitle": "在选定时间范围中检测到旧数据", - "xpack.apm.serviceInventory.upgradeAssistantLinkText": "升级助手", "xpack.apm.serviceLogs.noInfrastructureMessage": "没有可显示的日志消息。", "xpack.apm.serviceMap.anomalyDetectionPopoverDisabled": "通过在 APM 设置中启用异常检测来显示服务运行状况指标。", "xpack.apm.serviceMap.anomalyDetectionPopoverLink": "查看异常", @@ -8110,7 +8103,6 @@ "xpack.canvas.functions.alterColumn.args.typeHelpText": "将列转换成的类型。留空将不更改类型。", "xpack.canvas.functions.alterColumn.cannotConvertTypeErrorMessage": "无法转换为“{type}”", "xpack.canvas.functions.alterColumn.columnNotFoundErrorMessage": "找不到列:“{column}”", - "xpack.canvas.functions.alterColumnHelpText": "在核心类型(包括 {list} 和 {end})之间转换,并重命名列。另请参见 {mapColumnFn} 和 {staticColumnFn}。", "xpack.canvas.functions.any.args.conditionHelpText": "要检查的条件。", "xpack.canvas.functions.anyHelpText": "至少满足一个条件时,返回 {BOOLEAN_TRUE}。另见 {all_fn}。", "xpack.canvas.functions.as.args.nameHelpText": "要为列提供的名称。", @@ -8312,7 +8304,6 @@ "xpack.canvas.functions.sortHelpText": "按指定列对 {DATATABLE} 进行排序。", "xpack.canvas.functions.staticColumn.args.nameHelpText": "新列的名称。", "xpack.canvas.functions.staticColumn.args.valueHelpText": "要在新列的每一行中插入的值。提示:使用子表达式可将其他列汇总为静态值。", - "xpack.canvas.functions.staticColumnHelpText": "添加每一行都具有相同静态值的列。另请参见 {alterColumnFn} 和 {mapColumnFn}。", "xpack.canvas.functions.string.args.valueHelpText": "要连结成一个字符串的值。根据需要加入空格。", "xpack.canvas.functions.stringHelpText": "将所有参数串联成单个字符串。", "xpack.canvas.functions.switch.args.caseHelpText": "要检查的条件。", @@ -15740,7 +15731,6 @@ "xpack.ingestPipelines.processors.defaultDescription.dateIndexName.indexNamePrefixDefault.noPrefixValueLabel": "无前缀", "xpack.ingestPipelines.processors.defaultDescription.dateIndexName.indexNamePrefixDefault.prefixValueLabel": "带前缀“{prefix}”", "xpack.ingestPipelines.processors.defaultDescription.dissect": "从“{field}”提取匹配分解模式的值", - "xpack.ingestPipelines.processors.defaultDescription.dot_expander": "将“{field}”扩展成对象字段", "xpack.ingestPipelines.processors.defaultDescription.drop": "丢弃文档而不返回错误", "xpack.ingestPipelines.processors.defaultDescription.enrich": "如果策略“{policy_name}”匹配“{field}”,将数据扩充到“{target_field}”", "xpack.ingestPipelines.processors.defaultDescription.fail": "引发使执行停止的异常", @@ -23149,8 +23139,6 @@ "xpack.securitySolution.detectionEngine.components.importRuleModal.overwriteExceptionLabel": "覆盖具有冲突“list_id”的现有例外列表", "xpack.securitySolution.detectionEngine.components.importRuleModal.selectRuleDescription": "选择要导入的规则。可以包括关联的规则操作和例外。", "xpack.securitySolution.detectionEngine.components.importRuleModal.successfullyImportedRulesTitle": "已成功导入 {totalRules} 个{totalRules, plural, other {规则}}", - "xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithActivatingTitle": "创建并激活规则", - "xpack.securitySolution.detectionEngine.createRule. stepScheduleRule.completeWithoutActivatingTitle": "创建规则但不激活", "xpack.securitySolution.detectionEngine.createRule.backToRulesButton": "规则", "xpack.securitySolution.detectionEngine.createRule.editRuleButton": "编辑", "xpack.securitySolution.detectionEngine.createRule.eqlRuleTypeDescription": "事件关联", @@ -23252,8 +23240,6 @@ "xpack.securitySolution.detectionEngine.createRule.stepRuleActions.invalidMustacheTemplateErrorMessage": "{key} 不是有效的 Mustache 模板", "xpack.securitySolution.detectionEngine.createRule.stepRuleActions.noConnectorSelectedErrorMessage": "未选择任何连接器", "xpack.securitySolution.detectionEngine.createRule.stepRuleActions.noReadActionsPrivileges": "无法创建规则操作。您对“操作”插件没有“读”权限。", - "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithActivatingTitle": "创建并激活规则", - "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.completeWithoutActivatingTitle": "创建规则但不激活", "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackHelpText": "增加回查时段的时间以防止错过告警。", "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldAdditionalLookBackLabel": "更多回查时间", "xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.fieldIntervalHelpText": "规则定期运行并检测指定时间范围内的告警。", @@ -23935,7 +23921,6 @@ "xpack.securitySolution.detectionEngine.ruleDescription.mlJobStoppedDescription": "已停止", "xpack.securitySolution.detectionEngine.ruleDescription.thresholdResultsAggregatedByDescription": "结果聚合依据", "xpack.securitySolution.detectionEngine.ruleDescription.thresholdResultsAllDescription": "所有结果", - "xpack.securitySolution.detectionEngine.ruleDetails.activateRuleLabel": "激活", "xpack.securitySolution.detectionEngine.ruleDetails.backToRulesButton": "规则", "xpack.securitySolution.detectionEngine.ruleDetails.deletedRule": "已删除规则", "xpack.securitySolution.detectionEngine.ruleDetails.exceptionsTab": "例外", @@ -23978,8 +23963,6 @@ "xpack.securitySolution.detectionEngine.rules.allRules.actions.editRuleSettingsToolTip": "您没有 Kibana 操作权限", "xpack.securitySolution.detectionEngine.rules.allRules.actions.exportRuleDescription": "导出规则", "xpack.securitySolution.detectionEngine.rules.allRules.activeRuleDescription": "活动", - "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.activateSelectedErrorTitle": "启用{totalRules, plural, other {规则}}时出错", - "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deactivateSelectedErrorTitle": "禁用{totalRules, plural, other {规则}}时出错", "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedErrorTitle": "删除{totalRules, plural, other {规则}}时出错", "xpack.securitySolution.detectionEngine.rules.allRules.batchActions.deleteSelectedImmutableTitle": "选择内容包含无法删除的不可变规则", "xpack.securitySolution.detectionEngine.rules.allRules.batchActionsTitle": "批处理操作", @@ -27631,7 +27614,7 @@ "xpack.triggersActionsUI.cases.configureCases.mappingFieldSummary": "摘要", "xpack.triggersActionsUI.checkActionTypeEnabled.actionTypeDisabledByConfigMessage": "连接器已由 Kibana 配置禁用。", "xpack.triggersActionsUI.checkActionTypeEnabled.actionTypeDisabledByLicenseMessage": "此连接器需要{minimumLicenseRequired}许可证。", - "xpack.triggersActionsUI.checkAlertTypeEnabled.ruleTypeDisabledByLicenseMessage": "此规则类型需要{minimumLicenseRequired}许可证。", + "xpack.triggersActionsUI.checkRuleTypeEnabled.ruleTypeDisabledByLicenseMessage": "此规则类型需要{minimumLicenseRequired}许可证。", "xpack.triggersActionsUI.common.constants.comparators.groupByTypes.allDocumentsLabel": "所有文档", "xpack.triggersActionsUI.common.constants.comparators.groupByTypes.topLabel": "排名前", "xpack.triggersActionsUI.common.constants.comparators.isAboveLabel": "高于", @@ -28078,153 +28061,137 @@ "xpack.triggersActionsUI.sections.addModalConnectorForm.flyoutTitle": "{actionTypeName} 连接器", "xpack.triggersActionsUI.sections.addModalConnectorForm.saveButtonLabel": "保存", "xpack.triggersActionsUI.sections.addModalConnectorForm.updateSuccessNotificationText": "已创建“{connectorName}”", - "xpack.triggersActionsUI.sections.alertAdd.flyoutTitle": "创建规则", - "xpack.triggersActionsUI.sections.alertAdd.indexControls.timeFieldOptionLabel": "选择字段", - "xpack.triggersActionsUI.sections.alertAdd.operationName": "创建", - "xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText": "无法创建规则。", - "xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText": "已创建规则“{ruleName}”", - "xpack.triggersActionsUI.sections.alertAddFooter.cancelButtonLabel": "取消", - "xpack.triggersActionsUI.sections.alertAddFooter.saveButtonLabel": "保存", - "xpack.triggersActionsUI.sections.alertDetails.actionWithBrokenConnectorWarningBannerEditText": "编辑规则", - "xpack.triggersActionsUI.sections.alertDetails.actionWithBrokenConnectorWarningBannerTitle": "与此规则关联的连接器之一出现问题。", - "xpack.triggersActionsUI.sections.alertDetails.alertDetailsTitle": "{alertName}", - "xpack.triggersActionsUI.sections.alertDetails.alertInstances.disabledRule": "此规则已禁用,无法显示。", - "xpack.triggersActionsUI.sections.alertDetails.alerts.disabledRuleTitle": "已禁用规则", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.avgDurationDescription": "平均持续时间", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.alert": "告警", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.duration": "持续时间", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.mute": "静音", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.start": "启动", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.status": "状态", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.ruleLastExecutionDescription": "上次响应", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.ruleTypeExcessDurationMessage": "持续时间超出了规则的预期运行时间。", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.status.active": "活动", - "xpack.triggersActionsUI.sections.alertDetails.alertsList.status.inactive": "已恢复", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.enableLoadingTitle": "启用", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.enableTitle": "启用", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.muteLoadingTitle": "静音", - "xpack.triggersActionsUI.sections.alertDetails.collapsedItemActons.muteTitle": "静音", - "xpack.triggersActionsUI.sections.alertDetails.dismissButtonTitle": "关闭", - "xpack.triggersActionsUI.sections.alertDetails.editAlertButtonLabel": "编辑", - "xpack.triggersActionsUI.sections.alertDetails.manageLicensePlanBannerLinkTitle": "管理许可证", - "xpack.triggersActionsUI.sections.alertDetails.redirectObjectNoun": "规则", - "xpack.triggersActionsUI.sections.alertDetails.unableToLoadAlertMessage": "无法加载规则:{message}", - "xpack.triggersActionsUI.sections.alertDetails.unableToLoadAlertsMessage": "无法加载告警:{message}", - "xpack.triggersActionsUI.sections.alertDetails.viewAlertInAppButtonLabel": "在应用中查看", - "xpack.triggersActionsUI.sections.alertEdit.cancelButtonLabel": "取消", - "xpack.triggersActionsUI.sections.alertEdit.disabledActionsWarningTitle": "此规则具有已禁用的操作", - "xpack.triggersActionsUI.sections.alertEdit.flyoutTitle": "编辑规则", - "xpack.triggersActionsUI.sections.alertEdit.saveButtonLabel": "保存", - "xpack.triggersActionsUI.sections.alertEdit.saveErrorNotificationText": "无法更新规则。", - "xpack.triggersActionsUI.sections.alertEdit.saveSuccessNotificationText": "已更新“{ruleName}”", - "xpack.triggersActionsUI.sections.alertForm.alertNameLabel": "名称", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.label": "每", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.description": "操作在告警状态更改时运行。", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.display": "仅在状态更改时", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.label": "仅在状态更改时", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.description": "告警活动时,操作按规则时间间隔重复。", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.display": "每次告警处于活动状态时", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.label": "每次告警处于活动状态时", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.description": "操作按照您设置的时间间隔运行。", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.display": "按定制操作时间间隔", - "xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.label": "按定制操作时间间隔", - "xpack.triggersActionsUI.sections.alertForm.changeAlertTypeAriaLabel": "删除", - "xpack.triggersActionsUI.sections.alertForm.checkFieldLabel": "检查频率", - "xpack.triggersActionsUI.sections.alertForm.checkWithTooltip": "定义评估条件的频率。检查已排队;它们的运行接近于容量允许的定义值。", - "xpack.triggersActionsUI.sections.alertForm.conditions.addConditionLabel": "添加:", - "xpack.triggersActionsUI.sections.alertForm.conditions.removeConditionLabel": "移除", - "xpack.triggersActionsUI.sections.alertForm.conditions.title": "条件:", - "xpack.triggersActionsUI.sections.alertForm.documentationLabel": "文档", - "xpack.triggersActionsUI.sections.alertForm.error.belowMinimumText": "时间间隔小于此规则类型的最小值 ({minimum})", - "xpack.triggersActionsUI.sections.alertForm.error.noAuthorizedRuleTypes": "为了{operation}规则,您需要获得相应的权限。", - "xpack.triggersActionsUI.sections.alertForm.error.noAuthorizedRuleTypesTitle": "您尚无权{operation}任何规则类型", - "xpack.triggersActionsUI.sections.alertForm.error.requiredActionConnector": "“{actionTypeId} 连接器的操作”必填。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredIntervalText": "“检查时间间隔”必填。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredNameText": "“名称”必填。", - "xpack.triggersActionsUI.sections.alertForm.error.requiredRuleTypeIdText": "“规则类型”必填。", - "xpack.triggersActionsUI.sections.alertForm.loadingRuleTypeParamsDescription": "正在加载规则类型参数……", - "xpack.triggersActionsUI.sections.alertForm.loadingRuleTypesDescription": "正在加载规则类型……", - "xpack.triggersActionsUI.sections.alertForm.renotifyFieldLabel": "通知", - "xpack.triggersActionsUI.sections.alertForm.renotifyWithTooltip": "定义规则处于活动状态时重复操作的频率。", - "xpack.triggersActionsUI.sections.alertForm.ruleTypeSelectLabel": "选择规则类型", - "xpack.triggersActionsUI.sections.alertForm.searchPlaceholderTitle": "搜索", - "xpack.triggersActionsUI.sections.alertForm.solutionFilterLabel": "按用例筛选", - "xpack.triggersActionsUI.sections.alertForm.tagsFieldLabel": "标签(可选)", - "xpack.triggersActionsUI.sections.alertForm.unableToLoadRuleTypesMessage": "无法加载规则类型", - "xpack.triggersActionsUI.sections.alertsList.actionTypeFilterLabel": "操作类型", - "xpack.triggersActionsUI.sections.alertsList.addRuleButtonLabel": "创建规则", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonDecrypting": "解密规则时发生错误。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonDisabled": "无法执行规则,因为在规则禁用之后已运行。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonLicense": "无法运行规则", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonReading": "读取规则时发生错误。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonRunning": "运行规则时发生错误。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonTimeout": "由于超时,规则执行已取消。", - "xpack.triggersActionsUI.sections.alertsList.alertErrorReasonUnknown": "由于未知原因发生错误。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.actionsTex": "操作", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.actionsWarningTooltip": "无法加载与此规则关联的连接器之一。请编辑该规则以选择新连接器。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.alertTypeTitle": "类型", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.deleteAriaLabel": "删除", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.deleteButtonTooltip": "删除", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.durationTitle": "运行规则所需的时间长度。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.editAriaLabel": "编辑", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.editButtonTooltip": "编辑", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.enabledTitle": "已启用", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.lastExecutionDateTitle": "上次执行的开始时间。", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.mutedBadge": "已静音", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.nameTitle": "名称", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.ruleExecutionPercentileSelectButton": "选择百分位数", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.ruleExecutionPercentileTooltip": "此规则过去的 {sampleLimit} 执行持续时间的第 {percentileOrdinal} 个百分位", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.scheduleTitle": "时间间隔", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.statusTitle": "状态", - "xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.successRatioTitle": "成功执行此规则的频率", - "xpack.triggersActionsUI.sections.alertsList.alertStatusActive": "活动", - "xpack.triggersActionsUI.sections.alertsList.alertStatusError": "错误", - "xpack.triggersActionsUI.sections.alertsList.alertStatusFilterLabel": "状态", - "xpack.triggersActionsUI.sections.alertsList.alertStatusLicenseError": "许可证错误", - "xpack.triggersActionsUI.sections.alertsList.alertStatusOk": "确定", - "xpack.triggersActionsUI.sections.alertsList.alertStatusPending": "待处理", - "xpack.triggersActionsUI.sections.alertsList.alertStatusUnknown": "未知", - "xpack.triggersActionsUI.sections.alertsList.attentionBannerTitle": "{totalStatusesError, plural, other {# 个规则}}中出现错误。", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.buttonTitle": "管理规则", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.deleteAllTitle": "删除", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.disableAllTitle": "禁用", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.enableAllTitle": "启用", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToDeleteRulesMessage": "无法删除规则", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToDisableRulesMessage": "无法禁用规则", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToEnableRulesMessage": "无法启用规则", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToMuteRulesMessage": "无法静音规则", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToUnmuteRulesMessage": "无法取消静音规则", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.muteAllTitle": "静音", - "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.unmuteAllTitle": "取消静音", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteRuleTitle": "删除规则", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.disableTitle": "禁用", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.editTitle": "编辑规则", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle": "启用", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle": "静音", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle": "操作", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.unmuteTitle": "取消静音", - "xpack.triggersActionsUI.sections.alertsList.dismissBunnerButtonLabel": "关闭", - "xpack.triggersActionsUI.sections.alertsList.fixLicenseLink": "修复", - "xpack.triggersActionsUI.sections.alertsList.multipleTitle": "规则", - "xpack.triggersActionsUI.sections.alertsList.noPermissionToCreateDescription": "请联系您的系统管理员。", - "xpack.triggersActionsUI.sections.alertsList.noPermissionToCreateTitle": "没有创建规则的权限", - "xpack.triggersActionsUI.sections.alertsList.refreshAlertsButtonLabel": "刷新", - "xpack.triggersActionsUI.sections.alertsList.resetDefaultIndexLabel": "重置默认索引", - "xpack.triggersActionsUI.sections.alertsList.ruleTypeExcessDurationMessage": "持续时间超出了规则的预期运行时间。", - "xpack.triggersActionsUI.sections.alertsList.searchPlaceholderTitle": "搜索", - "xpack.triggersActionsUI.sections.alertsList.singleTitle": "规则", - "xpack.triggersActionsUI.sections.alertsList.totalItemsCountDescription": "正在显示:{pageSize} 个规则(共 {totalItemCount} 个)。", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesActiveDescription": "活动:{totalStatusesActive}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesErrorDescription": "错误:{totalStatusesError}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesOkDescription": "确定:{totalStatusesOk}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesPendingDescription": "待处理:{totalStatusesPending}", - "xpack.triggersActionsUI.sections.alertsList.totalStatusesUnknownDescription": "未知:{totalStatusesUnknown}", - "xpack.triggersActionsUI.sections.alertsList.typeFilterLabel": "类型", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadConnectorTypesMessage": "无法加载连接器类型", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadRulesMessage": "无法加载规则", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadRuleStatusInfoMessage": "无法加载规则状态信息", - "xpack.triggersActionsUI.sections.alertsList.unableToLoadRuleTypesMessage": "无法加载规则类型", - "xpack.triggersActionsUI.sections.alertsList.viewBunnerButtonLabel": "查看", + "xpack.triggersActionsUI.sections.ruleAdd.flyoutTitle": "创建规则", + "xpack.triggersActionsUI.sections.ruleAdd.indexControls.timeFieldOptionLabel": "选择字段", + "xpack.triggersActionsUI.sections.ruleAdd.operationName": "创建", + "xpack.triggersActionsUI.sections.ruleAdd.saveErrorNotificationText": "无法创建规则。", + "xpack.triggersActionsUI.sections.ruleAdd.saveSuccessNotificationText": "已创建规则“{ruleName}”", + "xpack.triggersActionsUI.sections.ruleAddFooter.cancelButtonLabel": "取消", + "xpack.triggersActionsUI.sections.ruleAddFooter.saveButtonLabel": "保存", + "xpack.triggersActionsUI.sections.ruleDetails.actionWithBrokenConnectorWarningBannerEditText": "编辑规则", + "xpack.triggersActionsUI.sections.ruleDetails.actionWithBrokenConnectorWarningBannerTitle": "与此规则关联的连接器之一出现问题。", + "xpack.triggersActionsUI.sections.ruleDetails.ruleDetailsTitle": "{ruleName}", + "xpack.triggersActionsUI.sections.ruleDetails.alertInstances.disabledRule": "此规则已禁用,无法显示。", + "xpack.triggersActionsUI.sections.ruleDetails.alertInstances.disabledRuleTitle": "已禁用规则", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.enableLoadingTitle": "启用", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.enableTitle": "启用", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.muteLoadingTitle": "静音", + "xpack.triggersActionsUI.sections.ruleDetails.collapsedItemActons.muteTitle": "静音", + "xpack.triggersActionsUI.sections.ruleDetails.dismissButtonTitle": "关闭", + "xpack.triggersActionsUI.sections.ruleDetails.editRuleButtonLabel": "编辑", + "xpack.triggersActionsUI.sections.ruleDetails.manageLicensePlanBannerLinkTitle": "管理许可证", + "xpack.triggersActionsUI.sections.ruleDetails.redirectObjectNoun": "规则", + "xpack.triggersActionsUI.sections.ruleDetails.unableToLoadRuleMessage": "无法加载规则:{message}", + "xpack.triggersActionsUI.sections.ruleDetails.unableToLoadRulesMessage": "无法加载告警:{message}", + "xpack.triggersActionsUI.sections.ruleDetails.viewRuleInAppButtonLabel": "在应用中查看", + "xpack.triggersActionsUI.sections.ruleEdit.cancelButtonLabel": "取消", + "xpack.triggersActionsUI.sections.ruleEdit.disabledActionsWarningTitle": "此规则具有已禁用的操作", + "xpack.triggersActionsUI.sections.ruleEdit.flyoutTitle": "编辑规则", + "xpack.triggersActionsUI.sections.ruleEdit.saveButtonLabel": "保存", + "xpack.triggersActionsUI.sections.ruleEdit.saveErrorNotificationText": "无法更新规则。", + "xpack.triggersActionsUI.sections.ruleEdit.saveSuccessNotificationText": "已更新“{ruleName}”", + "xpack.triggersActionsUI.sections.ruleForm.ruleNameLabel": "名称", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.label": "每", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.description": "操作在告警状态更改时运行。", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.display": "仅在状态更改时", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.label": "仅在状态更改时", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.description": "告警活动时,操作按规则时间间隔重复。", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.display": "每次告警处于活动状态时", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.label": "每次告警处于活动状态时", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.description": "操作按照您设置的时间间隔运行。", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.display": "按定制操作时间间隔", + "xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.label": "按定制操作时间间隔", + "xpack.triggersActionsUI.sections.ruleForm.changeRuleTypeAriaLabel": "删除", + "xpack.triggersActionsUI.sections.ruleForm.checkFieldLabel": "检查频率", + "xpack.triggersActionsUI.sections.ruleForm.checkWithTooltip": "定义评估条件的频率。", + "xpack.triggersActionsUI.sections.ruleForm.conditions.addConditionLabel": "添加:", + "xpack.triggersActionsUI.sections.ruleForm.conditions.removeConditionLabel": "移除", + "xpack.triggersActionsUI.sections.ruleForm.conditions.title": "条件:", + "xpack.triggersActionsUI.sections.ruleForm.documentationLabel": "文档", + "xpack.triggersActionsUI.sections.ruleForm.error.noAuthorizedRuleTypes": "为了{operation}规则,您需要获得相应的权限。", + "xpack.triggersActionsUI.sections.ruleForm.error.noAuthorizedRuleTypesTitle": "您尚无权{operation}任何规则类型", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredActionConnector": "“{actionTypeId} 连接器的操作”必填。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredIntervalText": "“检查时间间隔”必填。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredNameText": "“名称”必填。", + "xpack.triggersActionsUI.sections.ruleForm.error.requiredRuleTypeIdText": "“规则类型”必填。", + "xpack.triggersActionsUI.sections.ruleForm.loadingRuleTypeParamsDescription": "正在加载规则类型参数……", + "xpack.triggersActionsUI.sections.ruleForm.loadingRuleTypesDescription": "正在加载规则类型……", + "xpack.triggersActionsUI.sections.ruleForm.renotifyFieldLabel": "通知", + "xpack.triggersActionsUI.sections.ruleForm.renotifyWithTooltip": "定义规则处于活动状态时重复操作的频率。", + "xpack.triggersActionsUI.sections.ruleForm.ruleTypeSelectLabel": "选择规则类型", + "xpack.triggersActionsUI.sections.ruleForm.searchPlaceholderTitle": "搜索", + "xpack.triggersActionsUI.sections.ruleForm.solutionFilterLabel": "按用例筛选", + "xpack.triggersActionsUI.sections.ruleForm.tagsFieldLabel": "标签(可选)", + "xpack.triggersActionsUI.sections.ruleForm.unableToLoadRuleTypesMessage": "无法加载规则类型", + "xpack.triggersActionsUI.sections.rulesList.actionTypeFilterLabel": "操作类型", + "xpack.triggersActionsUI.sections.rulesList.addRuleButtonLabel": "创建规则", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonDecrypting": "解密规则时发生错误。", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonLicense": "无法运行规则", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonReading": "读取规则时发生错误。", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonRunning": "运行规则时发生错误。", + "xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonUnknown": "由于未知原因发生错误。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.actionsTex": "操作", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.actionsWarningTooltip": "无法加载与此规则关联的连接器之一。请编辑该规则以选择新连接器。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.ruleTypeTitle": "类型", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.deleteAriaLabel": "删除", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.deleteButtonTooltip": "删除", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.durationTitle": "运行规则所需的时间长度。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.editAriaLabel": "编辑", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.editButtonTooltip": "编辑", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.enabledTitle": "已启用", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.lastExecutionDateTitle": "上次执行的开始时间。", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.mutedBadge": "已静音", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.nameTitle": "名称", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.scheduleTitle": "时间间隔", + "xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.statusTitle": "状态", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusActive": "活动", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusError": "错误", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusFilterLabel": "状态", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusLicenseError": "许可证错误", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusOk": "确定", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusPending": "待处理", + "xpack.triggersActionsUI.sections.rulesList.ruleStatusUnknown": "未知", + "xpack.triggersActionsUI.sections.rulesList.attentionBannerTitle": "{totalStatusesError, plural, other {# 个规则}}中出现错误。", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.buttonTitle": "管理规则", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.deleteAllTitle": "删除", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.disableAllTitle": "禁用", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.enableAllTitle": "启用", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToDeleteRulesMessage": "无法删除规则", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToDisableRulesMessage": "无法禁用规则", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToEnableRulesMessage": "无法启用规则", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToMuteRulesMessage": "无法静音规则", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToUnmuteRulesMessage": "无法取消静音规则", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.muteAllTitle": "静音", + "xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.unmuteAllTitle": "取消静音", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.deleteRuleTitle": "删除规则", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.disableTitle": "禁用", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.editTitle": "编辑规则", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.enableTitle": "启用", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.muteTitle": "静音", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.popoverButtonTitle": "操作", + "xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.unmuteTitle": "取消静音", + "xpack.triggersActionsUI.sections.rulesList.dismissBunnerButtonLabel": "关闭", + "xpack.triggersActionsUI.sections.rulesList.fixLicenseLink": "修复", + "xpack.triggersActionsUI.sections.rulesList.multipleTitle": "规则", + "xpack.triggersActionsUI.sections.rulesList.noPermissionToCreateDescription": "请联系您的系统管理员。", + "xpack.triggersActionsUI.sections.rulesList.noPermissionToCreateTitle": "没有创建规则的权限", + "xpack.triggersActionsUI.sections.rulesList.refreshRulesButtonLabel": "刷新", + "xpack.triggersActionsUI.sections.rulesList.resetDefaultIndexLabel": "重置默认索引", + "xpack.triggersActionsUI.sections.rulesList.ruleTypeExcessDurationMessage": "持续时间超出了规则的预期运行时间。", + "xpack.triggersActionsUI.sections.rulesList.searchPlaceholderTitle": "搜索", + "xpack.triggersActionsUI.sections.rulesList.singleTitle": "规则", + "xpack.triggersActionsUI.sections.rulesList.totalItemsCountDescription": "正在显示:{pageSize} 个规则(共 {totalItemCount} 个)。", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesActiveDescription": "活动:{totalStatusesActive}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesErrorDescription": "错误:{totalStatusesError}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesOkDescription": "确定:{totalStatusesOk}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesPendingDescription": "待处理:{totalStatusesPending}", + "xpack.triggersActionsUI.sections.rulesList.totalStatusesUnknownDescription": "未知:{totalStatusesUnknown}", + "xpack.triggersActionsUI.sections.rulesList.typeFilterLabel": "类型", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadConnectorTypesMessage": "无法加载连接器类型", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadRulesMessage": "无法加载规则", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadRuleStatusInfoMessage": "无法加载规则状态信息", + "xpack.triggersActionsUI.sections.rulesList.unableToLoadRuleTypesMessage": "无法加载规则类型", + "xpack.triggersActionsUI.sections.rulesList.viewBunnerButtonLabel": "查看", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.addBccButton": "密送", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.addCcButton": "抄送", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.authenticationLabel": "身份验证", @@ -28244,20 +28211,20 @@ "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.subjectTextFieldLabel": "主题", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.tenantIdFieldLabel": "租户 ID", "xpack.triggersActionsUI.sections.builtinActionTypes.emailAction.userTextFieldLabel": "用户名", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseCancelButtonText": "取消", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseConfirmButtonText": "放弃更改", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseMessage": "您无法恢复未保存更改。", - "xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseTitle": "丢弃规则的未保存更改?", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveCancelButtonText": "取消", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveConfirmButtonText": "保存规则", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveTitle": "保存规则,而不执行任何操作?", - "xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveWithoutActionsMessage": "您可以随时添加操作。", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseCancelButtonText": "取消", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseConfirmButtonText": "放弃更改", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseMessage": "您无法恢复未保存更改。", + "xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseTitle": "丢弃规则的未保存更改?", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveCancelButtonText": "取消", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveConfirmButtonText": "保存规则", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveTitle": "保存规则,而不执行任何操作?", + "xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveWithoutActionsMessage": "您可以随时添加操作。", "xpack.triggersActionsUI.sections.connectorAddInline.accordion.deleteIconAriaLabel": "删除", "xpack.triggersActionsUI.sections.connectorAddInline.addConnectorButtonLabel": "创建连接器", "xpack.triggersActionsUI.sections.connectorAddInline.connectorAddInline.actionIdLabel": "使用其他 {connectorInstance} 连接器", "xpack.triggersActionsUI.sections.connectorAddInline.connectorAddInline.addNewConnectorEmptyButton": "添加连接器", "xpack.triggersActionsUI.sections.connectorAddInline.emptyConnectorsLabel": "无 {actionTypeName} 连接器", - "xpack.triggersActionsUI.sections.connectorAddInline.newAlertActionTypeEditTitle": "{actionConnectorName}", + "xpack.triggersActionsUI.sections.connectorAddInline.newRuleActionTypeEditTitle": "{actionConnectorName}", "xpack.triggersActionsUI.sections.connectorAddInline.unableToLoadConnectorTitle": "无法加载连接器", "xpack.triggersActionsUI.sections.connectorAddInline.unableToLoadConnectorTitle'": "无法加载连接器", "xpack.triggersActionsUI.sections.connectorAddInline.unauthorizedToCreateForEmptyConnectors": "只有获得授权的用户才能配置连接器。请联系您的管理员。", @@ -28281,7 +28248,7 @@ "xpack.triggersActionsUI.sections.isDeprecatedDescription": "此连接器已过时。请进行更新,或创建新连接器。", "xpack.triggersActionsUI.sections.manageLicense.manageLicenseCancelButtonText": "取消", "xpack.triggersActionsUI.sections.manageLicense.manageLicenseConfirmButtonText": "管理许可证", - "xpack.triggersActionsUI.sections.manageLicense.manageLicenseMessage": "规则类型 {alertTypeId} 已禁用,因为它需要{licenseRequired}许可证。继续前往“许可证管理”查看升级选项。", + "xpack.triggersActionsUI.sections.manageLicense.manageLicenseMessage": "规则类型 {ruleTypeId} 已禁用,因为它需要{licenseRequired}许可证。继续前往“许可证管理”查看升级选项。", "xpack.triggersActionsUI.sections.manageLicense.manageLicenseTitle": "需要{licenseRequired}许可证", "xpack.triggersActionsUI.sections.preconfiguredConnectorForm.flyoutTitle": "{connectorName}", "xpack.triggersActionsUI.sections.preconfiguredConnectorForm.tooltipContent": "这是预配置连接器,无法编辑", diff --git a/x-pack/plugins/triggers_actions_ui/common/index.ts b/x-pack/plugins/triggers_actions_ui/common/index.ts index 4989b98e5a555..560d045c0bb47 100644 --- a/x-pack/plugins/triggers_actions_ui/common/index.ts +++ b/x-pack/plugins/triggers_actions_ui/common/index.ts @@ -9,3 +9,4 @@ /* eslint-disable @kbn/eslint/no_export_all */ export * from './data'; +export const BASE_TRIGGERS_ACTIONS_UI_API_PATH = '/api/triggers_actions_ui'; diff --git a/x-pack/plugins/triggers_actions_ui/kibana.json b/x-pack/plugins/triggers_actions_ui/kibana.json index b72a7fe96817d..b7b918aff946f 100644 --- a/x-pack/plugins/triggers_actions_ui/kibana.json +++ b/x-pack/plugins/triggers_actions_ui/kibana.json @@ -1,8 +1,8 @@ { "id": "triggersActionsUi", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "kibana", "server": true, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx index 504f9256d0283..b2c350a4f1f29 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx @@ -29,8 +29,8 @@ import { setSavedObjectsClient } from '../common/lib/data_apis'; import { KibanaContextProvider } from '../common/lib/kibana'; const TriggersActionsUIHome = lazy(() => import('./home')); -const AlertDetailsRoute = lazy( - () => import('./sections/alert_details/components/alert_details_route') +const RuleDetailsRoute = lazy( + () => import('./sections/rule_details/components/rule_details_route') ); export interface TriggersAndActionsUiServices extends CoreStart { @@ -88,7 +88,7 @@ export const AppWithoutRouter = ({ sectionsRegex }: { sectionsRegex: string }) = /> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx index c2946d0d5fb15..a488086032f07 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx @@ -20,7 +20,7 @@ import { useHealthContext } from '../context/health_context'; import { useKibana } from '../../common/lib/kibana'; import { CenterJustifiedSpinner } from './center_justified_spinner'; import { triggersActionsUiHealth } from '../../common/lib/health_api'; -import { alertingFrameworkHealth } from '../lib/alert_api'; +import { alertingFrameworkHealth } from '../lib/rule_api'; interface Props { inFlyout?: boolean; @@ -28,7 +28,7 @@ interface Props { } interface HealthStatus { - isAlertsAvailable: boolean; + isRulesAvailable: boolean; isSufficientlySecure: boolean; hasPermanentEncryptionKey: boolean; } @@ -51,7 +51,7 @@ export const HealthCheck: React.FunctionComponent = ({ isSufficientlySecure: false, hasPermanentEncryptionKey: false, }; - if (healthStatus.isAlertsAvailable) { + if (healthStatus.isRulesAvailable) { const alertingHealthResult = await alertingFrameworkHealth({ http }); healthStatus.isSufficientlySecure = alertingHealthResult.isSufficientlySecure; healthStatus.hasPermanentEncryptionKey = alertingHealthResult.hasPermanentEncryptionKey; @@ -79,7 +79,7 @@ export const HealthCheck: React.FunctionComponent = ({ (healthCheck) => { return healthCheck?.isSufficientlySecure && healthCheck?.hasPermanentEncryptionKey ? ( <>{children} - ) : !healthCheck.isAlertsAvailable ? ( + ) : !healthCheck.isRulesAvailable ? ( ) : !healthCheck.isSufficientlySecure && !healthCheck.hasPermanentEncryptionKey ? ( diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx index aef842c9baccb..c9f010b2d6a7e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx @@ -12,7 +12,7 @@ import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; export const EmptyPrompt = ({ onCTAClicked }: { onCTAClicked: () => void }) => ( void }) => ( } actions={ import('./sections/actions_connectors_list/components/actions_connectors_list') ); -const AlertsList = lazy(() => import('./sections/alerts_list/components/alerts_list')); +const RulesList = lazy(() => import('./sections/rules_list/components/rules_list')); export interface MatchParams { section: Section; @@ -132,7 +132,7 @@ export const TriggersActionsUIHome: React.FunctionComponent diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/index.ts deleted file mode 100644 index ea4f146cb6acb..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 { alertingFrameworkHealth } from './health'; -export { mapFiltersToKql } from './map_filters_to_kql'; -export { loadAlertAggregations } from './aggregate'; -export { createAlert } from './create'; -export { deleteAlerts } from './delete'; -export { disableAlert, disableAlerts } from './disable'; -export { enableAlert, enableAlerts } from './enable'; -export { loadAlert } from './get_rule'; -export { loadAlertSummary } from './alert_summary'; -export { muteAlertInstance } from './mute_alert'; -export { muteAlert, muteAlerts } from './mute'; -export { loadAlertTypes } from './rule_types'; -export { loadAlerts } from './rules'; -export { loadAlertState } from './state'; -export { unmuteAlertInstance } from './unmute_alert'; -export { unmuteAlert, unmuteAlerts } from './unmute'; -export { updateAlert } from './update'; -export { resolveRule } from './resolve_rule'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.test.ts index 4dbda8f5d9614..26a69093ae48d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getAlertingSectionBreadcrumb, getAlertDetailsBreadcrumb } from './breadcrumb'; +import { getAlertingSectionBreadcrumb, getRuleDetailsBreadcrumb } from './breadcrumb'; import { i18n } from '@kbn/i18n'; import { routeToConnectors, routeToRules, routeToHome } from '../constants'; @@ -32,9 +32,9 @@ describe('getAlertingSectionBreadcrumb', () => { }); }); -describe('getAlertDetailsBreadcrumb', () => { +describe('getRuleDetailsBreadcrumb', () => { test('if select an alert should return proper breadcrumb title with alert name ', async () => { - expect(getAlertDetailsBreadcrumb('testId', 'testName')).toMatchObject({ + expect(getRuleDetailsBreadcrumb('testId', 'testName')).toMatchObject({ text: i18n.translate('xpack.triggersActionsUI.alertDetails.breadcrumbTitle', { defaultMessage: 'testName', }), diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.ts index b98aac8719d32..d26cdbcb3d174 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/breadcrumb.ts @@ -35,7 +35,7 @@ export const getAlertingSectionBreadcrumb = (type: string): { text: string; href } }; -export const getAlertDetailsBreadcrumb = ( +export const getRuleDetailsBreadcrumb = ( id: string, name: string ): { text: string; href: string } => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/capabilities.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/capabilities.ts index 0cde499de8042..74b8243519428 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/capabilities.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/capabilities.ts @@ -6,7 +6,7 @@ */ import { RuleType } from '../../types'; -import { InitialAlert } from '../sections/alert_form/alert_reducer'; +import { InitialRule } from '../sections/rule_form/rule_reducer'; /** * NOTE: Applications that want to show the alerting UIs will need to add @@ -23,9 +23,9 @@ export const hasExecuteActionsCapability = (capabilities: Capabilities) => export const hasDeleteActionsCapability = (capabilities: Capabilities) => capabilities?.actions?.delete; -export function hasAllPrivilege(alert: InitialAlert, alertType?: RuleType): boolean { - return alertType?.authorizedConsumers[alert.consumer]?.all ?? false; +export function hasAllPrivilege(rule: InitialRule, ruleType?: RuleType): boolean { + return ruleType?.authorizedConsumers[rule.consumer]?.all ?? false; } -export function hasReadPrivilege(alert: InitialAlert, alertType?: RuleType): boolean { - return alertType?.authorizedConsumers[alert.consumer]?.read ?? false; +export function hasReadPrivilege(rule: InitialRule, ruleType?: RuleType): boolean { + return ruleType?.authorizedConsumers[rule.consumer]?.read ?? false; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/check_alert_type_enabled.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/lib/check_rule_type_enabled.test.tsx similarity index 75% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/check_alert_type_enabled.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/lib/check_rule_type_enabled.test.tsx index ebdea0c3e5878..0668fb56c4ef1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/check_alert_type_enabled.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/check_rule_type_enabled.test.tsx @@ -6,18 +6,18 @@ */ import { RuleType } from '../../types'; -import { checkAlertTypeEnabled } from './check_alert_type_enabled'; +import { checkRuleTypeEnabled } from './check_rule_type_enabled'; -describe('checkAlertTypeEnabled', () => { - test(`returns isEnabled:true when alert type isn't provided`, async () => { - expect(checkAlertTypeEnabled()).toMatchInlineSnapshot(` +describe('checkRuleTypeEnabled', () => { + test(`returns isEnabled:true when rule type isn't provided`, async () => { + expect(checkRuleTypeEnabled()).toMatchInlineSnapshot(` Object { "isEnabled": true, } `); }); - test('returns isEnabled:true when alert type is enabled', async () => { + test('returns isEnabled:true when rule type is enabled', async () => { const alertType: RuleType = { id: 'test', name: 'Test', @@ -34,14 +34,14 @@ describe('checkAlertTypeEnabled', () => { minimumLicenseRequired: 'basic', enabledInLicense: true, }; - expect(checkAlertTypeEnabled(alertType)).toMatchInlineSnapshot(` + expect(checkRuleTypeEnabled(alertType)).toMatchInlineSnapshot(` Object { "isEnabled": true, } `); }); - test('returns isEnabled:false when alert type is disabled by license', async () => { + test('returns isEnabled:false when rule type is disabled by license', async () => { const alertType: RuleType = { id: 'test', name: 'Test', @@ -58,7 +58,7 @@ describe('checkAlertTypeEnabled', () => { minimumLicenseRequired: 'gold', enabledInLicense: false, }; - expect(checkAlertTypeEnabled(alertType)).toMatchInlineSnapshot(` + expect(checkRuleTypeEnabled(alertType)).toMatchInlineSnapshot(` Object { "isEnabled": false, "message": "This rule type requires a Gold license.", diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/check_alert_type_enabled.tsx b/x-pack/plugins/triggers_actions_ui/public/application/lib/check_rule_type_enabled.tsx similarity index 64% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/check_alert_type_enabled.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/lib/check_rule_type_enabled.tsx index 3b53e8f9a6c33..b1127c0b90eed 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/check_alert_type_enabled.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/check_rule_type_enabled.tsx @@ -17,24 +17,24 @@ export interface IsDisabledResult { message: string; } -const getLicenseCheckResult = (alertType: RuleType) => { +const getLicenseCheckResult = (ruleType: RuleType) => { return { isEnabled: false, message: i18n.translate( - 'xpack.triggersActionsUI.checkAlertTypeEnabled.ruleTypeDisabledByLicenseMessage', + 'xpack.triggersActionsUI.checkRuleTypeEnabled.ruleTypeDisabledByLicenseMessage', { defaultMessage: 'This rule type requires a {minimumLicenseRequired} license.', values: { - minimumLicenseRequired: upperFirst(alertType.minimumLicenseRequired), + minimumLicenseRequired: upperFirst(ruleType.minimumLicenseRequired), }, } ), }; }; -export function checkAlertTypeEnabled(alertType?: RuleType): IsEnabledResult | IsDisabledResult { - if (alertType?.enabledInLicense === false) { - return getLicenseCheckResult(alertType); +export function checkRuleTypeEnabled(ruleType?: RuleType): IsEnabledResult | IsDisabledResult { + if (ruleType?.enabledInLicense === false) { + return getLicenseCheckResult(ruleType); } return { isEnabled: true }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.test.ts similarity index 90% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.test.ts index 57feb1e7abae9..53378d1af572d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.test.ts @@ -6,11 +6,11 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { loadAlertAggregations } from './aggregate'; +import { loadRuleAggregations } from './aggregate'; const http = httpServiceMock.createStartContract(); -describe('loadAlertAggregations', () => { +describe('loadRuleAggregations', () => { beforeEach(() => jest.resetAllMocks()); test('should call aggregate API with base parameters', async () => { @@ -25,9 +25,9 @@ describe('loadAlertAggregations', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlertAggregations({ http }); + const result = await loadRuleAggregations({ http }); expect(result).toEqual({ - alertExecutionStatus: { + ruleExecutionStatus: { ok: 4, active: 2, error: 1, @@ -62,9 +62,9 @@ describe('loadAlertAggregations', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlertAggregations({ http, searchText: 'apples' }); + const result = await loadRuleAggregations({ http, searchText: 'apples' }); expect(result).toEqual({ - alertExecutionStatus: { + ruleExecutionStatus: { ok: 4, active: 2, error: 1, @@ -99,13 +99,13 @@ describe('loadAlertAggregations', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlertAggregations({ + const result = await loadRuleAggregations({ http, searchText: 'foo', actionTypesFilter: ['action', 'type'], }); expect(result).toEqual({ - alertExecutionStatus: { + ruleExecutionStatus: { ok: 4, active: 2, error: 1, @@ -140,12 +140,12 @@ describe('loadAlertAggregations', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlertAggregations({ + const result = await loadRuleAggregations({ http, typesFilter: ['foo', 'bar'], }); expect(result).toEqual({ - alertExecutionStatus: { + ruleExecutionStatus: { ok: 4, active: 2, error: 1, @@ -180,14 +180,14 @@ describe('loadAlertAggregations', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlertAggregations({ + const result = await loadRuleAggregations({ http, searchText: 'baz', actionTypesFilter: ['action', 'type'], typesFilter: ['foo', 'bar'], }); expect(result).toEqual({ - alertExecutionStatus: { + ruleExecutionStatus: { ok: 4, active: 2, error: 1, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts similarity index 74% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts index 60482b26b7f25..b2556900e763a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/aggregate.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/aggregate.ts @@ -5,38 +5,38 @@ * 2.0. */ import { HttpSetup } from 'kibana/public'; -import { AlertAggregations } from '../../../types'; +import { RuleAggregations } from '../../../types'; import { INTERNAL_BASE_ALERTING_API_PATH } from '../../constants'; import { mapFiltersToKql } from './map_filters_to_kql'; import { AsApiContract, RewriteRequestCase } from '../../../../../actions/common'; -const rewriteBodyRes: RewriteRequestCase = ({ - rule_execution_status: alertExecutionStatus, +const rewriteBodyRes: RewriteRequestCase = ({ + rule_execution_status: ruleExecutionStatus, rule_enabled_status: ruleEnabledStatus, rule_muted_status: ruleMutedStatus, ...rest }: any) => ({ ...rest, - alertExecutionStatus, + ruleExecutionStatus, ruleEnabledStatus, ruleMutedStatus, }); -export async function loadAlertAggregations({ +export async function loadRuleAggregations({ http, searchText, typesFilter, actionTypesFilter, - alertStatusesFilter, + ruleStatusesFilter, }: { http: HttpSetup; searchText?: string; typesFilter?: string[]; actionTypesFilter?: string[]; - alertStatusesFilter?: string[]; -}): Promise { - const filters = mapFiltersToKql({ typesFilter, actionTypesFilter, alertStatusesFilter }); - const res = await http.get>( + ruleStatusesFilter?: string[]; +}): Promise { + const filters = mapFiltersToKql({ typesFilter, actionTypesFilter, ruleStatusesFilter }); + const res = await http.get>( `${INTERNAL_BASE_ALERTING_API_PATH}/rules/_aggregate`, { query: { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/common_transformations.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/common_transformations.ts similarity index 82% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/common_transformations.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/common_transformations.ts index d380665658a81..bf2a0662490ae 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/common_transformations.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/common_transformations.ts @@ -6,9 +6,9 @@ */ import { AlertExecutionStatus } from '../../../../../alerting/common'; import { AsApiContract, RewriteRequestCase } from '../../../../../actions/common'; -import { Rule, AlertAction, ResolvedRule } from '../../../types'; +import { Rule, RuleAction, ResolvedRule } from '../../../types'; -const transformAction: RewriteRequestCase = ({ +const transformAction: RewriteRequestCase = ({ group, id, connector_type_id: actionTypeId, @@ -30,8 +30,8 @@ const transformExecutionStatus: RewriteRequestCase = ({ ...rest, }); -export const transformAlert: RewriteRequestCase = ({ - rule_type_id: alertTypeId, +export const transformRule: RewriteRequestCase = ({ + rule_type_id: ruleTypeId, created_by: createdBy, updated_by: updatedBy, created_at: createdAt, @@ -45,7 +45,7 @@ export const transformAlert: RewriteRequestCase = ({ actions: actions, ...rest }: any) => ({ - alertTypeId, + ruleTypeId, createdBy, updatedBy, createdAt, @@ -56,7 +56,7 @@ export const transformAlert: RewriteRequestCase = ({ mutedInstanceIds, executionStatus: executionStatus ? transformExecutionStatus(executionStatus) : undefined, actions: actions - ? actions.map((action: AsApiContract) => transformAction(action)) + ? actions.map((action: AsApiContract) => transformAction(action)) : [], scheduledTaskId, ...rest, @@ -69,7 +69,7 @@ export const transformResolvedRule: RewriteRequestCase = ({ ...rest }: any) => { return { - ...transformAlert(rest), + ...transformRule(rest), alias_target_id, outcome, }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/create.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/create.test.ts similarity index 92% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/create.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/create.test.ts index 8d1ec57a4e63e..acba66c83a735 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/create.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/create.test.ts @@ -6,12 +6,12 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { AlertUpdates } from '../../../types'; -import { createAlert } from './create'; +import { RuleUpdates } from '../../../types'; +import { createRule } from './create'; const http = httpServiceMock.createStartContract(); -describe('createAlert', () => { +describe('createRule', () => { beforeEach(() => jest.resetAllMocks()); test('should call create alert API', async () => { @@ -49,8 +49,8 @@ describe('createAlert', () => { create_at: '2021-04-01T21:33:13.247Z', updated_at: '2021-04-01T21:33:13.247Z', }; - const alertToCreate: Omit< - AlertUpdates, + const ruleToCreate: Omit< + RuleUpdates, 'createdBy' | 'updatedBy' | 'muteAll' | 'mutedInstanceIds' | 'executionStatus' > = { params: { @@ -70,7 +70,7 @@ describe('createAlert', () => { name: 'test', enabled: true, throttle: null, - alertTypeId: '.index-threshold', + ruleTypeId: '.index-threshold', notifyWhen: 'onActionGroupChange', actions: [ { @@ -90,7 +90,7 @@ describe('createAlert', () => { }; http.post.mockResolvedValueOnce(resolvedValue); - const result = await createAlert({ http, alert: alertToCreate }); + const result = await createRule({ http, rule: ruleToCreate }); expect(result).toEqual({ actions: [ { @@ -103,7 +103,7 @@ describe('createAlert', () => { }, }, ], - alertTypeId: '.index-threshold', + ruleTypeId: '.index-threshold', apiKeyOwner: undefined, consumer: 'alerts', create_at: '2021-04-01T21:33:13.247Z', diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/create.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/create.ts similarity index 66% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/create.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/create.ts index d07d99eb8e8c8..26b6cf6a9628c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/create.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/create.ts @@ -6,22 +6,22 @@ */ import { HttpSetup } from 'kibana/public'; import { AsApiContract, RewriteResponseCase } from '../../../../../actions/common'; -import { Rule, AlertUpdates } from '../../../types'; +import { Rule, RuleUpdates } from '../../../types'; import { BASE_ALERTING_API_PATH } from '../../constants'; -import { transformAlert } from './common_transformations'; +import { transformRule } from './common_transformations'; -type AlertCreateBody = Omit< - AlertUpdates, +type RuleCreateBody = Omit< + RuleUpdates, 'createdBy' | 'updatedBy' | 'muteAll' | 'mutedInstanceIds' | 'executionStatus' >; -const rewriteBodyRequest: RewriteResponseCase = ({ - alertTypeId, +const rewriteBodyRequest: RewriteResponseCase = ({ + ruleTypeId, notifyWhen, actions, ...res }): any => ({ ...res, - rule_type_id: alertTypeId, + rule_type_id: ruleTypeId, notify_when: notifyWhen, actions: actions.map(({ group, id, params }) => ({ group, @@ -30,15 +30,15 @@ const rewriteBodyRequest: RewriteResponseCase = ({ })), }); -export async function createAlert({ +export async function createRule({ http, - alert, + rule, }: { http: HttpSetup; - alert: AlertCreateBody; + rule: RuleCreateBody; }): Promise { const res = await http.post>(`${BASE_ALERTING_API_PATH}/rule`, { - body: JSON.stringify(rewriteBodyRequest(alert)), + body: JSON.stringify(rewriteBodyRequest(rule)), }); - return transformAlert(res); + return transformRule(res); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/delete.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.test.ts similarity index 86% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/delete.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.test.ts index 11e5f4763e775..95e48cf6e1734 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/delete.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.test.ts @@ -6,14 +6,14 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { deleteAlerts } from './delete'; +import { deleteRules } from './delete'; const http = httpServiceMock.createStartContract(); -describe('deleteAlerts', () => { +describe('deleteRules', () => { test('should call delete API for each alert', async () => { const ids = ['1', '2', '/']; - const result = await deleteAlerts({ http, ids }); + const result = await deleteRules({ http, ids }); expect(result).toEqual({ errors: [], successes: [undefined, undefined, undefined] }); expect(http.delete.mock.calls).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/delete.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts similarity index 95% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/delete.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts index d223dd08ca29a..053f5d68cdb69 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/delete.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/delete.ts @@ -7,7 +7,7 @@ import { HttpSetup } from 'kibana/public'; import { BASE_ALERTING_API_PATH } from '../../constants'; -export async function deleteAlerts({ +export async function deleteRules({ ids, http, }: { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/disable.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.test.ts similarity index 74% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/disable.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.test.ts index 4323816221c6e..582fb3b59f86f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/disable.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.test.ts @@ -6,14 +6,14 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { disableAlert, disableAlerts } from './disable'; +import { disableRule, disableRules } from './disable'; const http = httpServiceMock.createStartContract(); beforeEach(() => jest.resetAllMocks()); -describe('disableAlert', () => { - test('should call disable alert API', async () => { - const result = await disableAlert({ http, id: '1/' }); +describe('disableRule', () => { + test('should call disable rule API', async () => { + const result = await disableRule({ http, id: '1/' }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ @@ -25,10 +25,10 @@ describe('disableAlert', () => { }); }); -describe('disableAlerts', () => { - test('should call disable alert API per alert', async () => { +describe('disableRules', () => { + test('should call disable rule API per rule', async () => { const ids = ['1', '2', '/']; - const result = await disableAlerts({ http, ids }); + const result = await disableRules({ http, ids }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/enable.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts similarity index 73% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/enable.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts index 4bb3e3d45fcae..5b1e0452f51c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/enable.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/disable.ts @@ -7,16 +7,16 @@ import { HttpSetup } from 'kibana/public'; import { BASE_ALERTING_API_PATH } from '../../constants'; -export async function enableAlert({ id, http }: { id: string; http: HttpSetup }): Promise { - await http.post(`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}/_enable`); +export async function disableRule({ id, http }: { id: string; http: HttpSetup }): Promise { + await http.post(`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}/_disable`); } -export async function enableAlerts({ +export async function disableRules({ ids, http, }: { ids: string[]; http: HttpSetup; }): Promise { - await Promise.all(ids.map((id) => enableAlert({ id, http }))); + await Promise.all(ids.map((id) => disableRule({ id, http }))); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/enable.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.test.ts similarity index 74% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/enable.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.test.ts index 3a54a0772664b..993ae31f28832 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/enable.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.test.ts @@ -6,14 +6,14 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { enableAlert, enableAlerts } from './enable'; +import { enableRule, enableRules } from './enable'; const http = httpServiceMock.createStartContract(); beforeEach(() => jest.resetAllMocks()); -describe('enableAlert', () => { - test('should call enable alert API', async () => { - const result = await enableAlert({ http, id: '1/' }); +describe('enableRule', () => { + test('should call enable rule API', async () => { + const result = await enableRule({ http, id: '1/' }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ @@ -25,10 +25,10 @@ describe('enableAlert', () => { }); }); -describe('enableAlerts', () => { - test('should call enable alert API per alert', async () => { +describe('enableRules', () => { + test('should call enable rule API per rule', async () => { const ids = ['1', '2', '/']; - const result = await enableAlerts({ http, ids }); + const result = await enableRules({ http, ids }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/disable.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts similarity index 68% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/disable.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts index 758e66644b34e..fa4a462956663 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/disable.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/enable.ts @@ -7,16 +7,16 @@ import { HttpSetup } from 'kibana/public'; import { BASE_ALERTING_API_PATH } from '../../constants'; -export async function disableAlert({ id, http }: { id: string; http: HttpSetup }): Promise { - await http.post(`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}/_disable`); +export async function enableRule({ id, http }: { id: string; http: HttpSetup }): Promise { + await http.post(`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}/_enable`); } -export async function disableAlerts({ +export async function enableRules({ ids, http, }: { ids: string[]; http: HttpSetup; }): Promise { - await Promise.all(ids.map((id) => disableAlert({ id, http }))); + await Promise.all(ids.map((id) => enableRule({ id, http }))); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/get_rule.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.test.ts similarity index 90% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/get_rule.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.test.ts index 4708772f4ec35..9d7a3c5d5e6f5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/get_rule.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.test.ts @@ -6,15 +6,15 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { loadAlert } from './get_rule'; +import { loadRule } from './get_rule'; import uuid from 'uuid'; const http = httpServiceMock.createStartContract(); -describe('loadAlert', () => { +describe('loadRule', () => { test('should call get API with base parameters', async () => { - const alertId = `${uuid.v4()}/`; - const alertIdEncoded = encodeURIComponent(alertId); + const ruleId = `${uuid.v4()}/`; + const ruleIdEncoded = encodeURIComponent(ruleId); const resolvedValue = { id: '1/', params: { @@ -56,7 +56,7 @@ describe('loadAlert', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - expect(await loadAlert({ http, alertId })).toEqual({ + expect(await loadRule({ http, ruleId })).toEqual({ id: '1/', params: { aggType: 'count', @@ -75,7 +75,6 @@ describe('loadAlert', () => { name: 'dfsdfdsf', enabled: true, throttle: '1h', - alertTypeId: '.index-threshold', createdBy: 'elastic', updatedBy: 'elastic', createdAt: '2021-04-01T20:29:18.652Z', @@ -84,6 +83,7 @@ describe('loadAlert', () => { notifyWhen: 'onThrottleInterval', muteAll: false, mutedInstanceIds: [], + ruleTypeId: '.index-threshold', scheduledTaskId: '1', executionStatus: { status: 'ok', lastExecutionDate: '2021-04-01T21:16:46.709Z' }, actions: [ @@ -95,6 +95,6 @@ describe('loadAlert', () => { }, ], }); - expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${alertIdEncoded}`); + expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${ruleIdEncoded}`); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/get_rule.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.ts similarity index 79% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/get_rule.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.ts index c89fd9f90e0a3..8604de3cc8bcf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/get_rule.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/get_rule.ts @@ -8,17 +8,17 @@ import { HttpSetup } from 'kibana/public'; import { AsApiContract } from '../../../../../actions/common'; import { Rule } from '../../../types'; import { INTERNAL_BASE_ALERTING_API_PATH } from '../../constants'; -import { transformAlert } from './common_transformations'; +import { transformRule } from './common_transformations'; -export async function loadAlert({ +export async function loadRule({ http, - alertId, + ruleId, }: { http: HttpSetup; - alertId: string; + ruleId: string; }): Promise { const res = await http.get>( - `${INTERNAL_BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(alertId)}` + `${INTERNAL_BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(ruleId)}` ); - return transformAlert(res); + return transformRule(res); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/health.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/health.test.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/health.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/health.test.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/health.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/health.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/health.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/health.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/index.ts new file mode 100644 index 0000000000000..fff1cef678b02 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/index.ts @@ -0,0 +1,25 @@ +/* + * 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 { alertingFrameworkHealth } from './health'; +export { mapFiltersToKql } from './map_filters_to_kql'; +export { loadRuleAggregations } from './aggregate'; +export { createRule } from './create'; +export { deleteRules } from './delete'; +export { disableRule, disableRules } from './disable'; +export { enableRule, enableRules } from './enable'; +export { loadRule } from './get_rule'; +export { loadRuleSummary } from './rule_summary'; +export { muteAlertInstance } from './mute_alert'; +export { muteRule, muteRules } from './mute'; +export { loadRuleTypes } from './rule_types'; +export { loadRules } from './rules'; +export { loadRuleState } from './state'; +export { unmuteAlertInstance } from './unmute_alert'; +export { unmuteRule, unmuteRules } from './unmute'; +export { updateRule } from './update'; +export { resolveRule } from './resolve_rule'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/map_filters_to_kql.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.test.ts similarity index 88% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/map_filters_to_kql.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.test.ts index 4e5e2a412dad6..e1dd14a7a9fde 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/map_filters_to_kql.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.test.ts @@ -32,10 +32,10 @@ describe('mapFiltersToKql', () => { ]); }); - test('should handle alertStatusesFilter', () => { + test('should handle ruleStatusesFilter', () => { expect( mapFiltersToKql({ - alertStatusesFilter: ['alert', 'statuses', 'filter'], + ruleStatusesFilter: ['alert', 'statuses', 'filter'], }) ).toEqual(['alert.attributes.executionStatus.status:(alert or statuses or filter)']); }); @@ -52,12 +52,12 @@ describe('mapFiltersToKql', () => { ]); }); - test('should handle typesFilter, actionTypesFilter and alertStatusesFilter', () => { + test('should handle typesFilter, actionTypesFilter and ruleStatusesFilter', () => { expect( mapFiltersToKql({ typesFilter: ['type', 'filter'], actionTypesFilter: ['action', 'types', 'filter'], - alertStatusesFilter: ['alert', 'statuses', 'filter'], + ruleStatusesFilter: ['alert', 'statuses', 'filter'], }) ).toEqual([ 'alert.attributes.alertTypeId:(type or filter)', diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/map_filters_to_kql.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.ts similarity index 79% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/map_filters_to_kql.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.ts index 4c30e960034bf..d7b22a7a4aee4 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/map_filters_to_kql.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.ts @@ -8,11 +8,11 @@ export const mapFiltersToKql = ({ typesFilter, actionTypesFilter, - alertStatusesFilter, + ruleStatusesFilter, }: { typesFilter?: string[]; actionTypesFilter?: string[]; - alertStatusesFilter?: string[]; + ruleStatusesFilter?: string[]; }): string[] => { const filters = []; if (typesFilter && typesFilter.length) { @@ -29,8 +29,8 @@ export const mapFiltersToKql = ({ ].join('') ); } - if (alertStatusesFilter && alertStatusesFilter.length) { - filters.push(`alert.attributes.executionStatus.status:(${alertStatusesFilter.join(' or ')})`); + if (ruleStatusesFilter && ruleStatusesFilter.length) { + filters.push(`alert.attributes.executionStatus.status:(${ruleStatusesFilter.join(' or ')})`); } return filters; }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.test.ts similarity index 83% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.test.ts index 804096dbafac8..f89dfdd41ebe6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.test.ts @@ -6,14 +6,14 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { muteAlert, muteAlerts } from './mute'; +import { muteRule, muteRules } from './mute'; const http = httpServiceMock.createStartContract(); beforeEach(() => jest.resetAllMocks()); -describe('muteAlert', () => { +describe('muteRule', () => { test('should call mute alert API', async () => { - const result = await muteAlert({ http, id: '1/' }); + const result = await muteRule({ http, id: '1/' }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ @@ -25,10 +25,10 @@ describe('muteAlert', () => { }); }); -describe('muteAlerts', () => { +describe('muteRules', () => { test('should call mute alert API per alert', async () => { const ids = ['1', '2', '/']; - const result = await muteAlerts({ http, ids }); + const result = await muteRules({ http, ids }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts similarity index 63% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts index 888cdfa92c8f5..81bbcf2e2b270 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute.ts @@ -7,10 +7,10 @@ import { HttpSetup } from 'kibana/public'; import { BASE_ALERTING_API_PATH } from '../../constants'; -export async function muteAlert({ id, http }: { id: string; http: HttpSetup }): Promise { +export async function muteRule({ id, http }: { id: string; http: HttpSetup }): Promise { await http.post(`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}/_mute_all`); } -export async function muteAlerts({ ids, http }: { ids: string[]; http: HttpSetup }): Promise { - await Promise.all(ids.map((id) => muteAlert({ http, id }))); +export async function muteRules({ ids, http }: { ids: string[]; http: HttpSetup }): Promise { + await Promise.all(ids.map((id) => muteRule({ http, id }))); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute_alert.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute_alert.test.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute_alert.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute_alert.test.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute_alert.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute_alert.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/mute_alert.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/mute_alert.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/resolve_rule.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/resolve_rule.test.ts similarity index 98% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/resolve_rule.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/resolve_rule.test.ts index 14b64f56f31ff..fe9ce240b50e5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/resolve_rule.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/resolve_rule.test.ts @@ -77,7 +77,6 @@ describe('resolveRule', () => { name: 'dfsdfdsf', enabled: true, throttle: '1h', - alertTypeId: '.index-threshold', createdBy: 'elastic', updatedBy: 'elastic', createdAt: '2021-04-01T20:29:18.652Z', @@ -86,6 +85,7 @@ describe('resolveRule', () => { notifyWhen: 'onThrottleInterval', muteAll: false, mutedInstanceIds: [], + ruleTypeId: '.index-threshold', scheduledTaskId: '1', executionStatus: { status: 'ok', lastExecutionDate: '2021-04-01T21:16:46.709Z' }, actions: [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/resolve_rule.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/resolve_rule.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/resolve_rule.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/resolve_rule.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_summary.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.test.ts similarity index 84% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_summary.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.test.ts index 7a1fdbe53c7c5..ed81bae9777b6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_summary.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.test.ts @@ -6,14 +6,14 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { AlertSummary } from '../../../../../alerting/common'; -import { loadAlertSummary } from './alert_summary'; +import { RuleSummary } from '../../../types'; +import { loadRuleSummary } from './rule_summary'; const http = httpServiceMock.createStartContract(); -describe('loadAlertSummary', () => { - test('should call alert summary API', async () => { - const resolvedValue: AlertSummary = { +describe('loadRuleSummary', () => { + test('should call rule summary API', async () => { + const resolvedValue: RuleSummary = { alerts: {}, consumer: 'alerts', enabled: true, @@ -55,7 +55,7 @@ describe('loadAlertSummary', () => { }, }); - const result = await loadAlertSummary({ http, ruleId: 'te/st' }); + const result = await loadRuleSummary({ http, ruleId: 'te/st' }); expect(result).toEqual(resolvedValue); expect(http.get.mock.calls[0]).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_summary.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.ts similarity index 84% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_summary.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.ts index 55ba674dbd7f5..0ddc58602bd5e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_summary.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_summary.ts @@ -6,7 +6,7 @@ */ import { HttpSetup } from 'kibana/public'; import { INTERNAL_BASE_ALERTING_API_PATH } from '../../constants'; -import { AlertSummary, ExecutionDuration } from '../../../types'; +import { RuleSummary, ExecutionDuration } from '../../../types'; import { RewriteRequestCase, AsApiContract } from '../../../../../actions/common'; const transformExecutionDuration: RewriteRequestCase = ({ @@ -17,7 +17,7 @@ const transformExecutionDuration: RewriteRequestCase = ({ ...rest, }); -const rewriteBodyRes: RewriteRequestCase = ({ +const rewriteBodyRes: RewriteRequestCase = ({ rule_type_id: ruleTypeId, mute_all: muteAll, status_start_date: statusStartDate, @@ -37,7 +37,7 @@ const rewriteBodyRes: RewriteRequestCase = ({ executionDuration: executionDuration ? transformExecutionDuration(executionDuration) : undefined, }); -export async function loadAlertSummary({ +export async function loadRuleSummary({ http, ruleId, numberOfExecutions, @@ -45,8 +45,8 @@ export async function loadAlertSummary({ http: HttpSetup; ruleId: string; numberOfExecutions?: number; -}): Promise { - const res = await http.get>( +}): Promise { + const res = await http.get>( `${INTERNAL_BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(ruleId)}/_alert_summary`, { query: { number_of_executions: numberOfExecutions }, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rule_types.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.test.ts similarity index 91% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rule_types.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.test.ts index 49f50858b6983..cd14c9f707960 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rule_types.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.test.ts @@ -7,12 +7,12 @@ import { RuleType } from '../../../types'; import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { loadAlertTypes } from './rule_types'; +import { loadRuleTypes } from './rule_types'; import { ALERTS_FEATURE_ID } from '../../../../../alerting/common'; const http = httpServiceMock.createStartContract(); -describe('loadAlertTypes', () => { +describe('loadRuleTypes', () => { test('should call get alert types API', async () => { const resolvedValue: RuleType[] = [ { @@ -34,7 +34,7 @@ describe('loadAlertTypes', () => { ]; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlertTypes({ http }); + const result = await loadRuleTypes({ http }); expect(result).toEqual(resolvedValue); expect(http.get.mock.calls[0]).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rule_types.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.ts similarity index 94% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rule_types.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.ts index 63207dd35dfac..2b96deaa0dfb1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rule_types.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rule_types.ts @@ -37,7 +37,7 @@ const rewriteBodyReq: RewriteRequestCase = ({ ...rest, }); -export async function loadAlertTypes({ http }: { http: HttpSetup }): Promise { +export async function loadRuleTypes({ http }: { http: HttpSetup }): Promise { const res = await http.get>>>( `${BASE_ALERTING_API_PATH}/rule_types` ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.test.ts similarity index 93% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.test.ts index 6453876938b4e..2b70955ded4c3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.test.ts @@ -5,11 +5,11 @@ * 2.0. */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { loadAlerts } from './rules'; +import { loadRules } from './rules'; const http = httpServiceMock.createStartContract(); -describe('loadAlerts', () => { +describe('loadRules', () => { beforeEach(() => jest.resetAllMocks()); test('should call find API with base parameters', async () => { @@ -21,7 +21,7 @@ describe('loadAlerts', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlerts({ http, page: { index: 0, size: 10 } }); + const result = await loadRules({ http, page: { index: 0, size: 10 } }); expect(result).toEqual({ page: 1, perPage: 10, @@ -56,7 +56,7 @@ describe('loadAlerts', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlerts({ http, searchText: 'apples', page: { index: 0, size: 10 } }); + const result = await loadRules({ http, searchText: 'apples', page: { index: 0, size: 10 } }); expect(result).toEqual({ page: 1, perPage: 10, @@ -91,7 +91,7 @@ describe('loadAlerts', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlerts({ + const result = await loadRules({ http, searchText: 'foo', page: { index: 0, size: 10 }, @@ -130,7 +130,7 @@ describe('loadAlerts', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlerts({ + const result = await loadRules({ http, typesFilter: ['foo', 'bar'], page: { index: 0, size: 10 }, @@ -169,7 +169,7 @@ describe('loadAlerts', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlerts({ + const result = await loadRules({ http, searchText: 'baz', typesFilter: ['foo', 'bar'], @@ -209,7 +209,7 @@ describe('loadAlerts', () => { }; http.get.mockResolvedValueOnce(resolvedValue); - const result = await loadAlerts({ + const result = await loadRules({ http, searchText: 'apples, foo, baz', typesFilter: ['foo', 'bar'], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.ts similarity index 88% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.ts index 2f75ca2bbd0ba..97c432a480355 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/rules.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.ts @@ -9,19 +9,19 @@ import { INTERNAL_BASE_ALERTING_API_PATH } from '../../constants'; import { Rule, Pagination, Sorting } from '../../../types'; import { AsApiContract } from '../../../../../actions/common'; import { mapFiltersToKql } from './map_filters_to_kql'; -import { transformAlert } from './common_transformations'; +import { transformRule } from './common_transformations'; const rewriteResponseRes = (results: Array>): Rule[] => { - return results.map((item) => transformAlert(item)); + return results.map((item) => transformRule(item)); }; -export async function loadAlerts({ +export async function loadRules({ http, page, searchText, typesFilter, actionTypesFilter, - alertStatusesFilter, + ruleStatusesFilter, sort = { field: 'name', direction: 'asc' }, }: { http: HttpSetup; @@ -29,7 +29,7 @@ export async function loadAlerts({ searchText?: string; typesFilter?: string[]; actionTypesFilter?: string[]; - alertStatusesFilter?: string[]; + ruleStatusesFilter?: string[]; sort?: Sorting; }): Promise<{ page: number; @@ -37,7 +37,7 @@ export async function loadAlerts({ total: number; data: Rule[]; }> { - const filters = mapFiltersToKql({ typesFilter, actionTypesFilter, alertStatusesFilter }); + const filters = mapFiltersToKql({ typesFilter, actionTypesFilter, ruleStatusesFilter }); const res = await http.get< AsApiContract<{ page: number; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/state.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/state.test.ts similarity index 81% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/state.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/state.test.ts index ae27352be0b90..db22fa4d2d896 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/state.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/state.test.ts @@ -6,16 +6,16 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { loadAlertState } from './state'; +import { loadRuleState } from './state'; import uuid from 'uuid'; const http = httpServiceMock.createStartContract(); -describe('loadAlertState', () => { +describe('loadRuleState', () => { beforeEach(() => jest.resetAllMocks()); test('should call get API with base parameters', async () => { - const alertId = uuid.v4(); + const ruleId = uuid.v4(); const resolvedValue = { alertTypeState: { some: 'value', @@ -35,12 +35,12 @@ describe('loadAlertState', () => { }, }); - expect(await loadAlertState({ http, alertId })).toEqual(resolvedValue); - expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${alertId}/state`); + expect(await loadRuleState({ http, ruleId })).toEqual(resolvedValue); + expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${ruleId}/state`); }); - test('should parse AlertInstances', async () => { - const alertId = uuid.v4(); + test('should parse RuleInstances', async () => { + const ruleId = uuid.v4(); const resolvedValue = { alertTypeState: { some: 'value', @@ -74,7 +74,7 @@ describe('loadAlertState', () => { }, }); - expect(await loadAlertState({ http, alertId })).toEqual({ + expect(await loadRuleState({ http, ruleId })).toEqual({ ...resolvedValue, alertInstances: { first_instance: { @@ -88,14 +88,14 @@ describe('loadAlertState', () => { }, }, }); - expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${alertId}/state`); + expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${ruleId}/state`); }); test('should handle empty response from api', async () => { - const alertId = uuid.v4(); + const ruleId = uuid.v4(); http.get.mockResolvedValueOnce(''); - expect(await loadAlertState({ http, alertId })).toEqual({}); - expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${alertId}/state`); + expect(await loadRuleState({ http, ruleId })).toEqual({}); + expect(http.get).toHaveBeenCalledWith(`/internal/alerting/rule/${ruleId}/state`); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/state.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/state.ts similarity index 87% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/state.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/state.ts index b0b321159bf1c..35fd63d92d25b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/state.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/state.ts @@ -26,23 +26,23 @@ const rewriteBodyRes: RewriteRequestCase = ({ }); type EmptyHttpResponse = ''; -export async function loadAlertState({ +export async function loadRuleState({ http, - alertId, + ruleId, }: { http: HttpSetup; - alertId: string; + ruleId: string; }): Promise { return await http .get | EmptyHttpResponse>( - `${INTERNAL_BASE_ALERTING_API_PATH}/rule/${alertId}/state` + `${INTERNAL_BASE_ALERTING_API_PATH}/rule/${ruleId}/state` ) .then((state) => (state ? rewriteBodyRes(state) : {})) .then((state: RuleTaskState) => { return pipe( ruleStateSchema.decode(state), fold((e: Errors) => { - throw new Error(`Rule "${alertId}" has invalid state`); + throw new Error(`Rule "${ruleId}" has invalid state`); }, identity) ); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.test.ts similarity index 74% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.test.ts index dfaceffcf8f00..fe55c2e2656fb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.test.ts @@ -6,15 +6,15 @@ */ import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { unmuteAlert, unmuteAlerts } from './unmute'; +import { unmuteRule, unmuteRules } from './unmute'; const http = httpServiceMock.createStartContract(); beforeEach(() => jest.resetAllMocks()); -describe('unmuteAlerts', () => { - test('should call unmute alert API per alert', async () => { +describe('unmuteRules', () => { + test('should call unmute rule API per rule', async () => { const ids = ['1', '2', '/']; - const result = await unmuteAlerts({ http, ids }); + const result = await unmuteRules({ http, ids }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ @@ -32,9 +32,9 @@ describe('unmuteAlerts', () => { }); }); -describe('unmuteAlert', () => { - test('should call unmute alert API', async () => { - const result = await unmuteAlert({ http, id: '1/' }); +describe('unmuteRule', () => { + test('should call unmute rule API', async () => { + const result = await unmuteRule({ http, id: '1/' }); expect(result).toEqual(undefined); expect(http.post.mock.calls).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts similarity index 72% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts index bd2139f052645..951038159ca81 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute.ts @@ -7,16 +7,16 @@ import { HttpSetup } from 'kibana/public'; import { BASE_ALERTING_API_PATH } from '../../constants'; -export async function unmuteAlert({ id, http }: { id: string; http: HttpSetup }): Promise { +export async function unmuteRule({ id, http }: { id: string; http: HttpSetup }): Promise { await http.post(`${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}/_unmute_all`); } -export async function unmuteAlerts({ +export async function unmuteRules({ ids, http, }: { ids: string[]; http: HttpSetup; }): Promise { - await Promise.all(ids.map((id) => unmuteAlert({ id, http }))); + await Promise.all(ids.map((id) => unmuteRule({ id, http }))); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute_alert.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute_alert.test.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute_alert.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute_alert.test.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute_alert.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute_alert.ts similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/unmute_alert.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/unmute_alert.ts diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/update.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/update.test.ts similarity index 76% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/update.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/update.test.ts index bc6e7aedd122b..911245de63f67 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/update.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/update.test.ts @@ -5,16 +5,15 @@ * 2.0. */ -import { Rule } from '../../../types'; +import { Rule, RuleNotifyWhenType } from '../../../types'; import { httpServiceMock } from '../../../../../../../src/core/public/mocks'; -import { updateAlert } from './update'; -import { AlertNotifyWhenType } from '../../../../../alerting/common'; +import { updateRule } from './update'; const http = httpServiceMock.createStartContract(); -describe('updateAlert', () => { - test('should call alert update API', async () => { - const alertToUpdate = { +describe('updateRule', () => { + test('should call rule update API', async () => { + const ruleToUpdate = { throttle: '1m', consumer: 'alerts', name: 'test', @@ -28,13 +27,13 @@ describe('updateAlert', () => { updatedAt: new Date('1970-01-01T00:00:00.000Z'), apiKey: null, apiKeyOwner: null, - notifyWhen: 'onThrottleInterval' as AlertNotifyWhenType, + notifyWhen: 'onThrottleInterval' as RuleNotifyWhenType, }; const resolvedValue: Rule = { - ...alertToUpdate, + ...ruleToUpdate, id: '12/3', enabled: true, - alertTypeId: 'test', + ruleTypeId: 'test', createdBy: null, updatedBy: null, muteAll: false, @@ -46,7 +45,7 @@ describe('updateAlert', () => { }; http.put.mockResolvedValueOnce(resolvedValue); - const result = await updateAlert({ http, id: '12/3', alert: alertToUpdate }); + const result = await updateRule({ http, id: '12/3', rule: ruleToUpdate }); expect(result).toEqual(resolvedValue); expect(http.put.mock.calls[0]).toMatchInlineSnapshot(` Array [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/update.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/update.ts similarity index 71% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/update.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/update.ts index 4867d33ab2dd1..a3b9d081c20d3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/update.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/update.ts @@ -7,15 +7,15 @@ import { HttpSetup } from 'kibana/public'; import { pick } from 'lodash'; import { BASE_ALERTING_API_PATH } from '../../constants'; -import { Rule, AlertUpdates } from '../../../types'; +import { Rule, RuleUpdates } from '../../../types'; import { RewriteResponseCase, AsApiContract } from '../../../../../actions/common'; -import { transformAlert } from './common_transformations'; +import { transformRule } from './common_transformations'; -type AlertUpdatesBody = Pick< - AlertUpdates, +type RuleUpdatesBody = Pick< + RuleUpdates, 'name' | 'tags' | 'schedule' | 'actions' | 'params' | 'throttle' | 'notifyWhen' >; -const rewriteBodyRequest: RewriteResponseCase = ({ +const rewriteBodyRequest: RewriteResponseCase = ({ notifyWhen, actions, ...res @@ -29,14 +29,14 @@ const rewriteBodyRequest: RewriteResponseCase = ({ })), }); -export async function updateAlert({ +export async function updateRule({ http, - alert, + rule, id, }: { http: HttpSetup; - alert: Pick< - AlertUpdates, + rule: Pick< + RuleUpdates, 'throttle' | 'name' | 'tags' | 'schedule' | 'params' | 'actions' | 'notifyWhen' >; id: string; @@ -46,10 +46,10 @@ export async function updateAlert({ { body: JSON.stringify( rewriteBodyRequest( - pick(alert, ['throttle', 'name', 'tags', 'schedule', 'params', 'actions', 'notifyWhen']) + pick(rule, ['throttle', 'name', 'tags', 'schedule', 'params', 'actions', 'notifyWhen']) ) ), } ); - return transformAlert(res); + return transformRule(res); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_type_compare.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_type_compare.test.ts similarity index 74% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_type_compare.test.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_type_compare.test.ts index faa32204ba66e..e9ec012707c7b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_type_compare.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_type_compare.test.ts @@ -6,18 +6,18 @@ */ import { RuleTypeModel } from '../../types'; -import { alertTypeGroupCompare, alertTypeCompare } from './alert_type_compare'; -import { IsEnabledResult, IsDisabledResult } from './check_alert_type_enabled'; +import { ruleTypeGroupCompare, ruleTypeCompare } from './rule_type_compare'; +import { IsEnabledResult, IsDisabledResult } from './check_rule_type_enabled'; -test('should sort groups by containing enabled alert types first and then by name', async () => { - const alertTypes: Array< +test('should sort groups by containing enabled rule types first and then by name', async () => { + const ruleTypes: Array< [ string, Array<{ id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; }> ] > = [ @@ -28,8 +28,8 @@ test('should sort groups by containing enabled alert types first and then by nam id: '1', name: 'test2', checkEnabledResult: { isEnabled: false, message: 'gold license' }, - alertTypeItem: { - id: 'my-alert-type', + ruleTypeItem: { + id: 'my-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -49,8 +49,8 @@ test('should sort groups by containing enabled alert types first and then by nam id: '2', name: 'abc', checkEnabledResult: { isEnabled: false, message: 'platinum license' }, - alertTypeItem: { - id: 'my-alert-type', + ruleTypeItem: { + id: 'my-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -65,8 +65,8 @@ test('should sort groups by containing enabled alert types first and then by nam id: '3', name: 'cdf', checkEnabledResult: { isEnabled: true }, - alertTypeItem: { - id: 'disabled-alert-type', + ruleTypeItem: { + id: 'disabled-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -86,8 +86,8 @@ test('should sort groups by containing enabled alert types first and then by nam id: '4', name: 'cde', checkEnabledResult: { isEnabled: true }, - alertTypeItem: { - id: 'my-alert-type', + ruleTypeItem: { + id: 'my-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -107,25 +107,25 @@ test('should sort groups by containing enabled alert types first and then by nam groups.set('bcd', 'BCD'); groups.set('cde', 'CDE'); - const result = [...alertTypes].sort((right, left) => alertTypeGroupCompare(right, left, groups)); - expect(result[0]).toEqual(alertTypes[1]); - expect(result[1]).toEqual(alertTypes[2]); - expect(result[2]).toEqual(alertTypes[0]); + const result = [...ruleTypes].sort((right, left) => ruleTypeGroupCompare(right, left, groups)); + expect(result[0]).toEqual(ruleTypes[1]); + expect(result[1]).toEqual(ruleTypes[2]); + expect(result[2]).toEqual(ruleTypes[0]); }); -test('should sort alert types by enabled first and then by name', async () => { - const alertTypes: Array<{ +test('should sort rule types by enabled first and then by name', async () => { + const ruleTypes: Array<{ id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; }> = [ { id: '1', name: 'bcd', checkEnabledResult: { isEnabled: false, message: 'gold license' }, - alertTypeItem: { - id: 'my-alert-type', + ruleTypeItem: { + id: 'my-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -140,8 +140,8 @@ test('should sort alert types by enabled first and then by name', async () => { id: '2', name: 'abc', checkEnabledResult: { isEnabled: false, message: 'platinum license' }, - alertTypeItem: { - id: 'my-alert-type', + ruleTypeItem: { + id: 'my-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -156,8 +156,8 @@ test('should sort alert types by enabled first and then by name', async () => { id: '3', name: 'cdf', checkEnabledResult: { isEnabled: true }, - alertTypeItem: { - id: 'disabled-alert-type', + ruleTypeItem: { + id: 'disabled-rule-type', iconClass: 'test', description: 'Alert when testing', documentationUrl: 'https://localhost.local/docs', @@ -169,8 +169,8 @@ test('should sort alert types by enabled first and then by name', async () => { }, }, ]; - const result = [...alertTypes].sort(alertTypeCompare); - expect(result[0]).toEqual(alertTypes[2]); - expect(result[1]).toEqual(alertTypes[1]); - expect(result[2]).toEqual(alertTypes[0]); + const result = [...ruleTypes].sort(ruleTypeCompare); + expect(result[0]).toEqual(ruleTypes[2]); + expect(result[1]).toEqual(ruleTypes[1]); + expect(result[2]).toEqual(ruleTypes[0]); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_type_compare.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_type_compare.ts similarity index 63% rename from x-pack/plugins/triggers_actions_ui/public/application/lib/alert_type_compare.ts rename to x-pack/plugins/triggers_actions_ui/public/application/lib/rule_type_compare.ts index d05fb400b5e56..c04574f7961e0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/alert_type_compare.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_type_compare.ts @@ -6,16 +6,16 @@ */ import { RuleTypeModel } from '../../types'; -import { IsEnabledResult, IsDisabledResult } from './check_alert_type_enabled'; +import { IsEnabledResult, IsDisabledResult } from './check_rule_type_enabled'; -export function alertTypeGroupCompare( +export function ruleTypeGroupCompare( left: [ string, Array<{ id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; }> ], right: [ @@ -24,28 +24,28 @@ export function alertTypeGroupCompare( id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; }> ], groupNames: Map | undefined ) { const groupNameA = left[0]; const groupNameB = right[0]; - const leftAlertTypesList = left[1]; - const rightAlertTypesList = right[1]; + const leftRuleTypesList = left[1]; + const rightRuleTypesList = right[1]; - const hasEnabledAlertTypeInListLeft = - leftAlertTypesList.find((alertTypeItem) => alertTypeItem.checkEnabledResult.isEnabled) !== + const hasEnabledRuleTypeInListLeft = + leftRuleTypesList.find((ruleTypeItem) => ruleTypeItem.checkEnabledResult.isEnabled) !== undefined; - const hasEnabledAlertTypeInListRight = - rightAlertTypesList.find((alertTypeItem) => alertTypeItem.checkEnabledResult.isEnabled) !== + const hasEnabledRuleTypeInListRight = + rightRuleTypesList.find((ruleTypeItem) => ruleTypeItem.checkEnabledResult.isEnabled) !== undefined; - if (hasEnabledAlertTypeInListLeft && !hasEnabledAlertTypeInListRight) { + if (hasEnabledRuleTypeInListLeft && !hasEnabledRuleTypeInListRight) { return -1; } - if (!hasEnabledAlertTypeInListLeft && hasEnabledAlertTypeInListRight) { + if (!hasEnabledRuleTypeInListLeft && hasEnabledRuleTypeInListRight) { return 1; } @@ -54,18 +54,18 @@ export function alertTypeGroupCompare( : groupNameA.localeCompare(groupNameB); } -export function alertTypeCompare( +export function ruleTypeCompare( a: { id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; }, b: { id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; } ) { if (a.checkEnabledResult.isEnabled === true && b.checkEnabledResult.isEnabled === false) { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.test.ts index c6524c9d05d56..162cb222b78fe 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.test.ts @@ -10,7 +10,7 @@ import { throwIfIsntContained, isValidUrl, getConnectorWithInvalidatedFields, - getAlertWithInvalidatedFields, + getRuleWithInvalidatedFields, } from './value_validators'; import uuid from 'uuid'; import { Rule, IErrorObject, UserConfiguredActionConnector } from '../../types'; @@ -155,9 +155,9 @@ describe('getConnectorWithInvalidatedFields', () => { }); }); -describe('getAlertWithInvalidatedFields', () => { - test('sets to null all fields that are required but undefined in alert', () => { - const alert: Rule = { +describe('getRuleWithInvalidatedFields', () => { + test('sets to null all fields that are required but undefined in rule', () => { + const rule: Rule = { params: {}, consumer: 'test', schedule: { @@ -171,17 +171,39 @@ describe('getAlertWithInvalidatedFields', () => { } as any; const baseAlertErrors = { name: ['Name is required.'], - alertTypeId: ['Rule type is required.'], + ruleTypeId: ['Rule type is required.'], }; const actionsErrors: IErrorObject[] = []; const paramsErrors = {}; - getAlertWithInvalidatedFields(alert, paramsErrors, baseAlertErrors, actionsErrors); - expect(alert.name).toBeNull(); - expect(alert.alertTypeId).toBeNull(); + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect(rule.name).toBeNull(); + expect(rule.ruleTypeId).toBeNull(); }); - test('does not set to null any fields that are required and defined but invalid in alert', () => { - const alert: Rule = { + test('handles undefined fields with dot notation', () => { + const rule: Rule = { + params: {}, + consumer: 'test', + schedule: { + interval: undefined, + }, + actions: [], + tags: [], + muteAll: false, + enabled: false, + mutedInstanceIds: [], + } as any; + const baseAlertErrors = { + 'schedule.interval': ['Interval is required.'], + }; + const actionsErrors: IErrorObject[] = []; + const paramsErrors = {}; + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect(rule.schedule.interval).toBeNull(); + }); + + test('does not set to null any fields that are required and defined but invalid in rule', () => { + const rule: Rule = { name: 'test', id: '123', params: {}, @@ -198,14 +220,36 @@ describe('getAlertWithInvalidatedFields', () => { const baseAlertErrors = { consumer: ['Consumer is invalid.'] }; const actionsErrors: IErrorObject[] = []; const paramsErrors = {}; - getAlertWithInvalidatedFields(alert, paramsErrors, baseAlertErrors, actionsErrors); - expect(alert.consumer).toEqual('@@@@'); + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect(rule.consumer).toEqual('@@@@'); + }); + + test('handles defined but invalid fields with dot notation', () => { + const rule: Rule = { + params: {}, + consumer: 'test', + schedule: { + interval: '1s', + }, + actions: [], + tags: [], + muteAll: false, + enabled: false, + mutedInstanceIds: [], + } as any; + const baseAlertErrors = { + 'schedule.interval': ['Interval is too short.'], + }; + const actionsErrors: IErrorObject[] = []; + const paramsErrors = {}; + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect(rule.schedule.interval).toEqual('1s'); }); - test('set to null all fields that are required but undefined in alert params', () => { - const alert: Rule = { + test('set to null all fields that are required but undefined in rule params', () => { + const rule: Rule = { name: 'test', - alertTypeId: '.threshold', + ruleTypeId: '.threshold', id: '123', params: {}, consumer: 'test', @@ -232,15 +276,15 @@ describe('getAlertWithInvalidatedFields', () => { const baseAlertErrors = {}; const actionsErrors: IErrorObject[] = []; const paramsErrors = { index: ['Index is required.'], timeField: ['Time field is required.'] }; - getAlertWithInvalidatedFields(alert, paramsErrors, baseAlertErrors, actionsErrors); - expect(alert.params.index).toBeNull(); - expect(alert.params.timeField).toBeNull(); + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect(rule.params.index).toBeNull(); + expect(rule.params.timeField).toBeNull(); }); - test('does not set to null any fields that are required and defined but invalid in alert params', () => { - const alert: Rule = { + test('does not set to null any fields that are required and defined but invalid in rule params', () => { + const rule: Rule = { name: 'test', - alertTypeId: '.threshold', + ruleTypeId: '.threshold', id: '123', params: { aggField: 'foo', @@ -273,15 +317,15 @@ describe('getAlertWithInvalidatedFields', () => { aggField: ['Aggregation field is invalid.'], termSize: ['Term size is invalid.'], }; - getAlertWithInvalidatedFields(alert, paramsErrors, baseAlertErrors, actionsErrors); - expect(alert.params.aggField).toEqual('foo'); - expect(alert.params.termSize).toEqual('big'); + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect(rule.params.aggField).toEqual('foo'); + expect(rule.params.termSize).toEqual('big'); }); - test('set to null all fields that are required but undefined in alert actions', () => { - const alert: Rule = { + test('set to null all fields that are required but undefined in rule actions', () => { + const rule: Rule = { name: 'test', - alertTypeId: '.threshold', + ruleTypeId: '.threshold', id: '123', params: {}, consumer: 'test', @@ -319,14 +363,14 @@ describe('getAlertWithInvalidatedFields', () => { const baseAlertErrors = {}; const actionsErrors = [{ 'incident.field.name': ['Name is required.'] }]; const paramsErrors = {}; - getAlertWithInvalidatedFields(alert, paramsErrors, baseAlertErrors, actionsErrors); - expect((alert.actions[0].params as any).incident.field.name).toBeNull(); + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect((rule.actions[0].params as any).incident.field.name).toBeNull(); }); - test('validates multiple alert actions with the same connector id', () => { - const alert: Rule = { + test('validates multiple rule actions with the same connector id', () => { + const rule: Rule = { name: 'test', - alertTypeId: '.threshold', + ruleTypeId: '.threshold', id: '123', params: {}, consumer: 'test', @@ -379,8 +423,8 @@ describe('getAlertWithInvalidatedFields', () => { { 'incident.field.name': ['Name is invalid.'] }, ]; const paramsErrors = {}; - getAlertWithInvalidatedFields(alert, paramsErrors, baseAlertErrors, actionsErrors); - expect((alert.actions[0].params as any).incident.field.name).toBeNull(); - expect((alert.actions[1].params as any).incident.field.name).toEqual('myIncident'); + getRuleWithInvalidatedFields(rule, paramsErrors, baseAlertErrors, actionsErrors); + expect((rule.actions[0].params as any).incident.field.name).toBeNull(); + expect((rule.actions[1].params as any).incident.field.name).toEqual('myIncident'); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.ts b/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.ts index 161776dfe0a3e..e4e27291f972a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/value_validators.ts @@ -70,24 +70,24 @@ export function getConnectorWithInvalidatedFields( return connector; } -export function getAlertWithInvalidatedFields( - alert: Rule, +export function getRuleWithInvalidatedFields( + rule: Rule, paramsErrors: IErrorObject, baseAlertErrors: IErrorObject, actionsErrors: IErrorObject[] ) { Object.keys(paramsErrors).forEach((errorKey) => { - if (paramsErrors[errorKey].length >= 1 && get(alert.params, errorKey) === undefined) { - set(alert.params, errorKey, null); + if (paramsErrors[errorKey].length >= 1 && get(rule.params, errorKey) === undefined) { + set(rule.params, errorKey, null); } }); Object.keys(baseAlertErrors).forEach((errorKey) => { - if (baseAlertErrors[errorKey].length >= 1 && get(alert, errorKey) === undefined) { - set(alert, errorKey, null); + if (baseAlertErrors[errorKey].length >= 1 && get(rule, errorKey) === undefined) { + set(rule, errorKey, null); } }); actionsErrors.forEach((error: IErrorObject, index: number) => { - const actionToValidate = alert.actions.length > index ? alert.actions[index] : null; + const actionToValidate = rule.actions.length > index ? rule.actions[index] : null; if (actionToValidate) { Object.keys(error).forEach((errorKey) => { if (error[errorKey].length >= 1 && get(actionToValidate!.params, errorKey) === undefined) { @@ -96,5 +96,5 @@ export function getAlertWithInvalidatedFields( }); } }); - return alert; + return rule; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx index ace563aa96b9e..97945fd8752c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.test.tsx @@ -14,7 +14,7 @@ import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { ValidationResult, Rule, - AlertAction, + RuleAction, ConnectorValidationResult, GenericValidationResult, } from '../../../types'; @@ -193,7 +193,7 @@ describe('action_form', () => { const useKibanaMock = useKibana as jest.Mocked; describe('action_form in alert', () => { - async function setup(customActions?: AlertAction[], customRecoveredActionGroup?: string) { + async function setup(customActions?: RuleAction[], customRecoveredActionGroup?: string) { const actionTypeRegistry = actionTypeRegistryMock.create(); const { loadAllActions } = jest.requireMock('../../lib/action_connector_api'); @@ -283,7 +283,7 @@ describe('action_form', () => { setActionGroupIdByIndex={(group: string, index: number) => { initialAlert.actions[index].group = group; }} - setActions={(_updatedActions: AlertAction[]) => {}} + setActions={(_updatedActions: RuleAction[]) => {}} setActionParamsProperty={(key: string, value: any, index: number) => (initialAlert.actions[index] = { ...initialAlert.actions[index], [key]: value }) } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx index f25827fb4ba99..7c1af79c05626 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx @@ -22,7 +22,7 @@ import { import { loadActionTypes, loadAllActions as loadConnectors } from '../../lib/action_connector_api'; import { ActionTypeModel, - AlertAction, + RuleAction, ActionTypeIndex, ActionConnector, ActionType, @@ -48,13 +48,13 @@ export interface ActionGroupWithMessageVariables extends ActionGroup { } export interface ActionAccordionFormProps { - actions: AlertAction[]; + actions: RuleAction[]; defaultActionGroupId: string; actionGroups?: ActionGroupWithMessageVariables[]; defaultActionMessage?: string; setActionIdByIndex: (id: string, index: number) => void; setActionGroupIdByIndex?: (group: string, index: number) => void; - setActions: (actions: AlertAction[]) => void; + setActions: (actions: RuleAction[]) => void; setActionParamsProperty: (key: string, value: AlertActionParam, index: number) => void; actionTypes?: ActionType[]; messageVariables?: ActionVariables; @@ -307,7 +307,7 @@ export const ActionForm = ({ {actionTypesIndex && - actions.map((actionItem: AlertAction, index: number) => { + actions.map((actionItem: RuleAction, index: number) => { const actionConnector = connectors.find((field) => field.id === actionItem.id); // connectors doesn't exists if (!actionConnector) { @@ -322,11 +322,11 @@ export const ActionForm = ({ connectors={connectors} onDeleteConnector={() => { const updatedActions = actions.filter( - (_item: AlertAction, i: number) => i !== index + (_item: RuleAction, i: number) => i !== index ); setActions(updatedActions); setIsAddActionPanelOpen( - updatedActions.filter((item: AlertAction) => item.id !== actionItem.id) + updatedActions.filter((item: RuleAction) => item.id !== actionItem.id) .length === 0 ); setActiveActionItem(undefined); @@ -335,7 +335,7 @@ export const ActionForm = ({ setActiveActionItem({ actionTypeId: actionItem.actionTypeId, indices: actions - .map((item: AlertAction, idx: number) => + .map((item: RuleAction, idx: number) => item.id === actionItem.id ? idx : -1 ) .filter((idx: number) => idx >= 0), @@ -375,11 +375,11 @@ export const ActionForm = ({ actionTypeRegistry={actionTypeRegistry} onDeleteAction={() => { const updatedActions = actions.filter( - (_item: AlertAction, i: number) => i !== index + (_item: RuleAction, i: number) => i !== index ); setActions(updatedActions); setIsAddActionPanelOpen( - updatedActions.filter((item: AlertAction) => item.id !== actionItem.id).length === + updatedActions.filter((item: RuleAction) => item.id !== actionItem.id).length === 0 ); setActiveActionItem(undefined); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx index e04b96b6839cf..484f6698a8b29 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.test.tsx @@ -11,7 +11,7 @@ import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { ActionConnector, ActionType, - AlertAction, + RuleAction, ConnectorValidationResult, GenericValidationResult, } from '../../../types'; @@ -138,7 +138,7 @@ describe('action_type_form', () => { function getActionTypeForm( index?: number, actionConnector?: ActionConnector, Record>, - actionItem?: AlertAction, + actionItem?: RuleAction, defaultActionGroupId?: string, connectors?: Array, Record>>, actionTypeIndex?: Record, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx index 4a27c4c1e6fef..c817f5895a816 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx @@ -28,7 +28,7 @@ import { partition } from 'lodash'; import { ActionVariable, AlertActionParam } from '../../../../../alerting/common'; import { IErrorObject, - AlertAction, + RuleAction, ActionTypeIndex, ActionConnector, ActionVariables, @@ -43,7 +43,7 @@ import { DefaultActionParams } from '../../lib/get_defaults_for_action_params'; import { ConnectorsSelection } from './connectors_selection'; export type ActionTypeFormProps = { - actionItem: AlertAction; + actionItem: RuleAction; actionConnector: ActionConnector; index: number; onAddConnector: () => void; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx index cd274c542c9d5..558ae873892da 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx @@ -23,7 +23,7 @@ import { EuiButtonEmpty, EuiIconTip, } from '@elastic/eui'; -import { AlertAction, ActionTypeIndex, ActionConnector } from '../../../types'; +import { RuleAction, ActionTypeIndex, ActionConnector } from '../../../types'; import { hasSaveActionsCapability } from '../../lib/capabilities'; import { ActionAccordionFormProps } from './action_form'; import { useKibana } from '../../../common/lib/kibana'; @@ -32,7 +32,7 @@ import { ConnectorsSelection } from './connectors_selection'; type AddConnectorInFormProps = { actionTypesIndex: ActionTypeIndex; - actionItem: AlertAction; + actionItem: RuleAction; connectors: ActionConnector[]; index: number; onAddConnector: () => void; @@ -155,7 +155,7 @@ export const AddConnectorInline = ({
{ - const onSaveHandler = onSave ?? reloadAlerts; - - const initialAlert: InitialAlert = useMemo(() => { - return { - params: {}, - consumer, - alertTypeId, - schedule: { - interval: DEFAULT_ALERT_INTERVAL, - }, - actions: [], - tags: [], - notifyWhen: 'onActionGroupChange', - ...(initialValues ? initialValues : {}), - }; - }, [alertTypeId, consumer, initialValues]); - - const [{ alert }, dispatch] = useReducer(alertReducer as InitialAlertReducer, { - alert: initialAlert, - }); - const [initialAlertParams, setInitialAlertParams] = useState({}); - const [isSaving, setIsSaving] = useState(false); - const [isConfirmAlertSaveModalOpen, setIsConfirmAlertSaveModalOpen] = useState(false); - const [isConfirmAlertCloseModalOpen, setIsConfirmAlertCloseModalOpen] = useState(false); - const [ruleTypeIndex, setRuleTypeIndex] = useState( - props.ruleTypeIndex - ); - const [changedFromDefaultInterval, setChangedFromDefaultInterval] = useState(false); - - const setAlert = (value: InitialAlert) => { - dispatch({ command: { type: 'setAlert' }, payload: { key: 'alert', value } }); - }; - - const setRuleProperty = (key: Key, value: Rule[Key] | null) => { - dispatch({ command: { type: 'setProperty' }, payload: { key, value } }); - }; - - const { - http, - notifications: { toasts }, - application: { capabilities }, - } = useKibana().services; - - const canShowActions = hasShowActionsCapability(capabilities); - - useEffect(() => { - if (alertTypeId) { - setRuleProperty('alertTypeId', alertTypeId); - } - }, [alertTypeId]); - - useEffect(() => { - if (!props.ruleTypeIndex) { - (async () => { - const alertTypes = await loadAlertTypes({ http }); - const index: RuleTypeIndex = new Map(); - for (const alertType of alertTypes) { - index.set(alertType.id, alertType); - } - setRuleTypeIndex(index); - })(); - } - }, [props.ruleTypeIndex, http]); - - useEffect(() => { - if (isEmpty(alert.params) && !isEmpty(initialAlertParams)) { - // alert params are explicitly cleared when the alert type is cleared. - // clear the "initial" params in order to capture the - // default when a new alert type is selected - setInitialAlertParams({}); - } else if (isEmpty(initialAlertParams)) { - // captures the first change to the alert params, - // when consumers set a default value for the alert params - setInitialAlertParams(alert.params); - } - }, [alert.params, initialAlertParams, setInitialAlertParams]); - - const [alertActionsErrors, setAlertActionsErrors] = useState([]); - const [isLoading, setIsLoading] = useState(false); - - useEffect(() => { - (async () => { - setIsLoading(true); - const res = await getAlertActionErrors(alert as Rule, actionTypeRegistry); - setIsLoading(false); - setAlertActionsErrors([...res]); - })(); - }, [alert, actionTypeRegistry]); - - useEffect(() => { - if (alert.alertTypeId && ruleTypeIndex) { - const type = ruleTypeIndex.get(alert.alertTypeId); - if (type?.defaultScheduleInterval && !changedFromDefaultInterval) { - setRuleProperty('schedule', { interval: type.defaultScheduleInterval }); - } - } - }, [alert.alertTypeId, ruleTypeIndex, alert.schedule.interval, changedFromDefaultInterval]); - - useEffect(() => { - if (alert.schedule.interval !== DEFAULT_ALERT_INTERVAL && !changedFromDefaultInterval) { - setChangedFromDefaultInterval(true); - } - }, [alert.schedule.interval, changedFromDefaultInterval]); - - const checkForChangesAndCloseFlyout = () => { - if ( - hasAlertChanged(alert, initialAlert, false) || - haveAlertParamsChanged(alert.params, initialAlertParams) - ) { - setIsConfirmAlertCloseModalOpen(true); - } else { - onClose(AlertFlyoutCloseReason.CANCELED); - } - }; - - const saveAlertAndCloseFlyout = async () => { - const savedAlert = await onSaveAlert(); - setIsSaving(false); - if (savedAlert) { - onClose(AlertFlyoutCloseReason.SAVED); - if (onSaveHandler) { - onSaveHandler(); - } - } - }; - - const alertType = alert.alertTypeId ? ruleTypeRegistry.get(alert.alertTypeId) : null; - - const { alertBaseErrors, alertErrors, alertParamsErrors } = getAlertErrors( - alert as Rule, - alertType, - alert.alertTypeId ? ruleTypeIndex?.get(alert.alertTypeId) : undefined - ); - - // Confirm before saving if user is able to add actions but hasn't added any to this alert - const shouldConfirmSave = canShowActions && alert.actions?.length === 0; - - async function onSaveAlert(): Promise { - try { - const newAlert = await createAlert({ http, alert: alert as AlertUpdates }); - toasts.addSuccess( - i18n.translate('xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText', { - defaultMessage: 'Created rule "{ruleName}"', - values: { - ruleName: newAlert.name, - }, - }) - ); - return newAlert; - } catch (errorRes) { - toasts.addDanger( - errorRes.body?.message ?? - i18n.translate('xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText', { - defaultMessage: 'Cannot create rule.', - }) - ); - } - } - - return ( - - - - -

- -

-
-
- - - - - - { - setIsSaving(true); - if (isLoading || !isValidAlert(alert, alertErrors, alertActionsErrors)) { - setAlert( - getAlertWithInvalidatedFields( - alert as Rule, - alertParamsErrors, - alertBaseErrors, - alertActionsErrors - ) - ); - setIsSaving(false); - return; - } - if (shouldConfirmSave) { - setIsConfirmAlertSaveModalOpen(true); - } else { - await saveAlertAndCloseFlyout(); - } - }} - onCancel={checkForChangesAndCloseFlyout} - /> - - - {isConfirmAlertSaveModalOpen && ( - { - setIsConfirmAlertSaveModalOpen(false); - await saveAlertAndCloseFlyout(); - }} - onCancel={() => { - setIsSaving(false); - setIsConfirmAlertSaveModalOpen(false); - }} - /> - )} - {isConfirmAlertCloseModalOpen && ( - { - setIsConfirmAlertCloseModalOpen(false); - onClose(AlertFlyoutCloseReason.CANCELED); - }} - onCancel={() => { - setIsConfirmAlertCloseModalOpen(false); - }} - /> - )} -
-
- ); -}; - -// eslint-disable-next-line import/no-default-export -export { AlertAdd as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_errors.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_errors.ts deleted file mode 100644 index d3e0f93d1d0b6..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_errors.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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 { isObject } from 'lodash'; -import { i18n } from '@kbn/i18n'; -import { parseDuration } from '../../../../../alerting/common/parse_duration'; -import { - RuleTypeModel, - Rule, - IErrorObject, - AlertAction, - RuleType, - ValidationResult, - ActionTypeRegistryContract, -} from '../../../types'; -import { InitialAlert } from './alert_reducer'; - -export function validateBaseProperties( - alertObject: InitialAlert, - serverRuleType?: RuleType -): ValidationResult { - const validationResult = { errors: {} }; - const errors = { - name: new Array(), - interval: new Array(), - alertTypeId: new Array(), - actionConnectors: new Array(), - }; - validationResult.errors = errors; - if (!alertObject.name) { - errors.name.push( - i18n.translate('xpack.triggersActionsUI.sections.alertForm.error.requiredNameText', { - defaultMessage: 'Name is required.', - }) - ); - } - if (alertObject.schedule.interval.length < 2) { - errors.interval.push( - i18n.translate('xpack.triggersActionsUI.sections.alertForm.error.requiredIntervalText', { - defaultMessage: 'Check interval is required.', - }) - ); - } else if (serverRuleType?.minimumScheduleInterval) { - const duration = parseDuration(alertObject.schedule.interval); - const minimumDuration = parseDuration(serverRuleType.minimumScheduleInterval); - if (duration < minimumDuration) { - errors.interval.push( - i18n.translate('xpack.triggersActionsUI.sections.alertForm.error.belowMinimumText', { - defaultMessage: 'Interval is below minimum ({minimum}) for this rule type', - values: { - minimum: serverRuleType.minimumScheduleInterval, - }, - }) - ); - } - } - - if (!alertObject.alertTypeId) { - errors.alertTypeId.push( - i18n.translate('xpack.triggersActionsUI.sections.alertForm.error.requiredRuleTypeIdText', { - defaultMessage: 'Rule type is required.', - }) - ); - } - const emptyConnectorActions = alertObject.actions.find( - (actionItem) => /^\d+$/.test(actionItem.id) && Object.keys(actionItem.params).length > 0 - ); - if (emptyConnectorActions !== undefined) { - errors.actionConnectors.push( - i18n.translate('xpack.triggersActionsUI.sections.alertForm.error.requiredActionConnector', { - defaultMessage: 'Action for {actionTypeId} connector is required.', - values: { actionTypeId: emptyConnectorActions.actionTypeId }, - }) - ); - } - return validationResult; -} - -export function getAlertErrors( - alert: Rule, - alertTypeModel: RuleTypeModel | null, - serverRuleType?: RuleType -) { - const alertParamsErrors: IErrorObject = alertTypeModel - ? alertTypeModel.validate(alert.params).errors - : []; - const alertBaseErrors = validateBaseProperties(alert, serverRuleType).errors as IErrorObject; - const alertErrors = { - ...alertParamsErrors, - ...alertBaseErrors, - } as IErrorObject; - - return { - alertParamsErrors, - alertBaseErrors, - alertErrors, - }; -} - -export async function getAlertActionErrors( - alert: Rule, - actionTypeRegistry: ActionTypeRegistryContract -): Promise { - return await Promise.all( - alert.actions.map( - async (alertAction: AlertAction) => - ( - await actionTypeRegistry.get(alertAction.actionTypeId)?.validateParams(alertAction.params) - ).errors - ) - ); -} - -export const hasObjectErrors: (errors: IErrorObject) => boolean = (errors) => - !!Object.values(errors).find((errorList) => { - if (isObject(errorList)) return hasObjectErrors(errorList as IErrorObject); - return errorList.length >= 1; - }); - -export function isValidAlert( - alertObject: InitialAlert | Rule, - validationResult: IErrorObject, - actionsErrors: IErrorObject[] -): alertObject is Rule { - return ( - !hasObjectErrors(validationResult) && - actionsErrors.every((error: IErrorObject) => !hasObjectErrors(error)) - ); -} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_reducer.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_reducer.test.ts deleted file mode 100644 index a581e702b9a47..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_reducer.test.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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 { alertReducer } from './alert_reducer'; -import { Rule } from '../../../types'; - -describe('alert reducer', () => { - let initialAlert: Rule; - beforeAll(() => { - initialAlert = { - params: {}, - consumer: 'alerts', - alertTypeId: null, - schedule: { - interval: '1m', - }, - actions: [], - tags: [], - notifyWhen: 'onActionGroupChange', - } as unknown as Rule; - }); - - // setAlert - test('if modified alert was reset to initial', () => { - const alert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setProperty' }, - payload: { - key: 'name', - value: 'new name', - }, - } - ); - expect(alert.alert.name).toBe('new name'); - - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setAlert' }, - payload: { - key: 'alert', - value: initialAlert, - }, - } - ); - expect(updatedAlert.alert.name).toBeUndefined(); - }); - - test('if property name was changed', () => { - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setProperty' }, - payload: { - key: 'name', - value: 'new name', - }, - } - ); - expect(updatedAlert.alert.name).toBe('new name'); - }); - - test('if initial schedule property was updated', () => { - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setScheduleProperty' }, - payload: { - key: 'interval', - value: '10s', - }, - } - ); - expect(updatedAlert.alert.schedule.interval).toBe('10s'); - }); - - test('if alert params property was added and updated', () => { - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setRuleParams' }, - payload: { - key: 'testParam', - value: 'new test params property', - }, - } - ); - expect(updatedAlert.alert.params.testParam).toBe('new test params property'); - - const updatedAlertParamsProperty = alertReducer( - { alert: updatedAlert.alert }, - { - command: { type: 'setRuleParams' }, - payload: { - key: 'testParam', - value: 'test params property updated', - }, - } - ); - expect(updatedAlertParamsProperty.alert.params.testParam).toBe('test params property updated'); - }); - - test('if alert action params property was added and updated', () => { - initialAlert.actions.push({ - id: '', - actionTypeId: 'testId', - group: 'Alert', - params: {}, - }); - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setAlertActionParams' }, - payload: { - key: 'testActionParam', - value: 'new test action params property', - index: 0, - }, - } - ); - expect(updatedAlert.alert.actions[0].params.testActionParam).toBe( - 'new test action params property' - ); - - const updatedAlertActionParamsProperty = alertReducer( - { alert: updatedAlert.alert }, - { - command: { type: 'setAlertActionParams' }, - payload: { - key: 'testActionParam', - value: 'test action params property updated', - index: 0, - }, - } - ); - expect(updatedAlertActionParamsProperty.alert.actions[0].params.testActionParam).toBe( - 'test action params property updated' - ); - }); - - test('if the existing alert action params property was set to undefined (when other connector was selected)', () => { - initialAlert.actions.push({ - id: '', - actionTypeId: 'testId', - group: 'Alert', - params: { - testActionParam: 'some value', - }, - }); - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setAlertActionParams' }, - payload: { - key: 'testActionParam', - value: undefined, - index: 0, - }, - } - ); - expect(updatedAlert.alert.actions[0].params.testActionParam).toBe(undefined); - }); - - test('if alert action property was updated', () => { - initialAlert.actions.push({ - id: '', - actionTypeId: 'testId', - group: 'Alert', - params: {}, - }); - const updatedAlert = alertReducer( - { alert: initialAlert }, - { - command: { type: 'setAlertActionProperty' }, - payload: { - key: 'group', - value: 'Warning', - index: 0, - }, - } - ); - expect(updatedAlert.alert.actions[0].group).toBe('Warning'); - }); -}); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_reducer.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_reducer.ts deleted file mode 100644 index 5099fa61bdb38..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_reducer.ts +++ /dev/null @@ -1,203 +0,0 @@ -/* - * 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 { SavedObjectAttribute } from 'kibana/public'; -import { isEqual } from 'lodash'; -import { Reducer } from 'react'; -import { AlertActionParam, IntervalSchedule } from '../../../../../alerting/common'; -import { Rule, AlertAction } from '../../../types'; - -export type InitialAlert = Partial & - Pick; - -interface CommandType< - T extends - | 'setAlert' - | 'setProperty' - | 'setScheduleProperty' - | 'setRuleParams' - | 'setAlertActionParams' - | 'setAlertActionProperty' -> { - type: T; -} - -export interface AlertState { - alert: InitialAlert; -} - -interface Payload { - key: Keys; - value: Value; - index?: number; -} - -interface AlertPayload { - key: Key; - value: Rule[Key] | null; - index?: number; -} - -interface AlertActionPayload { - key: Key; - value: AlertAction[Key] | null; - index?: number; -} - -interface AlertSchedulePayload { - key: Key; - value: IntervalSchedule[Key]; - index?: number; -} - -export type AlertReducerAction = - | { - command: CommandType<'setAlert'>; - payload: Payload<'alert', InitialAlert>; - } - | { - command: CommandType<'setProperty'>; - payload: AlertPayload; - } - | { - command: CommandType<'setScheduleProperty'>; - payload: AlertSchedulePayload; - } - | { - command: CommandType<'setRuleParams'>; - payload: Payload; - } - | { - command: CommandType<'setAlertActionParams'>; - payload: Payload; - } - | { - command: CommandType<'setAlertActionProperty'>; - payload: AlertActionPayload; - }; - -export type InitialAlertReducer = Reducer<{ alert: InitialAlert }, AlertReducerAction>; -export type ConcreteAlertReducer = Reducer<{ alert: Rule }, AlertReducerAction>; - -export const alertReducer = ( - state: { alert: AlertPhase }, - action: AlertReducerAction -) => { - const { alert } = state; - - switch (action.command.type) { - case 'setAlert': { - const { key, value } = action.payload as Payload<'alert', AlertPhase>; - if (key === 'alert') { - return { - ...state, - alert: value, - }; - } else { - return state; - } - } - case 'setProperty': { - const { key, value } = action.payload as AlertPayload; - if (isEqual(alert[key], value)) { - return state; - } else { - return { - ...state, - alert: { - ...alert, - [key]: value, - }, - }; - } - } - case 'setScheduleProperty': { - const { key, value } = action.payload as AlertSchedulePayload; - if (alert.schedule && isEqual(alert.schedule[key], value)) { - return state; - } else { - return { - ...state, - alert: { - ...alert, - schedule: { - ...alert.schedule, - [key]: value, - }, - }, - }; - } - } - case 'setRuleParams': { - const { key, value } = action.payload as Payload>; - if (isEqual(alert.params[key], value)) { - return state; - } else { - return { - ...state, - alert: { - ...alert, - params: { - ...alert.params, - [key]: value, - }, - }, - }; - } - } - case 'setAlertActionParams': { - const { key, value, index } = action.payload as Payload< - keyof AlertAction, - SavedObjectAttribute - >; - if ( - index === undefined || - alert.actions[index] == null || - (!!alert.actions[index][key] && isEqual(alert.actions[index][key], value)) - ) { - return state; - } else { - const oldAction = alert.actions.splice(index, 1)[0]; - const updatedAction = { - ...oldAction, - params: { - ...oldAction.params, - [key]: value, - }, - }; - alert.actions.splice(index, 0, updatedAction); - return { - ...state, - alert: { - ...alert, - actions: [...alert.actions], - }, - }; - } - } - case 'setAlertActionProperty': { - const { key, value, index } = action.payload as AlertActionPayload; - if (index === undefined || isEqual(alert.actions[index][key], value)) { - return state; - } else { - const oldAction = alert.actions.splice(index, 1)[0]; - const updatedAction = { - ...oldAction, - [key]: value, - }; - alert.actions.splice(index, 0, updatedAction); - return { - ...state, - alert: { - ...alert, - actions: [...alert.actions], - }, - }; - } - } - } -}; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/has_alert_changed.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/has_alert_changed.test.ts deleted file mode 100644 index 580c8914c97b3..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/has_alert_changed.test.ts +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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 { InitialAlert } from './alert_reducer'; -import { hasAlertChanged } from './has_alert_changed'; - -function createAlert(overrides = {}): InitialAlert { - return { - params: {}, - consumer: 'test', - alertTypeId: 'test', - schedule: { - interval: '1m', - }, - actions: [], - tags: [], - notifyWhen: 'onActionGroupChange', - ...overrides, - }; -} - -test('should return false for same alert', () => { - const a = createAlert(); - expect(hasAlertChanged(a, a, true)).toEqual(false); -}); - -test('should return true for different alert', () => { - const a = createAlert(); - const b = createAlert({ alertTypeId: 'differentTest' }); - expect(hasAlertChanged(a, b, true)).toEqual(true); -}); - -test('should correctly compare name field', () => { - // name field doesn't exist initially - const a = createAlert(); - // set name to actual value - const b = createAlert({ name: 'myAlert' }); - // set name to different value - const c = createAlert({ name: 'anotherAlert' }); - // set name to various empty/null/undefined states - const d = createAlert({ name: '' }); - const e = createAlert({ name: undefined }); - const f = createAlert({ name: null }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); - expect(hasAlertChanged(a, c, true)).toEqual(true); - expect(hasAlertChanged(a, d, true)).toEqual(false); - expect(hasAlertChanged(a, e, true)).toEqual(false); - expect(hasAlertChanged(a, f, true)).toEqual(false); - - expect(hasAlertChanged(b, c, true)).toEqual(true); - expect(hasAlertChanged(b, d, true)).toEqual(true); - expect(hasAlertChanged(b, e, true)).toEqual(true); - expect(hasAlertChanged(b, f, true)).toEqual(true); - - expect(hasAlertChanged(c, d, true)).toEqual(true); - expect(hasAlertChanged(c, e, true)).toEqual(true); - expect(hasAlertChanged(c, f, true)).toEqual(true); - - expect(hasAlertChanged(d, e, true)).toEqual(false); - expect(hasAlertChanged(d, f, true)).toEqual(false); -}); - -test('should correctly compare alertTypeId field', () => { - const a = createAlert(); - - // set alertTypeId to different value - const b = createAlert({ alertTypeId: 'myAlertId' }); - // set alertTypeId to various empty/null/undefined states - const c = createAlert({ alertTypeId: '' }); - const d = createAlert({ alertTypeId: undefined }); - const e = createAlert({ alertTypeId: null }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); - expect(hasAlertChanged(a, c, true)).toEqual(true); - expect(hasAlertChanged(a, d, true)).toEqual(true); - expect(hasAlertChanged(a, e, true)).toEqual(true); - - expect(hasAlertChanged(b, c, true)).toEqual(true); - expect(hasAlertChanged(b, d, true)).toEqual(true); - expect(hasAlertChanged(b, e, true)).toEqual(true); - - expect(hasAlertChanged(c, d, true)).toEqual(false); - expect(hasAlertChanged(c, e, true)).toEqual(false); - expect(hasAlertChanged(d, e, true)).toEqual(false); -}); - -test('should correctly compare throttle field', () => { - // throttle field doesn't exist initially - const a = createAlert(); - // set throttle to actual value - const b = createAlert({ throttle: '1m' }); - // set throttle to different value - const c = createAlert({ throttle: '1h' }); - // set throttle to various empty/null/undefined states - const d = createAlert({ throttle: '' }); - const e = createAlert({ throttle: undefined }); - const f = createAlert({ throttle: null }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); - expect(hasAlertChanged(a, c, true)).toEqual(true); - expect(hasAlertChanged(a, d, true)).toEqual(false); - expect(hasAlertChanged(a, e, true)).toEqual(false); - expect(hasAlertChanged(a, f, true)).toEqual(false); - - expect(hasAlertChanged(b, c, true)).toEqual(true); - expect(hasAlertChanged(b, d, true)).toEqual(true); - expect(hasAlertChanged(b, e, true)).toEqual(true); - expect(hasAlertChanged(b, f, true)).toEqual(true); - - expect(hasAlertChanged(c, d, true)).toEqual(true); - expect(hasAlertChanged(c, e, true)).toEqual(true); - expect(hasAlertChanged(c, f, true)).toEqual(true); - - expect(hasAlertChanged(d, e, true)).toEqual(false); - expect(hasAlertChanged(d, f, true)).toEqual(false); -}); - -test('should correctly compare tags field', () => { - const a = createAlert(); - const b = createAlert({ tags: ['first'] }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); -}); - -test('should correctly compare schedule field', () => { - const a = createAlert(); - const b = createAlert({ schedule: { interval: '3h' } }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); -}); - -test('should correctly compare actions field', () => { - const a = createAlert(); - const b = createAlert({ - actions: [{ actionTypeId: 'action', group: 'group', id: 'actionId', params: {} }], - }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); -}); - -test('should skip comparing params field if compareParams=false', () => { - const a = createAlert(); - const b = createAlert({ params: { newParam: 'value' } }); - - expect(hasAlertChanged(a, b, false)).toEqual(false); -}); - -test('should correctly compare params field if compareParams=true', () => { - const a = createAlert(); - const b = createAlert({ params: { newParam: 'value' } }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); -}); - -test('should correctly compare notifyWhen field', () => { - const a = createAlert(); - const b = createAlert({ notifyWhen: 'onActiveAlert' }); - - expect(hasAlertChanged(a, b, true)).toEqual(true); -}); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx index f4edf0ad1a9b8..fe8382e224ffd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx @@ -25,7 +25,7 @@ export const BulkOperationPopover: React.FunctionComponent = ({ children }) => { onClick={() => setIsPopoverOpen(!isPopoverOpen)} > diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.scss b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.scss similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.scss rename to x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.scss diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.tsx similarity index 58% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.tsx index 347ebb227e445..208fbcde88143 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.tsx @@ -10,207 +10,207 @@ import React, { useState } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; -import { AlertTableItem } from '../../../../types'; +import { RuleTableItem } from '../../../../types'; import { - withBulkAlertOperations, + withBulkRuleOperations, ComponentOpts as BulkOperationsComponentOpts, -} from './with_bulk_alert_api_operations'; -import './alert_quick_edit_buttons.scss'; +} from './with_bulk_rule_api_operations'; +import './rule_quick_edit_buttons.scss'; import { useKibana } from '../../../../common/lib/kibana'; export type ComponentOpts = { - selectedItems: AlertTableItem[]; + selectedItems: RuleTableItem[]; onPerformingAction?: () => void; onActionPerformed?: () => void; - setAlertsToDelete: React.Dispatch>; + setRulesToDelete: React.Dispatch>; } & BulkOperationsComponentOpts; -export const AlertQuickEditButtons: React.FunctionComponent = ({ +export const RuleQuickEditButtons: React.FunctionComponent = ({ selectedItems, onPerformingAction = noop, onActionPerformed = noop, - muteAlerts, - unmuteAlerts, - enableAlerts, - disableAlerts, - setAlertsToDelete, + muteRules, + unmuteRules, + enableRules, + disableRules, + setRulesToDelete, }: ComponentOpts) => { const { notifications: { toasts }, } = useKibana().services; - const [isMutingAlerts, setIsMutingAlerts] = useState(false); - const [isUnmutingAlerts, setIsUnmutingAlerts] = useState(false); - const [isEnablingAlerts, setIsEnablingAlerts] = useState(false); - const [isDisablingAlerts, setIsDisablingAlerts] = useState(false); - const [isDeletingAlerts, setIsDeletingAlerts] = useState(false); + const [isMutingRules, setIsMutingRules] = useState(false); + const [isUnmutingRules, setIsUnmutingRules] = useState(false); + const [isEnablingRules, setIsEnablingRules] = useState(false); + const [isDisablingRules, setIsDisablingRules] = useState(false); + const [isDeletingRules, setIsDeletingRules] = useState(false); - const allAlertsMuted = selectedItems.every(isAlertMuted); - const allAlertsDisabled = selectedItems.every(isAlertDisabled); + const allRulesMuted = selectedItems.every(isRuleMuted); + const allRulesDisabled = selectedItems.every(isRuleDisabled); const isPerformingAction = - isMutingAlerts || isUnmutingAlerts || isEnablingAlerts || isDisablingAlerts || isDeletingAlerts; + isMutingRules || isUnmutingRules || isEnablingRules || isDisablingRules || isDeletingRules; - const hasDisabledByLicenseAlertTypes = !!selectedItems.find( + const hasDisabledByLicenseRuleTypes = !!selectedItems.find( (alertItem) => !alertItem.enabledInLicense ); async function onmMuteAllClick() { onPerformingAction(); - setIsMutingAlerts(true); + setIsMutingRules(true); try { - await muteAlerts(selectedItems); + await muteRules(selectedItems); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToMuteRulesMessage', + 'xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToMuteRulesMessage', { defaultMessage: 'Failed to mute rule(s)', } ), }); } finally { - setIsMutingAlerts(false); + setIsMutingRules(false); onActionPerformed(); } } async function onUnmuteAllClick() { onPerformingAction(); - setIsUnmutingAlerts(true); + setIsUnmutingRules(true); try { - await unmuteAlerts(selectedItems); + await unmuteRules(selectedItems); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToUnmuteRulesMessage', + 'xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToUnmuteRulesMessage', { defaultMessage: 'Failed to unmute rule(s)', } ), }); } finally { - setIsUnmutingAlerts(false); + setIsUnmutingRules(false); onActionPerformed(); } } async function onEnableAllClick() { onPerformingAction(); - setIsEnablingAlerts(true); + setIsEnablingRules(true); try { - await enableAlerts(selectedItems); + await enableRules(selectedItems); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToEnableRulesMessage', + 'xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToEnableRulesMessage', { defaultMessage: 'Failed to enable rule(s)', } ), }); } finally { - setIsEnablingAlerts(false); + setIsEnablingRules(false); onActionPerformed(); } } async function onDisableAllClick() { onPerformingAction(); - setIsDisablingAlerts(true); + setIsDisablingRules(true); try { - await disableAlerts(selectedItems); + await disableRules(selectedItems); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToDisableRulesMessage', + 'xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToDisableRulesMessage', { defaultMessage: 'Failed to disable rule(s)', } ), }); } finally { - setIsDisablingAlerts(false); + setIsDisablingRules(false); onActionPerformed(); } } async function deleteSelectedItems() { onPerformingAction(); - setIsDeletingAlerts(true); + setIsDeletingRules(true); try { - setAlertsToDelete(selectedItems.map((selected: any) => selected.id)); + setRulesToDelete(selectedItems.map((selected: any) => selected.id)); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.failedToDeleteRulesMessage', + 'xpack.triggersActionsUI.sections.rulesList.bulkActionPopover.failedToDeleteRulesMessage', { defaultMessage: 'Failed to delete rule(s)', } ), }); } finally { - setIsDeletingAlerts(false); + setIsDeletingRules(false); onActionPerformed(); } } return ( - {!allAlertsMuted && ( + {!allRulesMuted && ( )} - {allAlertsMuted && ( + {allRulesMuted && ( )} - {allAlertsDisabled && ( + {allRulesDisabled && ( )} - {!allAlertsDisabled && ( + {!allRulesDisabled && ( @@ -219,7 +219,7 @@ export const AlertQuickEditButtons: React.FunctionComponent = ({ = ({ className="actBulkActionPopover__deleteAll" > @@ -236,13 +236,13 @@ export const AlertQuickEditButtons: React.FunctionComponent = ({ ); }; -export const AlertQuickEditButtonsWithApi = withBulkAlertOperations(AlertQuickEditButtons); +export const RuleQuickEditButtonsWithApi = withBulkRuleOperations(RuleQuickEditButtons); -function isAlertDisabled(alert: AlertTableItem) { +function isRuleDisabled(alert: RuleTableItem) { return alert.enabled === false; } -function isAlertMuted(alert: AlertTableItem) { +function isRuleMuted(alert: RuleTableItem) { return alert.muteAll === true; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_alert_api_operations.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_alert_api_operations.test.tsx deleted file mode 100644 index d2194d2246944..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_alert_api_operations.test.tsx +++ /dev/null @@ -1,277 +0,0 @@ -/* - * 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 * as React from 'react'; -import { shallow, mount } from 'enzyme'; -import uuid from 'uuid'; -import { withBulkAlertOperations, ComponentOpts } from './with_bulk_alert_api_operations'; -import * as alertApi from '../../../lib/alert_api'; -import { Rule } from '../../../../types'; -import { useKibana } from '../../../../common/lib/kibana'; -jest.mock('../../../../common/lib/kibana'); - -jest.mock('../../../lib/alert_api'); -const useKibanaMock = useKibana as jest.Mocked; - -describe('with_bulk_alert_api_operations', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('extends any component with AlertApi methods', () => { - const ComponentToExtend = (props: ComponentOpts) => { - expect(typeof props.muteAlerts).toEqual('function'); - expect(typeof props.unmuteAlerts).toEqual('function'); - expect(typeof props.enableAlerts).toEqual('function'); - expect(typeof props.disableAlerts).toEqual('function'); - expect(typeof props.deleteAlerts).toEqual('function'); - expect(typeof props.muteAlert).toEqual('function'); - expect(typeof props.unmuteAlert).toEqual('function'); - expect(typeof props.enableAlert).toEqual('function'); - expect(typeof props.disableAlert).toEqual('function'); - expect(typeof props.deleteAlert).toEqual('function'); - expect(typeof props.loadAlert).toEqual('function'); - expect(typeof props.loadAlertTypes).toEqual('function'); - expect(typeof props.resolveRule).toEqual('function'); - return
; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - expect(shallow().type()).toEqual(ComponentToExtend); - }); - - // single alert - it('muteAlert calls the muteAlert api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ muteAlert, alert }: ComponentOpts & { alert: Rule }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alert = mockAlert(); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.muteAlert).toHaveBeenCalledTimes(1); - expect(alertApi.muteAlert).toHaveBeenCalledWith({ id: alert.id, http }); - }); - - it('unmuteAlert calls the unmuteAlert api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ unmuteAlert, alert }: ComponentOpts & { alert: Rule }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alert = mockAlert({ muteAll: true }); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.unmuteAlert).toHaveBeenCalledTimes(1); - expect(alertApi.unmuteAlert).toHaveBeenCalledWith({ id: alert.id, http }); - }); - - it('enableAlert calls the muteAlerts api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ enableAlert, alert }: ComponentOpts & { alert: Rule }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alert = mockAlert({ enabled: false }); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.enableAlert).toHaveBeenCalledTimes(1); - expect(alertApi.enableAlert).toHaveBeenCalledWith({ id: alert.id, http }); - }); - - it('disableAlert calls the disableAlert api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ disableAlert, alert }: ComponentOpts & { alert: Rule }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alert = mockAlert(); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.disableAlert).toHaveBeenCalledTimes(1); - expect(alertApi.disableAlert).toHaveBeenCalledWith({ id: alert.id, http }); - }); - - it('deleteAlert calls the deleteAlert api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ deleteAlert, alert }: ComponentOpts & { alert: Rule }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alert = mockAlert(); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.deleteAlerts).toHaveBeenCalledTimes(1); - expect(alertApi.deleteAlerts).toHaveBeenCalledWith({ ids: [alert.id], http }); - }); - - // bulk alerts - it('muteAlerts calls the muteAlerts api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ muteAlerts, alerts }: ComponentOpts & { alerts: Rule[] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alerts = [mockAlert(), mockAlert()]; - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.muteAlerts).toHaveBeenCalledTimes(1); - expect(alertApi.muteAlerts).toHaveBeenCalledWith({ ids: [alerts[0].id, alerts[1].id], http }); - }); - - it('unmuteAlerts calls the unmuteAlerts api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ unmuteAlerts, alerts }: ComponentOpts & { alerts: Rule[] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alerts = [mockAlert({ muteAll: true }), mockAlert({ muteAll: true })]; - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.unmuteAlerts).toHaveBeenCalledTimes(1); - expect(alertApi.unmuteAlerts).toHaveBeenCalledWith({ ids: [alerts[0].id, alerts[1].id], http }); - }); - - it('enableAlerts calls the muteAlertss api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ enableAlerts, alerts }: ComponentOpts & { alerts: Rule[] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alerts = [ - mockAlert({ enabled: false }), - mockAlert({ enabled: true }), - mockAlert({ enabled: false }), - ]; - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.enableAlerts).toHaveBeenCalledTimes(1); - expect(alertApi.enableAlerts).toHaveBeenCalledWith({ ids: [alerts[0].id, alerts[2].id], http }); - }); - - it('disableAlerts calls the disableAlerts api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ disableAlerts, alerts }: ComponentOpts & { alerts: Rule[] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alerts = [mockAlert(), mockAlert()]; - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.disableAlerts).toHaveBeenCalledTimes(1); - expect(alertApi.disableAlerts).toHaveBeenCalledWith({ - ids: [alerts[0].id, alerts[1].id], - http, - }); - }); - - it('deleteAlerts calls the deleteAlerts api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ deleteAlerts, alerts }: ComponentOpts & { alerts: Rule[] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alerts = [mockAlert(), mockAlert()]; - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.deleteAlerts).toHaveBeenCalledTimes(1); - expect(alertApi.deleteAlerts).toHaveBeenCalledWith({ ids: [alerts[0].id, alerts[1].id], http }); - }); - - it('loadAlert calls the loadAlert api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ loadAlert, alertId }: ComponentOpts & { alertId: Rule['id'] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const alertId = uuid.v4(); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.loadAlert).toHaveBeenCalledTimes(1); - expect(alertApi.loadAlert).toHaveBeenCalledWith({ alertId, http }); - }); - - it('resolveRule calls the resolveRule api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ resolveRule, ruleId }: ComponentOpts & { ruleId: Rule['id'] }) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const ruleId = uuid.v4(); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.resolveRule).toHaveBeenCalledTimes(1); - expect(alertApi.resolveRule).toHaveBeenCalledWith({ ruleId, http }); - }); - - it('loadAlertTypes calls the loadAlertTypes api', () => { - const { http } = useKibanaMock().services; - const ComponentToExtend = ({ loadAlertTypes }: ComponentOpts) => { - return ; - }; - - const ExtendedComponent = withBulkAlertOperations(ComponentToExtend); - const component = mount(); - component.find('button').simulate('click'); - - expect(alertApi.loadAlertTypes).toHaveBeenCalledTimes(1); - expect(alertApi.loadAlertTypes).toHaveBeenCalledWith({ http }); - }); -}); - -function mockAlert(overloads: Partial = {}): Rule { - return { - id: uuid.v4(), - enabled: true, - name: `alert-${uuid.v4()}`, - tags: [], - alertTypeId: '.noop', - consumer: 'consumer', - schedule: { interval: '1m' }, - actions: [], - params: {}, - createdBy: null, - updatedBy: null, - createdAt: new Date(), - updatedAt: new Date(), - apiKeyOwner: null, - throttle: null, - notifyWhen: null, - muteAll: false, - mutedInstanceIds: [], - executionStatus: { - status: 'unknown', - lastExecutionDate: new Date('2020-08-20T19:23:38Z'), - }, - ...overloads, - }; -} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_alert_api_operations.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_alert_api_operations.tsx deleted file mode 100644 index 0308e17ac342c..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_alert_api_operations.tsx +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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 React from 'react'; - -import { - Rule, - RuleType, - RuleTaskState, - AlertSummary, - AlertingFrameworkHealth, - ResolvedRule, -} from '../../../../types'; -import { - deleteAlerts, - disableAlerts, - enableAlerts, - muteAlerts, - unmuteAlerts, - disableAlert, - enableAlert, - muteAlert, - unmuteAlert, - muteAlertInstance, - unmuteAlertInstance, - loadAlert, - loadAlertState, - loadAlertSummary, - loadAlertTypes, - alertingFrameworkHealth, - resolveRule, -} from '../../../lib/alert_api'; -import { useKibana } from '../../../../common/lib/kibana'; - -export interface ComponentOpts { - muteAlerts: (alerts: Rule[]) => Promise; - unmuteAlerts: (alerts: Rule[]) => Promise; - enableAlerts: (alerts: Rule[]) => Promise; - disableAlerts: (alerts: Rule[]) => Promise; - deleteAlerts: (alerts: Rule[]) => Promise<{ - successes: string[]; - errors: string[]; - }>; - muteAlert: (alert: Rule) => Promise; - unmuteAlert: (alert: Rule) => Promise; - muteAlertInstance: (alert: Rule, alertInstanceId: string) => Promise; - unmuteAlertInstance: (alert: Rule, alertInstanceId: string) => Promise; - enableAlert: (alert: Rule) => Promise; - disableAlert: (alert: Rule) => Promise; - deleteAlert: (alert: Rule) => Promise<{ - successes: string[]; - errors: string[]; - }>; - loadAlert: (id: Rule['id']) => Promise; - loadAlertState: (id: Rule['id']) => Promise; - loadAlertSummary: (id: Rule['id'], numberOfExecutions?: number) => Promise; - loadAlertTypes: () => Promise; - getHealth: () => Promise; - resolveRule: (id: Rule['id']) => Promise; -} - -export type PropsWithOptionalApiHandlers = Omit & Partial; - -export function withBulkAlertOperations( - WrappedComponent: React.ComponentType -): React.FunctionComponent> { - return (props: PropsWithOptionalApiHandlers) => { - const { http } = useKibana().services; - return ( - - muteAlerts({ - http, - ids: items.filter((item) => !isAlertMuted(item)).map((item) => item.id), - }) - } - unmuteAlerts={async (items: Rule[]) => - unmuteAlerts({ http, ids: items.filter(isAlertMuted).map((item) => item.id) }) - } - enableAlerts={async (items: Rule[]) => - enableAlerts({ http, ids: items.filter(isAlertDisabled).map((item) => item.id) }) - } - disableAlerts={async (items: Rule[]) => - disableAlerts({ - http, - ids: items.filter((item) => !isAlertDisabled(item)).map((item) => item.id), - }) - } - deleteAlerts={async (items: Rule[]) => - deleteAlerts({ http, ids: items.map((item) => item.id) }) - } - muteAlert={async (alert: Rule) => { - if (!isAlertMuted(alert)) { - return await muteAlert({ http, id: alert.id }); - } - }} - unmuteAlert={async (alert: Rule) => { - if (isAlertMuted(alert)) { - return await unmuteAlert({ http, id: alert.id }); - } - }} - muteAlertInstance={async (alert: Rule, instanceId: string) => { - if (!isAlertInstanceMuted(alert, instanceId)) { - return muteAlertInstance({ http, id: alert.id, instanceId }); - } - }} - unmuteAlertInstance={async (alert: Rule, instanceId: string) => { - if (isAlertInstanceMuted(alert, instanceId)) { - return unmuteAlertInstance({ http, id: alert.id, instanceId }); - } - }} - enableAlert={async (alert: Rule) => { - if (isAlertDisabled(alert)) { - return await enableAlert({ http, id: alert.id }); - } - }} - disableAlert={async (alert: Rule) => { - if (!isAlertDisabled(alert)) { - return await disableAlert({ http, id: alert.id }); - } - }} - deleteAlert={async (alert: Rule) => deleteAlerts({ http, ids: [alert.id] })} - loadAlert={async (alertId: Rule['id']) => loadAlert({ http, alertId })} - loadAlertState={async (alertId: Rule['id']) => loadAlertState({ http, alertId })} - loadAlertSummary={async (ruleId: Rule['id'], numberOfExecutions?: number) => - loadAlertSummary({ http, ruleId, numberOfExecutions }) - } - loadAlertTypes={async () => loadAlertTypes({ http })} - resolveRule={async (ruleId: Rule['id']) => resolveRule({ http, ruleId })} - getHealth={async () => alertingFrameworkHealth({ http })} - /> - ); - }; -} - -function isAlertDisabled(alert: Rule) { - return alert.enabled === false; -} - -function isAlertMuted(alert: Rule) { - return alert.muteAll === true; -} - -function isAlertInstanceMuted(alert: Rule, instanceId: string) { - return alert.mutedInstanceIds.findIndex((muted) => muted === instanceId) >= 0; -} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_rule_api_operations.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_rule_api_operations.test.tsx new file mode 100644 index 0000000000000..d0950c0c75fc2 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_rule_api_operations.test.tsx @@ -0,0 +1,277 @@ +/* + * 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 * as React from 'react'; +import { shallow, mount } from 'enzyme'; +import uuid from 'uuid'; +import { withBulkRuleOperations, ComponentOpts } from './with_bulk_rule_api_operations'; +import * as ruleApi from '../../../lib/rule_api'; +import { Rule } from '../../../../types'; +import { useKibana } from '../../../../common/lib/kibana'; +jest.mock('../../../../common/lib/kibana'); + +jest.mock('../../../lib/rule_api'); +const useKibanaMock = useKibana as jest.Mocked; + +describe('with_bulk_rule_api_operations', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('extends any component with RuleApi methods', () => { + const ComponentToExtend = (props: ComponentOpts) => { + expect(typeof props.muteRules).toEqual('function'); + expect(typeof props.unmuteRules).toEqual('function'); + expect(typeof props.enableRules).toEqual('function'); + expect(typeof props.disableRules).toEqual('function'); + expect(typeof props.deleteRules).toEqual('function'); + expect(typeof props.muteRule).toEqual('function'); + expect(typeof props.unmuteRule).toEqual('function'); + expect(typeof props.enableRule).toEqual('function'); + expect(typeof props.disableRule).toEqual('function'); + expect(typeof props.deleteRule).toEqual('function'); + expect(typeof props.loadRule).toEqual('function'); + expect(typeof props.loadRuleTypes).toEqual('function'); + expect(typeof props.resolveRule).toEqual('function'); + return
; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + expect(shallow().type()).toEqual(ComponentToExtend); + }); + + // single rule + it('muteRule calls the muteRule api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ muteRule, rule }: ComponentOpts & { rule: Rule }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rule = mockRule(); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.muteRule).toHaveBeenCalledTimes(1); + expect(ruleApi.muteRule).toHaveBeenCalledWith({ id: rule.id, http }); + }); + + it('unmuteRule calls the unmuteRule api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ unmuteRule, rule }: ComponentOpts & { rule: Rule }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rule = mockRule({ muteAll: true }); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.unmuteRule).toHaveBeenCalledTimes(1); + expect(ruleApi.unmuteRule).toHaveBeenCalledWith({ id: rule.id, http }); + }); + + it('enableRule calls the muteRules api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ enableRule, rule }: ComponentOpts & { rule: Rule }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rule = mockRule({ enabled: false }); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.enableRule).toHaveBeenCalledTimes(1); + expect(ruleApi.enableRule).toHaveBeenCalledWith({ id: rule.id, http }); + }); + + it('disableRule calls the disableRule api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ disableRule, rule }: ComponentOpts & { rule: Rule }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rule = mockRule(); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.disableRule).toHaveBeenCalledTimes(1); + expect(ruleApi.disableRule).toHaveBeenCalledWith({ id: rule.id, http }); + }); + + it('deleteRule calls the deleteRule api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ deleteRule, rule }: ComponentOpts & { rule: Rule }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rule = mockRule(); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.deleteRules).toHaveBeenCalledTimes(1); + expect(ruleApi.deleteRules).toHaveBeenCalledWith({ ids: [rule.id], http }); + }); + + // bulk rules + it('muteRules calls the muteRules api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ muteRules, rules }: ComponentOpts & { rules: Rule[] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rules = [mockRule(), mockRule()]; + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.muteRules).toHaveBeenCalledTimes(1); + expect(ruleApi.muteRules).toHaveBeenCalledWith({ ids: [rules[0].id, rules[1].id], http }); + }); + + it('unmuteRules calls the unmuteRules api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ unmuteRules, rules }: ComponentOpts & { rules: Rule[] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rules = [mockRule({ muteAll: true }), mockRule({ muteAll: true })]; + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.unmuteRules).toHaveBeenCalledTimes(1); + expect(ruleApi.unmuteRules).toHaveBeenCalledWith({ ids: [rules[0].id, rules[1].id], http }); + }); + + it('enableRules calls the muteRuless api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ enableRules, rules }: ComponentOpts & { rules: Rule[] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rules = [ + mockRule({ enabled: false }), + mockRule({ enabled: true }), + mockRule({ enabled: false }), + ]; + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.enableRules).toHaveBeenCalledTimes(1); + expect(ruleApi.enableRules).toHaveBeenCalledWith({ ids: [rules[0].id, rules[2].id], http }); + }); + + it('disableRules calls the disableRules api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ disableRules, rules }: ComponentOpts & { rules: Rule[] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rules = [mockRule(), mockRule()]; + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.disableRules).toHaveBeenCalledTimes(1); + expect(ruleApi.disableRules).toHaveBeenCalledWith({ + ids: [rules[0].id, rules[1].id], + http, + }); + }); + + it('deleteRules calls the deleteRules api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ deleteRules, rules }: ComponentOpts & { rules: Rule[] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const rules = [mockRule(), mockRule()]; + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.deleteRules).toHaveBeenCalledTimes(1); + expect(ruleApi.deleteRules).toHaveBeenCalledWith({ ids: [rules[0].id, rules[1].id], http }); + }); + + it('loadRule calls the loadRule api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ loadRule, ruleId }: ComponentOpts & { ruleId: Rule['id'] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const ruleId = uuid.v4(); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.loadRule).toHaveBeenCalledTimes(1); + expect(ruleApi.loadRule).toHaveBeenCalledWith({ ruleId, http }); + }); + + it('resolveRule calls the resolveRule api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ resolveRule, ruleId }: ComponentOpts & { ruleId: Rule['id'] }) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const ruleId = uuid.v4(); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.resolveRule).toHaveBeenCalledTimes(1); + expect(ruleApi.resolveRule).toHaveBeenCalledWith({ ruleId, http }); + }); + + it('loadRuleTypes calls the loadRuleTypes api', () => { + const { http } = useKibanaMock().services; + const ComponentToExtend = ({ loadRuleTypes }: ComponentOpts) => { + return ; + }; + + const ExtendedComponent = withBulkRuleOperations(ComponentToExtend); + const component = mount(); + component.find('button').simulate('click'); + + expect(ruleApi.loadRuleTypes).toHaveBeenCalledTimes(1); + expect(ruleApi.loadRuleTypes).toHaveBeenCalledWith({ http }); + }); +}); + +function mockRule(overloads: Partial = {}): Rule { + return { + id: uuid.v4(), + enabled: true, + name: `rule-${uuid.v4()}`, + tags: [], + ruleTypeId: '.noop', + consumer: 'consumer', + schedule: { interval: '1m' }, + actions: [], + params: {}, + createdBy: null, + updatedBy: null, + createdAt: new Date(), + updatedAt: new Date(), + apiKeyOwner: null, + throttle: null, + notifyWhen: null, + muteAll: false, + mutedInstanceIds: [], + executionStatus: { + status: 'unknown', + lastExecutionDate: new Date('2020-08-20T19:23:38Z'), + }, + ...overloads, + }; +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_rule_api_operations.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_rule_api_operations.tsx new file mode 100644 index 0000000000000..d9bafe5816d69 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/with_bulk_rule_api_operations.tsx @@ -0,0 +1,151 @@ +/* + * 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 React from 'react'; + +import { + Rule, + RuleType, + RuleTaskState, + RuleSummary, + AlertingFrameworkHealth, + ResolvedRule, +} from '../../../../types'; +import { + deleteRules, + disableRules, + enableRules, + muteRules, + unmuteRules, + disableRule, + enableRule, + muteRule, + unmuteRule, + muteAlertInstance, + unmuteAlertInstance, + loadRule, + loadRuleState, + loadRuleSummary, + loadRuleTypes, + alertingFrameworkHealth, + resolveRule, +} from '../../../lib/rule_api'; +import { useKibana } from '../../../../common/lib/kibana'; + +export interface ComponentOpts { + muteRules: (rules: Rule[]) => Promise; + unmuteRules: (rules: Rule[]) => Promise; + enableRules: (rules: Rule[]) => Promise; + disableRules: (rules: Rule[]) => Promise; + deleteRules: (rules: Rule[]) => Promise<{ + successes: string[]; + errors: string[]; + }>; + muteRule: (rule: Rule) => Promise; + unmuteRule: (rule: Rule) => Promise; + muteAlertInstance: (rule: Rule, alertInstanceId: string) => Promise; + unmuteAlertInstance: (rule: Rule, alertInstanceId: string) => Promise; + enableRule: (rule: Rule) => Promise; + disableRule: (rule: Rule) => Promise; + deleteRule: (rule: Rule) => Promise<{ + successes: string[]; + errors: string[]; + }>; + loadRule: (id: Rule['id']) => Promise; + loadRuleState: (id: Rule['id']) => Promise; + loadRuleSummary: (id: Rule['id'], numberOfExecutions?: number) => Promise; + loadRuleTypes: () => Promise; + getHealth: () => Promise; + resolveRule: (id: Rule['id']) => Promise; +} + +export type PropsWithOptionalApiHandlers = Omit & Partial; + +export function withBulkRuleOperations( + WrappedComponent: React.ComponentType +): React.FunctionComponent> { + return (props: PropsWithOptionalApiHandlers) => { + const { http } = useKibana().services; + return ( + + muteRules({ + http, + ids: items.filter((item) => !isRuleMuted(item)).map((item) => item.id), + }) + } + unmuteRules={async (items: Rule[]) => + unmuteRules({ http, ids: items.filter(isRuleMuted).map((item) => item.id) }) + } + enableRules={async (items: Rule[]) => + enableRules({ http, ids: items.filter(isRuleDisabled).map((item) => item.id) }) + } + disableRules={async (items: Rule[]) => + disableRules({ + http, + ids: items.filter((item) => !isRuleDisabled(item)).map((item) => item.id), + }) + } + deleteRules={async (items: Rule[]) => + deleteRules({ http, ids: items.map((item) => item.id) }) + } + muteRule={async (rule: Rule) => { + if (!isRuleMuted(rule)) { + return await muteRule({ http, id: rule.id }); + } + }} + unmuteRule={async (rule: Rule) => { + if (isRuleMuted(rule)) { + return await unmuteRule({ http, id: rule.id }); + } + }} + muteAlertInstance={async (rule: Rule, instanceId: string) => { + if (!isAlertInstanceMuted(rule, instanceId)) { + return muteAlertInstance({ http, id: rule.id, instanceId }); + } + }} + unmuteAlertInstance={async (rule: Rule, instanceId: string) => { + if (isAlertInstanceMuted(rule, instanceId)) { + return unmuteAlertInstance({ http, id: rule.id, instanceId }); + } + }} + enableRule={async (rule: Rule) => { + if (isRuleDisabled(rule)) { + return await enableRule({ http, id: rule.id }); + } + }} + disableRule={async (rule: Rule) => { + if (!isRuleDisabled(rule)) { + return await disableRule({ http, id: rule.id }); + } + }} + deleteRule={async (rule: Rule) => deleteRules({ http, ids: [rule.id] })} + loadRule={async (ruleId: Rule['id']) => loadRule({ http, ruleId })} + loadRuleState={async (ruleId: Rule['id']) => loadRuleState({ http, ruleId })} + loadRuleSummary={async (ruleId: Rule['id'], numberOfExecutions?: number) => + loadRuleSummary({ http, ruleId, numberOfExecutions }) + } + loadRuleTypes={async () => loadRuleTypes({ http })} + resolveRule={async (ruleId: Rule['id']) => resolveRule({ http, ruleId })} + getHealth={async () => alertingFrameworkHealth({ http })} + /> + ); + }; +} + +function isRuleDisabled(rule: Rule) { + return rule.enabled === false; +} + +function isRuleMuted(rule: Rule) { + return rule.muteAll === true; +} + +function isAlertInstanceMuted(rule: Rule, instanceId: string) { + return rule.mutedInstanceIds.findIndex((muted) => muted === instanceId) >= 0; +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/connectors.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/connectors.ts index 4bf7f036ba10a..6543d74ecd7a2 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/connectors.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/connectors.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { ActionConnector, ActionTypeIndex, AlertAction } from '../../../types'; +import { ActionConnector, ActionTypeIndex, RuleAction } from '../../../types'; export const getValidConnectors = ( connectors: ActionConnector[], - actionItem: AlertAction, + actionItem: RuleAction, actionTypesIndex: ActionTypeIndex ): ActionConnector[] => { const actionType = actionTypesIndex[actionItem.actionTypeId]; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/index.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/index.tsx index c3dd76094b5a9..5b8a6ea569344 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/index.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/index.tsx @@ -8,13 +8,16 @@ import { lazy } from 'react'; import { suspendedComponentWithProps } from '../lib/suspended_component_with_props'; -export type { ActionGroupWithCondition, AlertConditionsProps } from './alert_form/alert_conditions'; +export type { + ActionGroupWithCondition, + RuleConditionsProps as AlertConditionsProps, +} from './rule_form/rule_conditions'; -export const AlertConditions = lazy(() => import('./alert_form/alert_conditions')); -export const AlertConditionsGroup = lazy(() => import('./alert_form/alert_conditions_group')); +export const AlertConditions = lazy(() => import('./rule_form/rule_conditions')); +export const AlertConditionsGroup = lazy(() => import('./rule_form/rule_conditions_group')); -export const AlertAdd = suspendedComponentWithProps(lazy(() => import('./alert_form/alert_add'))); -export const AlertEdit = suspendedComponentWithProps(lazy(() => import('./alert_form/alert_edit'))); +export const AlertAdd = suspendedComponentWithProps(lazy(() => import('./rule_form/rule_add'))); +export const AlertEdit = suspendedComponentWithProps(lazy(() => import('./rule_form/rule_edit'))); export const ConnectorAddFlyout = suspendedComponentWithProps( lazy(() => import('./action_connector_form/connector_add_flyout')) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/rule_muted_switch.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/alert_muted_switch.tsx similarity index 90% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/rule_muted_switch.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/alert_muted_switch.tsx index ce550243bcc37..3f236ea25a19b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/rule_muted_switch.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/alert_muted_switch.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { EuiSwitch, EuiLoadingSpinner } from '@elastic/eui'; -import { AlertListItem } from './alerts'; +import { AlertListItem } from './rule'; interface ComponentOpts { alert: AlertListItem; @@ -16,7 +16,7 @@ interface ComponentOpts { disabled: boolean; } -export const RuleMutedSwitch: React.FunctionComponent = ({ +export const AlertMutedSwitch: React.FunctionComponent = ({ alert, onMuteAction, disabled, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.scss b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.scss similarity index 90% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.scss rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.scss index 243ba5bc9c52c..c4d2bf1bbb2d6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.scss +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.scss @@ -1,6 +1,6 @@ // Add truncation to heath status -.alertsList__health { +.rulesList__health { width: 100%; .euiFlexItem:last-of-type { @@ -13,4 +13,4 @@ .ruleDurationWarningIcon { bottom: $euiSizeXS; position: relative; -} \ No newline at end of file +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.test.tsx similarity index 84% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.test.tsx index 909a562224ef7..ac103f113a8f1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.test.tsx @@ -10,8 +10,8 @@ import uuid from 'uuid'; import { shallow } from 'enzyme'; import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; -import { Alerts, AlertListItem, alertToListItem } from './alerts'; -import { Rule, AlertSummary, AlertStatus, RuleType } from '../../../../types'; +import { RuleComponent, AlertListItem, alertToListItem } from './rule'; +import { Rule, RuleSummary, AlertStatus, RuleType } from '../../../../types'; import { EuiBasicTable } from '@elastic/eui'; import { ExecutionDurationChart } from '../../common/components/execution_duration_chart'; @@ -33,18 +33,18 @@ beforeAll(() => { global.Date.now = jest.fn(() => fakeNow.getTime()); }); -describe('alerts', () => { - it('render a list of alerts', () => { +describe('rules', () => { + it('render a list of rules', () => { const rule = mockRule(); const ruleType = mockRuleType(); - const alertSummary = mockAlertSummary({ + const ruleSummary = mockRuleSummary({ alerts: { - first_alert: { + first_rule: { status: 'OK', muted: false, actionGroupId: 'default', }, - second_alert: { + second_rule: { status: 'Active', muted: false, actionGroupId: 'action group id unknown', @@ -52,47 +52,42 @@ describe('alerts', () => { }, }); - const alerts: AlertListItem[] = [ + const rules: AlertListItem[] = [ // active first - alertToListItem( - fakeNow.getTime(), - ruleType, - 'second_alert', - alertSummary.alerts.second_alert - ), + alertToListItem(fakeNow.getTime(), ruleType, 'second_rule', ruleSummary.alerts.second_rule), // ok second - alertToListItem(fakeNow.getTime(), ruleType, 'first_alert', alertSummary.alerts.first_alert), + alertToListItem(fakeNow.getTime(), ruleType, 'first_rule', ruleSummary.alerts.first_rule), ]; expect( shallow( - ) .find(EuiBasicTable) .prop('items') - ).toEqual(alerts); + ).toEqual(rules); }); it('render a hidden field with duration epoch', () => { const rule = mockRule(); const ruleType = mockRuleType(); - const alertSummary = mockAlertSummary(); + const ruleSummary = mockRuleSummary(); expect( shallow( - ) .find('[name="alertsDurationEpoch"]') @@ -100,7 +95,7 @@ describe('alerts', () => { ).toEqual(fake2MinutesAgo.getTime()); }); - it('render all active alerts', () => { + it('render all active rules', () => { const rule = mockRule(); const ruleType = mockRuleType(); const alerts: Record = { @@ -115,12 +110,12 @@ describe('alerts', () => { }; expect( shallow( - @@ -133,22 +128,22 @@ describe('alerts', () => { ]); }); - it('render all inactive alerts', () => { + it('render all inactive rules', () => { const rule = mockRule({ mutedInstanceIds: ['us-west', 'us-east'], }); const ruleType = mockRuleType(); - const alertUsWest: AlertStatus = { status: 'OK', muted: false }; - const alertUsEast: AlertStatus = { status: 'OK', muted: false }; + const ruleUsWest: AlertStatus = { status: 'OK', muted: false }; + const ruleUsEast: AlertStatus = { status: 'OK', muted: false }; expect( shallow( - { .find(EuiBasicTable) .prop('items') ).toEqual([ - alertToListItem(fakeNow.getTime(), ruleType, 'us-west', alertUsWest), - alertToListItem(fakeNow.getTime(), ruleType, 'us-east', alertUsEast), + alertToListItem(fakeNow.getTime(), ruleType, 'us-west', ruleUsWest), + alertToListItem(fakeNow.getTime(), ruleType, 'us-east', ruleUsEast), ]); }); }); describe('alertToListItem', () => { - it('handles active alerts', () => { + it('handles active rules', () => { const ruleType = mockRuleType({ actionGroups: [ { id: 'default', name: 'Default Action Group' }, @@ -197,7 +192,7 @@ describe('alertToListItem', () => { }); }); - it('handles active alerts with no action group id', () => { + it('handles active rules with no action group id', () => { const ruleType = mockRuleType(); const start = fake2MinutesAgo; const alert: AlertStatus = { @@ -216,7 +211,7 @@ describe('alertToListItem', () => { }); }); - it('handles active muted alerts', () => { + it('handles active muted rules', () => { const ruleType = mockRuleType(); const start = fake2MinutesAgo; const alert: AlertStatus = { @@ -236,7 +231,7 @@ describe('alertToListItem', () => { }); }); - it('handles active alerts with start date', () => { + it('handles active rules with start date', () => { const ruleType = mockRuleType(); const alert: AlertStatus = { status: 'Active', @@ -254,7 +249,7 @@ describe('alertToListItem', () => { }); }); - it('handles muted inactive alerts', () => { + it('handles muted inactive rules', () => { const ruleType = mockRuleType(); const alert: AlertStatus = { status: 'OK', @@ -278,15 +273,15 @@ describe('execution duration overview', () => { executionStatus: { status: 'ok', lastExecutionDate: new Date('2020-08-20T19:23:38Z') }, }); const ruleType = mockRuleType(); - const alertSummary = mockAlertSummary(); + const ruleSummary = mockRuleSummary(); const wrapper = mountWithIntl( - ); @@ -304,17 +299,17 @@ describe('execution duration overview', () => { it('renders average execution duration', async () => { const rule = mockRule(); const ruleType = mockRuleType({ ruleTaskTimeout: '10m' }); - const alertSummary = mockAlertSummary({ + const ruleSummary = mockRuleSummary({ executionDuration: { average: 60284, valuesWithTimestamp: {} }, }); const wrapper = mountWithIntl( - ); @@ -335,17 +330,17 @@ describe('execution duration overview', () => { it('renders warning when average execution duration exceeds rule timeout', async () => { const rule = mockRule(); const ruleType = mockRuleType({ ruleTaskTimeout: '10m' }); - const alertSummary = mockAlertSummary({ + const ruleSummary = mockRuleSummary({ executionDuration: { average: 60284345, valuesWithTimestamp: {} }, }); const wrapper = mountWithIntl( - ); @@ -366,15 +361,15 @@ describe('execution duration overview', () => { it('renders execution duration chart', () => { const rule = mockRule(); const ruleType = mockRuleType(); - const alertSummary = mockAlertSummary(); + const ruleSummary = mockRuleSummary(); expect( shallow( - ) @@ -390,7 +385,7 @@ function mockRule(overloads: Partial = {}): Rule { enabled: true, name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: 'consumer', schedule: { interval: '1m' }, actions: [], @@ -425,15 +420,15 @@ function mockRuleType(overloads: Partial = {}): RuleType { defaultActionGroupId: 'default', recoveryActionGroup: { id: 'recovered', name: 'Recovered' }, authorizedConsumers: {}, - producer: 'alerts', + producer: 'rules', minimumLicenseRequired: 'basic', enabledInLicense: true, ...overloads, }; } -function mockAlertSummary(overloads: Partial = {}): AlertSummary { - const summary: AlertSummary = { +function mockRuleSummary(overloads: Partial = {}): RuleSummary { + const summary: RuleSummary = { id: 'rule-id', name: 'rule-name', tags: ['tag-1', 'tag-2'], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.tsx similarity index 82% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.tsx index 9d4ef14dec64a..1a08f12c11743 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule.tsx @@ -28,36 +28,36 @@ import { AlertExecutionStatusErrorReasons, AlertStatusValues, } from '../../../../../../alerting/common'; -import { Rule, AlertSummary, AlertStatus, RuleType, Pagination } from '../../../../types'; +import { Rule, RuleSummary, AlertStatus, RuleType, Pagination } from '../../../../types'; import { - ComponentOpts as AlertApis, - withBulkAlertOperations, -} from '../../common/components/with_bulk_alert_api_operations'; + ComponentOpts as RuleApis, + withBulkRuleOperations, +} from '../../common/components/with_bulk_rule_api_operations'; import { DEFAULT_SEARCH_PAGE_SIZE } from '../../../constants'; -import './alerts.scss'; -import { RuleMutedSwitch } from './rule_muted_switch'; -import { getHealthColor } from '../../alerts_list/components/alert_status_filter'; +import './rule.scss'; +import { AlertMutedSwitch } from './alert_muted_switch'; +import { getHealthColor } from '../../rules_list/components/rule_status_filter'; import { - alertsStatusesTranslationsMapping, + rulesStatusesTranslationsMapping, ALERT_STATUS_LICENSE_ERROR, -} from '../../alerts_list/translations'; +} from '../../rules_list/translations'; import { formatMillisForDisplay, shouldShowDurationWarning, } from '../../../lib/execution_duration_utils'; import { ExecutionDurationChart } from '../../common/components/execution_duration_chart'; -type AlertsProps = { +type RuleProps = { rule: Rule; ruleType: RuleType; readOnly: boolean; - alertSummary: AlertSummary; + ruleSummary: RuleSummary; requestRefresh: () => Promise; numberOfExecutions: number; onChangeDuration: (length: number) => void; durationEpoch?: number; isLoadingChart?: boolean; -} & Pick; +} & Pick; export const alertsTableColumns = ( onMuteAction: (alert: AlertListItem) => Promise, @@ -65,7 +65,7 @@ export const alertsTableColumns = ( ) => [ { field: 'alert', - name: i18n.translate('xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.alert', { + name: i18n.translate('xpack.triggersActionsUI.sections.ruleDetails.alertsList.columns.Alert', { defaultMessage: 'Alert', }), sortable: false, @@ -82,10 +82,9 @@ export const alertsTableColumns = ( }, { field: 'status', - name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.status', - { defaultMessage: 'Status' } - ), + name: i18n.translate('xpack.triggersActionsUI.sections.ruleDetails.alertsList.columns.status', { + defaultMessage: 'Status', + }), width: '15%', render: (value: AlertListItemStatus) => { return ( @@ -104,7 +103,7 @@ export const alertsTableColumns = ( render: (value: Date | undefined) => { return value ? moment(value).format('D MMM YYYY @ HH:mm:ss') : ''; }, - name: i18n.translate('xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.start', { + name: i18n.translate('xpack.triggersActionsUI.sections.ruleDetails.alertsList.columns.start', { defaultMessage: 'Start', }), sortable: false, @@ -116,7 +115,7 @@ export const alertsTableColumns = ( return value ? durationAsString(moment.duration(value)) : ''; }, name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.duration', + 'xpack.triggersActionsUI.sections.ruleDetails.alertsList.columns.duration', { defaultMessage: 'Duration' } ), sortable: false, @@ -127,12 +126,12 @@ export const alertsTableColumns = ( field: '', align: RIGHT_ALIGNMENT, width: '60px', - name: i18n.translate('xpack.triggersActionsUI.sections.alertDetails.alertsList.columns.mute', { + name: i18n.translate('xpack.triggersActionsUI.sections.ruleDetails.alertsList.columns.mute', { defaultMessage: 'Mute', }), render: (alert: AlertListItem) => { return ( - await onMuteAction(alert)} alert={alert} @@ -150,11 +149,11 @@ function durationAsString(duration: Duration): string { .join(':'); } -export function Alerts({ +export function RuleComponent({ rule, ruleType, readOnly, - alertSummary, + ruleSummary, muteAlertInstance, unmuteAlertInstance, requestRefresh, @@ -162,13 +161,13 @@ export function Alerts({ onChangeDuration, durationEpoch = Date.now(), isLoadingChart, -}: AlertsProps) { +}: RuleProps) { const [pagination, setPagination] = useState({ index: 0, size: DEFAULT_SEARCH_PAGE_SIZE, }); - const alerts = Object.entries(alertSummary.alerts) + const alerts = Object.entries(ruleSummary.alerts) .map(([alertId, alert]) => alertToListItem(durationEpoch, ruleType, alertId, alert)) .sort((leftAlert, rightAlert) => leftAlert.sortPriority - rightAlert.sortPriority); @@ -183,7 +182,7 @@ export function Alerts({ const showDurationWarning = shouldShowDurationWarning( ruleType, - alertSummary.executionDuration.average + ruleSummary.executionDuration.average ); const healthColor = getHealthColor(rule.executionStatus.status); @@ -191,7 +190,7 @@ export function Alerts({ rule.executionStatus.error?.reason === AlertExecutionStatusErrorReasons.License; const statusMessage = isLicenseError ? ALERT_STATUS_LICENSE_ERROR - : alertsStatusesTranslationsMapping[rule.executionStatus.status]; + : rulesStatusesTranslationsMapping[rule.executionStatus.status]; return ( <> @@ -212,7 +211,7 @@ export function Alerts({ } description={i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.ruleLastExecutionDescription', + 'xpack.triggersActionsUI.sections.ruleDetails.rulesList.ruleLastExecutionDescription', { defaultMessage: `Last response`, } @@ -239,7 +238,7 @@ export function Alerts({ type="alert" color="warning" content={i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.ruleTypeExcessDurationMessage', + 'xpack.triggersActionsUI.sections.ruleDetails.alertsList.ruleTypeExcessDurationMessage', { defaultMessage: `Duration exceeds the rule's expected run time.`, } @@ -249,12 +248,12 @@ export function Alerts({ )} - {formatMillisForDisplay(alertSummary.executionDuration.average)} + {formatMillisForDisplay(ruleSummary.executionDuration.average)} } description={i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.avgDurationDescription', + 'xpack.triggersActionsUI.sections.ruleDetails.alertsList.avgDurationDescription', { defaultMessage: `Average duration`, } @@ -264,7 +263,7 @@ export function Alerts({ ); } -export const AlertsWithApi = withBulkAlertOperations(Alerts); +export const RuleWithApi = withBulkRuleOperations(RuleComponent); function getPage(items: any[], pagination: Pagination) { return chunk(items, pagination.size)[pagination.index] || []; @@ -323,12 +322,12 @@ export interface AlertListItem { } const ACTIVE_LABEL = i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.status.active', + 'xpack.triggersActionsUI.sections.ruleDetails.rulesList.status.active', { defaultMessage: 'Active' } ); const INACTIVE_LABEL = i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.alertsList.status.inactive', + 'xpack.triggersActionsUI.sections.ruleDetails.rulesList.status.inactive', { defaultMessage: 'Recovered' } ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.test.tsx similarity index 72% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.test.tsx index e12322c3b84ad..4af24e9a44602 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.test.tsx @@ -10,7 +10,7 @@ import uuid from 'uuid'; import { shallow } from 'enzyme'; import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from '@testing-library/react'; -import { AlertDetails } from './alert_details'; +import { RuleDetails } from './rule_details'; import { Rule, ActionType, RuleTypeModel, RuleType } from '../../../../types'; import { EuiBadge, @@ -35,7 +35,7 @@ jest.mock('react-router-dom', () => ({ push: jest.fn(), }), useLocation: () => ({ - pathname: '/triggersActions/alerts/', + pathname: '/triggersActions/rules/', }), })); @@ -45,17 +45,17 @@ jest.mock('../../../lib/action_connector_api', () => ({ jest.mock('../../../lib/capabilities', () => ({ hasAllPrivilege: jest.fn(() => true), - hasSaveAlertsCapability: jest.fn(() => true), + hasSaveRulesCapability: jest.fn(() => true), hasExecuteActionsCapability: jest.fn(() => true), })); const useKibanaMock = useKibana as jest.Mocked; const ruleTypeRegistry = ruleTypeRegistryMock.create(); -const mockAlertApis = { - muteAlert: jest.fn(), - unmuteAlert: jest.fn(), - enableAlert: jest.fn(), - disableAlert: jest.fn(), +const mockRuleApis = { + muteRule: jest.fn(), + unmuteRule: jest.fn(), + enableRule: jest.fn(), + disableRule: jest.fn(), requestRefresh: jest.fn(), refreshToken: Date.now(), }; @@ -65,7 +65,7 @@ const authorizedConsumers = { }; const recoveryActionGroup: ActionGroup<'recovered'> = { id: 'recovered', name: 'Recovered' }; -const alertType: RuleType = { +const ruleType: RuleType = { id: '.noop', name: 'No Op', actionGroups: [{ id: 'default', name: 'Default' }], @@ -78,27 +78,27 @@ const alertType: RuleType = { enabledInLicense: true, }; -describe('alert_details', () => { - it('renders the alert name as a title', () => { - const alert = mockAlert(); +describe('rule_details', () => { + it('renders the rule name as a title', () => { + const rule = mockRule(); expect( shallow( - + ).find('EuiPageHeader') ).toBeTruthy(); }); - it('renders the alert type badge', () => { - const alert = mockAlert(); + it('renders the rule type badge', () => { + const rule = mockRule(); expect( shallow( - - ).find({alertType.name}) + + ).find({ruleType.name}) ).toBeTruthy(); }); - it('renders the alert error banner with error message, when alert status is an error', () => { - const alert = mockAlert({ + it('renders the rule error banner with error message, when rule status is an error', () => { + const rule = mockRule({ executionStatus: { status: 'error', lastExecutionDate: new Date('2020-08-20T19:23:38Z'), @@ -110,9 +110,9 @@ describe('alert_details', () => { }); expect( shallow( - + ).containsMatchingElement( - + {'test'} ) @@ -120,8 +120,8 @@ describe('alert_details', () => { }); describe('actions', () => { - it('renders an alert action', () => { - const alert = mockAlert({ + it('renders an rule action', () => { + const rule = mockRule({ actions: [ { group: 'default', @@ -145,11 +145,11 @@ describe('alert_details', () => { expect( shallow( - ).containsMatchingElement( @@ -159,8 +159,8 @@ describe('alert_details', () => { ).toBeTruthy(); }); - it('renders a counter for multiple alert action', () => { - const alert = mockAlert({ + it('renders a counter for multiple rule action', () => { + const rule = mockRule({ actions: [ { group: 'default', @@ -196,12 +196,7 @@ describe('alert_details', () => { ]; const details = shallow( - + ); expect( @@ -223,19 +218,19 @@ describe('alert_details', () => { }); describe('links', () => { - it('links to the app that created the alert', () => { - const alert = mockAlert(); + it('links to the app that created the rule', () => { + const rule = mockRule(); expect( shallow( - + ).find('ViewInApp') ).toBeTruthy(); }); it('links to the Edit flyout', () => { - const alert = mockAlert(); + const rule = mockRule(); const pageHeaderProps = shallow( - + ) .find('EuiPageHeader') .props() as EuiPageHeaderProps; @@ -243,7 +238,7 @@ describe('alert_details', () => { expect(!!rightSideItems && rightSideItems[2]!).toMatchInlineSnapshot(` { > @@ -262,12 +257,12 @@ describe('alert_details', () => { }); describe('disable button', () => { - it('should render a disable button when alert is enabled', () => { - const alert = mockAlert({ + it('should render a disable button when rule is enabled', () => { + const rule = mockRule({ enabled: true, }); const enableButton = shallow( - + ) .find(EuiSwitch) .find('[name="enable"]') @@ -279,12 +274,12 @@ describe('disable button', () => { }); }); - it('should render a enable button and empty state when alert is disabled', async () => { - const alert = mockAlert({ + it('should render a enable button and empty state when rule is disabled', async () => { + const rule = mockRule({ enabled: false, }); const wrapper = mountWithIntl( - + ); await act(async () => { @@ -309,21 +304,21 @@ describe('disable button', () => { wrapper.update(); }); - expect(mockAlertApis.enableAlert).toHaveBeenCalledTimes(1); + expect(mockRuleApis.enableRule).toHaveBeenCalledTimes(1); }); - it('should disable the alert when alert is enabled and button is clicked', () => { - const alert = mockAlert({ + it('should disable the rule when rule is enabled and button is clicked', () => { + const rule = mockRule({ enabled: true, }); - const disableAlert = jest.fn(); + const disableRule = jest.fn(); const enableButton = shallow( - ) .find(EuiSwitch) @@ -333,23 +328,23 @@ describe('disable button', () => { enableButton.simulate('click'); const handler = enableButton.prop('onChange'); expect(typeof handler).toEqual('function'); - expect(disableAlert).toHaveBeenCalledTimes(0); + expect(disableRule).toHaveBeenCalledTimes(0); handler!({} as React.FormEvent); - expect(disableAlert).toHaveBeenCalledTimes(1); + expect(disableRule).toHaveBeenCalledTimes(1); }); - it('should enable the alert when alert is disabled and button is clicked', () => { - const alert = mockAlert({ + it('should enable the rule when rule is disabled and button is clicked', () => { + const rule = mockRule({ enabled: false, }); - const enableAlert = jest.fn(); + const enableRule = jest.fn(); const enableButton = shallow( - ) .find(EuiSwitch) @@ -359,13 +354,13 @@ describe('disable button', () => { enableButton.simulate('click'); const handler = enableButton.prop('onChange'); expect(typeof handler).toEqual('function'); - expect(enableAlert).toHaveBeenCalledTimes(0); + expect(enableRule).toHaveBeenCalledTimes(0); handler!({} as React.FormEvent); - expect(enableAlert).toHaveBeenCalledTimes(1); + expect(enableRule).toHaveBeenCalledTimes(1); }); - it('should reset error banner dismissal after re-enabling the alert', async () => { - const alert = mockAlert({ + it('should reset error banner dismissal after re-enabling the rule', async () => { + const rule = mockRule({ enabled: true, executionStatus: { status: 'error', @@ -377,16 +372,16 @@ describe('disable button', () => { }, }); - const disableAlert = jest.fn(); - const enableAlert = jest.fn(); + const disableRule = jest.fn(); + const enableRule = jest.fn(); const wrapper = mountWithIntl( - ); @@ -401,31 +396,31 @@ describe('disable button', () => { await nextTick(); }); - // Disable the alert + // Disable the rule await act(async () => { wrapper.find('[data-test-subj="enableSwitch"] .euiSwitch__button').first().simulate('click'); await nextTick(); }); - expect(disableAlert).toHaveBeenCalled(); + expect(disableRule).toHaveBeenCalled(); await act(async () => { await nextTick(); wrapper.update(); }); - // Enable the alert + // Enable the rule await act(async () => { wrapper.find('[data-test-subj="enableSwitch"] .euiSwitch__button').first().simulate('click'); await nextTick(); }); - expect(enableAlert).toHaveBeenCalled(); + expect(enableRule).toHaveBeenCalled(); // Ensure error banner is back expect(wrapper.find('[data-test-subj="dismiss-execution-error"]').length).toBeGreaterThan(0); }); it('should show the loading spinner when the rule enabled switch was clicked and the server responded with some delay', async () => { - const alert = mockAlert({ + const rule = mockRule({ enabled: true, executionStatus: { status: 'error', @@ -437,18 +432,18 @@ describe('disable button', () => { }, }); - const disableAlert = jest.fn(async () => { + const disableRule = jest.fn(async () => { await new Promise((resolve) => setTimeout(resolve, 6000)); }); - const enableAlert = jest.fn(); + const enableRule = jest.fn(); const wrapper = mountWithIntl( - ); @@ -463,19 +458,19 @@ describe('disable button', () => { await nextTick(); }); - // Disable the alert + // Disable the rule await act(async () => { wrapper.find('[data-test-subj="enableSwitch"] .euiSwitch__button').first().simulate('click'); await nextTick(); }); - expect(disableAlert).toHaveBeenCalled(); + expect(disableRule).toHaveBeenCalled(); await act(async () => { await nextTick(); wrapper.update(); }); - // Enable the alert + // Enable the rule await act(async () => { expect(wrapper.find('[data-test-subj="enableSpinner"]').length).toBeGreaterThan(0); await nextTick(); @@ -484,13 +479,13 @@ describe('disable button', () => { }); describe('mute button', () => { - it('should render an mute button when alert is enabled', () => { - const alert = mockAlert({ + it('should render an mute button when rule is enabled', () => { + const rule = mockRule({ enabled: true, muteAll: false, }); const enableButton = shallow( - + ) .find(EuiSwitch) .find('[name="mute"]') @@ -501,13 +496,13 @@ describe('mute button', () => { }); }); - it('should render an muted button when alert is muted', () => { - const alert = mockAlert({ + it('should render an muted button when rule is muted', () => { + const rule = mockRule({ enabled: true, muteAll: true, }); const enableButton = shallow( - + ) .find(EuiSwitch) .find('[name="mute"]') @@ -518,19 +513,19 @@ describe('mute button', () => { }); }); - it('should mute the alert when alert is unmuted and button is clicked', () => { - const alert = mockAlert({ + it('should mute the rule when rule is unmuted and button is clicked', () => { + const rule = mockRule({ enabled: true, muteAll: false, }); - const muteAlert = jest.fn(); + const muteRule = jest.fn(); const enableButton = shallow( - ) .find(EuiSwitch) @@ -539,24 +534,24 @@ describe('mute button', () => { enableButton.simulate('click'); const handler = enableButton.prop('onChange'); expect(typeof handler).toEqual('function'); - expect(muteAlert).toHaveBeenCalledTimes(0); + expect(muteRule).toHaveBeenCalledTimes(0); handler!({} as React.FormEvent); - expect(muteAlert).toHaveBeenCalledTimes(1); + expect(muteRule).toHaveBeenCalledTimes(1); }); - it('should unmute the alert when alert is muted and button is clicked', () => { - const alert = mockAlert({ + it('should unmute the rule when rule is muted and button is clicked', () => { + const rule = mockRule({ enabled: true, muteAll: true, }); - const unmuteAlert = jest.fn(); + const unmuteRule = jest.fn(); const enableButton = shallow( - ) .find(EuiSwitch) @@ -565,18 +560,18 @@ describe('mute button', () => { enableButton.simulate('click'); const handler = enableButton.prop('onChange'); expect(typeof handler).toEqual('function'); - expect(unmuteAlert).toHaveBeenCalledTimes(0); + expect(unmuteRule).toHaveBeenCalledTimes(0); handler!({} as React.FormEvent); - expect(unmuteAlert).toHaveBeenCalledTimes(1); + expect(unmuteRule).toHaveBeenCalledTimes(1); }); - it('should disabled mute button when alert is disabled', () => { - const alert = mockAlert({ + it('should disabled mute button when rule is disabled', () => { + const rule = mockRule({ enabled: false, muteAll: false, }); const enableButton = shallow( - + ) .find(EuiSwitch) .find('[name="mute"]') @@ -600,10 +595,10 @@ describe('edit button', () => { }, ]; ruleTypeRegistry.has.mockReturnValue(true); - const alertTypeR: RuleTypeModel = { - id: 'my-alert-type', + const ruleTypeR: RuleTypeModel = { + id: 'my-rule-type', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: () => { return { errors: {} }; @@ -611,11 +606,11 @@ describe('edit button', () => { ruleParamsExpression: jest.fn(), requiresAppContext: false, }; - ruleTypeRegistry.get.mockReturnValue(alertTypeR); + ruleTypeRegistry.get.mockReturnValue(ruleTypeR); useKibanaMock().services.ruleTypeRegistry = ruleTypeRegistry; - it('should render an edit button when alert and actions are editable', () => { - const alert = mockAlert({ + it('should render an edit button when rule and actions are editable', () => { + const rule = mockRule({ enabled: true, muteAll: false, actions: [ @@ -628,12 +623,7 @@ describe('edit button', () => { ], }); const pageHeaderProps = shallow( - + ) .find('EuiPageHeader') .props() as EuiPageHeaderProps; @@ -641,7 +631,7 @@ describe('edit button', () => { expect(!!rightSideItems && rightSideItems[2]!).toMatchInlineSnapshot(` { > @@ -657,10 +647,10 @@ describe('edit button', () => { `); }); - it('should not render an edit button when alert editable but actions arent', () => { + it('should not render an edit button when rule editable but actions arent', () => { const { hasExecuteActionsCapability } = jest.requireMock('../../../lib/capabilities'); hasExecuteActionsCapability.mockReturnValueOnce(false); - const alert = mockAlert({ + const rule = mockRule({ enabled: true, muteAll: false, actions: [ @@ -674,12 +664,7 @@ describe('edit button', () => { }); expect( shallow( - + ) .find(EuiButtonEmpty) .find('[name="edit"]') @@ -688,21 +673,16 @@ describe('edit button', () => { ).toBeFalsy(); }); - it('should render an edit button when alert editable but actions arent when there are no actions on the alert', async () => { + it('should render an edit button when rule editable but actions arent when there are no actions on the rule', async () => { const { hasExecuteActionsCapability } = jest.requireMock('../../../lib/capabilities'); hasExecuteActionsCapability.mockReturnValueOnce(false); - const alert = mockAlert({ + const rule = mockRule({ enabled: true, muteAll: false, actions: [], }); const pageHeaderProps = shallow( - + ) .find('EuiPageHeader') .props() as EuiPageHeaderProps; @@ -710,7 +690,7 @@ describe('edit button', () => { expect(!!rightSideItems && rightSideItems[2]!).toMatchInlineSnapshot(` { > @@ -739,10 +719,10 @@ describe('broken connector indicator', () => { }, ]; ruleTypeRegistry.has.mockReturnValue(true); - const alertTypeR: RuleTypeModel = { - id: 'my-alert-type', + const ruleTypeR: RuleTypeModel = { + id: 'my-rule-type', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: () => { return { errors: {} }; @@ -750,7 +730,7 @@ describe('broken connector indicator', () => { ruleParamsExpression: jest.fn(), requiresAppContext: false, }; - ruleTypeRegistry.get.mockReturnValue(alertTypeR); + ruleTypeRegistry.get.mockReturnValue(ruleTypeR); useKibanaMock().services.ruleTypeRegistry = ruleTypeRegistry; const { loadAllActions } = jest.requireMock('../../../lib/action_connector_api'); loadAllActions.mockResolvedValue([ @@ -775,7 +755,7 @@ describe('broken connector indicator', () => { ]); it('should not render broken connector indicator or warning if all rule actions connectors exist', async () => { - const alert = mockAlert({ + const rule = mockRule({ enabled: true, muteAll: false, actions: [ @@ -794,12 +774,7 @@ describe('broken connector indicator', () => { ], }); const wrapper = mountWithIntl( - + ); await act(async () => { await nextTick(); @@ -816,7 +791,7 @@ describe('broken connector indicator', () => { }); it('should render broken connector indicator and warning if any rule actions connector does not exist', async () => { - const alert = mockAlert({ + const rule = mockRule({ enabled: true, muteAll: false, actions: [ @@ -841,12 +816,7 @@ describe('broken connector indicator', () => { ], }); const wrapper = mountWithIntl( - + ); await act(async () => { await nextTick(); @@ -867,7 +837,7 @@ describe('broken connector indicator', () => { }); it('should render broken connector indicator and warning with no edit button if any rule actions connector does not exist and user has no edit access', async () => { - const alert = mockAlert({ + const rule = mockRule({ enabled: true, muteAll: false, actions: [ @@ -894,12 +864,7 @@ describe('broken connector indicator', () => { const { hasExecuteActionsCapability } = jest.requireMock('../../../lib/capabilities'); hasExecuteActionsCapability.mockReturnValue(false); const wrapper = mountWithIntl( - + ); await act(async () => { await nextTick(); @@ -922,14 +887,14 @@ describe('broken connector indicator', () => { describe('refresh button', () => { it('should call requestRefresh when clicked', async () => { - const alert = mockAlert(); + const rule = mockRule(); const requestRefresh = jest.fn(); const wrapper = mountWithIntl( - ); @@ -938,7 +903,7 @@ describe('refresh button', () => { await nextTick(); wrapper.update(); }); - const refreshButton = wrapper.find('[data-test-subj="refreshAlertsButton"]').first(); + const refreshButton = wrapper.find('[data-test-subj="refreshRulesButton"]').first(); expect(refreshButton.exists()).toBeTruthy(); refreshButton.simulate('click'); @@ -946,13 +911,13 @@ describe('refresh button', () => { }); }); -function mockAlert(overloads: Partial = {}): Rule { +function mockRule(overloads: Partial = {}): Rule { return { id: uuid.v4(), enabled: true, - name: `alert-${uuid.v4()}`, + name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: ALERTS_FEATURE_ID, schedule: { interval: '1m' }, actions: [], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx similarity index 70% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx index 1bb979ee86052..becf1376c8900 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx @@ -29,38 +29,38 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { AlertExecutionStatusErrorReasons } from '../../../../../../alerting/common'; import { hasAllPrivilege, hasExecuteActionsCapability } from '../../../lib/capabilities'; -import { getAlertingSectionBreadcrumb, getAlertDetailsBreadcrumb } from '../../../lib/breadcrumb'; +import { getAlertingSectionBreadcrumb, getRuleDetailsBreadcrumb } from '../../../lib/breadcrumb'; import { getCurrentDocTitle } from '../../../lib/doc_title'; import { Rule, RuleType, ActionType, ActionConnector } from '../../../../types'; import { ComponentOpts as BulkOperationsComponentOpts, - withBulkAlertOperations, -} from '../../common/components/with_bulk_alert_api_operations'; -import { AlertsRouteWithApi } from './alerts_route'; + withBulkRuleOperations, +} from '../../common/components/with_bulk_rule_api_operations'; +import { RuleRouteWithApi } from './rule_route'; import { ViewInApp } from './view_in_app'; -import { AlertEdit } from '../../alert_form'; +import { RuleEdit } from '../../rule_form'; import { routeToRuleDetails } from '../../../constants'; -import { alertsErrorReasonTranslationsMapping } from '../../alerts_list/translations'; +import { rulesErrorReasonTranslationsMapping } from '../../rules_list/translations'; import { useKibana } from '../../../../common/lib/kibana'; -import { alertReducer } from '../../alert_form/alert_reducer'; +import { ruleReducer } from '../../rule_form/rule_reducer'; import { loadAllActions as loadConnectors } from '../../../lib/action_connector_api'; -export type AlertDetailsProps = { - alert: Rule; - alertType: RuleType; +export type RuleDetailsProps = { + rule: Rule; + ruleType: RuleType; actionTypes: ActionType[]; requestRefresh: () => Promise; refreshToken?: number; -} & Pick; +} & Pick; -export const AlertDetails: React.FunctionComponent = ({ - alert, - alertType, +export const RuleDetails: React.FunctionComponent = ({ + rule, + ruleType, actionTypes, - disableAlert, - enableAlert, - unmuteAlert, - muteAlert, + disableRule, + enableRule, + unmuteRule, + muteRule, requestRefresh, refreshToken, }) => { @@ -73,9 +73,9 @@ export const AlertDetails: React.FunctionComponent = ({ chrome, http, } = useKibana().services; - const [{}, dispatch] = useReducer(alertReducer, { alert }); - const setInitialAlert = (value: Rule) => { - dispatch({ command: { type: 'setAlert' }, payload: { key: 'alert', value } }); + const [{}, dispatch] = useReducer(ruleReducer, { rule }); + const setInitialRule = (value: Rule) => { + dispatch({ command: { type: 'setRule' }, payload: { key: 'rule', value } }); }; const [hasActionsWithBrokenConnector, setHasActionsWithBrokenConnector] = @@ -84,10 +84,10 @@ export const AlertDetails: React.FunctionComponent = ({ // Set breadcrumb and page title useEffect(() => { setBreadcrumbs([ - getAlertingSectionBreadcrumb('alerts'), - getAlertDetailsBreadcrumb(alert.id, alert.name), + getAlertingSectionBreadcrumb('rules'), + getRuleDetailsBreadcrumb(rule.id, rule.name), ]); - chrome.docTitle.change(getCurrentDocTitle('alerts')); + chrome.docTitle.change(getCurrentDocTitle('rules')); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -102,7 +102,7 @@ export const AlertDetails: React.FunctionComponent = ({ } if (loadedConnectors.length > 0) { - const hasActionWithBrokenConnector = alert.actions.some( + const hasActionWithBrokenConnector = rule.actions.some( (action) => !loadedConnectors.find((connector) => connector.id === action.id) ); if (setHasActionsWithBrokenConnector) { @@ -114,38 +114,38 @@ export const AlertDetails: React.FunctionComponent = ({ }, []); const canExecuteActions = hasExecuteActionsCapability(capabilities); - const canSaveAlert = - hasAllPrivilege(alert, alertType) && - // if the alert has actions, can the user save the alert's action params - (canExecuteActions || (!canExecuteActions && alert.actions.length === 0)); + const canSaveRule = + hasAllPrivilege(rule, ruleType) && + // if the rule has actions, can the user save the rule's action params + (canExecuteActions || (!canExecuteActions && rule.actions.length === 0)); const actionTypesByTypeId = keyBy(actionTypes, 'id'); const hasEditButton = - // can the user save the alert - canSaveAlert && - // is this alert type editable from within Alerts Management - (ruleTypeRegistry.has(alert.alertTypeId) - ? !ruleTypeRegistry.get(alert.alertTypeId).requiresAppContext + // can the user save the rule + canSaveRule && + // is this rule type editable from within Rules Management + (ruleTypeRegistry.has(rule.ruleTypeId) + ? !ruleTypeRegistry.get(rule.ruleTypeId).requiresAppContext : false); - const alertActions = alert.actions; - const uniqueActions = Array.from(new Set(alertActions.map((item: any) => item.actionTypeId))); - const [isEnabled, setIsEnabled] = useState(alert.enabled); + const ruleActions = rule.actions; + const uniqueActions = Array.from(new Set(ruleActions.map((item: any) => item.actionTypeId))); + const [isEnabled, setIsEnabled] = useState(rule.enabled); const [isEnabledUpdating, setIsEnabledUpdating] = useState(false); const [isMutedUpdating, setIsMutedUpdating] = useState(false); - const [isMuted, setIsMuted] = useState(alert.muteAll); + const [isMuted, setIsMuted] = useState(rule.muteAll); const [editFlyoutVisible, setEditFlyoutVisibility] = useState(false); - const [dissmissAlertErrors, setDissmissAlertErrors] = useState(false); + const [dissmissRuleErrors, setDissmissRuleErrors] = useState(false); - const setAlert = async () => { - history.push(routeToRuleDetails.replace(`:ruleId`, alert.id)); + const setRule = async () => { + history.push(routeToRuleDetails.replace(`:ruleId`, rule.id)); }; - const getAlertStatusErrorReasonText = () => { - if (alert.executionStatus.error && alert.executionStatus.error.reason) { - return alertsErrorReasonTranslationsMapping[alert.executionStatus.error.reason]; + const getRuleStatusErrorReasonText = () => { + if (rule.executionStatus.error && rule.executionStatus.error.reason) { + return rulesErrorReasonTranslationsMapping[rule.executionStatus.error.reason]; } else { - return alertsErrorReasonTranslationsMapping.unknown; + return rulesErrorReasonTranslationsMapping.unknown; } }; @@ -153,28 +153,28 @@ export const AlertDetails: React.FunctionComponent = ({ ? [ <> setEditFlyoutVisibility(true)} name="edit" - disabled={!alertType.enabledInLicense} + disabled={!ruleType.enabledInLicense} > {editFlyoutVisible && ( - { - setInitialAlert(alert); + setInitialRule(rule); setEditFlyoutVisibility(false); }} actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} - ruleType={alertType} - onSave={setAlert} + ruleType={ruleType} + onSave={setRule} /> )} , @@ -184,26 +184,26 @@ export const AlertDetails: React.FunctionComponent = ({ return ( <> } rightSideItems={[ - , + , , @@ -217,29 +217,29 @@ export const AlertDetails: React.FunctionComponent = ({

- {alertType.name} + {ruleType.name}
{uniqueActions && uniqueActions.length ? ( <> {' '} {hasActionsWithBrokenConnector && ( = ({ @@ -285,26 +285,26 @@ export const AlertDetails: React.FunctionComponent = ({ ) : ( { setIsEnabledUpdating(true); if (isEnabled) { setIsEnabled(false); - await disableAlert(alert); + await disableRule(rule); // Reset dismiss if previously clicked - setDissmissAlertErrors(false); + setDissmissRuleErrors(false); } else { setIsEnabled(true); - await enableAlert(alert); + await enableRule(rule); } requestRefresh(); setIsEnabledUpdating(false); }} label={ } @@ -321,7 +321,7 @@ export const AlertDetails: React.FunctionComponent = ({ @@ -331,23 +331,23 @@ export const AlertDetails: React.FunctionComponent = ({ { setIsMutedUpdating(true); if (isMuted) { setIsMuted(false); - await unmuteAlert(alert); + await unmuteRule(rule); } else { setIsMuted(true); - await muteAlert(alert); + await muteRule(rule); } requestRefresh(); setIsMutedUpdating(false); }} label={ } @@ -357,18 +357,18 @@ export const AlertDetails: React.FunctionComponent = ({ - {alert.enabled && !dissmissAlertErrors && alert.executionStatus.status === 'error' ? ( + {rule.enabled && !dissmissRuleErrors && rule.executionStatus.status === 'error' ? ( - - {alert.executionStatus.error?.message} + + {rule.executionStatus.error?.message} @@ -376,15 +376,15 @@ export const AlertDetails: React.FunctionComponent = ({ setDissmissAlertErrors(true)} + onClick={() => setDissmissRuleErrors(true)} > - {alert.executionStatus.error?.reason === + {rule.executionStatus.error?.reason === AlertExecutionStatusErrorReasons.License && ( = ({ target="_blank" > @@ -413,7 +413,7 @@ export const AlertDetails: React.FunctionComponent = ({ data-test-subj="actionWithBrokenConnectorWarningBanner" size="s" title={i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.actionWithBrokenConnectorWarningBannerTitle', + 'xpack.triggersActionsUI.sections.ruleDetails.actionWithBrokenConnectorWarningBannerTitle', { defaultMessage: 'There is an issue with one of the connectors associated with this rule.', @@ -429,7 +429,7 @@ export const AlertDetails: React.FunctionComponent = ({ onClick={() => setEditFlyoutVisibility(true)} > @@ -442,13 +442,13 @@ export const AlertDetails: React.FunctionComponent = ({ )} - {alert.enabled ? ( - ) : ( <> @@ -459,7 +459,7 @@ export const AlertDetails: React.FunctionComponent = ({ title={

@@ -468,7 +468,7 @@ export const AlertDetails: React.FunctionComponent = ({ <>

@@ -483,7 +483,7 @@ export const AlertDetails: React.FunctionComponent = ({ onClick={async () => { setIsEnabledUpdating(true); setIsEnabled(true); - await enableAlert(alert); + await enableRule(rule); requestRefresh(); setIsEnabledUpdating(false); }} @@ -502,4 +502,4 @@ export const AlertDetails: React.FunctionComponent = ({ ); }; -export const AlertDetailsWithApi = withBulkAlertOperations(AlertDetails); +export const RuleDetailsWithApi = withBulkRuleOperations(RuleDetails); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details_route.test.tsx similarity index 79% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details_route.test.tsx index 9bfb8f20744de..796b2e107a6fe 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details_route.test.tsx @@ -12,14 +12,14 @@ import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { createMemoryHistory, createLocation } from 'history'; import { ToastsApi } from 'kibana/public'; -import { AlertDetailsRoute, getRuleData } from './alert_details_route'; +import { RuleDetailsRoute, getRuleData } from './rule_details_route'; import { Rule } from '../../../../types'; import { CenterJustifiedSpinner } from '../../../components/center_justified_spinner'; import { spacesPluginMock } from '../../../../../../spaces/public/mocks'; import { useKibana } from '../../../../common/lib/kibana'; jest.mock('../../../../common/lib/kibana'); -describe('alert_details_route', () => { +describe('rule_details_route', () => { beforeEach(() => { jest.clearAllMocks(); }); @@ -36,7 +36,7 @@ describe('alert_details_route', () => { expect( shallow( - + ).containsMatchingElement() ).toBeTruthy(); }); @@ -53,13 +53,12 @@ describe('alert_details_route', () => { alias_target_id: rule.id, })); const wrapper = mountWithIntl( - + ); await act(async () => { await nextTick(); wrapper.update(); }); - expect(resolveRule).toHaveBeenCalledWith(rule.id); expect((spacesMock as any).ui.redirectLegacyUrl).toHaveBeenCalledWith( `insightsAndAlerting/triggersActions/rule/new_id`, @@ -71,13 +70,13 @@ describe('alert_details_route', () => { await setup(); const rule = mockRule(); const ruleType = { - id: rule.alertTypeId, + id: rule.ruleTypeId, name: 'type name', authorizedConsumers: ['consumer'], }; - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); - loadAlertTypes.mockImplementationOnce(async () => [ruleType]); + loadRuleTypes.mockImplementationOnce(async () => [ruleType]); loadActionTypes.mockImplementation(async () => []); resolveRule.mockImplementationOnce(async () => ({ ...rule, @@ -86,9 +85,9 @@ describe('alert_details_route', () => { alias_target_id: rule.id, })); const wrapper = mountWithIntl( - ); await act(async () => { @@ -113,8 +112,8 @@ describe('getRuleData useEffect handler', () => { it('fetches rule', async () => { const rule = mockRule(); - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementationOnce(async () => rule); @@ -124,17 +123,17 @@ describe('getRuleData useEffect handler', () => { await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); expect(resolveRule).toHaveBeenCalledWith(rule.id); - expect(setAlert).toHaveBeenCalledWith(rule); + expect(setRule).toHaveBeenCalledWith(rule); }); it('fetches rule and connector types', async () => { @@ -154,14 +153,14 @@ describe('getRuleData useEffect handler', () => { ], }); const ruleType = { - id: rule.alertTypeId, + id: rule.ruleTypeId, name: 'type name', }; - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementation(async () => rule); - loadAlertTypes.mockImplementation(async () => [ruleType]); + loadRuleTypes.mockImplementation(async () => [ruleType]); loadActionTypes.mockImplementation(async () => [connectorType]); const toastNotifications = { @@ -170,21 +169,21 @@ describe('getRuleData useEffect handler', () => { await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); - expect(loadAlertTypes).toHaveBeenCalledTimes(1); + expect(loadRuleTypes).toHaveBeenCalledTimes(1); expect(loadActionTypes).toHaveBeenCalledTimes(1); expect(resolveRule).toHaveBeenCalled(); - expect(setAlert).toHaveBeenCalledWith(rule); - expect(setAlertType).toHaveBeenCalledWith(ruleType); + expect(setRule).toHaveBeenCalledWith(rule); + expect(setRuleType).toHaveBeenCalledWith(ruleType); expect(setActionTypes).toHaveBeenCalledWith([connectorType]); }); @@ -205,8 +204,8 @@ describe('getRuleData useEffect handler', () => { ], }); - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementation(async () => { throw new Error('OMG'); @@ -217,11 +216,11 @@ describe('getRuleData useEffect handler', () => { } as unknown as ToastsApi; await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); @@ -248,12 +247,12 @@ describe('getRuleData useEffect handler', () => { ], }); - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementation(async () => rule); - loadAlertTypes.mockImplementation(async () => { + loadRuleTypes.mockImplementation(async () => { throw new Error('OMG no rule type'); }); loadActionTypes.mockImplementation(async () => [connectorType]); @@ -263,11 +262,11 @@ describe('getRuleData useEffect handler', () => { } as unknown as ToastsApi; await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); @@ -294,16 +293,16 @@ describe('getRuleData useEffect handler', () => { ], }); const ruleType = { - id: rule.alertTypeId, + id: rule.ruleTypeId, name: 'type name', }; - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementation(async () => rule); - loadAlertTypes.mockImplementation(async () => [ruleType]); + loadRuleTypes.mockImplementation(async () => [ruleType]); loadActionTypes.mockImplementation(async () => { throw new Error('OMG no connector type'); }); @@ -313,11 +312,11 @@ describe('getRuleData useEffect handler', () => { } as unknown as ToastsApi; await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); @@ -349,11 +348,11 @@ describe('getRuleData useEffect handler', () => { name: 'type name', }; - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementation(async () => rule); - loadAlertTypes.mockImplementation(async () => [ruleType]); + loadRuleTypes.mockImplementation(async () => [ruleType]); loadActionTypes.mockImplementation(async () => [connectorType]); const toastNotifications = { @@ -361,17 +360,17 @@ describe('getRuleData useEffect handler', () => { } as unknown as ToastsApi; await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); expect(toastNotifications.addDanger).toHaveBeenCalledTimes(1); expect(toastNotifications.addDanger).toHaveBeenCalledWith({ - title: `Unable to load rule: Invalid Rule Type: ${rule.alertTypeId}`, + title: `Unable to load rule: Invalid Rule Type: ${rule.ruleTypeId}`, }); }); @@ -408,11 +407,11 @@ describe('getRuleData useEffect handler', () => { name: 'type name', }; - const { loadAlertTypes, loadActionTypes, resolveRule } = mockApis(); - const { setAlert, setAlertType, setActionTypes } = mockStateSetter(); + const { loadRuleTypes, loadActionTypes, resolveRule } = mockApis(); + const { setRule, setRuleType, setActionTypes } = mockStateSetter(); resolveRule.mockImplementation(async () => rule); - loadAlertTypes.mockImplementation(async () => [ruleType]); + loadRuleTypes.mockImplementation(async () => [ruleType]); loadActionTypes.mockImplementation(async () => [availableConnectorType]); const toastNotifications = { @@ -420,11 +419,11 @@ describe('getRuleData useEffect handler', () => { } as unknown as ToastsApi; await getRuleData( rule.id, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toastNotifications ); @@ -437,8 +436,8 @@ describe('getRuleData useEffect handler', () => { function mockApis() { return { - loadAlert: jest.fn(), - loadAlertTypes: jest.fn(), + loadRule: jest.fn(), + loadRuleTypes: jest.fn(), loadActionTypes: jest.fn(), resolveRule: jest.fn(), }; @@ -446,8 +445,8 @@ function mockApis() { function mockStateSetter() { return { - setAlert: jest.fn(), - setAlertType: jest.fn(), + setRule: jest.fn(), + setRuleType: jest.fn(), setActionTypes: jest.fn(), }; } @@ -470,7 +469,7 @@ function mockRule(overloads: Partial = {}): Rule { enabled: true, name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: 'consumer', schedule: { interval: '1m' }, actions: [], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details_route.tsx similarity index 66% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details_route.tsx index 2177275a0fb2f..c5cdff71506f3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details_route.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details_route.tsx @@ -11,12 +11,12 @@ import { RouteComponentProps } from 'react-router-dom'; import { ToastsApi } from 'kibana/public'; import { EuiSpacer } from '@elastic/eui'; import { RuleType, ActionType, ResolvedRule } from '../../../../types'; -import { AlertDetailsWithApi as AlertDetails } from './alert_details'; +import { RuleDetailsWithApi as RuleDetails } from './rule_details'; import { throwIfAbsent, throwIfIsntContained } from '../../../lib/value_validators'; import { - ComponentOpts as AlertApis, - withBulkAlertOperations, -} from '../../common/components/with_bulk_alert_api_operations'; + ComponentOpts as RuleApis, + withBulkRuleOperations, +} from '../../common/components/with_bulk_rule_api_operations'; import { ComponentOpts as ActionApis, withActionOperations, @@ -24,17 +24,17 @@ import { import { useKibana } from '../../../../common/lib/kibana'; import { CenterJustifiedSpinner } from '../../../components/center_justified_spinner'; -type AlertDetailsRouteProps = RouteComponentProps<{ +type RuleDetailsRouteProps = RouteComponentProps<{ ruleId: string; }> & Pick & - Pick; + Pick; -export const AlertDetailsRoute: React.FunctionComponent = ({ +export const RuleDetailsRoute: React.FunctionComponent = ({ match: { params: { ruleId }, }, - loadAlertTypes, + loadRuleTypes, loadActionTypes, resolveRule, }) => { @@ -46,44 +46,44 @@ export const AlertDetailsRoute: React.FunctionComponent const { basePath } = http; - const [alert, setAlert] = useState(null); - const [alertType, setAlertType] = useState(null); + const [rule, setRule] = useState(null); + const [ruleType, setRuleType] = useState(null); const [actionTypes, setActionTypes] = useState(null); const [refreshToken, requestRefresh] = React.useState(); useEffect(() => { getRuleData( ruleId, - loadAlertTypes, + loadRuleTypes, resolveRule, loadActionTypes, - setAlert, - setAlertType, + setRule, + setRuleType, setActionTypes, toasts ); - }, [ruleId, http, loadActionTypes, loadAlertTypes, resolveRule, toasts, refreshToken]); + }, [ruleId, http, loadActionTypes, loadRuleTypes, resolveRule, toasts, refreshToken]); useEffect(() => { - if (alert) { - const outcome = (alert as ResolvedRule).outcome; + if (rule) { + const outcome = (rule as ResolvedRule).outcome; if (spacesApi && outcome === 'aliasMatch') { // This rule has been resolved from a legacy URL - redirect the user to the new URL and display a toast. - const path = basePath.prepend(`insightsAndAlerting/triggersActions/rule/${alert.id}`); + const path = basePath.prepend(`insightsAndAlerting/triggersActions/rule/${rule.id}`); spacesApi.ui.redirectLegacyUrl( path, - i18n.translate('xpack.triggersActionsUI.sections.alertDetails.redirectObjectNoun', { + i18n.translate('xpack.triggersActionsUI.sections.ruleDetails.redirectObjectNoun', { defaultMessage: 'rule', }) ); } } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [alert]); + }, [rule]); const getLegacyUrlConflictCallout = () => { - const outcome = (alert as ResolvedRule).outcome; + const outcome = (rule as ResolvedRule).outcome; if (spacesApi && outcome === 'conflict') { - const aliasTargetId = (alert as ResolvedRule).alias_target_id!; // This is always defined if outcome === 'conflict' + const aliasTargetId = (rule as ResolvedRule).alias_target_id!; // This is always defined if outcome === 'conflict' // We have resolved to one rule, but there is another one with a legacy URL associated with this page. Display a // callout with a warning for the user, and provide a way for them to navigate to the other rule. const otherRulePath = basePath.prepend( @@ -94,12 +94,12 @@ export const AlertDetailsRoute: React.FunctionComponent {spacesApi.ui.components.getLegacyUrlConflict({ objectNoun: i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.redirectObjectNoun', + 'xpack.triggersActionsUI.sections.ruleDetails.redirectObjectNoun', { defaultMessage: 'rule', } ), - currentObjectId: alert?.id!, + currentObjectId: rule?.id!, otherObjectId: aliasTargetId, otherObjectPath: otherRulePath, })} @@ -109,12 +109,12 @@ export const AlertDetailsRoute: React.FunctionComponent return null; }; - return alert && alertType && actionTypes ? ( + return rule && ruleType && actionTypes ? ( <> {getLegacyUrlConflictCallout()} - requestRefresh(Date.now())} refreshToken={refreshToken} @@ -127,22 +127,22 @@ export const AlertDetailsRoute: React.FunctionComponent export async function getRuleData( ruleId: string, - loadAlertTypes: AlertApis['loadAlertTypes'], - resolveRule: AlertApis['resolveRule'], + loadRuleTypes: RuleApis['loadRuleTypes'], + resolveRule: RuleApis['resolveRule'], loadActionTypes: ActionApis['loadActionTypes'], - setAlert: React.Dispatch>, - setAlertType: React.Dispatch>, + setRule: React.Dispatch>, + setRuleType: React.Dispatch>, setActionTypes: React.Dispatch>, toasts: Pick ) { try { const loadedRule: ResolvedRule = await resolveRule(ruleId); - setAlert(loadedRule); + setRule(loadedRule); - const [loadedAlertType, loadedActionTypes] = await Promise.all([ - loadAlertTypes() - .then((types) => types.find((type) => type.id === loadedRule.alertTypeId)) - .then(throwIfAbsent(`Invalid Rule Type: ${loadedRule.alertTypeId}`)), + const [loadedRuleType, loadedActionTypes] = await Promise.all([ + loadRuleTypes() + .then((types) => types.find((type) => type.id === loadedRule.ruleTypeId)) + .then(throwIfAbsent(`Invalid Rule Type: ${loadedRule.ruleTypeId}`)), loadActionTypes().then( throwIfIsntContained( new Set(loadedRule.actions.map((action) => action.actionTypeId)), @@ -152,12 +152,12 @@ export async function getRuleData( ), ]); - setAlertType(loadedAlertType); + setRuleType(loadedRuleType); setActionTypes(loadedActionTypes); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.unableToLoadAlertMessage', + 'xpack.triggersActionsUI.sections.ruleDetails.unableToLoadRuleMessage', { defaultMessage: 'Unable to load rule: {message}', values: { @@ -169,6 +169,6 @@ export async function getRuleData( } } -const AlertDetailsRouteWithApi = withActionOperations(withBulkAlertOperations(AlertDetailsRoute)); +const RuleDetailsRouteWithApi = withActionOperations(withBulkRuleOperations(RuleDetailsRoute)); // eslint-disable-next-line import/no-default-export -export { AlertDetailsRouteWithApi as default }; +export { RuleDetailsRouteWithApi as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts_route.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_route.test.tsx similarity index 71% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts_route.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_route.test.tsx index e0b2ac6c2e6c8..d27522e74b6fb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts_route.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_route.test.tsx @@ -9,51 +9,51 @@ import * as React from 'react'; import uuid from 'uuid'; import { shallow } from 'enzyme'; import { ToastsApi } from 'kibana/public'; -import { AlertsRoute, getAlertSummary } from './alerts_route'; -import { Rule, AlertSummary, RuleType } from '../../../../types'; +import { RuleRoute, getRuleSummary } from './rule_route'; +import { Rule, RuleSummary, RuleType } from '../../../../types'; import { CenterJustifiedSpinner } from '../../../components/center_justified_spinner'; jest.mock('../../../../common/lib/kibana'); const fakeNow = new Date('2020-02-09T23:15:41.941Z'); const fake2MinutesAgo = new Date('2020-02-09T23:13:41.941Z'); -describe('alerts_summary_route', () => { +describe('rules_summary_route', () => { it('render a loader while fetching data', () => { const rule = mockRule(); const ruleType = mockRuleType(); expect( shallow( - + ).containsMatchingElement() ).toBeTruthy(); }); }); -describe('getAlertState useEffect handler', () => { +describe('getRuleState useEffect handler', () => { beforeEach(() => { jest.clearAllMocks(); }); - it('fetches alert summary', async () => { + it('fetches rule summary', async () => { const rule = mockRule(); - const alertSummary = mockAlertSummary(); - const { loadAlertSummary } = mockApis(); - const { setAlertSummary } = mockStateSetter(); + const ruleSummary = mockRuleSummary(); + const { loadRuleSummary } = mockApis(); + const { setRuleSummary } = mockStateSetter(); - loadAlertSummary.mockImplementationOnce(async () => alertSummary); + loadRuleSummary.mockImplementationOnce(async () => ruleSummary); const toastNotifications = { addDanger: jest.fn(), } as unknown as ToastsApi; - await getAlertSummary(rule.id, loadAlertSummary, setAlertSummary, toastNotifications); + await getRuleSummary(rule.id, loadRuleSummary, setRuleSummary, toastNotifications); - expect(loadAlertSummary).toHaveBeenCalledWith(rule.id, undefined); - expect(setAlertSummary).toHaveBeenCalledWith(alertSummary); + expect(loadRuleSummary).toHaveBeenCalledWith(rule.id, undefined); + expect(setRuleSummary).toHaveBeenCalledWith(ruleSummary); }); - it('displays an error if the alert summary isnt found', async () => { + it('displays an error if the rule summary isnt found', async () => { const connectorType = { id: '.server-log', name: 'Server log', @@ -70,34 +70,34 @@ describe('getAlertState useEffect handler', () => { ], }); - const { loadAlertSummary } = mockApis(); - const { setAlertSummary } = mockStateSetter(); + const { loadRuleSummary } = mockApis(); + const { setRuleSummary } = mockStateSetter(); - loadAlertSummary.mockImplementation(async () => { + loadRuleSummary.mockImplementation(async () => { throw new Error('OMG'); }); const toastNotifications = { addDanger: jest.fn(), } as unknown as ToastsApi; - await getAlertSummary(rule.id, loadAlertSummary, setAlertSummary, toastNotifications); + await getRuleSummary(rule.id, loadRuleSummary, setRuleSummary, toastNotifications); expect(toastNotifications.addDanger).toHaveBeenCalledTimes(1); expect(toastNotifications.addDanger).toHaveBeenCalledWith({ - title: 'Unable to load alerts: OMG', + title: 'Unable to load rules: OMG', }); }); }); function mockApis() { return { - loadAlertSummary: jest.fn(), + loadRuleSummary: jest.fn(), requestRefresh: jest.fn(), }; } function mockStateSetter() { return { - setAlertSummary: jest.fn(), + setRuleSummary: jest.fn(), }; } @@ -107,7 +107,7 @@ function mockRule(overloads: Partial = {}): Rule { enabled: true, name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: 'consumer', schedule: { interval: '1m' }, actions: [], @@ -142,15 +142,15 @@ function mockRuleType(overloads: Partial = {}): RuleType { defaultActionGroupId: 'default', recoveryActionGroup: { id: 'recovered', name: 'Recovered' }, authorizedConsumers: {}, - producer: 'alerts', + producer: 'rules', minimumLicenseRequired: 'basic', enabledInLicense: true, ...overloads, }; } -function mockAlertSummary(overloads: Partial = {}): any { - const summary: AlertSummary = { +function mockRuleSummary(overloads: Partial = {}): any { + const summary: RuleSummary = { id: 'rule-id', name: 'rule-name', tags: ['tag-1', 'tag-2'], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts_route.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_route.tsx similarity index 56% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts_route.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_route.tsx index 07e45c8d2b2d0..393cdc404db9e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alerts_route.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_route.tsx @@ -8,79 +8,79 @@ import { i18n } from '@kbn/i18n'; import { ToastsApi } from 'kibana/public'; import React, { useState, useEffect, useRef, useCallback } from 'react'; -import { Rule, AlertSummary, RuleType } from '../../../../types'; +import { Rule, RuleSummary, RuleType } from '../../../../types'; import { - ComponentOpts as AlertApis, - withBulkAlertOperations, -} from '../../common/components/with_bulk_alert_api_operations'; -import { AlertsWithApi as Alerts } from './alerts'; + ComponentOpts as RuleApis, + withBulkRuleOperations, +} from '../../common/components/with_bulk_rule_api_operations'; +import { RuleWithApi as Rules } from './rule'; import { useKibana } from '../../../../common/lib/kibana'; import { CenterJustifiedSpinner } from '../../../components/center_justified_spinner'; -type WithAlertSummaryProps = { +type WithRuleSummaryProps = { rule: Rule; ruleType: RuleType; readOnly: boolean; requestRefresh: () => Promise; refreshToken?: number; -} & Pick; +} & Pick; -export const AlertsRoute: React.FunctionComponent = ({ +export const RuleRoute: React.FunctionComponent = ({ rule, ruleType, readOnly, requestRefresh, - loadAlertSummary: loadAlertSummary, + loadRuleSummary: loadRuleSummary, refreshToken, }) => { const { notifications: { toasts }, } = useKibana().services; - const [alertSummary, setAlertSummary] = useState(null); + const [ruleSummary, setRuleSummary] = useState(null); const [numberOfExecutions, setNumberOfExecutions] = useState(60); const [isLoadingChart, setIsLoadingChart] = useState(true); const ruleID = useRef(null); const refreshTokenRef = useRef(refreshToken); - const getAlertSummaryWithLoadingState = useCallback( + const getRuleSummaryWithLoadingState = useCallback( async (executions: number = numberOfExecutions) => { setIsLoadingChart(true); - await getAlertSummary(ruleID.current!, loadAlertSummary, setAlertSummary, toasts, executions); + await getRuleSummary(ruleID.current!, loadRuleSummary, setRuleSummary, toasts, executions); setIsLoadingChart(false); }, - [setIsLoadingChart, ruleID, loadAlertSummary, setAlertSummary, toasts, numberOfExecutions] + [setIsLoadingChart, ruleID, loadRuleSummary, setRuleSummary, toasts, numberOfExecutions] ); useEffect(() => { if (ruleID.current !== rule.id) { ruleID.current = rule.id; - getAlertSummaryWithLoadingState(); + getRuleSummaryWithLoadingState(); } - }, [rule, ruleID, getAlertSummaryWithLoadingState]); + }, [rule, ruleID, getRuleSummaryWithLoadingState]); useEffect(() => { if (refreshTokenRef.current !== refreshToken) { refreshTokenRef.current = refreshToken; - getAlertSummaryWithLoadingState(); + getRuleSummaryWithLoadingState(); } - }, [refreshToken, refreshTokenRef, getAlertSummaryWithLoadingState]); + }, [refreshToken, refreshTokenRef, getRuleSummaryWithLoadingState]); const onChangeDuration = useCallback( (executions: number) => { setNumberOfExecutions(executions); - getAlertSummaryWithLoadingState(executions); + getRuleSummaryWithLoadingState(executions); }, - [getAlertSummaryWithLoadingState] + [getRuleSummaryWithLoadingState] ); - return alertSummary ? ( - = ({ ); }; -export async function getAlertSummary( +export async function getRuleSummary( ruleId: string, - loadAlertSummary: AlertApis['loadAlertSummary'], - setAlertSummary: React.Dispatch>, + loadRuleSummary: RuleApis['loadRuleSummary'], + setRuleSummary: React.Dispatch>, toasts: Pick, executionDuration?: number ) { try { - const loadedSummary = await loadAlertSummary(ruleId, executionDuration); - setAlertSummary(loadedSummary); + const loadedSummary = await loadRuleSummary(ruleId, executionDuration); + setRuleSummary(loadedSummary); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertDetails.unableToLoadAlertsMessage', + 'xpack.triggersActionsUI.sections.ruleDetails.unableToLoadRulesMessage', { - defaultMessage: 'Unable to load alerts: {message}', + defaultMessage: 'Unable to load rules: {message}', values: { message: e.message, }, @@ -115,4 +115,4 @@ export async function getAlertSummary( } } -export const AlertsRouteWithApi = withBulkAlertOperations(AlertsRoute); +export const RuleRouteWithApi = withBulkRuleOperations(RuleRoute); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/view_in_app.test.tsx similarity index 79% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/view_in_app.test.tsx index d177e94b8fd74..ee29facf60579 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/view_in_app.test.tsx @@ -16,30 +16,30 @@ import { useKibana } from '../../../../common/lib/kibana'; jest.mock('../../../../common/lib/kibana'); jest.mock('../../../lib/capabilities', () => ({ - hasSaveAlertsCapability: jest.fn(() => true), + hasSaveRulesCapability: jest.fn(() => true), })); describe('view in app', () => { - describe('link to the app that created the alert', () => { + describe('link to the app that created the rule', () => { it('is disabled when there is no navigation', async () => { - const alert = mockAlert(); + const rule = mockRule(); const { alerting } = useKibana().services; let component: ReactWrapper; await act(async () => { // use mount as we need useEffect to run - component = mount(); + component = mount(); await waitForUseEffect(); expect(component!.find('button').prop('disabled')).toBe(true); expect(component!.text()).toBe('View in app'); - expect(alerting!.getNavigation).toBeCalledWith(alert.id); + expect(alerting!.getNavigation).toBeCalledWith(rule.id); }); }); it('enabled when there is navigation', async () => { - const alert = mockAlert({ id: 'alert-with-nav', consumer: 'siem' }); + const rule = mockRule({ id: 'rule-with-nav', consumer: 'siem' }); const { application: { navigateToApp }, } = useKibana().services; @@ -47,7 +47,7 @@ describe('view in app', () => { let component: ReactWrapper; act(async () => { // use mount as we need useEffect to run - component = mount(); + component = mount(); await waitForUseEffect(); @@ -57,7 +57,7 @@ describe('view in app', () => { currentTarget: {}, } as React.MouseEvent<{}, MouseEvent>); - expect(navigateToApp).toBeCalledWith('siem', '/alert'); + expect(navigateToApp).toBeCalledWith('siem', '/rule'); }); }); }); @@ -69,13 +69,13 @@ function waitForUseEffect() { }); } -function mockAlert(overloads: Partial = {}): Rule { +function mockRule(overloads: Partial = {}): Rule { return { id: uuid.v4(), enabled: true, - name: `alert-${uuid.v4()}`, + name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: 'consumer', schedule: { interval: '1m' }, actions: [], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/view_in_app.tsx similarity index 53% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/view_in_app.tsx index df80be989aaa7..85b9bcd79806f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/view_in_app.tsx @@ -13,59 +13,59 @@ import { fromNullable, fold } from 'fp-ts/lib/Option'; import { pipe } from 'fp-ts/lib/pipeable'; import { - AlertNavigation, - AlertStateNavigation, - AlertUrlNavigation, + AlertNavigation as RuleNavigation, + AlertStateNavigation as RuleStateNavigation, + AlertUrlNavigation as RuleUrlNavigation, } from '../../../../../../alerting/common'; import { Rule } from '../../../../types'; import { useKibana } from '../../../../common/lib/kibana'; export interface ViewInAppProps { - alert: Rule; + rule: Rule; } const NO_NAVIGATION = false; -type AlertNavigationLoadingState = AlertNavigation | false | null; +type RuleNavigationLoadingState = RuleNavigation | false | null; -export const ViewInApp: React.FunctionComponent = ({ alert }) => { +export const ViewInApp: React.FunctionComponent = ({ rule }) => { const { application: { navigateToApp }, alerting: maybeAlerting, } = useKibana().services; - const [alertNavigation, setAlertNavigation] = useState(null); + const [ruleNavigation, setRuleNavigation] = useState(null); useEffect(() => { pipe( fromNullable(maybeAlerting), fold( /** - * If the alerting plugin is disabled, + * If the ruleing plugin is disabled, * navigation isn't supported */ - () => setAlertNavigation(NO_NAVIGATION), - (alerting) => { - return alerting - .getNavigation(alert.id) - .then((nav) => (nav ? setAlertNavigation(nav) : setAlertNavigation(NO_NAVIGATION))) + () => setRuleNavigation(NO_NAVIGATION), + (ruleing) => { + return ruleing + .getNavigation(rule.id) + .then((nav) => (nav ? setRuleNavigation(nav) : setRuleNavigation(NO_NAVIGATION))) .catch(() => { - setAlertNavigation(NO_NAVIGATION); + setRuleNavigation(NO_NAVIGATION); }); } ) ); - }, [alert.id, maybeAlerting]); + }, [rule.id, maybeAlerting]); return ( @@ -73,22 +73,22 @@ export const ViewInApp: React.FunctionComponent = ({ alert }) => }; function hasNavigation( - alertNavigation: AlertNavigationLoadingState -): alertNavigation is AlertStateNavigation | AlertUrlNavigation { - return alertNavigation - ? alertNavigation.hasOwnProperty('state') || alertNavigation.hasOwnProperty('path') + ruleNavigation: RuleNavigationLoadingState +): ruleNavigation is RuleStateNavigation | RuleUrlNavigation { + return ruleNavigation + ? ruleNavigation.hasOwnProperty('state') || ruleNavigation.hasOwnProperty('path') : NO_NAVIGATION; } function getNavigationHandler( - alertNavigation: AlertNavigationLoadingState, - alert: Rule, + ruleNavigation: RuleNavigationLoadingState, + rule: Rule, navigateToApp: CoreStart['application']['navigateToApp'] ): object { - return hasNavigation(alertNavigation) + return hasNavigation(ruleNavigation) ? { onClick: () => { - navigateToApp(alert.consumer, alertNavigation); + navigateToApp(rule.consumer, ruleNavigation); }, } : {}; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/confirm_rule_close.tsx similarity index 69% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/confirm_rule_close.tsx index e3de4804dc08f..1b3ad3473b7ec 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/confirm_rule_close.tsx @@ -15,11 +15,11 @@ interface Props { onCancel: () => void; } -export const ConfirmAlertClose: React.FC = ({ onConfirm, onCancel }) => { +export const ConfirmRuleClose: React.FC = ({ onConfirm, onCancel }) => { return ( = ({ onConfirm, onCancel }) => { onCancel={onCancel} onConfirm={onConfirm} confirmButtonText={i18n.translate( - 'xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseConfirmButtonText', + 'xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseConfirmButtonText', { defaultMessage: 'Discard changes', } )} cancelButtonText={i18n.translate( - 'xpack.triggersActionsUI.sections.confirmAlertClose.confirmAlertCloseCancelButtonText', + 'xpack.triggersActionsUI.sections.confirmRuleClose.confirmRuleCloseCancelButtonText', { defaultMessage: 'Cancel', } )} defaultFocusedButton="confirm" - data-test-subj="confirmAlertCloseModal" + data-test-subj="confirmRuleCloseModal" >

diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/confirm_rule_save.tsx similarity index 68% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/confirm_rule_save.tsx index ebc2407774bda..a3359374f2d10 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/confirm_rule_save.tsx @@ -15,11 +15,11 @@ interface Props { onCancel: () => void; } -export const ConfirmAlertSave: React.FC = ({ onConfirm, onCancel }) => { +export const ConfirmRuleSave: React.FC = ({ onConfirm, onCancel }) => { return ( = ({ onConfirm, onCancel }) => { onCancel={onCancel} onConfirm={onConfirm} confirmButtonText={i18n.translate( - 'xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveConfirmButtonText', + 'xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveConfirmButtonText', { defaultMessage: 'Save rule', } )} cancelButtonText={i18n.translate( - 'xpack.triggersActionsUI.sections.confirmAlertSave.confirmAlertSaveCancelButtonText', + 'xpack.triggersActionsUI.sections.confirmRuleSave.confirmRuleSaveCancelButtonText', { defaultMessage: 'Cancel', } )} defaultFocusedButton="confirm" - data-test-subj="confirmAlertSaveModal" + data-test-subj="confirmRuleSaveModal" >

diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/has_rule_changed.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/has_rule_changed.test.ts new file mode 100644 index 0000000000000..17f54d297b9be --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/has_rule_changed.test.ts @@ -0,0 +1,165 @@ +/* + * 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 { InitialRule } from './rule_reducer'; +import { hasRuleChanged } from './has_rule_changed'; + +function createRule(overrides = {}): InitialRule { + return { + params: {}, + consumer: 'test', + ruleTypeId: 'test', + schedule: { + interval: '1m', + }, + actions: [], + tags: [], + notifyWhen: 'onActionGroupChange', + ...overrides, + }; +} + +test('should return false for same rule', () => { + const a = createRule(); + expect(hasRuleChanged(a, a, true)).toEqual(false); +}); + +test('should return true for different rule', () => { + const a = createRule(); + const b = createRule({ ruleTypeId: 'differentTest' }); + expect(hasRuleChanged(a, b, true)).toEqual(true); +}); + +test('should correctly compare name field', () => { + // name field doesn't exist initially + const a = createRule(); + // set name to actual value + const b = createRule({ name: 'myRule' }); + // set name to different value + const c = createRule({ name: 'anotherRule' }); + // set name to various empty/null/undefined states + const d = createRule({ name: '' }); + const e = createRule({ name: undefined }); + const f = createRule({ name: null }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); + expect(hasRuleChanged(a, c, true)).toEqual(true); + expect(hasRuleChanged(a, d, true)).toEqual(false); + expect(hasRuleChanged(a, e, true)).toEqual(false); + expect(hasRuleChanged(a, f, true)).toEqual(false); + + expect(hasRuleChanged(b, c, true)).toEqual(true); + expect(hasRuleChanged(b, d, true)).toEqual(true); + expect(hasRuleChanged(b, e, true)).toEqual(true); + expect(hasRuleChanged(b, f, true)).toEqual(true); + + expect(hasRuleChanged(c, d, true)).toEqual(true); + expect(hasRuleChanged(c, e, true)).toEqual(true); + expect(hasRuleChanged(c, f, true)).toEqual(true); + + expect(hasRuleChanged(d, e, true)).toEqual(false); + expect(hasRuleChanged(d, f, true)).toEqual(false); +}); + +test('should correctly compare ruleTypeId field', () => { + const a = createRule(); + + // set ruleTypeId to different value + const b = createRule({ ruleTypeId: 'myRuleId' }); + // set ruleTypeId to various empty/null/undefined states + const c = createRule({ ruleTypeId: '' }); + const d = createRule({ ruleTypeId: undefined }); + const e = createRule({ ruleTypeId: null }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); + expect(hasRuleChanged(a, c, true)).toEqual(true); + expect(hasRuleChanged(a, d, true)).toEqual(true); + expect(hasRuleChanged(a, e, true)).toEqual(true); + + expect(hasRuleChanged(b, c, true)).toEqual(true); + expect(hasRuleChanged(b, d, true)).toEqual(true); + expect(hasRuleChanged(b, e, true)).toEqual(true); + + expect(hasRuleChanged(c, d, true)).toEqual(false); + expect(hasRuleChanged(c, e, true)).toEqual(false); + expect(hasRuleChanged(d, e, true)).toEqual(false); +}); + +test('should correctly compare throttle field', () => { + // throttle field doesn't exist initially + const a = createRule(); + // set throttle to actual value + const b = createRule({ throttle: '1m' }); + // set throttle to different value + const c = createRule({ throttle: '1h' }); + // set throttle to various empty/null/undefined states + const d = createRule({ throttle: '' }); + const e = createRule({ throttle: undefined }); + const f = createRule({ throttle: null }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); + expect(hasRuleChanged(a, c, true)).toEqual(true); + expect(hasRuleChanged(a, d, true)).toEqual(false); + expect(hasRuleChanged(a, e, true)).toEqual(false); + expect(hasRuleChanged(a, f, true)).toEqual(false); + + expect(hasRuleChanged(b, c, true)).toEqual(true); + expect(hasRuleChanged(b, d, true)).toEqual(true); + expect(hasRuleChanged(b, e, true)).toEqual(true); + expect(hasRuleChanged(b, f, true)).toEqual(true); + + expect(hasRuleChanged(c, d, true)).toEqual(true); + expect(hasRuleChanged(c, e, true)).toEqual(true); + expect(hasRuleChanged(c, f, true)).toEqual(true); + + expect(hasRuleChanged(d, e, true)).toEqual(false); + expect(hasRuleChanged(d, f, true)).toEqual(false); +}); + +test('should correctly compare tags field', () => { + const a = createRule(); + const b = createRule({ tags: ['first'] }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); +}); + +test('should correctly compare schedule field', () => { + const a = createRule(); + const b = createRule({ schedule: { interval: '3h' } }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); +}); + +test('should correctly compare actions field', () => { + const a = createRule(); + const b = createRule({ + actions: [{ actionTypeId: 'action', group: 'group', id: 'actionId', params: {} }], + }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); +}); + +test('should skip comparing params field if compareParams=false', () => { + const a = createRule(); + const b = createRule({ params: { newParam: 'value' } }); + + expect(hasRuleChanged(a, b, false)).toEqual(false); +}); + +test('should correctly compare params field if compareParams=true', () => { + const a = createRule(); + const b = createRule({ params: { newParam: 'value' } }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); +}); + +test('should correctly compare notifyWhen field', () => { + const a = createRule(); + const b = createRule({ notifyWhen: 'onActiveAlert' }); + + expect(hasRuleChanged(a, b, true)).toEqual(true); +}); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/has_alert_changed.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/has_rule_changed.ts similarity index 72% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/has_alert_changed.ts rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/has_rule_changed.ts index bcf34f6d4ad0f..a79e820e2cfd8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/has_alert_changed.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/has_rule_changed.ts @@ -8,20 +8,20 @@ import deepEqual from 'fast-deep-equal'; import { pick } from 'lodash'; import { RuleTypeParams } from '../../../types'; -import { InitialAlert } from './alert_reducer'; +import { InitialRule } from './rule_reducer'; const DEEP_COMPARE_FIELDS = ['tags', 'schedule', 'actions', 'notifyWhen']; -function getNonNullCompareFields(alert: InitialAlert) { - const { name, alertTypeId, throttle } = alert; +function getNonNullCompareFields(rule: InitialRule) { + const { name, ruleTypeId, throttle } = rule; return { ...(!!(name && name.length > 0) ? { name } : {}), - ...(!!(alertTypeId && alertTypeId.length > 0) ? { alertTypeId } : {}), + ...(!!(ruleTypeId && ruleTypeId.length > 0) ? { ruleTypeId } : {}), ...(!!(throttle && throttle.length > 0) ? { throttle } : {}), }; } -export function hasAlertChanged(a: InitialAlert, b: InitialAlert, compareParams: boolean) { +export function hasRuleChanged(a: InitialRule, b: InitialRule, compareParams: boolean) { // Deep compare these fields let objectsAreEqual = deepEqual(pick(a, DEEP_COMPARE_FIELDS), pick(b, DEEP_COMPARE_FIELDS)); if (compareParams) { @@ -36,6 +36,6 @@ export function hasAlertChanged(a: InitialAlert, b: InitialAlert, compareParams: return !objectsAreEqual || !nonNullCompareFieldsAreEqual; } -export function haveAlertParamsChanged(a: RuleTypeParams, b: RuleTypeParams) { +export function haveRuleParamsChanged(a: RuleTypeParams, b: RuleTypeParams) { return !deepEqual(a, b); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/index.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/index.tsx similarity index 67% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/index.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/index.tsx index ac2648eea3e89..dfab594febf10 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/index.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/index.tsx @@ -8,5 +8,5 @@ import { lazy } from 'react'; import { suspendedComponentWithProps } from '../../lib/suspended_component_with_props'; -export const AlertAdd = suspendedComponentWithProps(lazy(() => import('./alert_add'))); -export const AlertEdit = suspendedComponentWithProps(lazy(() => import('./alert_edit'))); +export const RuleAdd = suspendedComponentWithProps(lazy(() => import('./rule_add'))); +export const RuleEdit = suspendedComponentWithProps(lazy(() => import('./rule_edit'))); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.test.tsx similarity index 75% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.test.tsx index 7e45dd8ac636a..2b34cc80ddb89 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.test.tsx @@ -12,13 +12,13 @@ import { act } from 'react-dom/test-utils'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormLabel } from '@elastic/eui'; import { coreMock } from '../../../../../../../src/core/public/mocks'; -import AlertAdd from './alert_add'; -import { createAlert } from '../../lib/alert_api'; +import RuleAdd from './rule_add'; +import { createRule } from '../../lib/rule_api'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; import { Rule, - AlertAddProps, - AlertFlyoutCloseReason, + RuleAddProps, + RuleFlyoutCloseReason, ConnectorValidationResult, GenericValidationResult, ValidationResult, @@ -30,17 +30,21 @@ import { useKibana } from '../../../common/lib/kibana'; jest.mock('../../../common/lib/kibana'); -jest.mock('../../lib/alert_api', () => ({ - loadAlertTypes: jest.fn(), - createAlert: jest.fn(), +jest.mock('../../lib/rule_api', () => ({ + loadRuleTypes: jest.fn(), + createRule: jest.fn(), alertingFrameworkHealth: jest.fn(() => ({ isSufficientlySecure: true, hasPermanentEncryptionKey: true, })), })); +jest.mock('../../../common/lib/config_api', () => ({ + triggersActionsUiConfig: jest.fn().mockResolvedValue({ minimumScheduleInterval: '1m' }), +})); + jest.mock('../../../common/lib/health_api', () => ({ - triggersActionsUiHealth: jest.fn(() => ({ isAlertsAvailable: true })), + triggersActionsUiHealth: jest.fn(() => ({ isRulesAvailable: true })), })); const actionTypeRegistry = actionTypeRegistryMock.create(); @@ -52,26 +56,26 @@ export const TestExpression: FunctionComponent = () => { ); }; -describe('alert_add', () => { +describe('rule_add', () => { let wrapper: ReactWrapper; async function setup( initialValues?: Partial, - onClose: AlertAddProps['onClose'] = jest.fn(), + onClose: RuleAddProps['onClose'] = jest.fn(), defaultScheduleInterval?: string ) { const mocks = coreMock.createSetup(); - const { loadAlertTypes } = jest.requireMock('../../lib/alert_api'); - const alertTypes = [ + const { loadRuleTypes } = jest.requireMock('../../lib/rule_api'); + const ruleTypes = [ { - id: 'my-alert-type', + id: 'my-rule-type', name: 'Test', actionGroups: [ { @@ -95,7 +99,7 @@ describe('alert_add', () => { }, }, ]; - loadAlertTypes.mockResolvedValue(alertTypes); + loadRuleTypes.mockResolvedValue(ruleTypes); const [ { application: { capabilities }, @@ -104,7 +108,7 @@ describe('alert_add', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.application.capabilities = { ...capabilities, - alerts: { + rules: { show: true, save: true, delete: true, @@ -117,7 +121,7 @@ describe('alert_add', () => { }); const ruleType = { - id: 'my-alert-type', + id: 'my-rule-type', iconClass: 'test', description: 'test', documentationUrl: null, @@ -150,7 +154,7 @@ describe('alert_add', () => { actionTypeRegistry.has.mockReturnValue(true); wrapper = mountWithIntl( - { }); } - it('renders alert add flyout', async () => { + it('renders rule add flyout', async () => { const onClose = jest.fn(); await setup({}, onClose); - expect(wrapper.find('[data-test-subj="addAlertFlyoutTitle"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="saveAlertButton"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="addRuleFlyoutTitle"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="saveRuleButton"]').exists()).toBeTruthy(); - wrapper.find('[data-test-subj="my-alert-type-SelectOption"]').first().simulate('click'); + wrapper.find('[data-test-subj="my-rule-type-SelectOption"]').first().simulate('click'); - expect(wrapper.find('input#alertName').props().value).toBe(''); + expect(wrapper.find('input#ruleName').props().value).toBe(''); expect(wrapper.find('[data-test-subj="tagsComboBox"]').first().text()).toBe(''); expect(wrapper.find('.euiSelect').first().props().value).toBe('m'); - wrapper.find('[data-test-subj="cancelSaveAlertButton"]').first().simulate('click'); - expect(onClose).toHaveBeenCalledWith(AlertFlyoutCloseReason.CANCELED); + wrapper.find('[data-test-subj="cancelSaveRuleButton"]').first().simulate('click'); + expect(onClose).toHaveBeenCalledWith(RuleFlyoutCloseReason.CANCELED); }); - it('renders alert add flyout with initial values', async () => { + it('renders rule add flyout with initial values', async () => { const onClose = jest.fn(); await setup( { - name: 'Simple status alert', + name: 'Simple status rule', tags: ['uptime', 'logs'], schedule: { interval: '1h', @@ -202,23 +206,23 @@ describe('alert_add', () => { onClose ); - expect(wrapper.find('input#alertName').props().value).toBe('Simple status alert'); + expect(wrapper.find('input#ruleName').props().value).toBe('Simple status rule'); expect(wrapper.find('[data-test-subj="tagsComboBox"]').first().text()).toBe('uptimelogs'); expect(wrapper.find('.euiSelect').first().props().value).toBe('h'); }); - it('emit an onClose event when the alert is saved', async () => { + it('emit an onClose event when the rule is saved', async () => { const onClose = jest.fn(); - const alert = mockAlert(); + const rule = mockRule(); - (createAlert as jest.MockedFunction).mockResolvedValue(alert); + (createRule as jest.MockedFunction).mockResolvedValue(rule); await setup( { - name: 'Simple status alert', - alertTypeId: 'my-alert-type', + name: 'Simple status rule', + ruleTypeId: 'my-rule-type', tags: ['uptime', 'logs'], schedule: { interval: '1h', @@ -227,7 +231,7 @@ describe('alert_add', () => { onClose ); - wrapper.find('[data-test-subj="saveAlertButton"]').first().simulate('click'); + wrapper.find('[data-test-subj="saveRuleButton"]').first().simulate('click'); // Wait for handlers to fire await act(async () => { @@ -235,11 +239,11 @@ describe('alert_add', () => { wrapper.update(); }); - expect(onClose).toHaveBeenCalledWith(AlertFlyoutCloseReason.SAVED); + expect(onClose).toHaveBeenCalledWith(RuleFlyoutCloseReason.SAVED); }); it('should enforce any default inteval', async () => { - await setup({ alertTypeId: 'my-alert-type' }, jest.fn(), '3h'); + await setup({ ruleTypeId: 'my-rule-type' }, jest.fn(), '3h'); // Wait for handlers to fire await act(async () => { @@ -258,13 +262,13 @@ describe('alert_add', () => { }); }); -function mockAlert(overloads: Partial = {}): Rule { +function mockRule(overloads: Partial = {}): Rule { return { id: uuid.v4(), enabled: true, - name: `alert-${uuid.v4()}`, + name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: 'consumer', schedule: { interval: '1m' }, actions: [], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx new file mode 100644 index 0000000000000..2854e652e769e --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx @@ -0,0 +1,313 @@ +/* + * 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 React, { useReducer, useMemo, useState, useEffect } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { EuiTitle, EuiFlyoutHeader, EuiFlyout, EuiFlyoutBody, EuiPortal } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { isEmpty } from 'lodash'; +import { + Rule, + RuleTypeParams, + RuleUpdates, + RuleFlyoutCloseReason, + IErrorObject, + RuleAddProps, + RuleTypeIndex, + TriggersActionsUiConfig, +} from '../../../types'; +import { RuleForm } from './rule_form'; +import { getRuleActionErrors, getRuleErrors, isValidRule } from './rule_errors'; +import { ruleReducer, InitialRule, InitialRuleReducer } from './rule_reducer'; +import { createRule, loadRuleTypes } from '../../lib/rule_api'; +import { HealthCheck } from '../../components/health_check'; +import { ConfirmRuleSave } from './confirm_rule_save'; +import { ConfirmRuleClose } from './confirm_rule_close'; +import { hasShowActionsCapability } from '../../lib/capabilities'; +import RuleAddFooter from './rule_add_footer'; +import { HealthContextProvider } from '../../context/health_context'; +import { useKibana } from '../../../common/lib/kibana'; +import { hasRuleChanged, haveRuleParamsChanged } from './has_rule_changed'; +import { getRuleWithInvalidatedFields } from '../../lib/value_validators'; +import { DEFAULT_ALERT_INTERVAL } from '../../constants'; +import { triggersActionsUiConfig } from '../../../common/lib/config_api'; + +const RuleAdd = ({ + consumer, + ruleTypeRegistry, + actionTypeRegistry, + onClose, + canChangeTrigger, + ruleTypeId, + initialValues, + reloadRules, + onSave, + metadata, + ...props +}: RuleAddProps) => { + const onSaveHandler = onSave ?? reloadRules; + + const initialRule: InitialRule = useMemo(() => { + return { + params: {}, + consumer, + ruleTypeId, + schedule: { + interval: DEFAULT_ALERT_INTERVAL, + }, + actions: [], + tags: [], + notifyWhen: 'onActionGroupChange', + ...(initialValues ? initialValues : {}), + }; + }, [ruleTypeId, consumer, initialValues]); + + const [{ rule }, dispatch] = useReducer(ruleReducer as InitialRuleReducer, { + rule: initialRule, + }); + const [config, setConfig] = useState({}); + const [initialRuleParams, setInitialRuleParams] = useState({}); + const [isSaving, setIsSaving] = useState(false); + const [isConfirmRuleSaveModalOpen, setIsConfirmRuleSaveModalOpen] = useState(false); + const [isConfirmRuleCloseModalOpen, setIsConfirmRuleCloseModalOpen] = useState(false); + const [ruleTypeIndex, setRuleTypeIndex] = useState( + props.ruleTypeIndex + ); + const [changedFromDefaultInterval, setChangedFromDefaultInterval] = useState(false); + + const setRule = (value: InitialRule) => { + dispatch({ command: { type: 'setRule' }, payload: { key: 'rule', value } }); + }; + + const setRuleProperty = (key: Key, value: Rule[Key] | null) => { + dispatch({ command: { type: 'setProperty' }, payload: { key, value } }); + }; + + const { + http, + notifications: { toasts }, + application: { capabilities }, + } = useKibana().services; + + const canShowActions = hasShowActionsCapability(capabilities); + + useEffect(() => { + (async () => { + setConfig(await triggersActionsUiConfig({ http })); + })(); + }, [http]); + + useEffect(() => { + if (ruleTypeId) { + setRuleProperty('ruleTypeId', ruleTypeId); + } + }, [ruleTypeId]); + + useEffect(() => { + if (!props.ruleTypeIndex) { + (async () => { + const ruleTypes = await loadRuleTypes({ http }); + const index: RuleTypeIndex = new Map(); + for (const ruleType of ruleTypes) { + index.set(ruleType.id, ruleType); + } + setRuleTypeIndex(index); + })(); + } + }, [props.ruleTypeIndex, http]); + + useEffect(() => { + if (isEmpty(rule.params) && !isEmpty(initialRuleParams)) { + // rule params are explicitly cleared when the rule type is cleared. + // clear the "initial" params in order to capture the + // default when a new rule type is selected + setInitialRuleParams({}); + } else if (isEmpty(initialRuleParams)) { + // captures the first change to the rule params, + // when consumers set a default value for the rule params + setInitialRuleParams(rule.params); + } + }, [rule.params, initialRuleParams]); + + const [ruleActionsErrors, setRuleActionsErrors] = useState([]); + const [isLoading, setIsLoading] = useState(false); + + useEffect(() => { + (async () => { + setIsLoading(true); + const res = await getRuleActionErrors(rule as Rule, actionTypeRegistry); + setIsLoading(false); + setRuleActionsErrors([...res]); + })(); + }, [rule, actionTypeRegistry]); + + useEffect(() => { + if (rule.ruleTypeId && ruleTypeIndex) { + const type = ruleTypeIndex.get(rule.ruleTypeId); + if (type?.defaultScheduleInterval && !changedFromDefaultInterval) { + setRuleProperty('schedule', { interval: type.defaultScheduleInterval }); + } + } + }, [rule.ruleTypeId, ruleTypeIndex, rule.schedule.interval, changedFromDefaultInterval]); + + useEffect(() => { + if (rule.schedule.interval !== DEFAULT_ALERT_INTERVAL && !changedFromDefaultInterval) { + setChangedFromDefaultInterval(true); + } + }, [rule.schedule.interval, changedFromDefaultInterval]); + + const checkForChangesAndCloseFlyout = () => { + if ( + hasRuleChanged(rule, initialRule, false) || + haveRuleParamsChanged(rule.params, initialRuleParams) + ) { + setIsConfirmRuleCloseModalOpen(true); + } else { + onClose(RuleFlyoutCloseReason.CANCELED); + } + }; + + const saveRuleAndCloseFlyout = async () => { + const savedRule = await onSaveRule(); + setIsSaving(false); + if (savedRule) { + onClose(RuleFlyoutCloseReason.SAVED); + if (onSaveHandler) { + onSaveHandler(); + } + } + }; + + const ruleType = rule.ruleTypeId ? ruleTypeRegistry.get(rule.ruleTypeId) : null; + + const { ruleBaseErrors, ruleErrors, ruleParamsErrors } = getRuleErrors( + rule as Rule, + ruleType, + config + ); + + // Confirm before saving if user is able to add actions but hasn't added any to this rule + const shouldConfirmSave = canShowActions && rule.actions?.length === 0; + + async function onSaveRule(): Promise { + try { + const newRule = await createRule({ http, rule: rule as RuleUpdates }); + toasts.addSuccess( + i18n.translate('xpack.triggersActionsUI.sections.ruleAdd.saveSuccessNotificationText', { + defaultMessage: 'Created rule "{ruleName}"', + values: { + ruleName: newRule.name, + }, + }) + ); + return newRule; + } catch (errorRes) { + toasts.addDanger( + errorRes.body?.message ?? + i18n.translate('xpack.triggersActionsUI.sections.ruleAdd.saveErrorNotificationText', { + defaultMessage: 'Cannot create rule.', + }) + ); + } + } + + return ( + + + + +

+ +

+
+
+ + + + + + { + setIsSaving(true); + if (isLoading || !isValidRule(rule, ruleErrors, ruleActionsErrors)) { + setRule( + getRuleWithInvalidatedFields( + rule as Rule, + ruleParamsErrors, + ruleBaseErrors, + ruleActionsErrors + ) + ); + setIsSaving(false); + return; + } + if (shouldConfirmSave) { + setIsConfirmRuleSaveModalOpen(true); + } else { + await saveRuleAndCloseFlyout(); + } + }} + onCancel={checkForChangesAndCloseFlyout} + /> + + + {isConfirmRuleSaveModalOpen && ( + { + setIsConfirmRuleSaveModalOpen(false); + await saveRuleAndCloseFlyout(); + }} + onCancel={() => { + setIsSaving(false); + setIsConfirmRuleSaveModalOpen(false); + }} + /> + )} + {isConfirmRuleCloseModalOpen && ( + { + setIsConfirmRuleCloseModalOpen(false); + onClose(RuleFlyoutCloseReason.CANCELED); + }} + onCancel={() => { + setIsConfirmRuleCloseModalOpen(false); + }} + /> + )} +
+
+ ); +}; + +// eslint-disable-next-line import/no-default-export +export { RuleAdd as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add_footer.tsx similarity index 79% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add_footer.tsx index a0f0ec66d2346..f2d035b2112aa 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add_footer.tsx @@ -19,27 +19,27 @@ import { import { i18n } from '@kbn/i18n'; import { useHealthContext } from '../../context/health_context'; -interface AlertAddFooterProps { +interface RuleAddFooterProps { isSaving: boolean; isFormLoading: boolean; onSave: () => void; onCancel: () => void; } -export const AlertAddFooter = ({ +export const RuleAddFooter = ({ isSaving, onSave, onCancel, isFormLoading, -}: AlertAddFooterProps) => { +}: RuleAddFooterProps) => { const { loadingHealthCheck } = useHealthContext(); return ( - - {i18n.translate('xpack.triggersActionsUI.sections.alertAddFooter.cancelButtonLabel', { + + {i18n.translate('xpack.triggersActionsUI.sections.ruleAddFooter.cancelButtonLabel', { defaultMessage: 'Cancel', })} @@ -56,7 +56,7 @@ export const AlertAddFooter = ({ @@ -75,4 +75,4 @@ export const AlertAddFooter = ({ }; // eslint-disable-next-line import/no-default-export -export { AlertAddFooter as default }; +export { RuleAddFooter as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.test.tsx similarity index 93% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.test.tsx index 07f7b1475b92f..bde4596a518fb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.test.tsx @@ -9,7 +9,7 @@ import * as React from 'react'; import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; -import { AlertConditions, ActionGroupWithCondition } from './alert_conditions'; +import { RuleConditions, ActionGroupWithCondition } from './rule_conditions'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, @@ -19,7 +19,7 @@ import { EuiButtonEmpty, } from '@elastic/eui'; -describe('alert_conditions', () => { +describe('rule_conditions', () => { async function setup(element: React.ReactElement): Promise> { const wrapper = mountWithIntl(element); @@ -34,24 +34,23 @@ describe('alert_conditions', () => { it('renders with custom headline', async () => { const wrapper = await setup( - ); expect(wrapper.find(EuiTitle).find(FormattedMessage).prop('id')).toMatchInlineSnapshot( - `"xpack.triggersActionsUI.sections.alertForm.conditions.title"` + `"xpack.triggersActionsUI.sections.ruleForm.conditions.title"` ); expect( wrapper.find(EuiTitle).find(FormattedMessage).prop('defaultMessage') ).toMatchInlineSnapshot(`"Conditions:"`); - expect(wrapper.find('[data-test-subj="alertConditionsHeadline"]').get(0)) - .toMatchInlineSnapshot(` + expect(wrapper.find('[data-test-subj="ruleConditionsHeadline"]').get(0)).toMatchInlineSnapshot(` Set different threshold with their own status @@ -80,13 +79,13 @@ describe('alert_conditions', () => { }; const wrapper = await setup( - - + ); expect(wrapper.find(EuiDescriptionList).find(EuiDescriptionListDescription).get(0)) @@ -126,7 +125,7 @@ describe('alert_conditions', () => { }; const wrapper = await setup( - { ]} > - + ); expect(wrapper.find(EuiDescriptionList).find(EuiDescriptionListDescription).get(0)) @@ -178,7 +177,7 @@ describe('alert_conditions', () => { }; const wrapper = await setup( - { onInitializeConditionsFor={onInitializeConditionsFor} > - + ); expect(wrapper.find(EuiButtonEmpty).get(0)).toMatchInlineSnapshot(` @@ -246,13 +245,13 @@ describe('alert_conditions', () => { }; await setup( - - + ); expect(callbackProp).toHaveBeenCalledWith({ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.tsx similarity index 87% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.tsx index 217f99c62a4f9..94acf30ece4ea 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions.tsx @@ -30,7 +30,7 @@ export type ActionGroupWithCondition< } ); -export interface AlertConditionsProps { +export interface RuleConditionsProps { headline?: string; actionGroups: Array>; onInitializeConditionsFor?: ( @@ -42,14 +42,14 @@ export interface AlertConditionsProps({ +export const RuleConditions = ({ headline, actionGroups, onInitializeConditionsFor, onResetConditionsFor, includeBuiltInActionGroups = false, children, -}: PropsWithChildren>) => { +}: PropsWithChildren>) => { const [withConditions, withoutConditions] = partition( includeBuiltInActionGroups ? actionGroups @@ -63,16 +63,16 @@ export const AlertConditions = -
+
{headline && ( - + {headline} @@ -101,7 +101,7 @@ export const AlertConditions = @@ -126,4 +126,4 @@ export const AlertConditions = { +describe('rule_conditions_group', () => { async function setup(element: React.ReactElement): Promise> { const wrapper = mountWithIntl(element); @@ -28,14 +28,14 @@ describe('alert_conditions_group', () => { it('renders with actionGroup name as label', async () => { const InnerComponent = () =>
{'inner component'}
; const wrapper = await setup( - - + ); expect(wrapper.find(EuiFormRow).prop('label')).toMatchInlineSnapshot(` @@ -58,7 +58,7 @@ describe('alert_conditions_group', () => { it('renders a reset button when onResetConditionsFor is specified', async () => { const onResetConditionsFor = jest.fn(); const wrapper = await setup( - { onResetConditionsFor={onResetConditionsFor} >
{'inner component'}
-
+ ); expect(wrapper.find(EuiButtonIcon).prop('aria-label')).toMatchInlineSnapshot(`"Remove"`); @@ -82,7 +82,7 @@ describe('alert_conditions_group', () => { it('shouldnt render a reset button when isRequired is true', async () => { const onResetConditionsFor = jest.fn(); const wrapper = await setup( - { onResetConditionsFor={onResetConditionsFor} >
{'inner component'}
-
+ ); expect(wrapper.find(EuiButtonIcon).length).toEqual(0); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions_group.tsx similarity index 74% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions_group.tsx index dd0a7df38eb62..0b2d4d5fd26ce 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions_group.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_conditions_group.tsx @@ -8,18 +8,18 @@ import React, { PropsWithChildren } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiButtonIcon, EuiTitle } from '@elastic/eui'; -import { AlertConditionsProps, ActionGroupWithCondition } from './alert_conditions'; +import { RuleConditionsProps, ActionGroupWithCondition } from './rule_conditions'; -export type AlertConditionsGroupProps = { +export type RuleConditionsGroupProps = { actionGroup?: ActionGroupWithCondition; -} & Pick, 'onResetConditionsFor'>; +} & Pick, 'onResetConditionsFor'>; -export const AlertConditionsGroup = ({ +export const RuleConditionsGroup = ({ actionGroup, onResetConditionsFor, children, ...otherProps -}: PropsWithChildren>) => { +}: PropsWithChildren>) => { if (!actionGroup) { return null; } @@ -39,7 +39,7 @@ export const AlertConditionsGroup = ({ iconType="minusInCircle" color="danger" aria-label={i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.conditions.removeConditionLabel', + 'xpack.triggersActionsUI.sections.ruleForm.conditions.removeConditionLabel', { defaultMessage: 'Remove', } @@ -62,4 +62,4 @@ export const AlertConditionsGroup = ({ }; // eslint-disable-next-line import/no-default-export -export { AlertConditionsGroup as default }; +export { RuleConditionsGroup as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx similarity index 73% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx index ec33756cfec4a..9de3f5a87790e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.test.tsx @@ -18,7 +18,7 @@ import { } from '../../../types'; import { ruleTypeRegistryMock } from '../../rule_type_registry.mock'; import { ReactWrapper } from 'enzyme'; -import AlertEdit from './alert_edit'; +import RuleEdit from './rule_edit'; import { useKibana } from '../../../common/lib/kibana'; import { ALERTS_FEATURE_ID } from '../../../../../alerting/common'; jest.mock('../../../common/lib/kibana'); @@ -26,37 +26,41 @@ const actionTypeRegistry = actionTypeRegistryMock.create(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); const useKibanaMock = useKibana as jest.Mocked; -jest.mock('../../lib/alert_api', () => ({ - loadAlertTypes: jest.fn(), - updateAlert: jest.fn().mockRejectedValue({ body: { message: 'Fail message' } }), +jest.mock('../../lib/rule_api', () => ({ + loadRuleTypes: jest.fn(), + updateRule: jest.fn().mockRejectedValue({ body: { message: 'Fail message' } }), alertingFrameworkHealth: jest.fn(() => ({ isSufficientlySecure: true, hasPermanentEncryptionKey: true, })), })); -jest.mock('./alert_errors', () => ({ - getAlertActionErrors: jest.fn().mockImplementation(() => { +jest.mock('../../../common/lib/config_api', () => ({ + triggersActionsUiConfig: jest.fn().mockResolvedValue({ minimumScheduleInterval: '1m' }), +})); + +jest.mock('./rule_errors', () => ({ + getRuleActionErrors: jest.fn().mockImplementation(() => { return []; }), - getAlertErrors: jest.fn().mockImplementation(() => ({ - alertParamsErrors: {}, - alertBaseErrors: {}, - alertErrors: { + getRuleErrors: jest.fn().mockImplementation(() => ({ + ruleParamsErrors: {}, + ruleBaseErrors: {}, + ruleErrors: { name: new Array(), - interval: new Array(), - alertTypeId: new Array(), + 'schedule.interval': new Array(), + ruleTypeId: new Array(), actionConnectors: new Array(), }, })), - isValidAlert: jest.fn(), + isValidRule: jest.fn(), })); jest.mock('../../../common/lib/health_api', () => ({ - triggersActionsUiHealth: jest.fn(() => ({ isAlertsAvailable: true })), + triggersActionsUiHealth: jest.fn(() => ({ isRulesAvailable: true })), })); -describe('alert_edit', () => { +describe('rule_edit', () => { let wrapper: ReactWrapper; let mockedCoreSetup: ReturnType; @@ -64,7 +68,7 @@ describe('alert_edit', () => { mockedCoreSetup = coreMock.createSetup(); }); - async function setup(initialAlertFields = {}) { + async function setup(initialRuleFields = {}) { const [ { application: { capabilities }, @@ -73,7 +77,7 @@ describe('alert_edit', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.application.capabilities = { ...capabilities, - alerts: { + rules: { show: true, save: true, delete: true, @@ -81,10 +85,10 @@ describe('alert_edit', () => { }, }; - const { loadAlertTypes } = jest.requireMock('../../lib/alert_api'); - const alertTypes = [ + const { loadRuleTypes } = jest.requireMock('../../lib/rule_api'); + const ruleTypes = [ { - id: 'my-alert-type', + id: 'my-rule-type', name: 'Test', actionGroups: [ { @@ -108,7 +112,7 @@ describe('alert_edit', () => { }, ]; const ruleType = { - id: 'my-alert-type', + id: 'my-rule-type', iconClass: 'test', description: 'test', documentationUrl: null, @@ -132,8 +136,8 @@ describe('alert_edit', () => { }, actionConnectorFields: null, }); - loadAlertTypes.mockResolvedValue(alertTypes); - const alert: Rule = { + loadRuleTypes.mockResolvedValue(ruleTypes); + const rule: Rule = { id: 'ab5661e0-197e-45ee-b477-302d89193b5e', params: { aggType: 'average', @@ -144,20 +148,20 @@ describe('alert_edit', () => { window: '1s', comparator: 'between', }, - consumer: 'alerts', - alertTypeId: 'my-alert-type', + consumer: 'rules', + ruleTypeId: 'my-rule-type', enabled: false, schedule: { interval: '1m' }, actions: [ { actionTypeId: 'my-action-type', group: 'threshold met', - params: { message: 'Alert [{{ctx.metadata.name}}] has exceeded the threshold' }, + params: { message: 'Rule [{{ctx.metadata.name}}] has exceeded the threshold' }, id: '917f5d41-fbc4-4056-a8ad-ac592f7dcee2', }, ], tags: [], - name: 'test alert', + name: 'test rule', throttle: null, notifyWhen: null, apiKeyOwner: null, @@ -171,7 +175,7 @@ describe('alert_edit', () => { status: 'unknown', lastExecutionDate: new Date('2020-08-20T19:23:38Z'), }, - ...initialAlertFields, + ...initialRuleFields, }; actionTypeRegistry.get.mockReturnValueOnce(actionTypeModel); actionTypeRegistry.has.mockReturnValue(true); @@ -182,9 +186,9 @@ describe('alert_edit', () => { actionTypeRegistry.has.mockReturnValue(true); wrapper = mountWithIntl( - {}} - initialAlert={alert} + initialRule={rule} onSave={() => { return new Promise(() => {}); }} @@ -199,32 +203,32 @@ describe('alert_edit', () => { }); } - it('renders alert edit flyout', async () => { + it('renders rule edit flyout', async () => { await setup(); - expect(wrapper.find('[data-test-subj="editAlertFlyoutTitle"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="saveEditedAlertButton"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="editRuleFlyoutTitle"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="saveEditedRuleButton"]').exists()).toBeTruthy(); }); it('displays a toast message on save for server errors', async () => { - const { isValidAlert } = jest.requireMock('./alert_errors'); - (isValidAlert as jest.Mock).mockImplementation(() => { + const { isValidRule } = jest.requireMock('./rule_errors'); + (isValidRule as jest.Mock).mockImplementation(() => { return true; }); await setup({ name: undefined }); await act(async () => { - wrapper.find('[data-test-subj="saveEditedAlertButton"]').first().simulate('click'); + wrapper.find('[data-test-subj="saveEditedRuleButton"]').first().simulate('click'); }); expect(useKibanaMock().services.notifications.toasts.addDanger).toHaveBeenCalledWith( 'Fail message' ); }); - it('should pass in the server alert type into `getAlertErrors`', async () => { - const { getAlertErrors } = jest.requireMock('./alert_errors'); + it('should pass in the config into `getRuleErrors`', async () => { + const { getRuleErrors } = jest.requireMock('./rule_errors'); await setup(); - const lastCall = getAlertErrors.mock.calls[getAlertErrors.mock.calls.length - 1]; + const lastCall = getRuleErrors.mock.calls[getRuleErrors.mock.calls.length - 1]; expect(lastCall[2]).toBeDefined(); - expect(lastCall[2].id).toBe('my-alert-type'); + expect(lastCall[2]).toEqual({ minimumScheduleInterval: '1m' }); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx similarity index 59% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx index fc8f919f37901..289db888d6d03 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx @@ -26,124 +26,128 @@ import { cloneDeep } from 'lodash'; import { i18n } from '@kbn/i18n'; import { Rule, - AlertFlyoutCloseReason, - AlertEditProps, + RuleFlyoutCloseReason, + RuleEditProps, IErrorObject, RuleType, + TriggersActionsUiConfig, } from '../../../types'; -import { AlertForm } from './alert_form'; -import { getAlertActionErrors, getAlertErrors, isValidAlert } from './alert_errors'; -import { alertReducer, ConcreteAlertReducer } from './alert_reducer'; -import { updateAlert, loadAlertTypes } from '../../lib/alert_api'; +import { RuleForm } from './rule_form'; +import { getRuleActionErrors, getRuleErrors, isValidRule } from './rule_errors'; +import { ruleReducer, ConcreteRuleReducer } from './rule_reducer'; +import { updateRule, loadRuleTypes } from '../../lib/rule_api'; import { HealthCheck } from '../../components/health_check'; import { HealthContextProvider } from '../../context/health_context'; import { useKibana } from '../../../common/lib/kibana'; -import { ConfirmAlertClose } from './confirm_alert_close'; -import { hasAlertChanged } from './has_alert_changed'; -import { getAlertWithInvalidatedFields } from '../../lib/value_validators'; +import { ConfirmRuleClose } from './confirm_rule_close'; +import { hasRuleChanged } from './has_rule_changed'; +import { getRuleWithInvalidatedFields } from '../../lib/value_validators'; +import { triggersActionsUiConfig } from '../../../common/lib/config_api'; -export const AlertEdit = ({ - initialAlert, +export const RuleEdit = ({ + initialRule, onClose, - reloadAlerts, + reloadRules, onSave, ruleTypeRegistry, actionTypeRegistry, metadata, ...props -}: AlertEditProps) => { - const onSaveHandler = onSave ?? reloadAlerts; - const [{ alert }, dispatch] = useReducer(alertReducer as ConcreteAlertReducer, { - alert: cloneDeep(initialAlert), +}: RuleEditProps) => { + const onSaveHandler = onSave ?? reloadRules; + const [{ rule }, dispatch] = useReducer(ruleReducer as ConcreteRuleReducer, { + rule: cloneDeep(initialRule), }); const [isSaving, setIsSaving] = useState(false); const [hasActionsDisabled, setHasActionsDisabled] = useState(false); const [hasActionsWithBrokenConnector, setHasActionsWithBrokenConnector] = useState(false); - const [isConfirmAlertCloseModalOpen, setIsConfirmAlertCloseModalOpen] = useState(false); - const [alertActionsErrors, setAlertActionsErrors] = useState([]); + const [isConfirmRuleCloseModalOpen, setIsConfirmRuleCloseModalOpen] = useState(false); + const [ruleActionsErrors, setRuleActionsErrors] = useState([]); const [isLoading, setIsLoading] = useState(false); const [serverRuleType, setServerRuleType] = useState | undefined>( props.ruleType ); + const [config, setConfig] = useState({}); const { http, notifications: { toasts }, } = useKibana().services; - const setAlert = (value: Rule) => { - dispatch({ command: { type: 'setAlert' }, payload: { key: 'alert', value } }); + const setRule = (value: Rule) => { + dispatch({ command: { type: 'setRule' }, payload: { key: 'rule', value } }); }; - const alertType = ruleTypeRegistry.get(alert.alertTypeId); + const ruleType = ruleTypeRegistry.get(rule.ruleTypeId); + + useEffect(() => { + (async () => { + setConfig(await triggersActionsUiConfig({ http })); + })(); + }, [http]); useEffect(() => { (async () => { setIsLoading(true); - const res = await getAlertActionErrors(alert as Rule, actionTypeRegistry); - setAlertActionsErrors([...res]); + const res = await getRuleActionErrors(rule as Rule, actionTypeRegistry); + setRuleActionsErrors([...res]); setIsLoading(false); })(); - }, [alert, actionTypeRegistry]); + }, [rule, actionTypeRegistry]); useEffect(() => { if (!props.ruleType && !serverRuleType) { (async () => { - const serverRuleTypes = await loadAlertTypes({ http }); + const serverRuleTypes = await loadRuleTypes({ http }); for (const _serverRuleType of serverRuleTypes) { - if (alertType.id === _serverRuleType.id) { + if (ruleType.id === _serverRuleType.id) { setServerRuleType(_serverRuleType); } } })(); } - }, [props.ruleType, alertType.id, serverRuleType, http]); + }, [props.ruleType, ruleType.id, serverRuleType, http]); - const { alertBaseErrors, alertErrors, alertParamsErrors } = getAlertErrors( - alert as Rule, - alertType, - serverRuleType + const { ruleBaseErrors, ruleErrors, ruleParamsErrors } = getRuleErrors( + rule as Rule, + ruleType, + config ); const checkForChangesAndCloseFlyout = () => { - if (hasAlertChanged(alert, initialAlert, true)) { - setIsConfirmAlertCloseModalOpen(true); + if (hasRuleChanged(rule, initialRule, true)) { + setIsConfirmRuleCloseModalOpen(true); } else { - onClose(AlertFlyoutCloseReason.CANCELED); + onClose(RuleFlyoutCloseReason.CANCELED); } }; - async function onSaveAlert(): Promise { + async function onSaveRule(): Promise { try { if ( !isLoading && - isValidAlert(alert, alertErrors, alertActionsErrors) && + isValidRule(rule, ruleErrors, ruleActionsErrors) && !hasActionsWithBrokenConnector ) { - const newAlert = await updateAlert({ http, alert, id: alert.id }); + const newRule = await updateRule({ http, rule, id: rule.id }); toasts.addSuccess( - i18n.translate('xpack.triggersActionsUI.sections.alertEdit.saveSuccessNotificationText', { + i18n.translate('xpack.triggersActionsUI.sections.ruleEdit.saveSuccessNotificationText', { defaultMessage: "Updated '{ruleName}'", values: { - ruleName: newAlert.name, + ruleName: newRule.name, }, }) ); - return newAlert; + return newRule; } else { - setAlert( - getAlertWithInvalidatedFields( - alert as Rule, - alertParamsErrors, - alertBaseErrors, - alertActionsErrors - ) + setRule( + getRuleWithInvalidatedFields(rule, ruleParamsErrors, ruleBaseErrors, ruleActionsErrors) ); } } catch (errorRes) { toasts.addDanger( errorRes.body?.message ?? - i18n.translate('xpack.triggersActionsUI.sections.alertEdit.saveErrorNotificationText', { + i18n.translate('xpack.triggersActionsUI.sections.ruleEdit.saveErrorNotificationText', { defaultMessage: 'Cannot update rule.', }) ); @@ -154,17 +158,17 @@ export const AlertEdit = ({ - +

@@ -177,26 +181,27 @@ export const AlertEdit = ({ )} - checkForChangesAndCloseFlyout()} > - {i18n.translate( - 'xpack.triggersActionsUI.sections.alertEdit.cancelButtonLabel', - { - defaultMessage: 'Cancel', - } - )} + {i18n.translate('xpack.triggersActionsUI.sections.ruleEdit.cancelButtonLabel', { + defaultMessage: 'Cancel', + })} {isLoading ? ( @@ -229,16 +231,16 @@ export const AlertEdit = ({ { setIsSaving(true); - const savedAlert = await onSaveAlert(); + const savedRule = await onSaveRule(); setIsSaving(false); - if (savedAlert) { - onClose(AlertFlyoutCloseReason.SAVED); + if (savedRule) { + onClose(RuleFlyoutCloseReason.SAVED); if (onSaveHandler) { onSaveHandler(); } @@ -246,7 +248,7 @@ export const AlertEdit = ({ }} > @@ -255,14 +257,14 @@ export const AlertEdit = ({
- {isConfirmAlertCloseModalOpen && ( - { - setIsConfirmAlertCloseModalOpen(false); - onClose(AlertFlyoutCloseReason.CANCELED); + setIsConfirmRuleCloseModalOpen(false); + onClose(RuleFlyoutCloseReason.CANCELED); }} onCancel={() => { - setIsConfirmAlertCloseModalOpen(false); + setIsConfirmRuleCloseModalOpen(false); }} /> )} @@ -272,4 +274,4 @@ export const AlertEdit = ({ }; // eslint-disable-next-line import/no-default-export -export { AlertEdit as default }; +export { RuleEdit as default }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_errors.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_errors.test.tsx similarity index 61% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_errors.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_errors.test.tsx index 03e98b83615f2..02af29ce422ba 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_errors.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_errors.test.tsx @@ -9,70 +9,68 @@ import uuid from 'uuid'; import React, { Fragment } from 'react'; import { validateBaseProperties, - getAlertErrors, - getAlertActionErrors, + getRuleErrors, + getRuleActionErrors, hasObjectErrors, - isValidAlert, -} from './alert_errors'; -import { Rule, RuleType, RuleTypeModel } from '../../../types'; + isValidRule, +} from './rule_errors'; +import { Rule, RuleTypeModel } from '../../../types'; import { actionTypeRegistryMock } from '../../action_type_registry.mock'; -describe('alert_errors', () => { +const config = { minimumScheduleInterval: '1m' }; +describe('rule_errors', () => { describe('validateBaseProperties()', () => { it('should validate the name', () => { - const alert = mockAlert(); - alert.name = ''; - const result = validateBaseProperties(alert); + const rule = mockRule(); + rule.name = ''; + const result = validateBaseProperties(rule, config); expect(result.errors).toStrictEqual({ name: ['Name is required.'], - interval: [], - alertTypeId: [], + 'schedule.interval': [], + ruleTypeId: [], actionConnectors: [], }); }); it('should validate the interval', () => { - const alert = mockAlert(); - alert.schedule.interval = ''; - const result = validateBaseProperties(alert); + const rule = mockRule(); + rule.schedule.interval = ''; + const result = validateBaseProperties(rule, config); expect(result.errors).toStrictEqual({ name: [], - interval: ['Check interval is required.'], - alertTypeId: [], + 'schedule.interval': ['Check interval is required.'], + ruleTypeId: [], actionConnectors: [], }); }); it('should validate the minimumScheduleInterval', () => { - const alert = mockAlert(); - alert.schedule.interval = '2m'; - const result = validateBaseProperties( - alert, - mockserverRuleType({ minimumScheduleInterval: '5m' }) - ); + const rule = mockRule(); + rule.schedule.interval = '2s'; + const result = validateBaseProperties(rule, config); expect(result.errors).toStrictEqual({ name: [], - interval: ['Interval is below minimum (5m) for this rule type'], - alertTypeId: [], + 'schedule.interval': ['Interval must be at least 1 minute.'], + ruleTypeId: [], actionConnectors: [], }); }); - it('should validate the alertTypeId', () => { - const alert = mockAlert(); - alert.alertTypeId = ''; - const result = validateBaseProperties(alert); + it('should validate the ruleTypeId', () => { + const rule = mockRule(); + rule.ruleTypeId = ''; + const result = validateBaseProperties(rule, config); expect(result.errors).toStrictEqual({ name: [], - interval: [], - alertTypeId: ['Rule type is required.'], + 'schedule.interval': [], + ruleTypeId: ['Rule type is required.'], actionConnectors: [], }); }); it('should validate the connectors', () => { - const alert = mockAlert(); - alert.actions = [ + const rule = mockRule(); + rule.actions = [ { id: '1234', actionTypeId: 'myActionType', @@ -82,51 +80,51 @@ describe('alert_errors', () => { }, }, ]; - const result = validateBaseProperties(alert); + const result = validateBaseProperties(rule, config); expect(result.errors).toStrictEqual({ name: [], - interval: [], - alertTypeId: [], + 'schedule.interval': [], + ruleTypeId: [], actionConnectors: ['Action for myActionType connector is required.'], }); }); }); - describe('getAlertErrors()', () => { + describe('getRuleErrors()', () => { it('should return all errors', () => { - const result = getAlertErrors( - mockAlert({ + const result = getRuleErrors( + mockRule({ name: '', }), - mockAlertTypeModel({ + mockRuleTypeModel({ validate: () => ({ errors: { field: ['This is wrong'], }, }), }), - mockserverRuleType() + config ); expect(result).toStrictEqual({ - alertParamsErrors: { field: ['This is wrong'] }, - alertBaseErrors: { + ruleParamsErrors: { field: ['This is wrong'] }, + ruleBaseErrors: { name: ['Name is required.'], - interval: [], - alertTypeId: [], + 'schedule.interval': [], + ruleTypeId: [], actionConnectors: [], }, - alertErrors: { + ruleErrors: { name: ['Name is required.'], field: ['This is wrong'], - interval: [], - alertTypeId: [], + 'schedule.interval': [], + ruleTypeId: [], actionConnectors: [], }, }); }); }); - describe('getAlertActionErrors()', () => { + describe('getRuleActionErrors()', () => { it('should return an array of errors', async () => { const actionTypeRegistry = actionTypeRegistryMock.create(); actionTypeRegistry.get.mockImplementation((actionTypeId: string) => ({ @@ -137,8 +135,8 @@ describe('alert_errors', () => { }, })), })); - const result = await getAlertActionErrors( - mockAlert({ + const result = await getRuleActionErrors( + mockRule({ actions: [ { id: '1234', @@ -191,15 +189,15 @@ describe('alert_errors', () => { }); }); - describe('isValidAlert()', () => { - it('should return true for a valid alert', () => { - const result = isValidAlert(mockAlert(), {}, []); + describe('isValidRule()', () => { + it('should return true for a valid rule', () => { + const result = isValidRule(mockRule(), {}, []); expect(result).toBe(true); }); - it('should return false for an invalid alert', () => { + it('should return false for an invalid rule', () => { expect( - isValidAlert( - mockAlert(), + isValidRule( + mockRule(), { name: ['This is wrong'], }, @@ -207,7 +205,7 @@ describe('alert_errors', () => { ) ).toBe(false); expect( - isValidAlert(mockAlert(), {}, [ + isValidRule(mockRule(), {}, [ { name: ['This is wrong'], }, @@ -217,35 +215,10 @@ describe('alert_errors', () => { }); }); -function mockserverRuleType( - overloads: Partial> = {} -): RuleType { - return { - actionGroups: [], - defaultActionGroupId: 'default', - minimumLicenseRequired: 'basic', - recoveryActionGroup: { - id: 'recovery', - name: 'doRecovery', - }, - id: 'myAppAlertType', - name: 'myAppAlertType', - producer: 'myApp', - authorizedConsumers: {}, - enabledInLicense: true, - actionVariables: { - context: [], - state: [], - params: [], - }, - ...overloads, - }; -} - -function mockAlertTypeModel(overloads: Partial = {}): RuleTypeModel { +function mockRuleTypeModel(overloads: Partial = {}): RuleTypeModel { return { - id: 'alertTypeModel', - description: 'some alert', + id: 'ruleTypeModel', + description: 'some rule', iconClass: 'something', documentationUrl: null, validate: () => ({ errors: {} }), @@ -255,13 +228,13 @@ function mockAlertTypeModel(overloads: Partial = {}): RuleTypeMod }; } -function mockAlert(overloads: Partial = {}): Rule { +function mockRule(overloads: Partial = {}): Rule { return { id: uuid.v4(), enabled: true, - name: `alert-${uuid.v4()}`, + name: `rule-${uuid.v4()}`, tags: [], - alertTypeId: '.noop', + ruleTypeId: '.noop', consumer: 'consumer', schedule: { interval: '1m' }, actions: [], diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_errors.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_errors.ts new file mode 100644 index 0000000000000..d8bcb49ad86de --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_errors.ts @@ -0,0 +1,132 @@ +/* + * 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 { isObject } from 'lodash'; +import { i18n } from '@kbn/i18n'; +import { formatDuration, parseDuration } from '../../../../../alerting/common/parse_duration'; +import { + RuleTypeModel, + Rule, + IErrorObject, + RuleAction, + ValidationResult, + ActionTypeRegistryContract, + TriggersActionsUiConfig, +} from '../../../types'; +import { InitialRule } from './rule_reducer'; + +export function validateBaseProperties( + ruleObject: InitialRule, + config: TriggersActionsUiConfig +): ValidationResult { + const validationResult = { errors: {} }; + const errors = { + name: new Array(), + 'schedule.interval': new Array(), + ruleTypeId: new Array(), + actionConnectors: new Array(), + }; + validationResult.errors = errors; + if (!ruleObject.name) { + errors.name.push( + i18n.translate('xpack.triggersActionsUI.sections.ruleForm.error.requiredNameText', { + defaultMessage: 'Name is required.', + }) + ); + } + if (ruleObject.schedule.interval.length < 2) { + errors['schedule.interval'].push( + i18n.translate('xpack.triggersActionsUI.sections.ruleForm.error.requiredIntervalText', { + defaultMessage: 'Check interval is required.', + }) + ); + } else if (config.minimumScheduleInterval) { + const duration = parseDuration(ruleObject.schedule.interval); + const minimumDuration = parseDuration(config.minimumScheduleInterval); + if (duration < minimumDuration) { + errors['schedule.interval'].push( + i18n.translate('xpack.triggersActionsUI.sections.ruleForm.error.belowMinimumText', { + defaultMessage: 'Interval must be at least {minimum}.', + values: { + minimum: formatDuration(config.minimumScheduleInterval, true), + }, + }) + ); + } + } + + if (!ruleObject.ruleTypeId) { + errors.ruleTypeId.push( + i18n.translate('xpack.triggersActionsUI.sections.ruleForm.error.requiredRuleTypeIdText', { + defaultMessage: 'Rule type is required.', + }) + ); + } + const emptyConnectorActions = ruleObject.actions.find( + (actionItem) => /^\d+$/.test(actionItem.id) && Object.keys(actionItem.params).length > 0 + ); + if (emptyConnectorActions !== undefined) { + errors.actionConnectors.push( + i18n.translate('xpack.triggersActionsUI.sections.ruleForm.error.requiredActionConnector', { + defaultMessage: 'Action for {actionTypeId} connector is required.', + values: { actionTypeId: emptyConnectorActions.actionTypeId }, + }) + ); + } + return validationResult; +} + +export function getRuleErrors( + rule: Rule, + ruleTypeModel: RuleTypeModel | null, + config: TriggersActionsUiConfig +) { + const ruleParamsErrors: IErrorObject = ruleTypeModel + ? ruleTypeModel.validate(rule.params).errors + : []; + const ruleBaseErrors = validateBaseProperties(rule, config).errors as IErrorObject; + const ruleErrors = { + ...ruleParamsErrors, + ...ruleBaseErrors, + } as IErrorObject; + + return { + ruleParamsErrors, + ruleBaseErrors, + ruleErrors, + }; +} + +export async function getRuleActionErrors( + rule: Rule, + actionTypeRegistry: ActionTypeRegistryContract +): Promise { + return await Promise.all( + rule.actions.map( + async (ruleAction: RuleAction) => + ( + await actionTypeRegistry.get(ruleAction.actionTypeId)?.validateParams(ruleAction.params) + ).errors + ) + ); +} + +export const hasObjectErrors: (errors: IErrorObject) => boolean = (errors) => + !!Object.values(errors).find((errorList) => { + if (isObject(errorList)) return hasObjectErrors(errorList as IErrorObject); + return errorList.length >= 1; + }); + +export function isValidRule( + ruleObject: InitialRule | Rule, + validationResult: IErrorObject, + actionsErrors: IErrorObject[] +): ruleObject is Rule { + return ( + !hasObjectErrors(validationResult) && + actionsErrors.every((error: IErrorObject) => !hasObjectErrors(error)) + ); +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.scss b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.scss similarity index 56% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.scss rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.scss index 5d6ac684002fb..d80a80faac0a5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.scss +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.scss @@ -1,4 +1,4 @@ -.triggersActionsUI__alertTypeNodeHeading { +.triggersActionsUI__ruleTypeNodeHeading { margin-left: $euiSizeS; margin-right: $euiSizeS; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.test.tsx similarity index 65% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.test.tsx index 49803c0cc419d..39b4e77b1eace 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.test.tsx @@ -18,23 +18,23 @@ import { ConnectorValidationResult, GenericValidationResult, } from '../../../types'; -import { AlertForm } from './alert_form'; +import { RuleForm } from './rule_form'; import { coreMock } from 'src/core/public/mocks'; import { ALERTS_FEATURE_ID, RecoveredActionGroup } from '../../../../../alerting/common'; import { useKibana } from '../../../common/lib/kibana'; const actionTypeRegistry = actionTypeRegistryMock.create(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); -jest.mock('../../lib/alert_api', () => ({ - loadAlertTypes: jest.fn(), +jest.mock('../../lib/rule_api', () => ({ + loadRuleTypes: jest.fn(), })); jest.mock('../../../common/lib/kibana'); -describe('alert_form', () => { +describe('rule_form', () => { const ruleType = { - id: 'my-alert-type', + id: 'my-rule-type', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: (): ValidationResult => { return { errors: {} }; @@ -65,7 +65,7 @@ describe('alert_form', () => { }); const ruleTypeNonEditable = { - id: 'non-edit-alert-type', + id: 'non-edit-rule-type', iconClass: 'test', description: 'test', documentationUrl: null, @@ -79,7 +79,7 @@ describe('alert_form', () => { const disabledByLicenseRuleType = { id: 'disabled-by-license', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: (): ValidationResult => { return { errors: {} }; @@ -90,15 +90,15 @@ describe('alert_form', () => { const useKibanaMock = useKibana as jest.Mocked; - describe('alert_form create alert', () => { + describe('rule_form create rule', () => { let wrapper: ReactWrapper; async function setup() { const mocks = coreMock.createSetup(); - const { loadAlertTypes } = jest.requireMock('../../lib/alert_api'); - const alertTypes: RuleType[] = [ + const { loadRuleTypes } = jest.requireMock('../../lib/rule_api'); + const ruleTypes: RuleType[] = [ { - id: 'my-alert-type', + id: 'my-rule-type', name: 'Test', actionGroups: [ { @@ -144,7 +144,7 @@ describe('alert_form', () => { enabledInLicense: false, }, ]; - loadAlertTypes.mockResolvedValue(alertTypes); + loadRuleTypes.mockResolvedValue(ruleTypes); const [ { application: { capabilities }, @@ -153,7 +153,7 @@ describe('alert_form', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.application.capabilities = { ...capabilities, - alerts: { + rules: { show: true, save: true, delete: true, @@ -168,7 +168,7 @@ describe('alert_form', () => { actionTypeRegistry.list.mockReturnValue([actionType]); actionTypeRegistry.has.mockReturnValue(true); actionTypeRegistry.get.mockReturnValue(actionType); - const initialAlert = { + const initialRule = { name: 'test', params: {}, consumer: ALERTS_FEATURE_ID, @@ -183,10 +183,11 @@ describe('alert_form', () => { } as unknown as Rule; wrapper = mountWithIntl( - {}} - errors={{ name: [], interval: [], alertTypeId: [] }} + errors={{ name: [], 'schedule.interval': [], ruleTypeId: [] }} operation="create" actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} @@ -199,52 +200,59 @@ describe('alert_form', () => { }); } - it('renders alert name', async () => { + it('renders rule name', async () => { await setup(); - const alertNameField = wrapper.find('[data-test-subj="alertNameInput"]'); - expect(alertNameField.exists()).toBeTruthy(); - expect(alertNameField.first().prop('value')).toBe('test'); + const ruleNameField = wrapper.find('[data-test-subj="ruleNameInput"]'); + expect(ruleNameField.exists()).toBeTruthy(); + expect(ruleNameField.first().prop('value')).toBe('test'); }); - it('renders registered selected alert type', async () => { + it('renders registered selected rule type', async () => { await setup(); - const alertTypeSelectOptions = wrapper.find('[data-test-subj="my-alert-type-SelectOption"]'); - expect(alertTypeSelectOptions.exists()).toBeTruthy(); + const ruleTypeSelectOptions = wrapper.find('[data-test-subj="my-rule-type-SelectOption"]'); + expect(ruleTypeSelectOptions.exists()).toBeTruthy(); }); - it('does not render registered alert type which non editable', async () => { + it('renders minimum schedule interval', async () => { await setup(); - const alertTypeSelectOptions = wrapper.find( - '[data-test-subj="non-edit-alert-type-SelectOption"]' + expect(wrapper.find('[data-test-subj="intervalFormRow"]').first().prop('helpText')).toEqual( + `Interval must be at least 1 minute.` ); - expect(alertTypeSelectOptions.exists()).toBeFalsy(); + }); + + it('does not render registered rule type which non editable', async () => { + await setup(); + const ruleTypeSelectOptions = wrapper.find( + '[data-test-subj="non-edit-rule-type-SelectOption"]' + ); + expect(ruleTypeSelectOptions.exists()).toBeFalsy(); }); it('renders registered action types', async () => { await setup(); - const alertTypeSelectOptions = wrapper.find( + const ruleTypeSelectOptions = wrapper.find( '[data-test-subj=".server-log-ActionTypeSelectOption"]' ); - expect(alertTypeSelectOptions.exists()).toBeFalsy(); + expect(ruleTypeSelectOptions.exists()).toBeFalsy(); }); - it('renders alert type description', async () => { + it('renders rule type description', async () => { await setup(); - wrapper.find('button[data-test-subj="my-alert-type-SelectOption"]').first().simulate('click'); - const alertDescription = wrapper.find('[data-test-subj="alertDescription"]'); - expect(alertDescription.exists()).toBeTruthy(); - expect(alertDescription.first().text()).toContain('Alert when testing'); + wrapper.find('button[data-test-subj="my-rule-type-SelectOption"]').first().simulate('click'); + const ruleDescription = wrapper.find('[data-test-subj="ruleDescription"]'); + expect(ruleDescription.exists()).toBeTruthy(); + expect(ruleDescription.first().text()).toContain('Rule when testing'); }); - it('renders alert type documentation link', async () => { + it('renders rule type documentation link', async () => { await setup(); - wrapper.find('button[data-test-subj="my-alert-type-SelectOption"]').first().simulate('click'); - const alertDocumentationLink = wrapper.find('[data-test-subj="alertDocumentationLink"]'); - expect(alertDocumentationLink.exists()).toBeTruthy(); - expect(alertDocumentationLink.first().prop('href')).toBe('https://localhost.local/docs'); + wrapper.find('button[data-test-subj="my-rule-type-SelectOption"]').first().simulate('click'); + const ruleDocumentationLink = wrapper.find('[data-test-subj="ruleDocumentationLink"]'); + expect(ruleDocumentationLink.exists()).toBeTruthy(); + expect(ruleDocumentationLink.first().prop('href')).toBe('https://localhost.local/docs'); }); - it('renders alert types disabled by license', async () => { + it('renders rule types disabled by license', async () => { await setup(); const actionOption = wrapper.find(`[data-test-subj="disabled-by-license-SelectOption"]`); expect(actionOption.exists()).toBeTruthy(); @@ -254,15 +262,15 @@ describe('alert_form', () => { }); }); - describe('alert_form create alert non alerting consumer and producer', () => { + describe('rule_form create rule non ruleing consumer and producer', () => { let wrapper: ReactWrapper; async function setup() { - const { loadAlertTypes } = jest.requireMock('../../lib/alert_api'); + const { loadRuleTypes } = jest.requireMock('../../lib/rule_api'); - loadAlertTypes.mockResolvedValue([ + loadRuleTypes.mockResolvedValue([ { - id: 'other-consumer-producer-alert-type', + id: 'other-consumer-producer-rule-type', name: 'Test', actionGroups: [ { @@ -280,7 +288,7 @@ describe('alert_form', () => { }, }, { - id: 'same-consumer-producer-alert-type', + id: 'same-consumer-producer-rule-type', name: 'Test', actionGroups: [ { @@ -307,7 +315,7 @@ describe('alert_form', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.application.capabilities = { ...capabilities, - alerts: { + rules: { show: true, save: true, delete: true, @@ -315,7 +323,7 @@ describe('alert_form', () => { }; ruleTypeRegistry.list.mockReturnValue([ { - id: 'same-consumer-producer-alert-type', + id: 'same-consumer-producer-rule-type', iconClass: 'test', description: 'test', documentationUrl: null, @@ -326,7 +334,7 @@ describe('alert_form', () => { requiresAppContext: true, }, { - id: 'other-consumer-producer-alert-type', + id: 'other-consumer-producer-rule-type', iconClass: 'test', description: 'test', documentationUrl: null, @@ -340,8 +348,8 @@ describe('alert_form', () => { ruleTypeRegistry.has.mockReturnValue(true); actionTypeRegistry.get.mockReturnValue(actionType); - const initialAlert = { - name: 'non alerting consumer test', + const initialRule = { + name: 'non ruleing consumer test', params: {}, consumer: 'test', schedule: { @@ -355,10 +363,11 @@ describe('alert_form', () => { } as unknown as Rule; wrapper = mountWithIntl( - {}} - errors={{ name: [], interval: [], alertTypeId: [] }} + errors={{ name: [], 'schedule.interval': [], ruleTypeId: [] }} operation="create" actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} @@ -370,27 +379,27 @@ describe('alert_form', () => { wrapper.update(); }); - expect(loadAlertTypes).toHaveBeenCalled(); + expect(loadRuleTypes).toHaveBeenCalled(); } - it('renders alert type options which producer correspond to the alert consumer', async () => { + it('renders rule type options which producer correspond to the rule consumer', async () => { await setup(); - const alertTypeSelectOptions = wrapper.find( - '[data-test-subj="same-consumer-producer-alert-type-SelectOption"]' + const ruleTypeSelectOptions = wrapper.find( + '[data-test-subj="same-consumer-producer-rule-type-SelectOption"]' ); - expect(alertTypeSelectOptions.exists()).toBeTruthy(); + expect(ruleTypeSelectOptions.exists()).toBeTruthy(); }); - it('does not render alert type options which producer does not correspond to the alert consumer', async () => { + it('does not render rule type options which producer does not correspond to the rule consumer', async () => { await setup(); - const alertTypeSelectOptions = wrapper.find( - '[data-test-subj="other-consumer-producer-alert-type-SelectOption"]' + const ruleTypeSelectOptions = wrapper.find( + '[data-test-subj="other-consumer-producer-rule-type-SelectOption"]' ); - expect(alertTypeSelectOptions.exists()).toBeFalsy(); + expect(ruleTypeSelectOptions.exists()).toBeFalsy(); }); }); - describe('alert_form edit alert', () => { + describe('rule_form edit rule', () => { let wrapper: ReactWrapper; async function setup() { @@ -401,9 +410,9 @@ describe('alert_form', () => { actionTypeRegistry.has.mockReturnValue(true); actionTypeRegistry.get.mockReturnValue(actionType); - const initialAlert = { + const initialRule = { name: 'test', - alertTypeId: ruleType.id, + ruleTypeId: ruleType.id, params: {}, consumer: ALERTS_FEATURE_ID, schedule: { @@ -417,10 +426,11 @@ describe('alert_form', () => { } as unknown as Rule; wrapper = mountWithIntl( - {}} - errors={{ name: [], interval: [], alertTypeId: [] }} + errors={{ name: [], 'schedule.interval': [], ruleTypeId: [] }} operation="create" actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} @@ -433,31 +443,31 @@ describe('alert_form', () => { }); } - it('renders alert name', async () => { + it('renders rule name', async () => { await setup(); - const alertNameField = wrapper.find('[data-test-subj="alertNameInput"]'); - expect(alertNameField.exists()).toBeTruthy(); - expect(alertNameField.first().prop('value')).toBe('test'); + const ruleNameField = wrapper.find('[data-test-subj="ruleNameInput"]'); + expect(ruleNameField.exists()).toBeTruthy(); + expect(ruleNameField.first().prop('value')).toBe('test'); }); - it('renders registered selected alert type', async () => { + it('renders registered selected rule type', async () => { await setup(); - const alertTypeSelectOptions = wrapper.find('[data-test-subj="selectedAlertTypeTitle"]'); - expect(alertTypeSelectOptions.exists()).toBeTruthy(); + const ruleTypeSelectOptions = wrapper.find('[data-test-subj="selectedRuleTypeTitle"]'); + expect(ruleTypeSelectOptions.exists()).toBeTruthy(); }); - it('renders alert type description', async () => { + it('renders rule type description', async () => { await setup(); - const alertDescription = wrapper.find('[data-test-subj="alertDescription"]'); - expect(alertDescription.exists()).toBeTruthy(); - expect(alertDescription.first().text()).toContain('Alert when testing'); + const ruleDescription = wrapper.find('[data-test-subj="ruleDescription"]'); + expect(ruleDescription.exists()).toBeTruthy(); + expect(ruleDescription.first().text()).toContain('Rule when testing'); }); - it('renders alert type documentation link', async () => { + it('renders rule type documentation link', async () => { await setup(); - const alertDocumentationLink = wrapper.find('[data-test-subj="alertDocumentationLink"]'); - expect(alertDocumentationLink.exists()).toBeTruthy(); - expect(alertDocumentationLink.first().prop('href')).toBe('https://localhost.local/docs'); + const ruleDocumentationLink = wrapper.find('[data-test-subj="ruleDocumentationLink"]'); + expect(ruleDocumentationLink.exists()).toBeTruthy(); + expect(ruleDocumentationLink.first().prop('href')).toBe('https://localhost.local/docs'); }); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.tsx similarity index 62% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.tsx index fa226c4a74cdd..6ec6a93c34af2 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form.tsx @@ -38,39 +38,41 @@ import { import { capitalize } from 'lodash'; import { KibanaFeature } from '../../../../../features/public'; import { + formatDuration, getDurationNumberInItsUnit, getDurationUnitValue, } from '../../../../../alerting/common/parse_duration'; -import { loadAlertTypes } from '../../lib/alert_api'; -import { AlertReducerAction, InitialAlert } from './alert_reducer'; +import { loadRuleTypes } from '../../lib/rule_api'; +import { RuleReducerAction, InitialRule } from './rule_reducer'; import { RuleTypeModel, Rule, IErrorObject, - AlertAction, + RuleAction, RuleTypeIndex, RuleType, RuleTypeRegistryContract, ActionTypeRegistryContract, + TriggersActionsUiConfig, } from '../../../types'; import { getTimeOptions } from '../../../common/lib/get_time_options'; import { ActionForm } from '../action_connector_form'; import { - AlertActionParam, + AlertActionParam as RuleActionParam, ALERTS_FEATURE_ID, RecoveredActionGroup, isActionGroupDisabledForActionTypeId, } from '../../../../../alerting/common'; import { hasAllPrivilege, hasShowActionsCapability } from '../../lib/capabilities'; import { SolutionFilter } from './solution_filter'; -import './alert_form.scss'; +import './rule_form.scss'; import { useKibana } from '../../../common/lib/kibana'; import { recoveredActionGroupMessage } from '../../constants'; import { getDefaultsForActionParams } from '../../lib/get_defaults_for_action_params'; -import { IsEnabledResult, IsDisabledResult } from '../../lib/check_alert_type_enabled'; -import { AlertNotifyWhen } from './alert_notify_when'; -import { checkAlertTypeEnabled } from '../../lib/check_alert_type_enabled'; -import { alertTypeCompare, alertTypeGroupCompare } from '../../lib/alert_type_compare'; +import { IsEnabledResult, IsDisabledResult } from '../../lib/check_rule_type_enabled'; +import { RuleNotifyWhen } from './rule_notify_when'; +import { checkRuleTypeEnabled } from '../../lib/check_rule_type_enabled'; +import { ruleTypeCompare, ruleTypeGroupCompare } from '../../lib/rule_type_compare'; import { VIEW_LICENSE_OPTIONS_LINK } from '../../../common/constants'; import { SectionLoading } from '../../components/section_loading'; import { DEFAULT_ALERT_INTERVAL } from '../../constants'; @@ -81,9 +83,10 @@ function getProducerFeatureName(producer: string, kibanaFeatures: KibanaFeature[ return kibanaFeatures.find((featureItem) => featureItem.id === producer)?.name; } -interface AlertFormProps> { - alert: InitialAlert; - dispatch: React.Dispatch; +interface RuleFormProps> { + rule: InitialRule; + config: TriggersActionsUiConfig; + dispatch: React.Dispatch; errors: IErrorObject; ruleTypeRegistry: RuleTypeRegistryContract; actionTypeRegistry: ActionTypeRegistryContract; @@ -97,8 +100,9 @@ interface AlertFormProps> { const defaultScheduleInterval = getDurationNumberInItsUnit(DEFAULT_ALERT_INTERVAL); const defaultScheduleIntervalUnit = getDurationUnitValue(DEFAULT_ALERT_INTERVAL); -export const AlertForm = ({ - alert, +export const RuleForm = ({ + rule, + config, canChangeTrigger = true, dispatch, errors, @@ -108,7 +112,7 @@ export const AlertForm = ({ ruleTypeRegistry, actionTypeRegistry, metadata, -}: AlertFormProps) => { +}: RuleFormProps) => { const { http, notifications: { toasts }, @@ -120,65 +124,65 @@ export const AlertForm = ({ } = useKibana().services; const canShowActions = hasShowActionsCapability(capabilities); - const [alertTypeModel, setAlertTypeModel] = useState(null); + const [ruleTypeModel, setRuleTypeModel] = useState(null); - const [alertInterval, setAlertInterval] = useState( - alert.schedule.interval - ? getDurationNumberInItsUnit(alert.schedule.interval) + const [ruleInterval, setRuleInterval] = useState( + rule.schedule.interval + ? getDurationNumberInItsUnit(rule.schedule.interval) : defaultScheduleInterval ); - const [alertIntervalUnit, setAlertIntervalUnit] = useState( - alert.schedule.interval - ? getDurationUnitValue(alert.schedule.interval) + const [ruleIntervalUnit, setRuleIntervalUnit] = useState( + rule.schedule.interval + ? getDurationUnitValue(rule.schedule.interval) : defaultScheduleIntervalUnit ); - const [alertThrottle, setAlertThrottle] = useState( - alert.throttle ? getDurationNumberInItsUnit(alert.throttle) : null + const [ruleThrottle, setRuleThrottle] = useState( + rule.throttle ? getDurationNumberInItsUnit(rule.throttle) : null ); - const [alertThrottleUnit, setAlertThrottleUnit] = useState( - alert.throttle ? getDurationUnitValue(alert.throttle) : 'h' + const [ruleThrottleUnit, setRuleThrottleUnit] = useState( + rule.throttle ? getDurationUnitValue(rule.throttle) : 'h' ); const [defaultActionGroupId, setDefaultActionGroupId] = useState(undefined); const [ruleTypeIndex, setRuleTypeIndex] = useState(null); - const [availableAlertTypes, setAvailableAlertTypes] = useState< - Array<{ alertTypeModel: RuleTypeModel; alertType: RuleType }> + const [availableRuleTypes, setAvailableRuleTypes] = useState< + Array<{ ruleTypeModel: RuleTypeModel; ruleType: RuleType }> >([]); - const [filteredAlertTypes, setFilteredAlertTypes] = useState< - Array<{ alertTypeModel: RuleTypeModel; alertType: RuleType }> + const [filteredRuleTypes, setFilteredRuleTypes] = useState< + Array<{ ruleTypeModel: RuleTypeModel; ruleType: RuleType }> >([]); const [searchText, setSearchText] = useState(); const [inputText, setInputText] = useState(); const [solutions, setSolutions] = useState | undefined>(undefined); const [solutionsFilter, setSolutionFilter] = useState([]); - let hasDisabledByLicenseAlertTypes: boolean = false; + let hasDisabledByLicenseRuleTypes: boolean = false; - // load alert types + // load rule types useEffect(() => { (async () => { try { - const alertTypesResult = await loadAlertTypes({ http }); + const ruleTypesResult = await loadRuleTypes({ http }); const index: RuleTypeIndex = new Map(); - for (const alertTypeItem of alertTypesResult) { - index.set(alertTypeItem.id, alertTypeItem); + for (const ruleTypeItem of ruleTypesResult) { + index.set(ruleTypeItem.id, ruleTypeItem); } - if (alert.alertTypeId && index.has(alert.alertTypeId)) { - setDefaultActionGroupId(index.get(alert.alertTypeId)!.defaultActionGroupId); + if (rule.ruleTypeId && index.has(rule.ruleTypeId)) { + setDefaultActionGroupId(index.get(rule.ruleTypeId)!.defaultActionGroupId); } setRuleTypeIndex(index); - const availableAlertTypesResult = getAvailableAlertTypes(alertTypesResult); - setAvailableAlertTypes(availableAlertTypesResult); + const availableRuleTypesResult = getAvailableRuleTypes(ruleTypesResult); + setAvailableRuleTypes(availableRuleTypesResult); - const solutionsResult = availableAlertTypesResult.reduce( - (result: Map, alertTypeItem) => { - if (!result.has(alertTypeItem.alertType.producer)) { + const solutionsResult = availableRuleTypesResult.reduce( + (result: Map, ruleTypeItem) => { + if (!result.has(ruleTypeItem.ruleType.producer)) { result.set( - alertTypeItem.alertType.producer, + ruleTypeItem.ruleType.producer, (kibanaFeatures - ? getProducerFeatureName(alertTypeItem.alertType.producer, kibanaFeatures) - : capitalize(alertTypeItem.alertType.producer)) ?? - capitalize(alertTypeItem.alertType.producer) + ? getProducerFeatureName(ruleTypeItem.ruleType.producer, kibanaFeatures) + : capitalize(ruleTypeItem.ruleType.producer)) ?? + capitalize(ruleTypeItem.ruleType.producer) ); } return result; @@ -191,7 +195,7 @@ export const AlertForm = ({ } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.unableToLoadRuleTypesMessage', + 'xpack.triggersActionsUI.sections.ruleForm.unableToLoadRuleTypesMessage', { defaultMessage: 'Unable to load rule types' } ), }); @@ -201,25 +205,25 @@ export const AlertForm = ({ }, []); useEffect(() => { - setAlertTypeModel(alert.alertTypeId ? ruleTypeRegistry.get(alert.alertTypeId) : null); - if (alert.alertTypeId && ruleTypeIndex && ruleTypeIndex.has(alert.alertTypeId)) { - setDefaultActionGroupId(ruleTypeIndex.get(alert.alertTypeId)!.defaultActionGroupId); + setRuleTypeModel(rule.ruleTypeId ? ruleTypeRegistry.get(rule.ruleTypeId) : null); + if (rule.ruleTypeId && ruleTypeIndex && ruleTypeIndex.has(rule.ruleTypeId)) { + setDefaultActionGroupId(ruleTypeIndex.get(rule.ruleTypeId)!.defaultActionGroupId); } - }, [alert, alert.alertTypeId, ruleTypeIndex, ruleTypeRegistry]); + }, [rule, rule.ruleTypeId, ruleTypeIndex, ruleTypeRegistry]); useEffect(() => { - if (alert.schedule.interval) { - const interval = getDurationNumberInItsUnit(alert.schedule.interval); - const intervalUnit = getDurationUnitValue(alert.schedule.interval); + if (rule.schedule.interval) { + const interval = getDurationNumberInItsUnit(rule.schedule.interval); + const intervalUnit = getDurationUnitValue(rule.schedule.interval); if (interval !== defaultScheduleInterval) { - setAlertInterval(interval); + setRuleInterval(interval); } if (intervalUnit !== defaultScheduleIntervalUnit) { - setAlertIntervalUnit(intervalUnit); + setRuleIntervalUnit(intervalUnit); } } - }, [alert.schedule.interval]); + }, [rule.schedule.interval]); const setRuleProperty = useCallback( (key: Key, value: Rule[Key] | null) => { @@ -229,7 +233,7 @@ export const AlertForm = ({ ); const setActions = useCallback( - (updatedActions: AlertAction[]) => setRuleProperty('actions', updatedActions), + (updatedActions: RuleAction[]) => setRuleProperty('actions', updatedActions), [setRuleProperty] ); @@ -241,70 +245,70 @@ export const AlertForm = ({ dispatch({ command: { type: 'setScheduleProperty' }, payload: { key, value } }); }; - const setActionProperty = ( + const setActionProperty = ( key: Key, - value: AlertAction[Key] | null, + value: RuleAction[Key] | null, index: number ) => { - dispatch({ command: { type: 'setAlertActionProperty' }, payload: { key, value, index } }); + dispatch({ command: { type: 'setRuleActionProperty' }, payload: { key, value, index } }); }; const setActionParamsProperty = useCallback( - (key: string, value: AlertActionParam, index: number) => { - dispatch({ command: { type: 'setAlertActionParams' }, payload: { key, value, index } }); + (key: string, value: RuleActionParam, index: number) => { + dispatch({ command: { type: 'setRuleActionParams' }, payload: { key, value, index } }); }, [dispatch] ); useEffect(() => { const searchValue = searchText ? searchText.trim().toLocaleLowerCase() : null; - setFilteredAlertTypes( - availableAlertTypes - .filter((alertTypeItem) => + setFilteredRuleTypes( + availableRuleTypes + .filter((ruleTypeItem) => solutionsFilter.length > 0 - ? solutionsFilter.find((item) => alertTypeItem.alertType!.producer === item) - : alertTypeItem + ? solutionsFilter.find((item) => ruleTypeItem.ruleType!.producer === item) + : ruleTypeItem ) - .filter((alertTypeItem) => + .filter((ruleTypeItem) => searchValue - ? alertTypeItem.alertType.name.toString().toLocaleLowerCase().includes(searchValue) || - alertTypeItem.alertType!.producer.toLocaleLowerCase().includes(searchValue) || - alertTypeItem.alertTypeModel.description.toLocaleLowerCase().includes(searchValue) - : alertTypeItem + ? ruleTypeItem.ruleType.name.toString().toLocaleLowerCase().includes(searchValue) || + ruleTypeItem.ruleType!.producer.toLocaleLowerCase().includes(searchValue) || + ruleTypeItem.ruleTypeModel.description.toLocaleLowerCase().includes(searchValue) + : ruleTypeItem ) ); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ruleTypeRegistry, availableAlertTypes, searchText, JSON.stringify(solutionsFilter)]); + }, [ruleTypeRegistry, availableRuleTypes, searchText, JSON.stringify(solutionsFilter)]); - const getAvailableAlertTypes = (alertTypesResult: RuleType[]) => + const getAvailableRuleTypes = (ruleTypesResult: RuleType[]) => ruleTypeRegistry .list() .reduce( ( - arr: Array<{ alertType: RuleType; alertTypeModel: RuleTypeModel }>, + arr: Array<{ ruleType: RuleType; ruleTypeModel: RuleTypeModel }>, ruleTypeRegistryItem: RuleTypeModel ) => { - const alertType = alertTypesResult.find((item) => ruleTypeRegistryItem.id === item.id); - if (alertType) { + const ruleType = ruleTypesResult.find((item) => ruleTypeRegistryItem.id === item.id); + if (ruleType) { arr.push({ - alertType, - alertTypeModel: ruleTypeRegistryItem, + ruleType, + ruleTypeModel: ruleTypeRegistryItem, }); } return arr; }, [] ) - .filter((item) => item.alertType && hasAllPrivilege(alert, item.alertType)) + .filter((item) => item.ruleType && hasAllPrivilege(rule, item.ruleType)) .filter((item) => - alert.consumer === ALERTS_FEATURE_ID - ? !item.alertTypeModel.requiresAppContext - : item.alertType!.producer === alert.consumer + rule.consumer === ALERTS_FEATURE_ID + ? !item.ruleTypeModel.requiresAppContext + : item.ruleType!.producer === rule.consumer ); - const selectedAlertType = alert?.alertTypeId ? ruleTypeIndex?.get(alert?.alertTypeId) : undefined; - const recoveryActionGroup = selectedAlertType?.recoveryActionGroup?.id; + const selectedRuleType = rule?.ruleTypeId ? ruleTypeIndex?.get(rule?.ruleTypeId) : undefined; + const recoveryActionGroup = selectedRuleType?.recoveryActionGroup?.id; const getDefaultActionParams = useCallback( - (actionTypeId: string, actionGroupId: string): Record | undefined => + (actionTypeId: string, actionGroupId: string): Record | undefined => getDefaultsForActionParams( actionTypeId, actionGroupId, @@ -313,12 +317,12 @@ export const AlertForm = ({ [recoveryActionGroup] ); - const tagsOptions = alert.tags ? alert.tags.map((label: string) => ({ label })) : []; + const tagsOptions = rule.tags ? rule.tags.map((label: string) => ({ label })) : []; const isActionGroupDisabledForActionType = useCallback( - (alertType: RuleType, actionGroupId: string, actionTypeId: string): boolean => { + (ruleType: RuleType, actionGroupId: string, actionTypeId: string): boolean => { return isActionGroupDisabledForActionTypeId( - actionGroupId === alertType?.recoveryActionGroup?.id + actionGroupId === ruleType?.recoveryActionGroup?.id ? RecoveredActionGroup.id : actionGroupId, actionTypeId @@ -327,11 +331,9 @@ export const AlertForm = ({ [] ); - const AlertParamsExpressionComponent = alertTypeModel - ? alertTypeModel.ruleParamsExpression - : null; + const RuleParamsExpressionComponent = ruleTypeModel ? ruleTypeModel.ruleParamsExpression : null; - const alertTypesByProducer = filteredAlertTypes.reduce( + const ruleTypesByProducer = filteredRuleTypes.reduce( ( result: Record< string, @@ -339,22 +341,22 @@ export const AlertForm = ({ id: string; name: string; checkEnabledResult: IsEnabledResult | IsDisabledResult; - alertTypeItem: RuleTypeModel; + ruleTypeItem: RuleTypeModel; }> >, - alertTypeValue + ruleTypeValue ) => { - const producer = alertTypeValue.alertType.producer; + const producer = ruleTypeValue.ruleType.producer; if (producer) { - const checkEnabledResult = checkAlertTypeEnabled(alertTypeValue.alertType); + const checkEnabledResult = checkRuleTypeEnabled(ruleTypeValue.ruleType); if (!checkEnabledResult.isEnabled) { - hasDisabledByLicenseAlertTypes = true; + hasDisabledByLicenseRuleTypes = true; } (result[producer] = result[producer] || []).push({ - name: alertTypeValue.alertType.name, - id: alertTypeValue.alertTypeModel.id, + name: ruleTypeValue.ruleType.name, + id: ruleTypeValue.ruleTypeModel.id, checkEnabledResult, - alertTypeItem: alertTypeValue.alertTypeModel, + ruleTypeItem: ruleTypeValue.ruleTypeModel, }); } return result; @@ -362,18 +364,18 @@ export const AlertForm = ({ {} ); - const alertTypeNodes = Object.entries(alertTypesByProducer) - .sort((a, b) => alertTypeGroupCompare(a, b, solutions)) + const ruleTypeNodes = Object.entries(ruleTypesByProducer) + .sort((a, b) => ruleTypeGroupCompare(a, b, solutions)) .map(([solution, items], groupIndex) => ( @@ -391,13 +393,13 @@ export const AlertForm = ({ {items - .sort((a, b) => alertTypeCompare(a, b)) + .sort((a, b) => ruleTypeCompare(a, b)) .map((item, index) => { - const alertTypeListItemHtml = ( + const ruleTypeListItemHtml = ( {item.name} -

{item.alertTypeItem.description}

+

{item.ruleTypeItem.description}

); @@ -409,22 +411,22 @@ export const AlertForm = ({ color="primary" label={ item.checkEnabledResult.isEnabled ? ( - alertTypeListItemHtml + ruleTypeListItemHtml ) : ( - {alertTypeListItemHtml} + {ruleTypeListItemHtml} ) } isDisabled={!item.checkEnabledResult.isEnabled} onClick={() => { - setRuleProperty('alertTypeId', item.id); + setRuleProperty('ruleTypeId', item.id); setActions([]); - setAlertTypeModel(item.alertTypeItem); + setRuleTypeModel(item.ruleTypeItem); setRuleProperty('params', {}); if (ruleTypeIndex && ruleTypeIndex.has(item.id)) { setDefaultActionGroupId(ruleTypeIndex.get(item.id)!.defaultActionGroupId); @@ -438,15 +440,15 @@ export const AlertForm = ({
)); - const alertTypeDetails = ( + const ruleTypeDetails = ( <> - -
- {alert.alertTypeId && ruleTypeIndex && ruleTypeIndex.has(alert.alertTypeId) - ? ruleTypeIndex.get(alert.alertTypeId)!.name + +
+ {rule.ruleTypeId && ruleTypeIndex && ruleTypeIndex.has(rule.ruleTypeId) + ? ruleTypeIndex.get(rule.ruleTypeId)!.name : ''}
@@ -457,38 +459,38 @@ export const AlertForm = ({ iconType="cross" color="danger" aria-label={i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.changeAlertTypeAriaLabel', + 'xpack.triggersActionsUI.sections.ruleForm.changeRuleTypeAriaLabel', { defaultMessage: 'Delete', } )} onClick={() => { - setRuleProperty('alertTypeId', null); - setAlertTypeModel(null); + setRuleProperty('ruleTypeId', null); + setRuleTypeModel(null); setRuleProperty('params', {}); }} /> ) : null} - {alertTypeModel?.description && ( + {ruleTypeModel?.description && ( - - {alertTypeModel.description}  - {alertTypeModel?.documentationUrl && ( + + {ruleTypeModel.description}  + {ruleTypeModel?.documentationUrl && ( @@ -498,31 +500,31 @@ export const AlertForm = ({ )} - {AlertParamsExpressionComponent && + {RuleParamsExpressionComponent && defaultActionGroupId && - alert.alertTypeId && - selectedAlertType ? ( + rule.ruleTypeId && + selectedRuleType ? ( } > - {errors.actionConnectors.length >= 1 ? ( <> @@ -544,24 +546,24 @@ export const AlertForm = ({ ) : null} - isActionGroupDisabledForActionType(selectedAlertType, actionGroupId, actionTypeId) + isActionGroupDisabledForActionType(selectedRuleType, actionGroupId, actionTypeId) } - actionGroups={selectedAlertType.actionGroups.map((actionGroup) => - actionGroup.id === selectedAlertType.recoveryActionGroup.id + actionGroups={selectedRuleType.actionGroups.map((actionGroup) => + actionGroup.id === selectedRuleType.recoveryActionGroup.id ? { ...actionGroup, - omitMessageVariables: selectedAlertType.doesSetRecoveryContext + omitMessageVariables: selectedRuleType.doesSetRecoveryContext ? 'keepContext' : 'all', defaultActionMessage: recoveredActionGroupMessage, } - : { ...actionGroup, defaultActionMessage: alertTypeModel?.defaultActionMessage } + : { ...actionGroup, defaultActionMessage: ruleTypeModel?.defaultActionMessage } )} getDefaultActionParams={getDefaultActionParams} setActionIdByIndex={(id: string, index: number) => setActionProperty('id', id, index)} @@ -577,18 +579,18 @@ export const AlertForm = ({ ); - const labelForAlertChecked = ( + const labelForRuleChecked = ( <> {' '} @@ -600,28 +602,28 @@ export const AlertForm = ({ } - isInvalid={errors.name.length > 0 && alert.name !== undefined} + isInvalid={errors.name.length > 0 && rule.name !== undefined} error={errors.name} > 0 && alert.name !== undefined} + isInvalid={errors.name.length > 0 && rule.name !== undefined} name="name" - data-test-subj="alertNameInput" - value={alert.name || ''} + data-test-subj="ruleNameInput" + value={rule.name || ''} onChange={(e) => { setRuleProperty('name', e.target.value); }} onBlur={() => { - if (!alert.name) { + if (!rule.name) { setRuleProperty('name', ''); } }} @@ -631,7 +633,7 @@ export const AlertForm = ({ @@ -654,7 +656,7 @@ export const AlertForm = ({ ); }} onBlur={() => { - if (!alert.tags) { + if (!rule.tags) { setRuleProperty('tags', []); } }} @@ -667,36 +669,47 @@ export const AlertForm = ({ 0} - error={errors.interval} + helpText={ + errors['schedule.interval'].length > 0 + ? '' + : i18n.translate('xpack.triggersActionsUI.sections.ruleForm.checkEveryHelpText', { + defaultMessage: 'Interval must be at least {minimum}.', + values: { + minimum: formatDuration(config.minimumScheduleInterval ?? '1m', true), + }, + }) + } + label={labelForRuleChecked} + isInvalid={errors['schedule.interval'].length > 0} + error={errors['schedule.interval']} > 0} - value={alertInterval || ''} + isInvalid={errors['schedule.interval'].length > 0} + value={ruleInterval || ''} name="interval" data-test-subj="intervalInput" onChange={(e) => { const interval = e.target.value !== '' ? parseInt(e.target.value, 10) : undefined; - setAlertInterval(interval); - setScheduleProperty('interval', `${e.target.value}${alertIntervalUnit}`); + setRuleInterval(interval); + setScheduleProperty('interval', `${e.target.value}${ruleIntervalUnit}`); }} /> { - setAlertIntervalUnit(e.target.value); - setScheduleProperty('interval', `${alertInterval}${e.target.value}`); + setRuleIntervalUnit(e.target.value); + setScheduleProperty('interval', `${ruleInterval}${e.target.value}`); }} data-test-subj="intervalInputUnit" /> @@ -705,10 +718,10 @@ export const AlertForm = ({ - { setRuleProperty('notifyWhen', notifyWhen); @@ -717,8 +730,8 @@ export const AlertForm = ({ )} onThrottleChange={useCallback( (throttle: number | null, throttleUnit: string) => { - setAlertThrottle(throttle); - setAlertThrottleUnit(throttleUnit); + setRuleThrottle(throttle); + setRuleThrottleUnit(throttleUnit); setRuleProperty('throttle', throttle ? `${throttle}${throttleUnit}` : null); }, [setRuleProperty] @@ -727,15 +740,15 @@ export const AlertForm = ({ - {alertTypeModel ? ( - <>{alertTypeDetails} - ) : availableAlertTypes.length ? ( + {ruleTypeModel ? ( + <>{ruleTypeDetails} + ) : availableRuleTypes.length ? ( <>
@@ -766,7 +779,7 @@ export const AlertForm = ({ { setInputText(e.target.value); if (e.target.value === '') { @@ -779,7 +792,7 @@ export const AlertForm = ({ } }} placeholder={i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.searchPlaceholderTitle', + 'xpack.triggersActionsUI.sections.ruleForm.searchPlaceholderTitle', { defaultMessage: 'Search' } )} /> @@ -796,21 +809,21 @@ export const AlertForm = ({
- {errors.alertTypeId.length >= 1 && alert.alertTypeId !== undefined ? ( + {errors.ruleTypeId.length >= 1 && rule.ruleTypeId !== undefined ? ( <> - + ) : null} - {alertTypeNodes} + {ruleTypeNodes} ) : ruleTypeIndex ? ( - + ) : ( @@ -819,15 +832,15 @@ export const AlertForm = ({ ); }; -const NoAuthorizedAlertTypes = ({ operation }: { operation: string }) => ( +const NoAuthorizedRuleTypes = ({ operation }: { operation: string }) => ( @@ -837,7 +850,7 @@ const NoAuthorizedAlertTypes = ({ operation }: { operation: string }) => (

diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_notify_when.test.tsx similarity index 96% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_notify_when.test.tsx index c15f249fd7688..4098614c1a906 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_notify_when.test.tsx @@ -11,9 +11,9 @@ import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { Rule } from '../../../types'; import { ALERTS_FEATURE_ID } from '../../../../../alerting/common'; -import { AlertNotifyWhen } from './alert_notify_when'; +import { RuleNotifyWhen } from './rule_notify_when'; -describe('alert_notify_when', () => { +describe('rule_notify_when', () => { beforeEach(() => { jest.resetAllMocks(); }); @@ -21,11 +21,11 @@ describe('alert_notify_when', () => { const onNotifyWhenChange = jest.fn(); const onThrottleChange = jest.fn(); - describe('action_frequency_form new alert', () => { + describe('action_frequency_form new rule', () => { let wrapper: ReactWrapper; async function setup(overrides = {}) { - const initialAlert = { + const initialRule = { name: 'test', params: {}, consumer: ALERTS_FEATURE_ID, @@ -42,8 +42,8 @@ describe('alert_notify_when', () => { } as unknown as Rule; wrapper = mountWithIntl( - > = [ +const NOTIFY_WHEN_OPTIONS: Array> = [ { value: 'onActionGroupChange', inputDisplay: i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActionGroupChange.display', + 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActionGroupChange.display', { defaultMessage: 'Only on status change', } @@ -43,14 +43,14 @@ const NOTIFY_WHEN_OPTIONS: Array> = [

@@ -60,9 +60,9 @@ const NOTIFY_WHEN_OPTIONS: Array> = [ { value: 'onActiveAlert', inputDisplay: i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onActiveAlert.display', + 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onActiveAlert.display', { - defaultMessage: 'Every time alert is active', + defaultMessage: 'Every time rule is active', } ), 'data-test-subj': 'onActiveAlert', @@ -70,15 +70,15 @@ const NOTIFY_WHEN_OPTIONS: Array> = [ <>

@@ -88,7 +88,7 @@ const NOTIFY_WHEN_OPTIONS: Array> = [ { value: 'onThrottleInterval', inputDisplay: i18n.translate( - 'xpack.triggersActionsUI.sections.alertForm.alertNotifyWhen.onThrottleInterval.display', + 'xpack.triggersActionsUI.sections.ruleForm.ruleNotifyWhen.onThrottleInterval.display', { defaultMessage: 'On a custom action interval', } @@ -99,14 +99,14 @@ const NOTIFY_WHEN_OPTIONS: Array> = [

@@ -115,56 +115,56 @@ const NOTIFY_WHEN_OPTIONS: Array> = [ }, ]; -interface AlertNotifyWhenProps { - alert: InitialAlert; +interface RuleNotifyWhenProps { + rule: InitialRule; throttle: number | null; throttleUnit: string; - onNotifyWhenChange: (notifyWhen: AlertNotifyWhenType) => void; + onNotifyWhenChange: (notifyWhen: RuleNotifyWhenType) => void; onThrottleChange: (throttle: number | null, throttleUnit: string) => void; } -export const AlertNotifyWhen = ({ - alert, +export const RuleNotifyWhen = ({ + rule, throttle, throttleUnit, onNotifyWhenChange, onThrottleChange, -}: AlertNotifyWhenProps) => { - const [alertThrottle, setAlertThrottle] = useState(throttle || 1); +}: RuleNotifyWhenProps) => { + const [ruleThrottle, setRuleThrottle] = useState(throttle || 1); const [showCustomThrottleOpts, setShowCustomThrottleOpts] = useState(false); const [notifyWhenValue, setNotifyWhenValue] = - useState(DEFAULT_NOTIFY_WHEN_VALUE); + useState(DEFAULT_NOTIFY_WHEN_VALUE); useEffect(() => { - if (alert.notifyWhen) { - setNotifyWhenValue(alert.notifyWhen); + if (rule.notifyWhen) { + setNotifyWhenValue(rule.notifyWhen); } else { // If 'notifyWhen' is not set, derive value from existence of throttle value - setNotifyWhenValue(alert.throttle ? 'onThrottleInterval' : 'onActiveAlert'); + setNotifyWhenValue(rule.throttle ? 'onThrottleInterval' : 'onActiveAlert'); } - }, [alert]); + }, [rule]); useEffect(() => { setShowCustomThrottleOpts(notifyWhenValue === 'onThrottleInterval'); }, [notifyWhenValue]); - const onNotifyWhenValueChange = useCallback((newValue: AlertNotifyWhenType) => { - onThrottleChange(newValue === 'onThrottleInterval' ? alertThrottle : null, throttleUnit); + const onNotifyWhenValueChange = useCallback((newValue: RuleNotifyWhenType) => { + onThrottleChange(newValue === 'onThrottleInterval' ? ruleThrottle : null, throttleUnit); onNotifyWhenChange(newValue); setNotifyWhenValue(newValue); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - const labelForAlertRenotify = ( + const labelForRuleRenotify = ( <> {' '} @@ -173,7 +173,7 @@ export const AlertNotifyWhen = ({ return ( <> - + parseInt(value, 10)), filter((value) => !isNaN(value)), map((value) => { - setAlertThrottle(value); + setRuleThrottle(value); onThrottleChange(value, throttleUnit); }) ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_reducer.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_reducer.test.ts new file mode 100644 index 0000000000000..259cb5ed3ecea --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_reducer.test.ts @@ -0,0 +1,189 @@ +/* + * 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 { ruleReducer } from './rule_reducer'; +import { Rule } from '../../../types'; + +describe('rule reducer', () => { + let initialRule: Rule; + beforeAll(() => { + initialRule = { + params: {}, + consumer: 'rules', + ruleTypeId: null, + schedule: { + interval: '1m', + }, + actions: [], + tags: [], + notifyWhen: 'onActionGroupChange', + } as unknown as Rule; + }); + + // setRule + test('if modified rule was reset to initial', () => { + const rule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setProperty' }, + payload: { + key: 'name', + value: 'new name', + }, + } + ); + expect(rule.rule.name).toBe('new name'); + + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setRule' }, + payload: { + key: 'rule', + value: initialRule, + }, + } + ); + expect(updatedRule.rule.name).toBeUndefined(); + }); + + test('if property name was changed', () => { + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setProperty' }, + payload: { + key: 'name', + value: 'new name', + }, + } + ); + expect(updatedRule.rule.name).toBe('new name'); + }); + + test('if initial schedule property was updated', () => { + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setScheduleProperty' }, + payload: { + key: 'interval', + value: '10s', + }, + } + ); + expect(updatedRule.rule.schedule.interval).toBe('10s'); + }); + + test('if rule params property was added and updated', () => { + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setRuleParams' }, + payload: { + key: 'testParam', + value: 'new test params property', + }, + } + ); + expect(updatedRule.rule.params.testParam).toBe('new test params property'); + + const updatedRuleParamsProperty = ruleReducer( + { rule: updatedRule.rule }, + { + command: { type: 'setRuleParams' }, + payload: { + key: 'testParam', + value: 'test params property updated', + }, + } + ); + expect(updatedRuleParamsProperty.rule.params.testParam).toBe('test params property updated'); + }); + + test('if rule action params property was added and updated', () => { + initialRule.actions.push({ + id: '', + actionTypeId: 'testId', + group: 'Rule', + params: {}, + }); + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setRuleActionParams' }, + payload: { + key: 'testActionParam', + value: 'new test action params property', + index: 0, + }, + } + ); + expect(updatedRule.rule.actions[0].params.testActionParam).toBe( + 'new test action params property' + ); + + const updatedRuleActionParamsProperty = ruleReducer( + { rule: updatedRule.rule }, + { + command: { type: 'setRuleActionParams' }, + payload: { + key: 'testActionParam', + value: 'test action params property updated', + index: 0, + }, + } + ); + expect(updatedRuleActionParamsProperty.rule.actions[0].params.testActionParam).toBe( + 'test action params property updated' + ); + }); + + test('if the existing rule action params property was set to undefined (when other connector was selected)', () => { + initialRule.actions.push({ + id: '', + actionTypeId: 'testId', + group: 'Rule', + params: { + testActionParam: 'some value', + }, + }); + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setRuleActionParams' }, + payload: { + key: 'testActionParam', + value: undefined, + index: 0, + }, + } + ); + expect(updatedRule.rule.actions[0].params.testActionParam).toBe(undefined); + }); + + test('if rule action property was updated', () => { + initialRule.actions.push({ + id: '', + actionTypeId: 'testId', + group: 'Rule', + params: {}, + }); + const updatedRule = ruleReducer( + { rule: initialRule }, + { + command: { type: 'setRuleActionProperty' }, + payload: { + key: 'group', + value: 'Warning', + index: 0, + }, + } + ); + expect(updatedRule.rule.actions[0].group).toBe('Warning'); + }); +}); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_reducer.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_reducer.ts new file mode 100644 index 0000000000000..c9186ca1d01c8 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_reducer.ts @@ -0,0 +1,206 @@ +/* + * 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 { SavedObjectAttribute } from 'kibana/public'; +import { isEqual } from 'lodash'; +import { Reducer } from 'react'; +import { + AlertActionParam as RuleActionParam, + IntervalSchedule, +} from '../../../../../alerting/common'; +import { Rule, RuleAction } from '../../../types'; + +export type InitialRule = Partial & + Pick; + +interface CommandType< + T extends + | 'setRule' + | 'setProperty' + | 'setScheduleProperty' + | 'setRuleParams' + | 'setRuleActionParams' + | 'setRuleActionProperty' +> { + type: T; +} + +export interface RuleState { + rule: InitialRule; +} + +interface Payload { + key: Keys; + value: Value; + index?: number; +} + +interface RulePayload { + key: Key; + value: Rule[Key] | null; + index?: number; +} + +interface RuleActionPayload { + key: Key; + value: RuleAction[Key] | null; + index?: number; +} + +interface RuleSchedulePayload { + key: Key; + value: IntervalSchedule[Key]; + index?: number; +} + +export type RuleReducerAction = + | { + command: CommandType<'setRule'>; + payload: Payload<'rule', InitialRule>; + } + | { + command: CommandType<'setProperty'>; + payload: RulePayload; + } + | { + command: CommandType<'setScheduleProperty'>; + payload: RuleSchedulePayload; + } + | { + command: CommandType<'setRuleParams'>; + payload: Payload; + } + | { + command: CommandType<'setRuleActionParams'>; + payload: Payload; + } + | { + command: CommandType<'setRuleActionProperty'>; + payload: RuleActionPayload; + }; + +export type InitialRuleReducer = Reducer<{ rule: InitialRule }, RuleReducerAction>; +export type ConcreteRuleReducer = Reducer<{ rule: Rule }, RuleReducerAction>; + +export const ruleReducer = ( + state: { rule: RulePhase }, + action: RuleReducerAction +) => { + const { rule } = state; + + switch (action.command.type) { + case 'setRule': { + const { key, value } = action.payload as Payload<'rule', RulePhase>; + if (key === 'rule') { + return { + ...state, + rule: value, + }; + } else { + return state; + } + } + case 'setProperty': { + const { key, value } = action.payload as RulePayload; + if (isEqual(rule[key], value)) { + return state; + } else { + return { + ...state, + rule: { + ...rule, + [key]: value, + }, + }; + } + } + case 'setScheduleProperty': { + const { key, value } = action.payload as RuleSchedulePayload; + if (rule.schedule && isEqual(rule.schedule[key], value)) { + return state; + } else { + return { + ...state, + rule: { + ...rule, + schedule: { + ...rule.schedule, + [key]: value, + }, + }, + }; + } + } + case 'setRuleParams': { + const { key, value } = action.payload as Payload>; + if (isEqual(rule.params[key], value)) { + return state; + } else { + return { + ...state, + rule: { + ...rule, + params: { + ...rule.params, + [key]: value, + }, + }, + }; + } + } + case 'setRuleActionParams': { + const { key, value, index } = action.payload as Payload< + keyof RuleAction, + SavedObjectAttribute + >; + if ( + index === undefined || + rule.actions[index] == null || + (!!rule.actions[index][key] && isEqual(rule.actions[index][key], value)) + ) { + return state; + } else { + const oldAction = rule.actions.splice(index, 1)[0]; + const updatedAction = { + ...oldAction, + params: { + ...oldAction.params, + [key]: value, + }, + }; + rule.actions.splice(index, 0, updatedAction); + return { + ...state, + rule: { + ...rule, + actions: [...rule.actions], + }, + }; + } + } + case 'setRuleActionProperty': { + const { key, value, index } = action.payload as RuleActionPayload; + if (index === undefined || isEqual(rule.actions[index][key], value)) { + return state; + } else { + const oldAction = rule.actions.splice(index, 1)[0]; + const updatedAction = { + ...oldAction, + [key]: value, + }; + rule.actions.splice(index, 0, updatedAction); + return { + ...state, + rule: { + ...rule, + actions: [...rule.actions], + }, + }; + } + } + } +}; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/solution_filter.tsx similarity index 96% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/solution_filter.tsx index f46ec441227bf..c3a7510ee0a0c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/solution_filter.tsx @@ -43,7 +43,7 @@ export const SolutionFilter: React.FunctionComponent = ({ data-test-subj="solutionsFilterButton" > diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/action_type_filter.tsx similarity index 96% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/action_type_filter.tsx index 531b06364fee0..a136413d53e42 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/action_type_filter.tsx @@ -44,7 +44,7 @@ export const ActionTypeFilter: React.FunctionComponent = data-test-subj="actionTypeFilterButton" > diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.scss b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.scss similarity index 75% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.scss rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.scss index 9ebd43e107e27..ffe000073aa75 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.scss +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.scss @@ -4,6 +4,6 @@ } } -button[data-test-subj='deleteAlert'] { +button[data-test-subj='deleteRule'] { color: $euiColorDanger; } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.test.tsx similarity index 76% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.test.tsx index a036feea0fbcb..8ce6736aee8ad 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.test.tsx @@ -10,17 +10,17 @@ import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; import { CollapsedItemActions } from './collapsed_item_actions'; import { act } from 'react-dom/test-utils'; import { ruleTypeRegistryMock } from '../../../rule_type_registry.mock'; -import { AlertTableItem, RuleTypeModel } from '../../../../types'; +import { RuleTableItem, RuleTypeModel } from '../../../../types'; import { useKibana } from '../../../../common/lib/kibana'; jest.mock('../../../../common/lib/kibana'); -const onAlertChanged = jest.fn(); -const onEditAlert = jest.fn(); -const setAlertsToDelete = jest.fn(); -const disableAlert = jest.fn(); -const enableAlert = jest.fn(); -const unmuteAlert = jest.fn(); -const muteAlert = jest.fn(); +const onRuleChanged = jest.fn(); +const onEditRule = jest.fn(); +const setRulesToDelete = jest.fn(); +const disableRule = jest.fn(); +const enableRule = jest.fn(); +const unmuteRule = jest.fn(); +const muteRule = jest.fn(); export const tick = (ms = 0) => new Promise((resolve) => { @@ -31,10 +31,10 @@ describe('CollapsedItemActions', () => { async function setup(editable: boolean = true) { const ruleTypeRegistry = ruleTypeRegistryMock.create(); ruleTypeRegistry.has.mockReturnValue(true); - const alertTypeR: RuleTypeModel = { - id: 'my-alert-type', + const ruleTypeR: RuleTypeModel = { + id: 'my-rule-type', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: () => { return { errors: {} }; @@ -42,20 +42,20 @@ describe('CollapsedItemActions', () => { ruleParamsExpression: jest.fn(), requiresAppContext: !editable, }; - ruleTypeRegistry.get.mockReturnValue(alertTypeR); + ruleTypeRegistry.get.mockReturnValue(ruleTypeR); const useKibanaMock = useKibana as jest.Mocked; // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.ruleTypeRegistry = ruleTypeRegistry; } const getPropsWithRule = (overrides = {}, editable = false) => { - const rule: AlertTableItem = { + const rule: RuleTableItem = { id: '1', enabled: true, name: 'test rule', tags: ['tag1'], - alertTypeId: 'test_rule_type', - consumer: 'alerts', + ruleTypeId: 'test_rule_type', + consumer: 'rules', schedule: { interval: '5d' }, actions: [ { id: 'test', actionTypeId: 'the_connector', group: 'rule', params: { message: 'test' } }, @@ -76,7 +76,7 @@ describe('CollapsedItemActions', () => { }, actionsCount: 1, index: 0, - alertType: 'Test Alert Type', + ruleType: 'Test Rule Type', isEditable: true, enabledInLicense: true, ...overrides, @@ -84,13 +84,13 @@ describe('CollapsedItemActions', () => { return { item: rule, - onAlertChanged, - onEditAlert, - setAlertsToDelete, - disableAlert, - enableAlert, - unmuteAlert, - muteAlert, + onRuleChanged, + onEditRule, + setRulesToDelete, + disableRule, + enableRule, + unmuteRule, + muteRule, }; }; @@ -116,8 +116,8 @@ describe('CollapsedItemActions', () => { expect(wrapper.find('[data-test-subj="collapsedActionPanel"]').exists()).toBeFalsy(); expect(wrapper.find('[data-test-subj="muteButton"]').exists()).toBeFalsy(); expect(wrapper.find('[data-test-subj="disableButton"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="editAlert"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="deleteAlert"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="editRule"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="deleteRule"]').exists()).toBeFalsy(); wrapper.find('[data-test-subj="selectActionButton"]').first().simulate('click'); await act(async () => { @@ -128,8 +128,8 @@ describe('CollapsedItemActions', () => { expect(wrapper.find('[data-test-subj="collapsedActionPanel"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="muteButton"]').exists()).toBeTruthy(); expect(wrapper.find('[data-test-subj="disableButton"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="editAlert"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="deleteAlert"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="editRule"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="deleteRule"]').exists()).toBeTruthy(); expect( wrapper.find('[data-test-subj="selectActionButton"]').first().props().disabled @@ -139,10 +139,10 @@ describe('CollapsedItemActions', () => { expect(wrapper.find(`[data-test-subj="muteButton"] button`).text()).toEqual('Mute'); expect(wrapper.find(`[data-test-subj="disableButton"] button`).prop('disabled')).toBeFalsy(); expect(wrapper.find(`[data-test-subj="disableButton"] button`).text()).toEqual('Disable'); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).text()).toEqual('Edit rule'); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).text()).toEqual('Delete rule'); + expect(wrapper.find(`[data-test-subj="editRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="editRule"] button`).text()).toEqual('Edit rule'); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).text()).toEqual('Delete rule'); }); test('handles case when rule is unmuted and enabled and mute is clicked', async () => { @@ -158,7 +158,7 @@ describe('CollapsedItemActions', () => { await tick(10); wrapper.update(); }); - expect(muteAlert).toHaveBeenCalled(); + expect(muteRule).toHaveBeenCalled(); }); test('handles case when rule is unmuted and enabled and disable is clicked', async () => { @@ -174,7 +174,7 @@ describe('CollapsedItemActions', () => { await tick(10); wrapper.update(); }); - expect(disableAlert).toHaveBeenCalled(); + expect(disableRule).toHaveBeenCalled(); }); test('handles case when rule is muted and enabled and unmute is clicked', async () => { @@ -192,7 +192,7 @@ describe('CollapsedItemActions', () => { await tick(10); wrapper.update(); }); - expect(unmuteAlert).toHaveBeenCalled(); + expect(unmuteRule).toHaveBeenCalled(); }); test('handles case when rule is unmuted and disabled and enable is clicked', async () => { @@ -210,7 +210,7 @@ describe('CollapsedItemActions', () => { await tick(10); wrapper.update(); }); - expect(enableAlert).toHaveBeenCalled(); + expect(enableRule).toHaveBeenCalled(); }); test('handles case when edit rule is clicked', async () => { @@ -221,12 +221,12 @@ describe('CollapsedItemActions', () => { await nextTick(); wrapper.update(); }); - wrapper.find('button[data-test-subj="editAlert"]').simulate('click'); + wrapper.find('button[data-test-subj="editRule"]').simulate('click'); await act(async () => { await nextTick(); wrapper.update(); }); - expect(onEditAlert).toHaveBeenCalled(); + expect(onEditRule).toHaveBeenCalled(); }); test('handles case when delete rule is clicked', async () => { @@ -237,12 +237,12 @@ describe('CollapsedItemActions', () => { await nextTick(); wrapper.update(); }); - wrapper.find('button[data-test-subj="deleteAlert"]').simulate('click'); + wrapper.find('button[data-test-subj="deleteRule"]').simulate('click'); await act(async () => { await nextTick(); wrapper.update(); }); - expect(setAlertsToDelete).toHaveBeenCalled(); + expect(setRulesToDelete).toHaveBeenCalled(); }); test('renders actions correctly when rule is disabled', async () => { @@ -260,10 +260,10 @@ describe('CollapsedItemActions', () => { expect(wrapper.find(`[data-test-subj="muteButton"] button`).text()).toEqual('Mute'); expect(wrapper.find(`[data-test-subj="disableButton"] button`).prop('disabled')).toBeFalsy(); expect(wrapper.find(`[data-test-subj="disableButton"] button`).text()).toEqual('Enable'); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).text()).toEqual('Edit rule'); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).text()).toEqual('Delete rule'); + expect(wrapper.find(`[data-test-subj="editRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="editRule"] button`).text()).toEqual('Edit rule'); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).text()).toEqual('Delete rule'); }); test('renders actions correctly when rule is not editable', async () => { @@ -297,10 +297,10 @@ describe('CollapsedItemActions', () => { expect(wrapper.find(`[data-test-subj="muteButton"] button`).text()).toEqual('Mute'); expect(wrapper.find(`[data-test-subj="disableButton"] button`).prop('disabled')).toBeTruthy(); expect(wrapper.find(`[data-test-subj="disableButton"] button`).text()).toEqual('Disable'); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).text()).toEqual('Edit rule'); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).text()).toEqual('Delete rule'); + expect(wrapper.find(`[data-test-subj="editRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="editRule"] button`).text()).toEqual('Edit rule'); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).text()).toEqual('Delete rule'); }); test('renders actions correctly when rule is muted', async () => { @@ -318,10 +318,10 @@ describe('CollapsedItemActions', () => { expect(wrapper.find(`[data-test-subj="muteButton"] button`).text()).toEqual('Unmute'); expect(wrapper.find(`[data-test-subj="disableButton"] button`).prop('disabled')).toBeFalsy(); expect(wrapper.find(`[data-test-subj="disableButton"] button`).text()).toEqual('Disable'); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).text()).toEqual('Edit rule'); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).text()).toEqual('Delete rule'); + expect(wrapper.find(`[data-test-subj="editRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="editRule"] button`).text()).toEqual('Edit rule'); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).text()).toEqual('Delete rule'); }); test('renders actions correctly when rule type is not editable in this context', async () => { @@ -337,9 +337,9 @@ describe('CollapsedItemActions', () => { expect(wrapper.find(`[data-test-subj="muteButton"] button`).text()).toEqual('Mute'); expect(wrapper.find(`[data-test-subj="disableButton"] button`).prop('disabled')).toBeFalsy(); expect(wrapper.find(`[data-test-subj="disableButton"] button`).text()).toEqual('Disable'); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).prop('disabled')).toBeTruthy(); - expect(wrapper.find(`[data-test-subj="editAlert"] button`).text()).toEqual('Edit rule'); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).prop('disabled')).toBeFalsy(); - expect(wrapper.find(`[data-test-subj="deleteAlert"] button`).text()).toEqual('Delete rule'); + expect(wrapper.find(`[data-test-subj="editRule"] button`).prop('disabled')).toBeTruthy(); + expect(wrapper.find(`[data-test-subj="editRule"] button`).text()).toEqual('Edit rule'); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).prop('disabled')).toBeFalsy(); + expect(wrapper.find(`[data-test-subj="deleteRule"] button`).text()).toEqual('Delete rule'); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.tsx similarity index 68% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.tsx index e2870e8097946..4fcecc3410f17 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/collapsed_item_actions.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.tsx @@ -11,29 +11,29 @@ import React, { useEffect, useState } from 'react'; import { EuiButtonIcon, EuiPopover, EuiContextMenu } from '@elastic/eui'; import { useKibana } from '../../../../common/lib/kibana'; -import { AlertTableItem } from '../../../../types'; +import { RuleTableItem } from '../../../../types'; import { ComponentOpts as BulkOperationsComponentOpts, - withBulkAlertOperations, -} from '../../common/components/with_bulk_alert_api_operations'; + withBulkRuleOperations, +} from '../../common/components/with_bulk_rule_api_operations'; import './collapsed_item_actions.scss'; export type ComponentOpts = { - item: AlertTableItem; - onAlertChanged: () => void; - setAlertsToDelete: React.Dispatch>; - onEditAlert: (item: AlertTableItem) => void; -} & Pick; + item: RuleTableItem; + onRuleChanged: () => void; + setRulesToDelete: React.Dispatch>; + onEditRule: (item: RuleTableItem) => void; +} & Pick; export const CollapsedItemActions: React.FunctionComponent = ({ item, - onAlertChanged, - disableAlert, - enableAlert, - unmuteAlert, - muteAlert, - setAlertsToDelete, - onEditAlert, + onRuleChanged, + disableRule, + enableRule, + unmuteRule, + muteRule, + setRulesToDelete, + onEditRule, }: ComponentOpts) => { const { ruleTypeRegistry } = useKibana().services; @@ -45,8 +45,8 @@ export const CollapsedItemActions: React.FunctionComponent = ({ setIsMuted(item.muteAll); }, [item.enabled, item.muteAll]); - const isRuleTypeEditableInContext = ruleTypeRegistry.has(item.alertTypeId) - ? !ruleTypeRegistry.get(item.alertTypeId).requiresAppContext + const isRuleTypeEditableInContext = ruleTypeRegistry.has(item.ruleTypeId) + ? !ruleTypeRegistry.get(item.ruleTypeId).requiresAppContext : false; const button = ( @@ -56,7 +56,7 @@ export const CollapsedItemActions: React.FunctionComponent = ({ iconType="boxesHorizontal" onClick={() => setIsPopoverOpen(!isPopoverOpen)} aria-label={i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.popoverButtonTitle', { defaultMessage: 'Actions' } )} /> @@ -74,22 +74,22 @@ export const CollapsedItemActions: React.FunctionComponent = ({ const muteAll = isMuted; asyncScheduler.schedule(async () => { if (muteAll) { - await unmuteAlert({ ...item, muteAll }); + await unmuteRule({ ...item, muteAll }); } else { - await muteAlert({ ...item, muteAll }); + await muteRule({ ...item, muteAll }); } - onAlertChanged(); + onRuleChanged(); }, 10); setIsMuted(!isMuted); setIsPopoverOpen(!isPopoverOpen); }, name: isMuted ? i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.unmuteTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.unmuteTitle', { defaultMessage: 'Unmute' } ) : i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.muteTitle', { defaultMessage: 'Mute' } ), }, @@ -100,46 +100,46 @@ export const CollapsedItemActions: React.FunctionComponent = ({ const enabled = !isDisabled; asyncScheduler.schedule(async () => { if (enabled) { - await disableAlert({ ...item, enabled }); + await disableRule({ ...item, enabled }); } else { - await enableAlert({ ...item, enabled }); + await enableRule({ ...item, enabled }); } - onAlertChanged(); + onRuleChanged(); }, 10); setIsDisabled(!isDisabled); setIsPopoverOpen(!isPopoverOpen); }, name: isDisabled ? i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.enableTitle', { defaultMessage: 'Enable' } ) : i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.disableTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.disableTitle', { defaultMessage: 'Disable' } ), }, { disabled: !item.isEditable || !isRuleTypeEditableInContext, - 'data-test-subj': 'editAlert', + 'data-test-subj': 'editRule', onClick: () => { setIsPopoverOpen(!isPopoverOpen); - onEditAlert(item); + onEditRule(item); }, name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.editTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.editTitle', { defaultMessage: 'Edit rule' } ), }, { disabled: !item.isEditable, - 'data-test-subj': 'deleteAlert', + 'data-test-subj': 'deleteRule', onClick: () => { setIsPopoverOpen(!isPopoverOpen); - setAlertsToDelete([item.id]); + setRulesToDelete([item.id]); }, name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteRuleTitle', + 'xpack.triggersActionsUI.sections.rulesList.collapsedItemActons.deleteRuleTitle', { defaultMessage: 'Delete rule' } ), }, @@ -166,4 +166,4 @@ export const CollapsedItemActions: React.FunctionComponent = ({ ); }; -export const CollapsedItemActionsWithApi = withBulkAlertOperations(CollapsedItemActions); +export const CollapsedItemActionsWithApi = withBulkRuleOperations(CollapsedItemActions); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/manage_license_modal.tsx similarity index 86% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/manage_license_modal.tsx index 77cca21ad33cf..eb7a616359bcd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/manage_license_modal.tsx @@ -13,14 +13,14 @@ import { capitalize } from 'lodash'; interface Props { licenseType: string; - alertTypeId: string; + ruleTypeId: string; onConfirm: () => void; onCancel: () => void; } export const ManageLicenseModal: React.FC = ({ licenseType, - alertTypeId, + ruleTypeId, onConfirm, onCancel, }) => { @@ -51,8 +51,8 @@ export const ManageLicenseModal: React.FC = ({

diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/percentile_selectable_popover.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/percentile_selectable_popover.tsx similarity index 96% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/percentile_selectable_popover.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/percentile_selectable_popover.tsx index 807258522f385..0d3f98cee5cd8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/percentile_selectable_popover.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/percentile_selectable_popover.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiPopover, EuiButtonIcon, EuiSelectable, EuiSelectableOption } from '@elastic/eui'; const iconButtonTitle = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.ruleExecutionPercentileSelectButton', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.ruleExecutionPercentileSelectButton', { defaultMessage: 'select percentile' } ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_duration_format.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_duration_format.tsx similarity index 100% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_duration_format.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_duration_format.tsx diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_enabled_switch.test.tsx similarity index 85% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_enabled_switch.test.tsx index 0773d6c9c5ed0..418b6931ca1a3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_enabled_switch.test.tsx @@ -10,19 +10,19 @@ import { mountWithIntl } from '@kbn/test-jest-helpers'; import { RuleEnabledSwitch, ComponentOpts } from './rule_enabled_switch'; describe('RuleEnabledSwitch', () => { - const enableAlert = jest.fn(); + const enableRule = jest.fn(); const props: ComponentOpts = { - disableAlert: jest.fn(), - enableAlert, + disableRule: jest.fn(), + enableRule, item: { id: '1', - name: 'test alert', + name: 'test rule', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, createdBy: null, updatedBy: null, apiKeyOwner: null, @@ -35,7 +35,7 @@ describe('RuleEnabledSwitch', () => { }, consumer: 'test', actionsCount: 0, - alertType: 'test_alert_type', + ruleType: 'test_rule_type', createdAt: new Date('2020-08-20T19:23:38Z'), enabledInLicense: true, isEditable: false, @@ -43,7 +43,7 @@ describe('RuleEnabledSwitch', () => { index: 0, updatedAt: new Date('2020-08-20T19:23:38Z'), }, - onAlertChanged: jest.fn(), + onRuleChanged: jest.fn(), }; beforeEach(() => jest.resetAllMocks()); @@ -60,13 +60,13 @@ describe('RuleEnabledSwitch', () => { ...props, item: { id: '1', - name: 'test alert', + name: 'test rule', tags: ['tag1'], enabled: false, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, createdBy: null, updatedBy: null, apiKeyOwner: null, @@ -79,7 +79,7 @@ describe('RuleEnabledSwitch', () => { }, consumer: 'test', actionsCount: 0, - alertType: 'test_alert_type', + ruleType: 'test_rule_type', createdAt: new Date('2020-08-20T19:23:38Z'), enabledInLicense: true, isEditable: true, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_enabled_switch.tsx similarity index 76% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_enabled_switch.tsx index 036bfa68b8dbd..5b612833ba937 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/rule_enabled_switch.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_enabled_switch.tsx @@ -8,20 +8,20 @@ import React, { useState, useEffect } from 'react'; import { EuiSwitch, EuiLoadingSpinner } from '@elastic/eui'; -import { Rule, AlertTableItem } from '../../../../types'; +import { Rule, RuleTableItem } from '../../../../types'; export interface ComponentOpts { - item: AlertTableItem; - onAlertChanged: () => void; - enableAlert: (alert: Rule) => Promise; - disableAlert: (alert: Rule) => Promise; + item: RuleTableItem; + onRuleChanged: () => void; + enableRule: (rule: Rule) => Promise; + disableRule: (rule: Rule) => Promise; } export const RuleEnabledSwitch: React.FunctionComponent = ({ item, - onAlertChanged, - disableAlert, - enableAlert, + onRuleChanged, + disableRule, + enableRule, }: ComponentOpts) => { const [isEnabled, setIsEnabled] = useState(!item.enabled); useEffect(() => { @@ -42,13 +42,13 @@ export const RuleEnabledSwitch: React.FunctionComponent = ({ setIsUpdating(true); const enabled = item.enabled; if (enabled) { - await disableAlert({ ...item, enabled }); + await disableRule({ ...item, enabled }); } else { - await enableAlert({ ...item, enabled }); + await enableRule({ ...item, enabled }); } setIsEnabled(!isEnabled); setIsUpdating(false); - onAlertChanged(); + onRuleChanged(); }} label="" /> diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx similarity index 82% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx index fb6580e576ce3..2f2b1914bef09 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_filter.tsx @@ -18,17 +18,17 @@ import { AlertExecutionStatuses, AlertExecutionStatusValues, } from '../../../../../../alerting/common'; -import { alertsStatusesTranslationsMapping } from '../translations'; +import { rulesStatusesTranslationsMapping } from '../translations'; -interface AlertStatusFilterProps { +interface RuleStatusFilterProps { selectedStatuses: string[]; - onChange?: (selectedAlertStatusesIds: string[]) => void; + onChange?: (selectedRuleStatusesIds: string[]) => void; } -export const AlertStatusFilter: React.FunctionComponent = ({ +export const RuleStatusFilter: React.FunctionComponent = ({ selectedStatuses, onChange, -}: AlertStatusFilterProps) => { +}: RuleStatusFilterProps) => { const [selectedValues, setSelectedValues] = useState(selectedStatuses); const [isPopoverOpen, setIsPopoverOpen] = useState(false); @@ -55,10 +55,10 @@ export const AlertStatusFilter: React.FunctionComponent numActiveFilters={selectedValues.length} numFilters={selectedValues.length} onClick={() => setIsPopoverOpen(!isPopoverOpen)} - data-test-subj="alertStatusFilterButton" + data-test-subj="ruleStatusFilterButton" > @@ -80,9 +80,9 @@ export const AlertStatusFilter: React.FunctionComponent } }} checked={selectedValues.includes(item) ? 'on' : undefined} - data-test-subj={`alertStatus${item}FilerOption`} + data-test-subj={`ruleStatus${item}FilerOption`} > - {alertsStatusesTranslationsMapping[item]} + {rulesStatusesTranslationsMapping[item]} ); })} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.scss b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.scss similarity index 79% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.scss rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.scss index 138605421f202..28db982b826bd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.scss +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.scss @@ -1,7 +1,7 @@ -.actAlertsList__tableRowDisabled { +.actRulesList__tableRowDisabled { background-color: $euiColorLightestShade; - .actAlertsList__tableCellDisabled { + .actRulesList__tableCellDisabled { color: $euiColorDarkShade; } } @@ -10,7 +10,7 @@ &:hover, &:focus-within, &[class*='-isActive'] { - .alertSidebarItem__action { + .ruleSidebarItem__action { opacity: 1; } } @@ -20,10 +20,10 @@ * 1. Only visually hide the action, so that it's still accessible to screen readers. * 2. When tabbed to, this element needs to be visible for keyboard accessibility. */ -.alertSidebarItem__action { +.ruleSidebarItem__action { opacity: 0; /* 1 */ - &.alertSidebarItem__mobile { + &.ruleSidebarItem__mobile { opacity: 1; } @@ -41,4 +41,4 @@ bottom: $euiSizeXS; margin-left: $euiSizeXS; position: relative; -} \ No newline at end of file +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx similarity index 70% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx index 28aa0b2097aba..6d6afab22dae2 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx @@ -11,7 +11,7 @@ import { ReactWrapper } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { actionTypeRegistryMock } from '../../../action_type_registry.mock'; import { ruleTypeRegistryMock } from '../../../rule_type_registry.mock'; -import { AlertsList, percentileFields } from './alerts_list'; +import { RulesList, percentileFields } from './rules_list'; import { RuleTypeModel, ValidationResult, Percentiles } from '../../../../types'; import { AlertExecutionStatusErrorReasons, @@ -27,38 +27,41 @@ jest.mock('../../../lib/action_connector_api', () => ({ loadActionTypes: jest.fn(), loadAllActions: jest.fn(), })); -jest.mock('../../../lib/alert_api', () => ({ - loadAlerts: jest.fn(), - loadAlertTypes: jest.fn(), +jest.mock('../../../lib/rule_api', () => ({ + loadRules: jest.fn(), + loadRuleTypes: jest.fn(), alertingFrameworkHealth: jest.fn(() => ({ isSufficientlySecure: true, hasPermanentEncryptionKey: true, })), })); jest.mock('../../../../common/lib/health_api', () => ({ - triggersActionsUiHealth: jest.fn(() => ({ isAlertsAvailable: true })), + triggersActionsUiHealth: jest.fn(() => ({ isRulesAvailable: true })), +})); +jest.mock('../../../../common/lib/config_api', () => ({ + triggersActionsUiConfig: jest.fn().mockResolvedValue({ minimumScheduleInterval: '1m' }), })); jest.mock('react-router-dom', () => ({ useHistory: () => ({ push: jest.fn(), }), useLocation: () => ({ - pathname: '/triggersActions/alerts/', + pathname: '/triggersActions/rules/', }), })); jest.mock('../../../lib/capabilities', () => ({ hasAllPrivilege: jest.fn(() => true), - hasSaveAlertsCapability: jest.fn(() => true), + hasSaveRulesCapability: jest.fn(() => true), hasShowActionsCapability: jest.fn(() => true), hasExecuteActionsCapability: jest.fn(() => true), })); -const { loadAlerts, loadAlertTypes } = jest.requireMock('../../../lib/alert_api'); +const { loadRules, loadRuleTypes } = jest.requireMock('../../../lib/rule_api'); const { loadActionTypes, loadAllActions } = jest.requireMock('../../../lib/action_connector_api'); const actionTypeRegistry = actionTypeRegistryMock.create(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); const ruleType = { - id: 'test_alert_type', + id: 'test_rule_type', description: 'test', iconClass: 'test', documentationUrl: null, @@ -68,9 +71,9 @@ const ruleType = { ruleParamsExpression: () => null, requiresAppContext: false, }; -const alertTypeFromApi = { - id: 'test_alert_type', - name: 'some alert type', +const ruleTypeFromApi = { + id: 'test_rule_type', + name: 'some rule type', actionGroups: [{ id: 'default', name: 'Default' }], recoveryActionGroup: { id: 'recovered', name: 'Recovered' }, actionVariables: { context: [], state: [] }, @@ -87,10 +90,10 @@ ruleTypeRegistry.list.mockReturnValue([ruleType]); actionTypeRegistry.list.mockReturnValue([]); const useKibanaMock = useKibana as jest.Mocked; -describe('alerts_list component empty', () => { +describe('rules_list component empty', () => { let wrapper: ReactWrapper; async function setup() { - loadAlerts.mockResolvedValue({ + loadRules.mockResolvedValue({ page: 1, perPage: 10000, total: 0, @@ -106,7 +109,7 @@ describe('alerts_list component empty', () => { name: 'Test2', }, ]); - loadAlertTypes.mockResolvedValue([alertTypeFromApi]); + loadRuleTypes.mockResolvedValue([ruleTypeFromApi]); loadAllActions.mockResolvedValue([]); // eslint-disable-next-line react-hooks/rules-of-hooks @@ -115,7 +118,7 @@ describe('alerts_list component empty', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.actionTypeRegistry = actionTypeRegistry; - wrapper = mountWithIntl(); + wrapper = mountWithIntl(); await act(async () => { await nextTick(); @@ -125,20 +128,20 @@ describe('alerts_list component empty', () => { it('renders empty list', async () => { await setup(); - expect(wrapper.find('[data-test-subj="createFirstAlertEmptyPrompt"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="createFirstRuleEmptyPrompt"]').exists()).toBeTruthy(); }); - it('renders Create alert button', async () => { + it('renders Create rule button', async () => { await setup(); - expect( - wrapper.find('[data-test-subj="createFirstAlertButton"]').find('EuiButton') - ).toHaveLength(1); - expect(wrapper.find('AlertAdd').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="createFirstRuleButton"]').find('EuiButton')).toHaveLength( + 1 + ); + expect(wrapper.find('RuleAdd').exists()).toBeFalsy(); - wrapper.find('button[data-test-subj="createFirstAlertButton"]').simulate('click'); + wrapper.find('button[data-test-subj="createFirstRuleButton"]').simulate('click'); await act(async () => { - // When the AlertAdd component is rendered, it waits for the healthcheck to resolve + // When the RuleAdd component is rendered, it waits for the healthcheck to resolve await new Promise((resolve) => { setTimeout(resolve, 1000); }); @@ -147,23 +150,23 @@ describe('alerts_list component empty', () => { wrapper.update(); }); - expect(wrapper.find('AlertAdd').exists()).toEqual(true); + expect(wrapper.find('RuleAdd').exists()).toEqual(true); }); }); -describe('alerts_list component with items', () => { +describe('rules_list component with items', () => { let wrapper: ReactWrapper; - const mockedAlertsData = [ + const mockedRulesData = [ { id: '1', - name: 'test alert', + name: 'test rule', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -204,13 +207,13 @@ describe('alerts_list component with items', () => { }, { id: '2', - name: 'test alert ok', + name: 'test rule ok', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -247,13 +250,13 @@ describe('alerts_list component with items', () => { }, { id: '3', - name: 'test alert pending', + name: 'test rule pending', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -278,13 +281,13 @@ describe('alerts_list component with items', () => { }, { id: '4', - name: 'test alert error', + name: 'test rule error', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, - actions: [{ id: 'test', group: 'alert', params: { message: 'test' } }], - params: { name: 'test alert type name' }, + actions: [{ id: 'test', group: 'rule', params: { message: 'test' } }], + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -304,13 +307,13 @@ describe('alerts_list component with items', () => { }, { id: '5', - name: 'test alert license error', + name: 'test rule license error', tags: [], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, - actions: [{ id: 'test', group: 'alert', params: { message: 'test' } }], - params: { name: 'test alert type name' }, + actions: [{ id: 'test', group: 'rule', params: { message: 'test' } }], + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -331,11 +334,11 @@ describe('alerts_list component with items', () => { ]; async function setup(editable: boolean = true) { - loadAlerts.mockResolvedValue({ + loadRules.mockResolvedValue({ page: 1, perPage: 10000, total: 4, - data: mockedAlertsData, + data: mockedRulesData, }); loadActionTypes.mockResolvedValue([ { @@ -347,13 +350,13 @@ describe('alerts_list component with items', () => { name: 'Test2', }, ]); - loadAlertTypes.mockResolvedValue([alertTypeFromApi]); + loadRuleTypes.mockResolvedValue([ruleTypeFromApi]); loadAllActions.mockResolvedValue([]); const ruleTypeMock: RuleTypeModel = { - id: 'test_alert_type', + id: 'test_rule_type', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: () => { return { errors: {} }; @@ -369,54 +372,54 @@ describe('alerts_list component with items', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.actionTypeRegistry = actionTypeRegistry; - wrapper = mountWithIntl(); + wrapper = mountWithIntl(); await act(async () => { await nextTick(); wrapper.update(); }); - expect(loadAlerts).toHaveBeenCalled(); + expect(loadRules).toHaveBeenCalled(); expect(loadActionTypes).toHaveBeenCalled(); } - it('renders table of alerts', async () => { + it('renders table of rules', async () => { // Use fake timers so we don't have to wait for the EuiToolTip timeout jest.useFakeTimers(); await setup(); expect(wrapper.find('EuiBasicTable')).toHaveLength(1); - expect(wrapper.find('EuiTableRow')).toHaveLength(mockedAlertsData.length); + expect(wrapper.find('EuiTableRow')).toHaveLength(mockedRulesData.length); // Enabled switch column - expect( - wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-enabled"]').length - ).toEqual(mockedAlertsData.length); + expect(wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-enabled"]').length).toEqual( + mockedRulesData.length + ); // Name and rule type column - const ruleNameColumns = wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-name"]'); - expect(ruleNameColumns.length).toEqual(mockedAlertsData.length); - mockedAlertsData.forEach((rule, index) => { - expect(ruleNameColumns.at(index).text()).toEqual(`Name${rule.name}${alertTypeFromApi.name}`); + const ruleNameColumns = wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-name"]'); + expect(ruleNameColumns.length).toEqual(mockedRulesData.length); + mockedRulesData.forEach((rule, index) => { + expect(ruleNameColumns.at(index).text()).toEqual(`Name${rule.name}${ruleTypeFromApi.name}`); }); // Tags column expect( - wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-tagsPopover"]').length - ).toEqual(mockedAlertsData.length); + wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-tagsPopover"]').length + ).toEqual(mockedRulesData.length); // only show tags popover if tags exist on rule const tagsBadges = wrapper.find('EuiBadge[data-test-subj="ruleTagsBadge"]'); expect(tagsBadges.length).toEqual( - mockedAlertsData.filter((data) => data.tags.length > 0).length + mockedRulesData.filter((data) => data.tags.length > 0).length ); // Last run column expect( - wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-lastExecutionDate"]').length - ).toEqual(mockedAlertsData.length); + wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-lastExecutionDate"]').length + ).toEqual(mockedRulesData.length); // Last run tooltip wrapper - .find('[data-test-subj="alertsTableCell-lastExecutionDateTooltip"]') + .find('[data-test-subj="rulesTableCell-lastExecutionDateTooltip"]') .first() .simulate('mouseOver'); @@ -427,33 +430,29 @@ describe('alerts_list component with items', () => { expect(wrapper.find('.euiToolTipPopover').text()).toBe('Start time of the last execution.'); wrapper - .find('[data-test-subj="alertsTableCell-lastExecutionDateTooltip"]') + .find('[data-test-subj="rulesTableCell-lastExecutionDateTooltip"]') .first() .simulate('mouseOut'); // Schedule interval column expect( - wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-interval"]').length - ).toEqual(mockedAlertsData.length); + wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-interval"]').length + ).toEqual(mockedRulesData.length); // Duration column expect( - wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-duration"]').length - ).toEqual(mockedAlertsData.length); + wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-duration"]').length + ).toEqual(mockedRulesData.length); // show warning if duration is long const durationWarningIcon = wrapper.find('EuiIconTip[data-test-subj="ruleDurationWarning"]'); expect(durationWarningIcon.length).toEqual( - mockedAlertsData.filter( - (data) => - data.executionStatus.lastDuration > parseDuration(alertTypeFromApi.ruleTaskTimeout) + mockedRulesData.filter( + (data) => data.executionStatus.lastDuration > parseDuration(ruleTypeFromApi.ruleTaskTimeout) ).length ); // Duration tooltip - wrapper - .find('[data-test-subj="alertsTableCell-durationTooltip"]') - .first() - .simulate('mouseOver'); + wrapper.find('[data-test-subj="rulesTableCell-durationTooltip"]').first().simulate('mouseOver'); // Run the timers so the EuiTooltip will be visible jest.runAllTimers(); @@ -464,37 +463,37 @@ describe('alerts_list component with items', () => { ); // Status column - expect(wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-status"]').length).toEqual( - mockedAlertsData.length + expect(wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-status"]').length).toEqual( + mockedRulesData.length ); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-active"]').length).toEqual(1); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-ok"]').length).toEqual(1); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-pending"]').length).toEqual(1); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-unknown"]').length).toEqual(0); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-error"]').length).toEqual(2); - expect(wrapper.find('[data-test-subj="alertStatus-error-tooltip"]').length).toEqual(2); + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-active"]').length).toEqual(1); + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-ok"]').length).toEqual(1); + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-pending"]').length).toEqual(1); + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-unknown"]').length).toEqual(0); + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-error"]').length).toEqual(2); + expect(wrapper.find('[data-test-subj="ruleStatus-error-tooltip"]').length).toEqual(2); expect( - wrapper.find('EuiButtonEmpty[data-test-subj="alertStatus-error-license-fix"]').length + wrapper.find('EuiButtonEmpty[data-test-subj="ruleStatus-error-license-fix"]').length ).toEqual(1); - expect(wrapper.find('[data-test-subj="refreshAlertsButton"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="refreshRulesButton"]').exists()).toBeTruthy(); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-error"]').first().text()).toEqual( + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-error"]').first().text()).toEqual( 'Error' ); - expect(wrapper.find('EuiHealth[data-test-subj="alertStatus-error"]').last().text()).toEqual( + expect(wrapper.find('EuiHealth[data-test-subj="ruleStatus-error"]').last().text()).toEqual( 'License Error' ); // Monitoring column expect( - wrapper.find('EuiTableRowCell[data-test-subj="alertsTableCell-successRatio"]').length - ).toEqual(mockedAlertsData.length); + wrapper.find('EuiTableRowCell[data-test-subj="rulesTableCell-successRatio"]').length + ).toEqual(mockedRulesData.length); const ratios = wrapper.find( - 'EuiTableRowCell[data-test-subj="alertsTableCell-successRatio"] span[data-test-subj="successRatio"]' + 'EuiTableRowCell[data-test-subj="rulesTableCell-successRatio"] span[data-test-subj="successRatio"]' ); - mockedAlertsData.forEach((rule, index) => { + mockedRulesData.forEach((rule, index) => { if (rule.monitoring) { expect(ratios.at(index).text()).toEqual( `${rule.monitoring.execution.calculated_metrics.success_ratio * 100}%` @@ -506,14 +505,14 @@ describe('alerts_list component with items', () => { // P50 column is rendered initially expect( - wrapper.find(`[data-test-subj="alertsTable-${Percentiles.P50}ColumnName"]`).exists() + wrapper.find(`[data-test-subj="rulesTable-${Percentiles.P50}ColumnName"]`).exists() ).toBeTruthy(); let percentiles = wrapper.find( - `EuiTableRowCell[data-test-subj="alertsTableCell-ruleExecutionPercentile"] span[data-test-subj="rule-duration-format-value"]` + `EuiTableRowCell[data-test-subj="rulesTableCell-ruleExecutionPercentile"] span[data-test-subj="rule-duration-format-value"]` ); - mockedAlertsData.forEach((rule, index) => { + mockedRulesData.forEach((rule, index) => { if (typeof rule.monitoring?.execution.calculated_metrics.p50 === 'number') { // Ensure the table cells are getting the correct values expect(percentiles.at(index).text()).toEqual( @@ -523,7 +522,7 @@ describe('alerts_list component with items', () => { expect( wrapper .find( - 'EuiTableRowCell[data-test-subj="alertsTableCell-ruleExecutionPercentile"] [data-test-subj="rule-duration-format-tooltip"]' + 'EuiTableRowCell[data-test-subj="rulesTableCell-ruleExecutionPercentile"] [data-test-subj="rule-duration-format-tooltip"]' ) .at(index) .props().content @@ -535,11 +534,11 @@ describe('alerts_list component with items', () => { // Click column to sort by P50 wrapper - .find(`[data-test-subj="alertsTable-${Percentiles.P50}ColumnName"]`) + .find(`[data-test-subj="rulesTable-${Percentiles.P50}ColumnName"]`) .first() .simulate('click'); - expect(loadAlerts).toHaveBeenCalledWith( + expect(loadRules).toHaveBeenCalledWith( expect.objectContaining({ sort: { field: percentileFields[Percentiles.P50], @@ -550,11 +549,11 @@ describe('alerts_list component with items', () => { // Click column again to reverse sort by P50 wrapper - .find(`[data-test-subj="alertsTable-${Percentiles.P50}ColumnName"]`) + .find(`[data-test-subj="rulesTable-${Percentiles.P50}ColumnName"]`) .first() .simulate('click'); - expect(loadAlerts).toHaveBeenCalledWith( + expect(loadRules).toHaveBeenCalledWith( expect.objectContaining({ sort: { field: percentileFields[Percentiles.P50], @@ -589,14 +588,14 @@ describe('alerts_list component with items', () => { wrapper.update(); expect( - wrapper.find(`[data-test-subj="alertsTable-${Percentiles.P95}ColumnName"]`).exists() + wrapper.find(`[data-test-subj="rulesTable-${Percentiles.P95}ColumnName"]`).exists() ).toBeTruthy(); percentiles = wrapper.find( - `EuiTableRowCell[data-test-subj="alertsTableCell-ruleExecutionPercentile"] span[data-test-subj="rule-duration-format-value"]` + `EuiTableRowCell[data-test-subj="rulesTableCell-ruleExecutionPercentile"] span[data-test-subj="rule-duration-format-value"]` ); - mockedAlertsData.forEach((rule, index) => { + mockedRulesData.forEach((rule, index) => { if (typeof rule.monitoring?.execution.calculated_metrics.p95 === 'number') { expect(percentiles.at(index).text()).toEqual( getFormattedDuration(rule.monitoring.execution.calculated_metrics.p95) @@ -608,11 +607,11 @@ describe('alerts_list component with items', () => { // Click column to sort by P95 wrapper - .find(`[data-test-subj="alertsTable-${Percentiles.P95}ColumnName"]`) + .find(`[data-test-subj="rulesTable-${Percentiles.P95}ColumnName"]`) .first() .simulate('click'); - expect(loadAlerts).toHaveBeenCalledWith( + expect(loadRules).toHaveBeenCalledWith( expect.objectContaining({ sort: { field: percentileFields[Percentiles.P95], @@ -623,11 +622,11 @@ describe('alerts_list component with items', () => { // Click column again to reverse sort by P95 wrapper - .find(`[data-test-subj="alertsTable-${Percentiles.P95}ColumnName"]`) + .find(`[data-test-subj="rulesTable-${Percentiles.P95}ColumnName"]`) .first() .simulate('click'); - expect(loadAlerts).toHaveBeenCalledWith( + expect(loadRules).toHaveBeenCalledWith( expect.objectContaining({ sort: { field: percentileFields[Percentiles.P95], @@ -640,16 +639,16 @@ describe('alerts_list component with items', () => { jest.clearAllMocks(); }); - it('loads alerts when refresh button is clicked', async () => { + it('loads rules when refresh button is clicked', async () => { await setup(); - wrapper.find('[data-test-subj="refreshAlertsButton"]').first().simulate('click'); + wrapper.find('[data-test-subj="refreshRulesButton"]').first().simulate('click'); await act(async () => { await nextTick(); wrapper.update(); }); - expect(loadAlerts).toHaveBeenCalled(); + expect(loadRules).toHaveBeenCalled(); }); it('renders license errors and manage license modal on click', async () => { @@ -657,11 +656,9 @@ describe('alerts_list component with items', () => { await setup(); expect(wrapper.find('ManageLicenseModal').exists()).toBeFalsy(); expect( - wrapper.find('EuiButtonEmpty[data-test-subj="alertStatus-error-license-fix"]').length + wrapper.find('EuiButtonEmpty[data-test-subj="ruleStatus-error-license-fix"]').length ).toEqual(1); - wrapper - .find('EuiButtonEmpty[data-test-subj="alertStatus-error-license-fix"]') - .simulate('click'); + wrapper.find('EuiButtonEmpty[data-test-subj="ruleStatus-error-license-fix"]').simulate('click'); await act(async () => { await nextTick(); @@ -676,7 +673,7 @@ describe('alerts_list component with items', () => { expect(global.open).toHaveBeenCalled(); }); - it('sorts alerts when clicking the name column', async () => { + it('sorts rules when clicking the name column', async () => { await setup(); wrapper .find('[data-test-subj="tableHeaderCell_name_1"] .euiTableHeaderButton') @@ -688,7 +685,7 @@ describe('alerts_list component with items', () => { wrapper.update(); }); - expect(loadAlerts).toHaveBeenCalledWith( + expect(loadRules).toHaveBeenCalledWith( expect.objectContaining({ sort: { field: 'name', @@ -698,7 +695,7 @@ describe('alerts_list component with items', () => { ); }); - it('sorts alerts when clicking the enabled column', async () => { + it('sorts rules when clicking the enabled column', async () => { await setup(); wrapper .find('[data-test-subj="tableHeaderCell_enabled_0"] .euiTableHeaderButton') @@ -710,7 +707,7 @@ describe('alerts_list component with items', () => { wrapper.update(); }); - expect(loadAlerts).toHaveBeenLastCalledWith( + expect(loadRules).toHaveBeenLastCalledWith( expect.objectContaining({ sort: { field: 'enabled', @@ -722,22 +719,22 @@ describe('alerts_list component with items', () => { it('renders edit and delete buttons when user can manage rules', async () => { await setup(); - expect(wrapper.find('[data-test-subj="alertSidebarEditAction"]').exists()).toBeTruthy(); - expect(wrapper.find('[data-test-subj="alertSidebarDeleteAction"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="ruleSidebarEditAction"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="ruleSidebarDeleteAction"]').exists()).toBeTruthy(); }); it('does not render edit and delete button when rule type does not allow editing in rules management', async () => { await setup(false); - expect(wrapper.find('[data-test-subj="alertSidebarEditAction"]').exists()).toBeFalsy(); - expect(wrapper.find('[data-test-subj="alertSidebarDeleteAction"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="ruleSidebarEditAction"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="ruleSidebarDeleteAction"]').exists()).toBeTruthy(); }); }); -describe('alerts_list component empty with show only capability', () => { +describe('rules_list component empty with show only capability', () => { let wrapper: ReactWrapper; async function setup() { - loadAlerts.mockResolvedValue({ + loadRules.mockResolvedValue({ page: 1, perPage: 10000, total: 0, @@ -753,8 +750,8 @@ describe('alerts_list component empty with show only capability', () => { name: 'Test2', }, ]); - loadAlertTypes.mockResolvedValue([ - { id: 'test_alert_type', name: 'some alert type', authorizedConsumers: {} }, + loadRuleTypes.mockResolvedValue([ + { id: 'test_rule_type', name: 'some rule type', authorizedConsumers: {} }, ]); loadAllActions.mockResolvedValue([]); // eslint-disable-next-line react-hooks/rules-of-hooks @@ -762,7 +759,7 @@ describe('alerts_list component empty with show only capability', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.actionTypeRegistry = actionTypeRegistry; - wrapper = mountWithIntl(); + wrapper = mountWithIntl(); await act(async () => { await nextTick(); @@ -770,30 +767,30 @@ describe('alerts_list component empty with show only capability', () => { }); } - it('not renders create alert button', async () => { + it('not renders create rule button', async () => { await setup(); - expect(wrapper.find('[data-test-subj="createAlertButton"]')).toHaveLength(0); + expect(wrapper.find('[data-test-subj="createRuleButton"]')).toHaveLength(0); }); }); -describe('alerts_list with show only capability', () => { +describe('rules_list with show only capability', () => { let wrapper: ReactWrapper; async function setup(editable: boolean = true) { - loadAlerts.mockResolvedValue({ + loadRules.mockResolvedValue({ page: 1, perPage: 10000, total: 2, data: [ { id: '1', - name: 'test alert', + name: 'test rule', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -809,13 +806,13 @@ describe('alerts_list with show only capability', () => { }, { id: '2', - name: 'test alert 2', + name: 'test rule 2', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, - actions: [{ id: 'test', group: 'alert', params: { message: 'test' } }], - params: { name: 'test alert type name' }, + actions: [{ id: 'test', group: 'rule', params: { message: 'test' } }], + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -842,13 +839,13 @@ describe('alerts_list with show only capability', () => { }, ]); - loadAlertTypes.mockResolvedValue([alertTypeFromApi]); + loadRuleTypes.mockResolvedValue([ruleTypeFromApi]); loadAllActions.mockResolvedValue([]); const ruleTypeMock: RuleTypeModel = { - id: 'test_alert_type', + id: 'test_rule_type', iconClass: 'test', - description: 'Alert when testing', + description: 'Rule when testing', documentationUrl: 'https://localhost.local/docs', validate: () => { return { errors: {} }; @@ -864,7 +861,7 @@ describe('alerts_list with show only capability', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.actionTypeRegistry = actionTypeRegistry; - wrapper = mountWithIntl(); + wrapper = mountWithIntl(); await act(async () => { await nextTick(); @@ -872,14 +869,14 @@ describe('alerts_list with show only capability', () => { }); } - it('renders table of alerts with edit button disabled', async () => { + it('renders table of rules with edit button disabled', async () => { await setup(false); expect(wrapper.find('EuiBasicTable')).toHaveLength(1); expect(wrapper.find('EuiTableRow')).toHaveLength(2); expect(wrapper.find('[data-test-subj="editActionHoverButton"]')).toHaveLength(0); }); - it('renders table of alerts with delete button disabled', async () => { + it('renders table of rules with delete button disabled', async () => { const { hasAllPrivilege } = jest.requireMock('../../../lib/capabilities'); hasAllPrivilege.mockReturnValue(false); await setup(false); @@ -888,7 +885,7 @@ describe('alerts_list with show only capability', () => { expect(wrapper.find('[data-test-subj="deleteActionHoverButton"]')).toHaveLength(0); }); - it('renders table of alerts with actions menu collapsedItemActions', async () => { + it('renders table of rules with actions menu collapsedItemActions', async () => { await setup(false); expect(wrapper.find('EuiBasicTable')).toHaveLength(1); expect(wrapper.find('EuiTableRow')).toHaveLength(2); @@ -896,24 +893,24 @@ describe('alerts_list with show only capability', () => { }); }); -describe('alerts_list with disabled itmes', () => { +describe('rules_list with disabled itmes', () => { let wrapper: ReactWrapper; async function setup() { - loadAlerts.mockResolvedValue({ + loadRules.mockResolvedValue({ page: 1, perPage: 10000, total: 2, data: [ { id: '1', - name: 'test alert', + name: 'test rule', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type', + ruleTypeId: 'test_rule_type', schedule: { interval: '5d' }, actions: [], - params: { name: 'test alert type name' }, + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -929,13 +926,13 @@ describe('alerts_list with disabled itmes', () => { }, { id: '2', - name: 'test alert 2', + name: 'test rule 2', tags: ['tag1'], enabled: true, - alertTypeId: 'test_alert_type_disabled_by_license', + ruleTypeId: 'test_rule_type_disabled_by_license', schedule: { interval: '5d' }, - actions: [{ id: 'test', group: 'alert', params: { message: 'test' } }], - params: { name: 'test alert type name' }, + actions: [{ id: 'test', group: 'rule', params: { message: 'test' } }], + params: { name: 'test rule type name' }, scheduledTaskId: null, createdBy: null, updatedBy: null, @@ -962,11 +959,11 @@ describe('alerts_list with disabled itmes', () => { }, ]); - loadAlertTypes.mockResolvedValue([ - alertTypeFromApi, + loadRuleTypes.mockResolvedValue([ + ruleTypeFromApi, { - id: 'test_alert_type_disabled_by_license', - name: 'some alert type that is not allowed', + id: 'test_rule_type_disabled_by_license', + name: 'some rule type that is not allowed', actionGroups: [{ id: 'default', name: 'Default' }], recoveryActionGroup: { id: 'recovered', name: 'Recovered' }, actionVariables: { context: [], state: [] }, @@ -987,7 +984,7 @@ describe('alerts_list with disabled itmes', () => { // eslint-disable-next-line react-hooks/rules-of-hooks useKibanaMock().services.actionTypeRegistry = actionTypeRegistry; - wrapper = mountWithIntl(); + wrapper = mountWithIntl(); await act(async () => { await nextTick(); @@ -1001,7 +998,7 @@ describe('alerts_list with disabled itmes', () => { expect(wrapper.find('EuiTableRow')).toHaveLength(2); expect(wrapper.find('EuiTableRow').at(0).prop('className')).toEqual(''); expect(wrapper.find('EuiTableRow').at(1).prop('className')).toEqual( - 'actAlertsList__tableRowDisabled' + 'actRulesList__tableRowDisabled' ); expect(wrapper.find('EuiIconTip[data-test-subj="ruleDisabledByLicenseTooltip"]').length).toBe( 1 diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx similarity index 65% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx index 72228c285238d..4aa98895d5d97 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx @@ -43,27 +43,27 @@ import { isEmpty } from 'lodash'; import { ActionType, Rule, - AlertTableItem, + RuleTableItem, RuleType, RuleTypeIndex, Pagination, Percentiles, } from '../../../../types'; -import { AlertAdd, AlertEdit } from '../../alert_form'; +import { RuleAdd, RuleEdit } from '../../rule_form'; import { BulkOperationPopover } from '../../common/components/bulk_operation_popover'; -import { AlertQuickEditButtonsWithApi as AlertQuickEditButtons } from '../../common/components/alert_quick_edit_buttons'; +import { RuleQuickEditButtonsWithApi as RuleQuickEditButtons } from '../../common/components/rule_quick_edit_buttons'; import { CollapsedItemActionsWithApi as CollapsedItemActions } from './collapsed_item_actions'; import { TypeFilter } from './type_filter'; import { ActionTypeFilter } from './action_type_filter'; -import { AlertStatusFilter, getHealthColor } from './alert_status_filter'; +import { RuleStatusFilter, getHealthColor } from './rule_status_filter'; import { - loadAlerts, - loadAlertAggregations, - loadAlertTypes, - disableAlert, - enableAlert, - deleteAlerts, -} from '../../../lib/alert_api'; + loadRules, + loadRuleAggregations, + loadRuleTypes, + disableRule, + enableRule, + deleteRules, +} from '../../../lib/rule_api'; import { loadActionTypes } from '../../../lib/action_connector_api'; import { hasAllPrivilege, hasExecuteActionsCapability } from '../../../lib/capabilities'; import { routeToRuleDetails, DEFAULT_SEARCH_PAGE_SIZE } from '../../../constants'; @@ -77,13 +77,13 @@ import { formatDuration, MONITORING_HISTORY_LIMIT, } from '../../../../../../alerting/common'; -import { alertsStatusesTranslationsMapping, ALERT_STATUS_LICENSE_ERROR } from '../translations'; +import { rulesStatusesTranslationsMapping, ALERT_STATUS_LICENSE_ERROR } from '../translations'; import { useKibana } from '../../../../common/lib/kibana'; import { DEFAULT_HIDDEN_ACTION_TYPES } from '../../../../common/constants'; -import './alerts_list.scss'; +import './rules_list.scss'; import { CenterJustifiedSpinner } from '../../../components/center_justified_spinner'; import { ManageLicenseModal } from './manage_license_modal'; -import { checkAlertTypeEnabled } from '../../../lib/check_alert_type_enabled'; +import { checkRuleTypeEnabled } from '../../../lib/check_rule_type_enabled'; import { RuleEnabledSwitch } from './rule_enabled_switch'; import { PercentileSelectablePopover } from './percentile_selectable_popover'; import { RuleDurationFormat } from './rule_duration_format'; @@ -92,12 +92,12 @@ import { getFormattedSuccessRatio } from '../../../lib/monitoring_utils'; const ENTER_KEY = 13; -interface AlertTypeState { +interface RuleTypeState { isLoading: boolean; isInitialized: boolean; data: RuleTypeIndex; } -interface AlertState { +interface RuleState { isLoading: boolean; data: Rule[]; totalItemCount: number; @@ -121,7 +121,7 @@ const initialPercentileOptions = Object.values(Percentiles).map((percentile) => key: percentile, })); -export const AlertsList: React.FunctionComponent = () => { +export const RulesList: React.FunctionComponent = () => { const history = useHistory(); const { http, @@ -143,11 +143,11 @@ export const AlertsList: React.FunctionComponent = () => { const [inputText, setInputText] = useState(); const [typesFilter, setTypesFilter] = useState([]); const [actionTypesFilter, setActionTypesFilter] = useState([]); - const [alertStatusesFilter, setAlertStatusesFilter] = useState([]); - const [alertFlyoutVisible, setAlertFlyoutVisibility] = useState(false); - const [dismissAlertErrors, setDismissAlertErrors] = useState(false); + const [ruleStatusesFilter, setRuleStatusesFilter] = useState([]); + const [ruleFlyoutVisible, setRuleFlyoutVisibility] = useState(false); + const [dismissRuleErrors, setDismissRuleErrors] = useState(false); const [editFlyoutVisible, setEditFlyoutVisibility] = useState(false); - const [currentRuleToEdit, setCurrentRuleToEdit] = useState(null); + const [currentRuleToEdit, setCurrentRuleToEdit] = useState(null); const [tagPopoverOpenIndex, setTagPopoverOpenIndex] = useState(-1); const [percentileOptions, setPercentileOptions] = @@ -160,15 +160,15 @@ export const AlertsList: React.FunctionComponent = () => { } }, [percentileOptions]); - const [sort, setSort] = useState['sort']>({ + const [sort, setSort] = useState['sort']>({ field: 'name', direction: 'asc', }); const [manageLicenseModalOpts, setManageLicenseModalOpts] = useState<{ licenseType: string; - alertTypeId: string; + ruleTypeId: string; } | null>(null); - const [alertsStatusesTotal, setAlertsStatusesTotal] = useState>( + const [rulesStatusesTotal, setRulesStatusesTotal] = useState>( AlertExecutionStatusValues.reduce( (prev: Record, status: string) => ({ @@ -178,18 +178,18 @@ export const AlertsList: React.FunctionComponent = () => { {} ) ); - const [alertTypesState, setAlertTypesState] = useState({ + const [ruleTypesState, setRuleTypesState] = useState({ isLoading: false, isInitialized: false, data: new Map(), }); - const [alertsState, setAlertsState] = useState({ + const [rulesState, setRulesState] = useState({ isLoading: false, data: [], totalItemCount: 0, }); - const [alertsToDelete, setAlertsToDelete] = useState([]); - const onRuleEdit = (ruleItem: AlertTableItem) => { + const [rulesToDelete, setRulesToDelete] = useState([]); + const onRuleEdit = (ruleItem: RuleTableItem) => { setEditFlyoutVisibility(true); setCurrentRuleToEdit(ruleItem); }; @@ -198,35 +198,35 @@ export const AlertsList: React.FunctionComponent = () => { ruleTypeRegistry.has(ruleTypeId) ? !ruleTypeRegistry.get(ruleTypeId).requiresAppContext : false; useEffect(() => { - loadAlertsData(); + loadRulesData(); }, [ - alertTypesState, + ruleTypesState, page, searchText, percentileOptions, JSON.stringify(typesFilter), JSON.stringify(actionTypesFilter), - JSON.stringify(alertStatusesFilter), + JSON.stringify(ruleStatusesFilter), ]); useEffect(() => { (async () => { try { - setAlertTypesState({ ...alertTypesState, isLoading: true }); - const alertTypes = await loadAlertTypes({ http }); + setRuleTypesState({ ...ruleTypesState, isLoading: true }); + const ruleTypes = await loadRuleTypes({ http }); const index: RuleTypeIndex = new Map(); - for (const alertType of alertTypes) { - index.set(alertType.id, alertType); + for (const ruleType of ruleTypes) { + index.set(ruleType.id, ruleType); } - setAlertTypesState({ isLoading: false, data: index, isInitialized: true }); + setRuleTypesState({ isLoading: false, data: index, isInitialized: true }); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.unableToLoadRuleTypesMessage', + 'xpack.triggersActionsUI.sections.rulesList.unableToLoadRuleTypesMessage', { defaultMessage: 'Unable to load rule types' } ), }); - setAlertTypesState({ ...alertTypesState, isLoading: false }); + setRuleTypesState({ ...ruleTypesState, isLoading: false }); } })(); }, []); @@ -246,7 +246,7 @@ export const AlertsList: React.FunctionComponent = () => { } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.unableToLoadConnectorTypesMessage', + 'xpack.triggersActionsUI.sections.rulesList.unableToLoadConnectorTypesMessage', { defaultMessage: 'Unable to load connector types' } ), }); @@ -254,29 +254,28 @@ export const AlertsList: React.FunctionComponent = () => { })(); }, []); - async function loadAlertsData() { - const hasAnyAuthorizedAlertType = - alertTypesState.isInitialized && alertTypesState.data.size > 0; - if (hasAnyAuthorizedAlertType) { - setAlertsState({ ...alertsState, isLoading: true }); + async function loadRulesData() { + const hasAnyAuthorizedRuleType = ruleTypesState.isInitialized && ruleTypesState.data.size > 0; + if (hasAnyAuthorizedRuleType) { + setRulesState({ ...rulesState, isLoading: true }); try { - const alertsResponse = await loadAlerts({ + const rulesResponse = await loadRules({ http, page, searchText, typesFilter, actionTypesFilter, - alertStatusesFilter, + ruleStatusesFilter, sort, }); - await loadAlertAggs(); - setAlertsState({ + await loadRuleAggs(); + setRulesState({ isLoading: false, - data: alertsResponse.data, - totalItemCount: alertsResponse.total, + data: rulesResponse.data, + totalItemCount: rulesResponse.total, }); - if (!alertsResponse.data?.length && page.index > 0) { + if (!rulesResponse.data?.length && page.index > 0) { setPage({ ...page, index: 0 }); } @@ -284,41 +283,41 @@ export const AlertsList: React.FunctionComponent = () => { isEmpty(searchText) && isEmpty(typesFilter) && isEmpty(actionTypesFilter) && - isEmpty(alertStatusesFilter) + isEmpty(ruleStatusesFilter) ); - setNoData(alertsResponse.data.length === 0 && !isFilterApplied); + setNoData(rulesResponse.data.length === 0 && !isFilterApplied); } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.unableToLoadRulesMessage', + 'xpack.triggersActionsUI.sections.rulesList.unableToLoadRulesMessage', { defaultMessage: 'Unable to load rules', } ), }); - setAlertsState({ ...alertsState, isLoading: false }); + setRulesState({ ...rulesState, isLoading: false }); } setInitialLoad(false); } } - async function loadAlertAggs() { + async function loadRuleAggs() { try { - const alertsAggs = await loadAlertAggregations({ + const rulesAggs = await loadRuleAggregations({ http, searchText, typesFilter, actionTypesFilter, - alertStatusesFilter, + ruleStatusesFilter, }); - if (alertsAggs?.alertExecutionStatus) { - setAlertsStatusesTotal(alertsAggs.alertExecutionStatus); + if (rulesAggs?.ruleExecutionStatus) { + setRulesStatusesTotal(rulesAggs.ruleExecutionStatus); } } catch (e) { toasts.addDanger({ title: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.unableToLoadRuleStatusInfoMessage', + 'xpack.triggersActionsUI.sections.rulesList.unableToLoadRuleStatusInfoMessage', { defaultMessage: 'Unable to load rule status info', } @@ -329,7 +328,7 @@ export const AlertsList: React.FunctionComponent = () => { const renderAlertExecutionStatus = ( executionStatus: AlertExecutionStatus, - item: AlertTableItem + item: RuleTableItem ) => { const healthColor = getHealthColor(executionStatus.status); const tooltipMessage = @@ -338,20 +337,16 @@ export const AlertsList: React.FunctionComponent = () => { executionStatus.error?.reason === AlertExecutionStatusErrorReasons.License; const statusMessage = isLicenseError ? ALERT_STATUS_LICENSE_ERROR - : alertsStatusesTranslationsMapping[executionStatus.status]; + : rulesStatusesTranslationsMapping[executionStatus.status]; const health = ( - + {statusMessage} ); const healthWithTooltip = tooltipMessage ? ( - + {health} ) : ( @@ -365,16 +360,16 @@ export const AlertsList: React.FunctionComponent = () => { setManageLicenseModalOpts({ - licenseType: alertTypesState.data.get(item.alertTypeId)?.minimumLicenseRequired!, - alertTypeId: item.alertTypeId, + licenseType: ruleTypesState.data.get(item.ruleTypeId)?.minimumLicenseRequired!, + ruleTypeId: item.ruleTypeId, }) } > @@ -386,10 +381,10 @@ export const AlertsList: React.FunctionComponent = () => { const renderPercentileColumnName = () => { return ( - + { field: percentileFields[selectedPercentile!], width: '16%', name: renderPercentileColumnName(), - 'data-test-subj': 'alertsTableCell-ruleExecutionPercentile', + 'data-test-subj': 'rulesTableCell-ruleExecutionPercentile', sortable: true, truncateText: false, render: renderPercentileCellValue, }; }; - const getAlertsTableColumns = () => { + const getRulesTableColumns = () => { return [ { field: 'enabled', name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.enabledTitle', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.enabledTitle', { defaultMessage: 'Enabled' } ), width: '50px', - render(_enabled: boolean | undefined, item: AlertTableItem) { + render(_enabled: boolean | undefined, item: RuleTableItem) { return ( await disableAlert({ http, id: item.id })} - enableAlert={async () => await enableAlert({ http, id: item.id })} + disableRule={async () => await disableRule({ http, id: item.id })} + enableRule={async () => await enableRule({ http, id: item.id })} item={item} - onAlertChanged={() => loadAlertsData()} + onRuleChanged={() => loadRulesData()} /> ); }, sortable: true, - 'data-test-subj': 'alertsTableCell-enabled', + 'data-test-subj': 'rulesTableCell-enabled', }, { field: 'name', name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.nameTitle', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.nameTitle', { defaultMessage: 'Name' } ), sortable: true, truncateText: true, width: '30%', - 'data-test-subj': 'alertsTableCell-name', - render: (name: string, alert: AlertTableItem) => { - const ruleType = alertTypesState.data.get(alert.alertTypeId); - const checkEnabledResult = checkAlertTypeEnabled(ruleType); + 'data-test-subj': 'rulesTableCell-name', + render: (name: string, rule: RuleTableItem) => { + const ruleType = ruleTypesState.data.get(rule.ruleTypeId); + const checkEnabledResult = checkRuleTypeEnabled(ruleType); const link = ( <> @@ -477,7 +472,7 @@ export const AlertsList: React.FunctionComponent = () => { { - history.push(routeToRuleDetails.replace(`:ruleId`, alert.id)); + history.push(routeToRuleDetails.replace(`:ruleId`, rule.id)); }} > {name} @@ -498,7 +493,7 @@ export const AlertsList: React.FunctionComponent = () => { - {alert.alertType} + {rule.ruleType}
@@ -507,10 +502,10 @@ export const AlertsList: React.FunctionComponent = () => { return ( <> {link} - {alert.enabled && alert.muteAll && ( + {rule.enabled && rule.muteAll && ( @@ -524,8 +519,8 @@ export const AlertsList: React.FunctionComponent = () => { name: '', sortable: false, width: '50px', - 'data-test-subj': 'alertsTableCell-tagsPopover', - render: (tags: string[], item: AlertTableItem) => { + 'data-test-subj': 'rulesTableCell-tagsPopover', + render: (tags: string[], item: RuleTableItem) => { return tags.length > 0 ? ( { field: 'executionStatus.lastExecutionDate', name: ( { ), sortable: true, width: '15%', - 'data-test-subj': 'alertsTableCell-lastExecutionDate', + 'data-test-subj': 'rulesTableCell-lastExecutionDate', render: (date: Date) => { if (date) { return ( @@ -608,12 +603,12 @@ export const AlertsList: React.FunctionComponent = () => { field: 'schedule.interval', width: '6%', name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.scheduleTitle', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.scheduleTitle', { defaultMessage: 'Interval' } ), sortable: false, truncateText: false, - 'data-test-subj': 'alertsTableCell-interval', + 'data-test-subj': 'rulesTableCell-interval', render: (interval: string) => formatDuration(interval), }, { @@ -621,9 +616,9 @@ export const AlertsList: React.FunctionComponent = () => { width: '12%', name: ( { ), sortable: true, truncateText: false, - 'data-test-subj': 'alertsTableCell-duration', - render: (value: number, item: AlertTableItem) => { + 'data-test-subj': 'rulesTableCell-duration', + render: (value: number, item: RuleTableItem) => { const showDurationWarning = shouldShowDurationWarning( - alertTypesState.data.get(item.alertTypeId), + ruleTypesState.data.get(item.ruleTypeId), value ); @@ -651,10 +646,10 @@ export const AlertsList: React.FunctionComponent = () => { { width: '12%', name: ( { ), sortable: true, truncateText: false, - 'data-test-subj': 'alertsTableCell-successRatio', + 'data-test-subj': 'rulesTableCell-successRatio', render: (value: number) => { return ( @@ -700,58 +695,58 @@ export const AlertsList: React.FunctionComponent = () => { { field: 'executionStatus.status', name: i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.statusTitle', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.statusTitle', { defaultMessage: 'Status' } ), sortable: true, truncateText: false, width: '120px', - 'data-test-subj': 'alertsTableCell-status', - render: (_executionStatus: AlertExecutionStatus, item: AlertTableItem) => { + 'data-test-subj': 'rulesTableCell-status', + render: (_executionStatus: AlertExecutionStatus, item: RuleTableItem) => { return renderAlertExecutionStatus(item.executionStatus, item); }, }, { name: '', width: '10%', - render(item: AlertTableItem) { + render(item: RuleTableItem) { return ( - + - {item.isEditable && isRuleTypeEditableInContext(item.alertTypeId) ? ( - + {item.isEditable && isRuleTypeEditableInContext(item.ruleTypeId) ? ( + onRuleEdit(item)} iconType={'pencil'} aria-label={i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.editAriaLabel', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.editAriaLabel', { defaultMessage: 'Edit' } )} /> ) : null} {item.isEditable ? ( - + setAlertsToDelete([item.id])} + onClick={() => setRulesToDelete([item.id])} iconType={'trash'} aria-label={i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertsListTable.columns.deleteAriaLabel', + 'xpack.triggersActionsUI.sections.rulesList.rulesListTable.columns.deleteAriaLabel', { defaultMessage: 'Delete' } )} /> @@ -763,9 +758,9 @@ export const AlertsList: React.FunctionComponent = () => { loadAlertsData()} - setAlertsToDelete={setAlertsToDelete} - onEditAlert={() => onRuleEdit(item)} + onRuleChanged={() => loadRulesData()} + setRulesToDelete={setRulesToDelete} + onEditRule={() => onRuleEdit(item)} /> @@ -775,17 +770,17 @@ export const AlertsList: React.FunctionComponent = () => { ]; }; - const authorizedAlertTypes = [...alertTypesState.data.values()]; - const authorizedToCreateAnyAlerts = authorizedAlertTypes.some( - (alertType) => alertType.authorizedConsumers[ALERTS_FEATURE_ID]?.all + const authorizedRuleTypes = [...ruleTypesState.data.values()]; + const authorizedToCreateAnyRules = authorizedRuleTypes.some( + (ruleType) => ruleType.authorizedConsumers[ALERTS_FEATURE_ID]?.all ); const getProducerFeatureName = (producer: string) => { return kibanaFeatures?.find((featureItem) => featureItem.id === producer)?.name; }; - const groupAlertTypesByProducer = () => { - return authorizedAlertTypes.reduce( + const groupRuleTypesByProducer = () => { + return authorizedRuleTypes.reduce( ( result: Record< string, @@ -794,12 +789,12 @@ export const AlertsList: React.FunctionComponent = () => { name: string; }> >, - alertType + ruleType ) => { - const producer = alertType.producer; + const producer = ruleType.producer; (result[producer] = result[producer] || []).push({ - value: alertType.id, - name: alertType.name, + value: ruleType.id, + name: ruleType.name, }); return result; }, @@ -811,10 +806,10 @@ export const AlertsList: React.FunctionComponent = () => { setTypesFilter(types)} - options={sortBy(Object.entries(groupAlertTypesByProducer())).map( - ([groupName, alertTypesOptions]) => ({ + options={sortBy(Object.entries(groupRuleTypesByProducer())).map( + ([groupName, ruleTypesOptions]) => ({ groupName: getProducerFeatureName(groupName) ?? capitalize(groupName), - subOptions: alertTypesOptions.sort((a, b) => a.name.localeCompare(b.name)), + subOptions: ruleTypesOptions.sort((a, b) => a.name.localeCompare(b.name)), }) )} />, @@ -823,63 +818,63 @@ export const AlertsList: React.FunctionComponent = () => { actionTypes={actionTypes} onChange={(ids: string[]) => setActionTypesFilter(ids)} />, - setAlertStatusesFilter(ids)} + setRuleStatusesFilter(ids)} />, , ]; - const authorizedToModifySelectedAlerts = selectedIds.length - ? filterAlertsById(alertsState.data, selectedIds).every((selectedAlert) => - hasAllPrivilege(selectedAlert, alertTypesState.data.get(selectedAlert.alertTypeId)) + const authorizedToModifySelectedRules = selectedIds.length + ? filterRulesById(rulesState.data, selectedIds).every((selectedRule) => + hasAllPrivilege(selectedRule, ruleTypesState.data.get(selectedRule.ruleTypeId)) ) : false; const table = ( <> - {selectedIds.length > 0 && authorizedToModifySelectedAlerts && ( + {selectedIds.length > 0 && authorizedToModifySelectedRules && ( - setIsPerformingAction(true)} onActionPerformed={() => { - loadAlertsData(); + loadRulesData(); setIsPerformingAction(false); }} - setAlertsToDelete={setAlertsToDelete} + setRulesToDelete={setRulesToDelete} /> )} - {authorizedToCreateAnyAlerts ? ( + {authorizedToCreateAnyRules ? ( setAlertFlyoutVisibility(true)} + onClick={() => setRuleFlyoutVisibility(true)} > @@ -889,7 +884,7 @@ export const AlertsList: React.FunctionComponent = () => { { setInputText(e.target.value); if (e.target.value === '') { @@ -902,7 +897,7 @@ export const AlertsList: React.FunctionComponent = () => { } }} placeholder={i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.searchPlaceholderTitle', + 'xpack.triggersActionsUI.sections.rulesList.searchPlaceholderTitle', { defaultMessage: 'Search' } )} /> @@ -918,7 +913,7 @@ export const AlertsList: React.FunctionComponent = () => { - {!dismissAlertErrors && alertsStatusesTotal.error > 0 ? ( + {!dismissRuleErrors && rulesStatusesTotal.error > 0 ? ( { size="s" title={ } - iconType="alert" - data-test-subj="alertsErrorBanner" + iconType="rule" + data-test-subj="rulesErrorBanner" > setAlertStatusesFilter(['error'])} + onClick={() => setRuleStatusesFilter(['error'])} > - setDismissAlertErrors(true)}> + setDismissRuleErrors(true)}> @@ -960,64 +955,64 @@ export const AlertsList: React.FunctionComponent = () => { - + - + - + - + - + - + @@ -1026,38 +1021,38 @@ export const AlertsList: React.FunctionComponent = () => { ({ - 'data-test-subj': 'alert-row', - className: !alertTypesState.data.get(item.alertTypeId)?.enabledInLicense - ? 'actAlertsList__tableRowDisabled' + rowProps={(item: RuleTableItem) => ({ + 'data-test-subj': 'rule-row', + className: !ruleTypesState.data.get(item.ruleTypeId)?.enabledInLicense + ? 'actRulesList__tableRowDisabled' : '', })} - cellProps={(item: AlertTableItem) => ({ + cellProps={(item: RuleTableItem) => ({ 'data-test-subj': 'cell', - className: !alertTypesState.data.get(item.alertTypeId)?.enabledInLicense - ? 'actAlertsList__tableCellDisabled' + className: !ruleTypesState.data.get(item.ruleTypeId)?.enabledInLicense + ? 'actRulesList__tableCellDisabled' : '', })} - data-test-subj="alertsList" + data-test-subj="rulesList" pagination={{ pageIndex: page.index, pageSize: page.size, - /* Don't display alert count until we have the alert types initialized */ - totalItemCount: alertTypesState.isInitialized === false ? 0 : alertsState.totalItemCount, + /* Don't display rule count until we have the rule types initialized */ + totalItemCount: ruleTypesState.isInitialized === false ? 0 : rulesState.totalItemCount, }} selection={{ - selectable: (alert: AlertTableItem) => alert.isEditable, - onSelectionChange(updatedSelectedItemsList: AlertTableItem[]) { + selectable: (rule: RuleTableItem) => rule.isEditable, + onSelectionChange(updatedSelectedItemsList: RuleTableItem[]) { setSelectedIds(updatedSelectedItemsList.map((item) => item.id)); }, }} @@ -1066,7 +1061,7 @@ export const AlertsList: React.FunctionComponent = () => { sort: changedSort, }: { page?: Pagination; - sort?: EuiTableSortingType['sort']; + sort?: EuiTableSortingType['sort']; }) => { if (changedPage) { setPage(changedPage); @@ -1079,7 +1074,7 @@ export const AlertsList: React.FunctionComponent = () => { {manageLicenseModalOpts && ( { window.open(`${http.basePath.get()}/app/management/stack/license_management`, '_blank'); setManageLicenseModalOpts(null); @@ -1092,9 +1087,9 @@ export const AlertsList: React.FunctionComponent = () => { // if initial load, show spinner const getRulesList = () => { - if (noData && !alertsState.isLoading && !alertTypesState.isLoading) { - return authorizedToCreateAnyAlerts ? ( - setAlertFlyoutVisibility(true)} /> + if (noData && !rulesState.isLoading && !ruleTypesState.isLoading) { + return authorizedToCreateAnyRules ? ( + setRuleFlyoutVisibility(true)} /> ) : ( noPermissionPrompt ); @@ -1108,59 +1103,59 @@ export const AlertsList: React.FunctionComponent = () => { }; return ( -
+
{ - setAlertsToDelete([]); + setRulesToDelete([]); setSelectedIds([]); - await loadAlertsData(); + await loadRulesData(); }} onErrors={async () => { - // Refresh the alerts from the server, some alerts may have beend deleted - await loadAlertsData(); - setAlertsToDelete([]); + // Refresh the rules from the server, some rules may have beend deleted + await loadRulesData(); + setRulesToDelete([]); }} onCancel={() => { - setAlertsToDelete([]); + setRulesToDelete([]); }} - apiDeleteCall={deleteAlerts} - idsToDelete={alertsToDelete} - singleTitle={i18n.translate('xpack.triggersActionsUI.sections.alertsList.singleTitle', { + apiDeleteCall={deleteRules} + idsToDelete={rulesToDelete} + singleTitle={i18n.translate('xpack.triggersActionsUI.sections.rulesList.singleTitle', { defaultMessage: 'rule', })} - multipleTitle={i18n.translate('xpack.triggersActionsUI.sections.alertsList.multipleTitle', { + multipleTitle={i18n.translate('xpack.triggersActionsUI.sections.rulesList.multipleTitle', { defaultMessage: 'rules', })} setIsLoadingState={(isLoading: boolean) => { - setAlertsState({ ...alertsState, isLoading }); + setRulesState({ ...rulesState, isLoading }); }} /> {getRulesList()} - {alertFlyoutVisible && ( - { - setAlertFlyoutVisibility(false); + setRuleFlyoutVisibility(false); }} actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} - ruleTypeIndex={alertTypesState.data} - onSave={loadAlertsData} + ruleTypeIndex={ruleTypesState.data} + onSave={loadRulesData} /> )} {editFlyoutVisible && currentRuleToEdit && ( - { setEditFlyoutVisibility(false); }} actionTypeRegistry={actionTypeRegistry} ruleTypeRegistry={ruleTypeRegistry} ruleType={ - alertTypesState.data.get(currentRuleToEdit.alertTypeId) as RuleType + ruleTypesState.data.get(currentRuleToEdit.ruleTypeId) as RuleType } - onSave={loadAlertsData} + onSave={loadRulesData} /> )}
@@ -1168,7 +1163,7 @@ export const AlertsList: React.FunctionComponent = () => { }; // eslint-disable-next-line import/no-default-export -export { AlertsList as default }; +export { RulesList as default }; const noPermissionPrompt = (
@@ -1184,7 +1179,7 @@ const noPermissionPrompt = ( body={

@@ -1192,23 +1187,23 @@ const noPermissionPrompt = ( /> ); -function filterAlertsById(alerts: Rule[], ids: string[]): Rule[] { - return alerts.filter((alert) => ids.includes(alert.id)); +function filterRulesById(rules: Rule[], ids: string[]): Rule[] { + return rules.filter((rule) => ids.includes(rule.id)); } -function convertAlertsToTableItems( - alerts: Rule[], +function convertRulesToTableItems( + rules: Rule[], ruleTypeIndex: RuleTypeIndex, canExecuteActions: boolean ) { - return alerts.map((alert, index: number) => ({ - ...alert, + return rules.map((rule, index: number) => ({ + ...rule, index, - actionsCount: alert.actions.length, - alertType: ruleTypeIndex.get(alert.alertTypeId)?.name ?? alert.alertTypeId, + actionsCount: rule.actions.length, + ruleType: ruleTypeIndex.get(rule.ruleTypeId)?.name ?? rule.ruleTypeId, isEditable: - hasAllPrivilege(alert, ruleTypeIndex.get(alert.alertTypeId)) && - (canExecuteActions || (!canExecuteActions && !alert.actions.length)), - enabledInLicense: !!ruleTypeIndex.get(alert.alertTypeId)?.enabledInLicense, + hasAllPrivilege(rule, ruleTypeIndex.get(rule.ruleTypeId)) && + (canExecuteActions || (!canExecuteActions && !rule.actions.length)), + enabledInLicense: !!ruleTypeIndex.get(rule.ruleTypeId)?.enabledInLicense, })); } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/type_filter.tsx similarity index 90% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/type_filter.tsx index 3351e903f7bcd..6ce697f65f898 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/type_filter.tsx @@ -52,10 +52,10 @@ export const TypeFilter: React.FunctionComponent = ({ numActiveFilters={selectedValues.length} numFilters={selectedValues.length} onClick={() => setIsPopoverOpen(!isPopoverOpen)} - data-test-subj="alertTypeFilterButton" + data-test-subj="ruleTypeFilterButton" > @@ -64,7 +64,7 @@ export const TypeFilter: React.FunctionComponent = ({
{options.map((groupItem, groupIndex) => ( - +

{groupItem.groupName}

{groupItem.subOptions.map((item, index) => ( @@ -79,7 +79,7 @@ export const TypeFilter: React.FunctionComponent = ({ } }} checked={selectedValues.includes(item.value) ? 'on' : undefined} - data-test-subj={`alertType${item.value}FilterOption`} + data-test-subj={`ruleType${item.value}FilterOption`} > {item.name} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/translations.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/translations.ts similarity index 68% rename from x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/translations.ts rename to x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/translations.ts index 293a5e79e29b2..cccfe6074b7c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/translations.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/translations.ts @@ -8,48 +8,48 @@ import { i18n } from '@kbn/i18n'; export const ALERT_STATUS_OK = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertStatusOk', + 'xpack.triggersActionsUI.sections.rulesList.ruleStatusOk', { defaultMessage: 'Ok', } ); export const ALERT_STATUS_ACTIVE = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertStatusActive', + 'xpack.triggersActionsUI.sections.rulesList.ruleStatusActive', { defaultMessage: 'Active', } ); export const ALERT_STATUS_ERROR = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertStatusError', + 'xpack.triggersActionsUI.sections.rulesList.ruleStatusError', { defaultMessage: 'Error', } ); export const ALERT_STATUS_LICENSE_ERROR = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertStatusLicenseError', + 'xpack.triggersActionsUI.sections.rulesList.ruleStatusLicenseError', { defaultMessage: 'License Error', } ); export const ALERT_STATUS_PENDING = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertStatusPending', + 'xpack.triggersActionsUI.sections.rulesList.ruleStatusPending', { defaultMessage: 'Pending', } ); export const ALERT_STATUS_UNKNOWN = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertStatusUnknown', + 'xpack.triggersActionsUI.sections.rulesList.ruleStatusUnknown', { defaultMessage: 'Unknown', } ); -export const alertsStatusesTranslationsMapping = { +export const rulesStatusesTranslationsMapping = { ok: ALERT_STATUS_OK, active: ALERT_STATUS_ACTIVE, error: ALERT_STATUS_ERROR, @@ -58,55 +58,55 @@ export const alertsStatusesTranslationsMapping = { }; export const ALERT_ERROR_UNKNOWN_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonUnknown', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonUnknown', { defaultMessage: 'An error occurred for unknown reasons.', } ); export const ALERT_ERROR_READING_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonReading', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonReading', { defaultMessage: 'An error occurred when reading the rule.', } ); export const ALERT_ERROR_DECRYPTING_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonDecrypting', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonDecrypting', { defaultMessage: 'An error occurred when decrypting the rule.', } ); export const ALERT_ERROR_EXECUTION_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonRunning', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonRunning', { defaultMessage: 'An error occurred when running the rule.', } ); export const ALERT_ERROR_LICENSE_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonLicense', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonLicense', { defaultMessage: 'Cannot run rule', } ); export const ALERT_ERROR_TIMEOUT_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonTimeout', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonTimeout', { defaultMessage: 'Rule execution cancelled due to timeout.', } ); export const ALERT_ERROR_DISABLED_REASON = i18n.translate( - 'xpack.triggersActionsUI.sections.alertsList.alertErrorReasonDisabled', + 'xpack.triggersActionsUI.sections.rulesList.ruleErrorReasonDisabled', { defaultMessage: 'Rule failed to execute because rule ran after it was disabled.', } ); -export const alertsErrorReasonTranslationsMapping = { +export const rulesErrorReasonTranslationsMapping = { read: ALERT_ERROR_READING_REASON, decrypt: ALERT_ERROR_DECRYPTING_REASON, execute: ALERT_ERROR_EXECUTION_REASON, diff --git a/x-pack/plugins/triggers_actions_ui/public/common/get_add_alert_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/common/get_add_alert_flyout.tsx index 2698f4ee2e428..85735a7854d3f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/get_add_alert_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/get_add_alert_flyout.tsx @@ -6,9 +6,9 @@ */ import React from 'react'; -import { AlertAdd } from '../application/sections/alert_form'; -import type { AlertAddProps } from '../types'; +import { RuleAdd } from '../application/sections/rule_form'; +import type { RuleAddProps as AlertAddProps } from '../types'; export const getAddAlertFlyoutLazy = (props: AlertAddProps) => { - return ; + return ; }; diff --git a/x-pack/plugins/triggers_actions_ui/public/common/get_edit_alert_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/common/get_edit_alert_flyout.tsx index 26cc1159e5afd..58bdc43e15377 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/get_edit_alert_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/get_edit_alert_flyout.tsx @@ -6,9 +6,9 @@ */ import React from 'react'; -import { AlertEdit } from '../application/sections/alert_form'; -import type { AlertEditProps } from '../types'; +import { RuleEdit } from '../application/sections/rule_form'; +import type { RuleEditProps as AlertEditProps } from '../types'; export const getEditAlertFlyoutLazy = (props: AlertEditProps) => { - return ; + return ; }; diff --git a/x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts b/x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts index e9f6a2a38b513..072684de68b3e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/common/index_controls/index.ts @@ -91,7 +91,7 @@ export const getFields = async (http: HttpSetup, indexes: string[]) => { export const firstFieldOption = { text: i18n.translate( - 'xpack.triggersActionsUI.sections.alertAdd.indexControls.timeFieldOptionLabel', + 'xpack.triggersActionsUI.sections.ruleAdd.indexControls.timeFieldOptionLabel', { defaultMessage: 'Select a field', } diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/config_api.test.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/config_api.test.ts new file mode 100644 index 0000000000000..28563730c3db7 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/config_api.test.ts @@ -0,0 +1,25 @@ +/* + * 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 { httpServiceMock } from 'src/core/public/mocks'; +import { triggersActionsUiConfig } from './config_api'; + +describe('triggersActionsUiConfig', () => { + const http = httpServiceMock.createStartContract(); + + test('should call triggersActionsUiConfig API', async () => { + const result = await triggersActionsUiConfig({ http }); + expect(result).toEqual(undefined); + expect(http.get.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "/api/triggers_actions_ui/_config", + ], + ] + `); + }); +}); diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/config_api.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/config_api.ts new file mode 100644 index 0000000000000..aa0321ef8346b --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/config_api.ts @@ -0,0 +1,13 @@ +/* + * 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 { HttpSetup } from 'kibana/public'; +import { BASE_TRIGGERS_ACTIONS_UI_API_PATH } from '../../../common'; + +export async function triggersActionsUiConfig({ http }: { http: HttpSetup }): Promise { + return await http.get(`${BASE_TRIGGERS_ACTIONS_UI_API_PATH}/_config`); +} diff --git a/x-pack/plugins/triggers_actions_ui/public/common/lib/health_api.ts b/x-pack/plugins/triggers_actions_ui/public/common/lib/health_api.ts index 74c6fe76ba289..55db8164bae14 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/lib/health_api.ts +++ b/x-pack/plugins/triggers_actions_ui/public/common/lib/health_api.ts @@ -6,9 +6,28 @@ */ import { HttpSetup } from 'kibana/public'; +import { BASE_TRIGGERS_ACTIONS_UI_API_PATH } from '../../../common'; -const TRIGGERS_ACTIONS_UI_API_ROOT = '/api/triggers_actions_ui'; +interface TriggersActionsUiHealth { + isRulesAvailable: boolean; +} + +interface TriggersActionsServerHealth { + isAlertsAvailable: boolean; +} -export async function triggersActionsUiHealth({ http }: { http: HttpSetup }): Promise { - return await http.get(`${TRIGGERS_ACTIONS_UI_API_ROOT}/_health`); +export async function triggersActionsUiHealth({ + http, +}: { + http: HttpSetup; +}): Promise { + const result = await http.get( + `${BASE_TRIGGERS_ACTIONS_UI_API_PATH}/_health` + ); + if (result) { + return { + isRulesAvailable: result.isAlertsAvailable, + }; + } + return result; } diff --git a/x-pack/plugins/triggers_actions_ui/public/index.ts b/x-pack/plugins/triggers_actions_ui/public/index.ts index 67b1518a4b8e2..36ac247cf5c7e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/index.ts @@ -11,7 +11,7 @@ import { Plugin } from './plugin'; export type { - AlertAction, + RuleAction, Rule, RuleTypeModel, ActionType, @@ -22,7 +22,7 @@ export type { ActionVariables, ActionConnector, IErrorObject, - AlertFlyoutCloseReason, + RuleFlyoutCloseReason, RuleTypeParams, AsApiContract, } from './types'; @@ -45,7 +45,7 @@ export function plugin() { export { Plugin }; export * from './plugin'; -export { loadAlertAggregations } from './application/lib/alert_api/aggregate'; +export { loadRuleAggregations } from './application/lib/rule_api/aggregate'; export { loadActionTypes } from './application/lib/action_connector_api/connector_types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/mocks.ts b/x-pack/plugins/triggers_actions_ui/public/mocks.ts index 0ef528ed921a3..7a0420594118b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/mocks.ts +++ b/x-pack/plugins/triggers_actions_ui/public/mocks.ts @@ -15,8 +15,8 @@ import { getEditAlertFlyoutLazy } from './common/get_edit_alert_flyout'; import { TypeRegistry } from './application/type_registry'; import { ActionTypeModel, - AlertAddProps, - AlertEditProps, + RuleAddProps, + RuleEditProps, RuleTypeModel, ConnectorAddFlyoutProps, ConnectorEditFlyoutProps, @@ -37,16 +37,14 @@ function createStartMock(): TriggersAndActionsUIPublicPluginStart { actionTypeRegistry, }); }, - getAddAlertFlyout: (props: Omit) => { + getAddAlertFlyout: (props: Omit) => { return getAddAlertFlyoutLazy({ ...props, actionTypeRegistry, ruleTypeRegistry, }); }, - getEditAlertFlyout: ( - props: Omit - ) => { + getEditAlertFlyout: (props: Omit) => { return getEditAlertFlyoutLazy({ ...props, actionTypeRegistry, diff --git a/x-pack/plugins/triggers_actions_ui/public/plugin.ts b/x-pack/plugins/triggers_actions_ui/public/plugin.ts index 12ea42b6c6bf0..e11a1d7e61a1d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/plugin.ts +++ b/x-pack/plugins/triggers_actions_ui/public/plugin.ts @@ -34,8 +34,8 @@ import { getEditAlertFlyoutLazy } from './common/get_edit_alert_flyout'; import type { ActionTypeModel, - AlertAddProps, - AlertEditProps, + RuleAddProps, + RuleEditProps, RuleTypeModel, ConnectorAddFlyoutProps, ConnectorEditFlyoutProps, @@ -56,11 +56,11 @@ export interface TriggersAndActionsUIPublicPluginStart { props: Omit ) => ReactElement; getAddAlertFlyout: ( - props: Omit - ) => ReactElement; + props: Omit + ) => ReactElement; getEditAlertFlyout: ( - props: Omit - ) => ReactElement; + props: Omit + ) => ReactElement; } interface PluginsSetup { @@ -186,9 +186,7 @@ export class Plugin actionTypeRegistry: this.actionTypeRegistry, }); }, - getAddAlertFlyout: ( - props: Omit - ) => { + getAddAlertFlyout: (props: Omit) => { return getAddAlertFlyoutLazy({ ...props, actionTypeRegistry: this.actionTypeRegistry, @@ -196,7 +194,7 @@ export class Plugin }); }, getEditAlertFlyout: ( - props: Omit + props: Omit ) => { return getEditAlertFlyoutLazy({ ...props, diff --git a/x-pack/plugins/triggers_actions_ui/public/types.ts b/x-pack/plugins/triggers_actions_ui/public/types.ts index 67c2da627bf39..d4658c3e3f5a5 100644 --- a/x-pack/plugins/triggers_actions_ui/public/types.ts +++ b/x-pack/plugins/triggers_actions_ui/public/types.ts @@ -23,17 +23,17 @@ import { TypeRegistry } from './application/type_registry'; import { ActionGroup, AlertActionParam, - SanitizedAlert as SanitizedRule, + SanitizedAlert, ResolvedSanitizedRule, - AlertAction, + AlertAction as RuleAction, AlertAggregations, RuleTaskState, - AlertSummary, + AlertSummary as RuleSummary, ExecutionDuration, AlertStatus, RawAlertInstance, AlertingFrameworkHealth, - AlertNotifyWhenType, + AlertNotifyWhenType as RuleNotifyWhenType, AlertTypeParams as RuleTypeParams, ActionVariable, RuleType as CommonRuleType, @@ -41,22 +41,34 @@ import { // In Triggers and Actions we treat all `Alert`s as `SanitizedRule` // so the `Params` is a black-box of Record -type Rule = SanitizedRule; -type ResolvedRule = ResolvedSanitizedRule; +type SanitizedRule = Omit< + SanitizedAlert, + 'alertTypeId' +> & { + ruleTypeId: SanitizedAlert['alertTypeId']; +}; +type Rule = SanitizedRule; +type ResolvedRule = Omit, 'alertTypeId'> & { + ruleTypeId: ResolvedSanitizedRule['alertTypeId']; +}; +type RuleAggregations = Omit & { + ruleExecutionStatus: AlertAggregations['alertExecutionStatus']; +}; export type { Rule, - AlertAction, - AlertAggregations, + RuleAction, + RuleAggregations, RuleTaskState, - AlertSummary, + RuleSummary, ExecutionDuration, AlertStatus, RawAlertInstance, AlertingFrameworkHealth, - AlertNotifyWhenType, + RuleNotifyWhenType, RuleTypeParams, ResolvedRule, + SanitizedRule, }; export type { ActionType, AsApiContract }; export { @@ -93,7 +105,7 @@ export interface ActionConnectorFieldsProps { isEdit: boolean; } -export enum AlertFlyoutCloseReason { +export enum RuleFlyoutCloseReason { SAVED, CANCELED, } @@ -222,7 +234,6 @@ export interface RuleType< | 'defaultActionGroupId' | 'ruleTaskTimeout' | 'defaultScheduleInterval' - | 'minimumScheduleInterval' | 'doesSetRecoveryContext' > { actionVariables: ActionVariables; @@ -232,10 +243,10 @@ export interface RuleType< export type SanitizedRuleType = Omit; -export type AlertUpdates = Omit; +export type RuleUpdates = Omit; -export interface AlertTableItem extends Rule { - alertType: RuleType['name']; +export interface RuleTableItem extends Rule { + ruleType: RuleType['name']; index: number; actionsCount: number; isEditable: boolean; @@ -250,7 +261,7 @@ export interface RuleTypeParamsExpressionProps< ruleParams: Params; ruleInterval: string; ruleThrottle: string; - alertNotifyWhen: AlertNotifyWhenType; + alertNotifyWhen: RuleNotifyWhenType; setRuleParams: (property: Key, value: Params[Key] | undefined) => void; setRuleProperty: ( key: Prop, @@ -303,28 +314,28 @@ export interface ConnectorEditFlyoutProps { actionTypeRegistry: ActionTypeRegistryContract; } -export interface AlertEditProps> { - initialAlert: Rule; +export interface RuleEditProps> { + initialRule: Rule; ruleTypeRegistry: RuleTypeRegistryContract; actionTypeRegistry: ActionTypeRegistryContract; - onClose: (reason: AlertFlyoutCloseReason) => void; + onClose: (reason: RuleFlyoutCloseReason) => void; /** @deprecated use `onSave` as a callback after an alert is saved*/ - reloadAlerts?: () => Promise; + reloadRules?: () => Promise; onSave?: () => Promise; metadata?: MetaData; ruleType?: RuleType; } -export interface AlertAddProps> { +export interface RuleAddProps> { consumer: string; ruleTypeRegistry: RuleTypeRegistryContract; actionTypeRegistry: ActionTypeRegistryContract; - onClose: (reason: AlertFlyoutCloseReason) => void; - alertTypeId?: string; + onClose: (reason: RuleFlyoutCloseReason) => void; + ruleTypeId?: string; canChangeTrigger?: boolean; initialValues?: Partial; /** @deprecated use `onSave` as a callback after an alert is saved*/ - reloadAlerts?: () => Promise; + reloadRules?: () => Promise; onSave?: () => Promise; metadata?: MetaData; ruleTypeIndex?: RuleTypeIndex; @@ -335,3 +346,7 @@ export enum Percentiles { P95 = 'P95', P99 = 'P99', } + +export interface TriggersActionsUiConfig { + minimumScheduleInterval?: string; +} diff --git a/x-pack/plugins/triggers_actions_ui/server/plugin.ts b/x-pack/plugins/triggers_actions_ui/server/plugin.ts index a5751c1a8abf0..c33ce21777782 100644 --- a/x-pack/plugins/triggers_actions_ui/server/plugin.ts +++ b/x-pack/plugins/triggers_actions_ui/server/plugin.ts @@ -6,19 +6,19 @@ */ import { Logger, Plugin, CoreSetup, PluginInitializerContext } from 'src/core/server'; -import { PluginSetupContract as AlertsPluginSetup } from '../../alerting/server'; +import { PluginSetupContract as AlertingPluginSetup } from '../../alerting/server'; import { EncryptedSavedObjectsPluginSetup } from '../../encrypted_saved_objects/server'; import { getService, register as registerDataService } from './data'; -import { createHealthRoute } from './routes/health'; +import { createHealthRoute, createConfigRoute } from './routes'; +import { BASE_TRIGGERS_ACTIONS_UI_API_PATH } from '../common'; -const BASE_ROUTE = '/api/triggers_actions_ui'; export interface PluginStartContract { data: ReturnType; } interface PluginsSetup { encryptedSavedObjects?: EncryptedSavedObjectsPluginSetup; - alerting?: AlertsPluginSetup; + alerting?: AlertingPluginSetup; } export class TriggersActionsPlugin implements Plugin { @@ -36,10 +36,21 @@ export class TriggersActionsPlugin implements Plugin logger: this.logger, data: this.data, router, - baseRoute: BASE_ROUTE, + baseRoute: BASE_TRIGGERS_ACTIONS_UI_API_PATH, }); - createHealthRoute(this.logger, router, BASE_ROUTE, plugins.alerting !== undefined); + createHealthRoute( + this.logger, + router, + BASE_TRIGGERS_ACTIONS_UI_API_PATH, + plugins.alerting !== undefined + ); + createConfigRoute( + this.logger, + router, + BASE_TRIGGERS_ACTIONS_UI_API_PATH, + plugins.alerting?.getConfig() + ); } public start(): PluginStartContract { diff --git a/x-pack/plugins/triggers_actions_ui/server/routes/config.test.ts b/x-pack/plugins/triggers_actions_ui/server/routes/config.test.ts new file mode 100644 index 0000000000000..a7e1772ddabc7 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/server/routes/config.test.ts @@ -0,0 +1,30 @@ +/* + * 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 { httpServiceMock, httpServerMock, loggingSystemMock } from 'src/core/server/mocks'; +import { createConfigRoute } from './config'; + +describe('createConfigRoute', () => { + it('registers the route', async () => { + const router = httpServiceMock.createRouter(); + const logger = loggingSystemMock.create().get(); + createConfigRoute(logger, router, `/api/triggers_actions_ui`, { + minimumScheduleInterval: '1m', + }); + + const [config, handler] = router.get.mock.calls[0]; + expect(config.path).toMatchInlineSnapshot(`"/api/triggers_actions_ui/_config"`); + + const mockResponse = httpServerMock.createResponseFactory(); + await handler({}, httpServerMock.createKibanaRequest(), mockResponse); + + expect(mockResponse.ok).toBeCalled(); + expect(mockResponse.ok.mock.calls[0][0]).toEqual({ + body: { minimumScheduleInterval: '1m' }, + }); + }); +}); diff --git a/x-pack/plugins/triggers_actions_ui/server/routes/config.ts b/x-pack/plugins/triggers_actions_ui/server/routes/config.ts new file mode 100644 index 0000000000000..d10651c4c252a --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/server/routes/config.ts @@ -0,0 +1,40 @@ +/* + * 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 { + IRouter, + RequestHandlerContext, + KibanaRequest, + IKibanaResponse, + KibanaResponseFactory, +} from 'kibana/server'; +import { Logger } from '../../../../../src/core/server'; +import { PublicAlertingConfig } from '../../../alerting/server'; + +export function createConfigRoute( + logger: Logger, + router: IRouter, + baseRoute: string, + config?: PublicAlertingConfig +) { + const path = `${baseRoute}/_config`; + logger.debug(`registering triggers_actions_ui config route GET ${path}`); + router.get( + { + path, + validate: false, + }, + handler + ); + async function handler( + ctx: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise { + return res.ok({ body: config ?? {} }); + } +} diff --git a/x-pack/plugins/triggers_actions_ui/server/routes/index.ts b/x-pack/plugins/triggers_actions_ui/server/routes/index.ts new file mode 100644 index 0000000000000..145b72ebb34fb --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/server/routes/index.ts @@ -0,0 +1,8 @@ +/* + * 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 { createHealthRoute } from './health'; +export { createConfigRoute } from './config'; diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index ac36780f10c01..38d3fa9ad5996 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -17,6 +17,7 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../features/tsconfig.json" }, + { "path": "../rule_registry/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/saved_objects/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts index 0c31a5b8d2fe5..69584dd75de7d 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts @@ -36,11 +36,11 @@ describe('transformFlatSettings', () => { transformFlatSettings({ settings: { // Settings that should get preserved + // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.number_of_replicas': '1', 'index.number_of_shards': '5', // Blacklisted settings - // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.allocation.existing_shards_allocator': 'gateway_allocator', 'index.blocks.write': 'true', 'index.creation_date': '1547052614626', @@ -87,11 +87,11 @@ describe('transformFlatSettings', () => { transformFlatSettings({ settings: { // Settings that should get preserved + // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.number_of_replicas': '1', 'index.number_of_shards': '5', // Deprecated settings - // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.soft_deletes.enabled': 'true', 'index.translog.retention.size': '5b', }, @@ -111,11 +111,11 @@ describe('transformFlatSettings', () => { transformFlatSettings({ settings: { // Settings that should get preserved + // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.number_of_replicas': '1', 'index.number_of_shards': '5', // Deprecated settings - // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.soft_deletes.enabled': 'true', 'index.translog.retention.age': '5d', }, @@ -245,6 +245,7 @@ describe('transformFlatSettings', () => { expect( getReindexWarnings({ settings: { + // @ts-expect-error @elastic/elasticsearch doesn't declare it 'index.number_of_replicas': '1', }, mappings: {}, diff --git a/x-pack/plugins/upgrade_assistant/server/routes/cloud_backup_status.ts b/x-pack/plugins/upgrade_assistant/server/routes/cloud_backup_status.ts index b757602c6ab53..6dffead8ec91f 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/cloud_backup_status.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/cloud_backup_status.ts @@ -24,7 +24,6 @@ export function registerCloudBackupStatusRoutes({ repository: CLOUD_SNAPSHOT_REPOSITORY, snapshot: '_all', ignore_unavailable: true, // Allow request to succeed even if some snapshots are unavailable. - // @ts-expect-error @elastic/elasticsearch "desc" is a new param order: 'desc', sort: 'start_time', size: 1, diff --git a/x-pack/plugins/uptime/e2e/journeys/alerts/status_alert_flyouts_in_alerting_app.ts b/x-pack/plugins/uptime/e2e/journeys/alerts/status_alert_flyouts_in_alerting_app.ts index ba973a7aa8a61..859954364f9d3 100644 --- a/x-pack/plugins/uptime/e2e/journeys/alerts/status_alert_flyouts_in_alerting_app.ts +++ b/x-pack/plugins/uptime/e2e/journeys/alerts/status_alert_flyouts_in_alerting_app.ts @@ -23,7 +23,7 @@ journey('StatusFlyoutInAlertingApp', async ({ page, params }) => { }); step('Open monitor status flyout', async () => { - await page.click(byTestId('createFirstAlertButton')); + await page.click(byTestId('createFirstRuleButton')); await waitForLoadingToFinish({ page }); await page.click(byTestId('"xpack.uptime.alerts.monitorStatus-SelectOption"')); await waitForLoadingToFinish({ page }); @@ -54,7 +54,7 @@ journey('StatusFlyoutInAlertingApp', async ({ page, params }) => { }); step('Open tls alert flyout', async () => { - await page.click(byTestId('createFirstAlertButton')); + await page.click(byTestId('createFirstRuleButton')); await waitForLoadingToFinish({ page }); await page.click(byTestId('"xpack.uptime.alerts.tlsCertificate-SelectOption"')); await waitForLoadingToFinish({ page }); diff --git a/x-pack/plugins/uptime/e2e/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts b/x-pack/plugins/uptime/e2e/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts index 024e8e53c3b2a..d8b53f9f3c89f 100644 --- a/x-pack/plugins/uptime/e2e/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts +++ b/x-pack/plugins/uptime/e2e/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts @@ -23,7 +23,7 @@ journey('TlsFlyoutInAlertingApp', async ({ page, params }) => { }); step('Open tls alert flyout', async () => { - await page.click(byTestId('createFirstAlertButton')); + await page.click(byTestId('createFirstRuleButton')); await waitForLoadingToFinish({ page }); await page.click(byTestId('"xpack.uptime.alerts.tlsCertificate-SelectOption"')); await waitForLoadingToFinish({ page }); diff --git a/x-pack/plugins/uptime/e2e/journeys/monitor_details/monitor_alerts.journey.ts b/x-pack/plugins/uptime/e2e/journeys/monitor_details/monitor_alerts.journey.ts index c44dbc187bd53..565dcc56cc983 100644 --- a/x-pack/plugins/uptime/e2e/journeys/monitor_details/monitor_alerts.journey.ts +++ b/x-pack/plugins/uptime/e2e/journeys/monitor_details/monitor_alerts.journey.ts @@ -66,7 +66,7 @@ journey('MonitorAlerts', async ({ page, params }: { page: Page; params: any }) = }); step('close anomaly detection flyout', async () => { - await page.click(byTestId('cancelSaveAlertButton')); + await page.click(byTestId('cancelSaveRuleButton')); }); step('open anomaly detection alert', async () => { @@ -80,7 +80,7 @@ journey('MonitorAlerts', async ({ page, params }: { page: Page; params: any }) = }); step('save anomaly detection alert', async () => { - await page.click(byTestId('saveAlertButton')); + await page.click(byTestId('saveRuleButton')); await page.click(byTestId('confirmModalConfirmButton')); await page.waitForSelector(`text=Created rule "${alertId}"`); }); diff --git a/x-pack/plugins/uptime/e2e/page_objects/monitor_details.tsx b/x-pack/plugins/uptime/e2e/page_objects/monitor_details.tsx index efadc26a383c0..7cce2c061fa82 100644 --- a/x-pack/plugins/uptime/e2e/page_objects/monitor_details.tsx +++ b/x-pack/plugins/uptime/e2e/page_objects/monitor_details.tsx @@ -99,7 +99,7 @@ export function monitorDetailsPageProvider({ page, kibanaUrl }: { page: Page; ki }, async updateAlert({ id, threshold }: AlertType) { - await this.fillByTestSubj('alertNameInput', id); + await this.fillByTestSubj('ruleNameInput', id); await this.selectAlertThreshold(threshold); }, diff --git a/x-pack/plugins/uptime/public/components/common/alerts/uptime_edit_alert_flyout.tsx b/x-pack/plugins/uptime/public/components/common/alerts/uptime_edit_alert_flyout.tsx index fbad21cbfaed5..a12589cc74971 100644 --- a/x-pack/plugins/uptime/public/components/common/alerts/uptime_edit_alert_flyout.tsx +++ b/x-pack/plugins/uptime/public/components/common/alerts/uptime_edit_alert_flyout.tsx @@ -7,14 +7,15 @@ import React, { useMemo } from 'react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; -import { +import type { Rule, TriggersAndActionsUIPublicPluginStart, } from '../../../../../triggers_actions_ui/public'; +import { UptimeAlertTypeParams } from '../../../state/alerts/alerts'; interface Props { alertFlyoutVisible: boolean; - initialAlert: Rule; + initialAlert: Rule; setAlertFlyoutVisibility: React.Dispatch>; } @@ -32,7 +33,7 @@ export const UptimeEditAlertFlyoutComponent = ({ const EditAlertFlyout = useMemo( () => triggersActionsUi.getEditAlertFlyout({ - initialAlert, + initialRule: initialAlert, onClose: () => { setAlertFlyoutVisibility(false); }, diff --git a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.test.tsx b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.test.tsx index e79150a4eb79e..ec58ac7ee5010 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.test.tsx @@ -15,7 +15,7 @@ describe('', () => { const onUpdate = jest.fn(); it('navigates to edit monitor flow on edit pencil', () => { - render(); + render(); expect(screen.getByLabelText('Edit monitor')).toHaveAttribute( 'href', diff --git a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.tsx b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.tsx index 5fa29b7cd7c56..9d84263f3701e 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/actions.tsx @@ -13,11 +13,12 @@ import { DeleteMonitor } from './delete_monitor'; interface Props { id: string; + name: string; isDisabled?: boolean; onUpdate: () => void; } -export const Actions = ({ id, onUpdate, isDisabled }: Props) => { +export const Actions = ({ id, name, onUpdate, isDisabled }: Props) => { const { basePath } = useContext(UptimeSettingsContext); return ( @@ -32,7 +33,7 @@ export const Actions = ({ id, onUpdate, isDisabled }: Props) => { /> - + ); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.test.tsx b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.test.tsx index a5c712b6e0456..2e69196c86cff 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.test.tsx @@ -26,7 +26,7 @@ describe('', () => { useFetcher.mockImplementation(originalUseFetcher); const deleteMonitor = jest.spyOn(fetchers, 'deleteMonitor'); const id = 'test-id'; - render(); + render(); expect(deleteMonitor).not.toBeCalled(); @@ -39,7 +39,8 @@ describe('', () => { it('calls set refresh when deletion is successful', () => { const id = 'test-id'; - render(); + const name = 'sample monitor'; + render(); userEvent.click(screen.getByLabelText('Delete monitor')); @@ -53,7 +54,7 @@ describe('', () => { status: FETCH_STATUS.LOADING, refetch: () => {}, }); - render(); + render(); expect(screen.getByLabelText('Deleting monitor...')).toBeInTheDocument(); }); diff --git a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.tsx b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.tsx index e0b706241b79a..88bace104adac 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/delete_monitor.tsx @@ -16,10 +16,12 @@ import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/publ export const DeleteMonitor = ({ id, + name, onUpdate, isDisabled, }: { id: string; + name: string; isDisabled?: boolean; onUpdate: () => void; }) => { @@ -70,7 +72,7 @@ export const DeleteMonitor = ({ const destroyModal = ( setIsDeleteModalVisible(false)} onConfirm={onConfirmDelete} cancelButtonText={NO_LABEL} @@ -103,16 +105,17 @@ export const DeleteMonitor = ({ const DELETE_DESCRIPTION_LABEL = i18n.translate( 'xpack.uptime.monitorManagement.confirmDescriptionLabel', { - defaultMessage: 'Are you sure you want to do delete the monitor?', + defaultMessage: + 'This action will delete the monitor but keep any data collected. This action cannot be undone.', } ); const YES_LABEL = i18n.translate('xpack.uptime.monitorManagement.yesLabel', { - defaultMessage: 'Yes', + defaultMessage: 'Delete', }); const NO_LABEL = i18n.translate('xpack.uptime.monitorManagement.noLabel', { - defaultMessage: 'No', + defaultMessage: 'Cancel', }); const DELETE_MONITOR_LABEL = i18n.translate('xpack.uptime.monitorManagement.deleteMonitorLabel', { diff --git a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/monitor_list.tsx index a222070b5d9d1..5d18fdcaca6fe 100644 --- a/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_management/monitor_list/monitor_list.tsx @@ -179,11 +179,17 @@ export const MonitorManagementList = ({ }, { align: 'left' as const, - field: 'id', name: i18n.translate('xpack.uptime.monitorManagement.monitorList.actions', { defaultMessage: 'Actions', }), - render: (id: string) => , + render: (fields: SyntheticsMonitorWithId) => ( + + ), }, ] as Array>; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx index 459f73a78ad8b..cf3a9d0800aea 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx @@ -34,7 +34,7 @@ export const UptimeAlertsFlyoutWrapperComponent = ({ triggersActionsUi.getAddAlertFlyout({ consumer: 'uptime', onClose: onCloseAlertFlyout, - alertTypeId, + ruleTypeId: alertTypeId, canChangeTrigger: !alertTypeId, }), // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx b/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx index 3d51051d28fe5..e35234aab54b0 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx @@ -13,16 +13,16 @@ import type { CoreTheme } from 'kibana/public'; import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; import { RedirectAppLinks, toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; import { ActionConnector } from '../../state/alerts/alerts'; -import { Alert } from '../../../../alerting/common'; import { kibanaService } from '../../state/kibana_service'; import { getUrlForAlert } from './common'; +import type { Rule } from '../../../../triggers_actions_ui/public'; export const simpleAlertEnabled = ( defaultActions: ActionConnector[], theme$: Observable, - alert: Alert + rule: Rule ) => { - const alertUrl = getUrlForAlert(alert.id, kibanaService.core.http.basePath.get()); + const alertUrl = getUrlForAlert(rule.id, kibanaService.core.http.basePath.get()); return { title: i18n.translate('xpack.uptime.overview.alerts.enabled.success', { diff --git a/x-pack/plugins/uptime/public/state/actions/types.ts b/x-pack/plugins/uptime/public/state/actions/types.ts index 70c92d825adde..13072c1b884e1 100644 --- a/x-pack/plugins/uptime/public/state/actions/types.ts +++ b/x-pack/plugins/uptime/public/state/actions/types.ts @@ -7,7 +7,7 @@ import { Action } from 'redux-actions'; import { IHttpFetchError } from 'src/core/public'; -import { Alert } from '../../../../alerting/common'; +import type { Rule } from '../../../../triggers_actions_ui/public'; import { UptimeAlertTypeParams } from '../alerts/alerts'; export interface AsyncAction { @@ -63,5 +63,5 @@ export interface AlertsResult { page: number; perPage: number; total: number; - data: Array>; + data: Array>; } diff --git a/x-pack/plugins/uptime/public/state/alerts/alerts.ts b/x-pack/plugins/uptime/public/state/alerts/alerts.ts index c33bb7bde01b8..757ee2acec0bd 100644 --- a/x-pack/plugins/uptime/public/state/alerts/alerts.ts +++ b/x-pack/plugins/uptime/public/state/alerts/alerts.ts @@ -21,8 +21,10 @@ import { fetchMonitorAlertRecords, NewAlertParams, } from '../api/alerts'; -import { ActionConnector as RawActionConnector } from '../../../../triggers_actions_ui/public'; -import { Alert } from '../../../../alerting/common'; +import type { + ActionConnector as RawActionConnector, + Rule, +} from '../../../../triggers_actions_ui/public'; import { kibanaService } from '../kibana_service'; import { monitorIdSelector } from '../selectors'; import { AlertsResult, MonitorIdParam } from '../actions/types'; @@ -37,15 +39,14 @@ export type UptimeAlertTypeParams = Record; export const createAlertAction = createAsyncAction< NewAlertParams, - Alert | null + Rule | null >('CREATE ALERT'); export const getConnectorsAction = createAsyncAction<{}, ActionConnector[]>('GET CONNECTORS'); export const getMonitorAlertsAction = createAsyncAction<{}, AlertsResult | null>('GET ALERTS'); -export const getAnomalyAlertAction = createAsyncAction< - MonitorIdParam, - Alert ->('GET EXISTING ALERTS'); +export const getAnomalyAlertAction = createAsyncAction>( + 'GET EXISTING ALERTS' +); export const deleteAlertAction = createAsyncAction<{ alertId: string }, string | null>( 'DELETE ALERTS' ); @@ -55,9 +56,9 @@ export const deleteAnomalyAlertAction = createAsyncAction<{ alertId: string }, a export interface AlertState { connectors: AsyncInitState; - newAlert: AsyncInitState>; + newAlert: AsyncInitState>; alerts: AsyncInitState; - anomalyAlert: AsyncInitState>; + anomalyAlert: AsyncInitState>; alertDeletion: AsyncInitState; anomalyAlertDeletion: AsyncInitState; } @@ -147,7 +148,7 @@ export function* fetchAlertsEffect() { ); yield takeLatest(createAlertAction.get, function* (action: Action): Generator { try { - const response = (yield call(createAlert, action.payload)) as Alert; + const response = (yield call(createAlert, action.payload)) as Rule; yield put(createAlertAction.success(response)); kibanaService.core.notifications.toasts.addSuccess( diff --git a/x-pack/plugins/uptime/public/state/api/alert_actions.ts b/x-pack/plugins/uptime/public/state/api/alert_actions.ts index 0e29300f02a65..93a19cedc6001 100644 --- a/x-pack/plugins/uptime/public/state/api/alert_actions.ts +++ b/x-pack/plugins/uptime/public/state/api/alert_actions.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { NewAlertParams } from './alerts'; -import { AlertAction } from '../../../../triggers_actions_ui/public'; +import { RuleAction as RuleActionOrig } from '../../../../triggers_actions_ui/public'; import { ACTION_GROUP_DEFINITIONS } from '../../../common/constants/alerts'; import { MonitorStatusTranslations } from '../../../common/translations'; import { @@ -36,7 +36,7 @@ export const EMAIL_ACTION_ID: ActionTypeId = '.email'; const { MONITOR_STATUS } = ACTION_GROUP_DEFINITIONS; -export type RuleAction = Omit; +export type RuleAction = Omit; const getRecoveryMessage = (selectedMonitor: Ping) => { return i18n.translate('xpack.uptime.alerts.monitorStatus.recoveryMessage', { diff --git a/x-pack/plugins/uptime/public/state/api/alerts.ts b/x-pack/plugins/uptime/public/state/api/alerts.ts index 7ddfbb872fb95..d19b9688b21d0 100644 --- a/x-pack/plugins/uptime/public/state/api/alerts.ts +++ b/x-pack/plugins/uptime/public/state/api/alerts.ts @@ -10,9 +10,9 @@ import { apiService } from './utils'; import { ActionConnector } from '../alerts/alerts'; import { AlertsResult, MonitorIdParam } from '../actions/types'; -import { ActionType, AsApiContract } from '../../../../triggers_actions_ui/public'; +import type { ActionType, AsApiContract, Rule } from '../../../../triggers_actions_ui/public'; import { API_URLS } from '../../../common/constants'; -import { Alert, AlertTypeParams } from '../../../../alerting/common'; +import { AlertTypeParams } from '../../../../alerting/common'; import { AtomicStatusCheckParams } from '../../../common/runtime_types/alerts'; import { populateAlertActions, RuleAction } from './alert_actions'; @@ -49,7 +49,7 @@ export interface NewAlertParams extends AlertTypeParams { } type NewMonitorStatusAlert = Omit< - Alert, + Rule, | 'id' | 'createdBy' | 'updatedBy' @@ -60,12 +60,12 @@ type NewMonitorStatusAlert = Omit< | 'muteAll' | 'mutedInstanceIds' | 'executionStatus' - | 'alertTypeId' + | 'ruleTypeId' | 'notifyWhen' | 'actions' > & { - rule_type_id: Alert['alertTypeId']; - notify_when: Alert['notifyWhen']; + rule_type_id: Rule['ruleTypeId']; + notify_when: Rule['notifyWhen']; actions: RuleAction[]; }; @@ -74,7 +74,7 @@ export const createAlert = async ({ monitorId, selectedMonitor, defaultEmail, -}: NewAlertParams): Promise => { +}: NewAlertParams): Promise => { const actions: RuleAction[] = populateAlertActions({ defaultActions, selectedMonitor, @@ -122,7 +122,7 @@ export const fetchMonitorAlertRecords = async (): Promise => { export const fetchAlertRecords = async ({ monitorId, -}: MonitorIdParam): Promise> => { +}: MonitorIdParam): Promise> => { const data = { page: 1, per_page: 500, @@ -131,11 +131,16 @@ export const fetchAlertRecords = async ({ sort_field: 'name.keyword', sort_order: 'asc', }; - const alerts = await apiService.get<{ data: Array> }>( - API_URLS.RULES_FIND, - data - ); - return alerts.data.find((alert) => alert.params.monitorId === monitorId) as Alert; + const rawRules = await apiService.get<{ + data: Array & { rule_type_id: string }>; + }>(API_URLS.RULES_FIND, data); + const monitorRule = rawRules.data.find( + (rule) => rule.params.monitorId === monitorId + ) as Rule & { rule_type_id: string }; + return { + ...monitorRule, + ruleTypeId: monitorRule.rule_type_id, + }; }; export const disableAlertById = async ({ alertId }: { alertId: string }) => { diff --git a/x-pack/plugins/uptime/server/lib/alerts/action_variables.ts b/x-pack/plugins/uptime/server/lib/alerts/action_variables.ts new file mode 100644 index 0000000000000..48fa6e45f19a8 --- /dev/null +++ b/x-pack/plugins/uptime/server/lib/alerts/action_variables.ts @@ -0,0 +1,43 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const MESSAGE = 'message'; +export const MONITOR_WITH_GEO = 'downMonitorsWithGeo'; +export const ALERT_REASON_MSG = 'reason'; + +export const ACTION_VARIABLES = { + [MESSAGE]: { + name: MESSAGE, + description: i18n.translate( + 'xpack.uptime.alerts.monitorStatus.actionVariables.context.message.description', + { + defaultMessage: 'A generated message summarizing the currently down monitors', + } + ), + }, + [MONITOR_WITH_GEO]: { + name: MONITOR_WITH_GEO, + description: i18n.translate( + 'xpack.uptime.alerts.monitorStatus.actionVariables.context.downMonitorsWithGeo.description', + { + defaultMessage: + 'A generated summary that shows some or all of the monitors detected as "down" by the alert', + } + ), + }, + [ALERT_REASON_MSG]: { + name: ALERT_REASON_MSG, + description: i18n.translate( + 'xpack.uptime.alerts.monitorStatus.actionVariables.context.alertReasonMessage.description', + { + defaultMessage: 'A concise description of the reason for the alert', + } + ), + }, +}; diff --git a/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts b/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts index ff6d5d42de510..208f19354a0f3 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts @@ -16,6 +16,7 @@ import { DynamicSettings } from '../../../common/runtime_types'; import { createRuleTypeMocks, bootstrapDependencies } from './test_utils'; import { getSeverityType } from '../../../../ml/common/util/anomaly_utils'; import { Ping } from '../../../common/runtime_types/ping'; +import { ALERT_REASON_MSG } from './action_variables'; interface MockAnomaly { severity: AnomaliesTableRecord['severity']; @@ -157,6 +158,7 @@ describe('duration anomaly alert', () => { ); const [{ value: alertInstanceMock }] = alertWithLifecycle.mock.results; expect(alertInstanceMock.replaceState).toHaveBeenCalledTimes(2); + const reasonMessages: string[] = []; mockAnomaliesResult.anomalies.forEach((anomaly, index) => { const slowestResponse = Math.round(anomaly.actualSort / 1000); const typicalResponse = Math.round(anomaly.typicalSort / 1000); @@ -180,6 +182,7 @@ Response times as high as ${slowestResponse} ms have been detected from location }, id: `${DURATION_ANOMALY.id}${index}`, }); + expect(alertInstanceMock.replaceState).toBeCalledWith({ firstCheckedAt: 'date', firstTriggeredAt: undefined, @@ -198,9 +201,35 @@ Response times as high as ${slowestResponse} ms have been detected from location slowestAnomalyResponse: `${slowestResponse} ms`, bucketSpan: anomaly.source.bucket_span, }); + const reasonMsg = `Abnormal (${getSeverityType( + anomaly.severity + )} level) response time detected on uptime-monitor with url ${ + mockPing.url?.full + } at date. Anomaly severity score is ${anomaly.severity}. + Response times as high as ${slowestResponse} ms have been detected from location ${ + anomaly.entityValue + }. Expected response time is ${typicalResponse} ms.`; + + reasonMessages.push(reasonMsg); }); expect(alertInstanceMock.scheduleActions).toHaveBeenCalledTimes(2); - expect(alertInstanceMock.scheduleActions).toBeCalledWith(DURATION_ANOMALY.id); + + expect(alertInstanceMock.scheduleActions.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "xpack.uptime.alerts.actionGroups.durationAnomaly", + Object { + "${ALERT_REASON_MSG}": "${reasonMessages[0]}", + }, + ] + `); + expect(alertInstanceMock.scheduleActions.mock.calls[1]).toMatchInlineSnapshot(` + Array [ + "xpack.uptime.alerts.actionGroups.durationAnomaly", + Object { + "${ALERT_REASON_MSG}": "${reasonMessages[1]}", + }, + ] + `); }); }); }); diff --git a/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.ts b/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.ts index b2f3ca0ad6d35..1dcb91b9e5270 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.ts @@ -26,6 +26,7 @@ import { getMLJobId } from '../../../common/lib'; import { DurationAnomalyTranslations as CommonDurationAnomalyTranslations } from '../../../common/translations'; import { createUptimeESClient } from '../lib'; +import { ALERT_REASON_MSG, ACTION_VARIABLES } from './action_variables'; export type ActionGroupIds = ActionGroupIdsOf; @@ -92,7 +93,7 @@ export const durationAnomalyAlertFactory: UptimeAlertTypeFactory }, ], actionVariables: { - context: [], + context: [ACTION_VARIABLES[ALERT_REASON_MSG]], state: [...durationAnomalyTranslations.actionVariables, ...commonStateTranslations], }, isExportable: true, @@ -122,6 +123,10 @@ export const durationAnomalyAlertFactory: UptimeAlertTypeFactory anomalies.forEach((anomaly, index) => { const summary = getAnomalySummary(anomaly, monitorInfo); + const alertReasonMessage = generateAlertMessage( + CommonDurationAnomalyTranslations.defaultActionMessage, + summary + ); const alertInstance = alertWithLifecycle({ id: DURATION_ANOMALY.id + index, @@ -133,17 +138,16 @@ export const durationAnomalyAlertFactory: UptimeAlertTypeFactory 'anomaly.bucket_span.minutes': summary.bucketSpan, [ALERT_EVALUATION_VALUE]: anomaly.actualSort, [ALERT_EVALUATION_THRESHOLD]: anomaly.typicalSort, - [ALERT_REASON]: generateAlertMessage( - CommonDurationAnomalyTranslations.defaultActionMessage, - summary - ), + [ALERT_REASON]: alertReasonMessage, }, }); alertInstance.replaceState({ ...updateState(state, false), ...summary, }); - alertInstance.scheduleActions(DURATION_ANOMALY.id); + alertInstance.scheduleActions(DURATION_ANOMALY.id, { + [ALERT_REASON_MSG]: alertReasonMessage, + }); }); } diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts index cea34b6daad96..d2e4a8dbc044e 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts @@ -241,6 +241,9 @@ describe('status check alert', () => { expect(alertInstanceMock.scheduleActions.mock.calls[0]).toMatchInlineSnapshot(` Array [ "xpack.uptime.alerts.actionGroups.monitorStatus", + Object { + "reason": "First from harrisburg failed 234 times in the last 15 mins. Alert when > 5.", + }, ] `); }); @@ -308,6 +311,9 @@ describe('status check alert', () => { expect(alertInstanceMock.scheduleActions.mock.calls[0]).toMatchInlineSnapshot(` Array [ "xpack.uptime.alerts.actionGroups.monitorStatus", + Object { + "reason": "First from harrisburg failed 234 times in the last 15m. Alert when > 5.", + }, ] `); }); @@ -776,15 +782,27 @@ describe('status check alert', () => { Array [ Array [ "xpack.uptime.alerts.actionGroups.monitorStatus", + Object { + "reason": "Foo from harrisburg 35 days availability is 99.28%. Alert when < 99.34%.", + }, ], Array [ "xpack.uptime.alerts.actionGroups.monitorStatus", + Object { + "reason": "Foo from fairbanks 35 days availability is 98.03%. Alert when < 99.34%.", + }, ], Array [ "xpack.uptime.alerts.actionGroups.monitorStatus", + Object { + "reason": "Unreliable from fairbanks 35 days availability is 90.92%. Alert when < 99.34%.", + }, ], Array [ "xpack.uptime.alerts.actionGroups.monitorStatus", + Object { + "reason": "no-name from fairbanks 35 days availability is 90.92%. Alert when < 99.34%.", + }, ], ] `); diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts index aa803a45fcdce..fe93928cb7e02 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts @@ -36,6 +36,7 @@ import { getUptimeIndexPattern, IndexPatternTitleAndFields } from '../requests/g import { UMServerLibs, UptimeESClient, createUptimeESClient } from '../lib'; import { ActionGroupIdsOf } from '../../../../alerting/common'; import { formatDurationFromTimeUnitChar, TimeUnitChar } from '../../../../observability/common'; +import { ALERT_REASON_MSG, MESSAGE, MONITOR_WITH_GEO, ACTION_VARIABLES } from './action_variables'; export type ActionGroupIds = ActionGroupIdsOf; /** @@ -268,25 +269,9 @@ export const statusCheckAlertFactory: UptimeAlertTypeFactory = ( ], actionVariables: { context: [ - { - name: 'message', - description: i18n.translate( - 'xpack.uptime.alerts.monitorStatus.actionVariables.context.message.description', - { - defaultMessage: 'A generated message summarizing the currently down monitors', - } - ), - }, - { - name: 'downMonitorsWithGeo', - description: i18n.translate( - 'xpack.uptime.alerts.monitorStatus.actionVariables.context.downMonitorsWithGeo.description', - { - defaultMessage: - 'A generated summary that shows some or all of the monitors detected as "down" by the alert', - } - ), - }, + ACTION_VARIABLES[MESSAGE], + ACTION_VARIABLES[MONITOR_WITH_GEO], + ACTION_VARIABLES[ALERT_REASON_MSG], ], state: [...commonMonitorStateI18, ...commonStateTranslations], }, @@ -375,7 +360,9 @@ export const statusCheckAlertFactory: UptimeAlertTypeFactory = ( ...updateState(state, true), }); - alert.scheduleActions(MONITOR_STATUS.id); + alert.scheduleActions(MONITOR_STATUS.id, { + [ALERT_REASON_MSG]: monitorSummary.reason, + }); } return updateState(state, downMonitorsByLocation.length > 0); } @@ -432,7 +419,9 @@ export const statusCheckAlertFactory: UptimeAlertTypeFactory = ( statusMessage, }); - alert.scheduleActions(MONITOR_STATUS.id); + alert.scheduleActions(MONITOR_STATUS.id, { + [ALERT_REASON_MSG]: monitorSummary.reason, + }); }); return updateState(state, downMonitorsByLocation.length > 0); diff --git a/x-pack/test/alerting_api_integration/common/config.ts b/x-pack/test/alerting_api_integration/common/config.ts index 7bcec7b11c10e..094857cfaf32c 100644 --- a/x-pack/test/alerting_api_integration/common/config.ts +++ b/x-pack/test/alerting_api_integration/common/config.ts @@ -161,6 +161,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) '--xpack.encryptedSavedObjects.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', '--xpack.alerting.invalidateApiKeysTask.interval="15s"', '--xpack.alerting.healthCheck.interval="1s"', + '--xpack.alerting.minimumScheduleInterval="1s"', `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, `--xpack.actions.rejectUnauthorized=${rejectUnauthorized}`, `--xpack.actions.microsoftGraphApiUrl=${servers.kibana.protocol}://${servers.kibana.hostname}:${servers.kibana.port}/api/_actions-FTS-external-service-simulators/exchange/users/test@/sendMail`, diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json index 7dea652f7f9bb..1036cee74da62 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json @@ -1,8 +1,8 @@ { "id": "aadFixtures", "owner": { - "name": "Alerting Services", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json index 5a76689f96d38..f007886f09aca 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json @@ -1,8 +1,8 @@ { "id": "actionsSimulators", "owner": { - "name": "Alerting Services", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json index 22ccd552762f5..e241028ec6977 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json @@ -1,8 +1,8 @@ { "id": "alertsFixtures", "owner": { - "name": "Alerting Services", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json index 206acd533b266..6c7ee636c35ad 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json @@ -1,8 +1,8 @@ { "id": "alertsRestrictedFixtures", "owner": { - "name": "Alerting Services", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json index 8adfa8d57e72b..79d04d29954c1 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json @@ -1,8 +1,8 @@ { "id": "taskManagerFixture", "owner": { - "name": "Alerting Services", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts index 3bc547ccb6a9a..1075a63742777 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts @@ -131,7 +131,7 @@ export default ({ getService }: FtrProviderContext) => { // TODO: https://github.com/elastic/kibana/pull/121644 clean up, make type-safe expect(rule?.execution_summary?.last_execution.status).to.eql('partial failure'); expect(rule?.execution_summary?.last_execution.message).to.eql( - 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["does-not-exist-*"] was found. This warning will continue to appear until a matching index is created or this rule is de-activated.' + 'This rule is attempting to query data from Elasticsearch indices listed in the "Index pattern" section of the rule definition, however no index matching: ["does-not-exist-*"] was found. This warning will continue to appear until a matching index is created or this rule is disabled.' ); }); diff --git a/x-pack/test/fleet_api_integration/apis/outputs/crud.ts b/x-pack/test/fleet_api_integration/apis/outputs/crud.ts index 86ce4a8fdf617..14f2e53949cfc 100644 --- a/x-pack/test/fleet_api_integration/apis/outputs/crud.ts +++ b/x-pack/test/fleet_api_integration/apis/outputs/crud.ts @@ -18,6 +18,7 @@ export default function (providerContext: FtrProviderContext) { describe('fleet_output_crud', async function () { skipIfNoDockerRegistry(providerContext); before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); setupFleetAndAgents(providerContext); @@ -36,6 +37,7 @@ export default function (providerContext: FtrProviderContext) { }); after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); }); @@ -99,6 +101,56 @@ export default function (providerContext: FtrProviderContext) { }); }); + it('should allow to create a logstash output ', async function () { + const { body: postResponse } = await supertest + .post(`/api/fleet/outputs`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'My Logstash Output', + type: 'logstash', + hosts: ['test.fr:443'], + ssl: { + certificate: 'CERTIFICATE', + key: 'KEY', + certificate_authorities: ['CA1', 'CA2'], + }, + }) + .expect(200); + + const { id: _, ...itemWithoutId } = postResponse.item; + expect(itemWithoutId).to.eql({ + name: 'My Logstash Output', + type: 'logstash', + hosts: ['test.fr:443'], + is_default: false, + is_default_monitoring: false, + ssl: { + certificate: 'CERTIFICATE', + key: 'KEY', + certificate_authorities: ['CA1', 'CA2'], + }, + }); + }); + + it('should not allow to create a logstash output with http hosts ', async function () { + const { body: postResponse } = await supertest + .post(`/api/fleet/outputs`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'My Logstash Output', + type: 'logstash', + hosts: ['https://test.fr:443'], + ssl: { + certificate: 'CERTIFICATE', + key: 'KEY', + certificate_authorities: ['CA1', 'CA2'], + }, + }) + .expect(400); + + expect(postResponse.message).match(/Invalid logstash host should not start with http\(s\)/); + }); + it('should toggle default output when creating a new default output ', async function () { await supertest .post(`/api/fleet/outputs`) diff --git a/x-pack/test/fleet_api_integration/apis/outputs/index.js b/x-pack/test/fleet_api_integration/apis/outputs/index.js index b799413638d47..b01c253defe76 100644 --- a/x-pack/test/fleet_api_integration/apis/outputs/index.js +++ b/x-pack/test/fleet_api_integration/apis/outputs/index.js @@ -8,5 +8,6 @@ export default function loadTests({ loadTestFile }) { describe('Output Endpoints', () => { loadTestFile(require.resolve('./crud')); + loadTestFile(require.resolve('./logstash_api_keys')); }); } diff --git a/x-pack/test/fleet_api_integration/apis/outputs/logstash_api_keys.ts b/x-pack/test/fleet_api_integration/apis/outputs/logstash_api_keys.ts new file mode 100644 index 0000000000000..316b4d09bda1b --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/outputs/logstash_api_keys.ts @@ -0,0 +1,65 @@ +/* + * 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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; +import { getEsClientForAPIKey } from '../agents/services'; +import { testUsers } from '../test_users'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + + describe('fleet_output_logstash_api_keys', async function () { + describe('POST /logstash_api_keys', () => { + it('should allow to create an api key with the right permissions', async () => { + const { body: apiKeyRes } = await supertest + .post(`/api/fleet/logstash_api_keys`) + .set('kbn-xsrf', 'xxx') + .expect(200); + + expect(apiKeyRes).to.have.keys('api_key'); + + const { body: privileges } = await getEsClientForAPIKey( + providerContext, + Buffer.from(apiKeyRes.api_key).toString('base64') + ).security.hasPrivileges( + { + body: { + cluster: ['monitor'], + index: [ + { + names: [ + 'logs-*-*', + 'metrics-*-*', + 'traces-*-*', + 'synthetics-*-*', + '.logs-endpoint.diagnostic.collection-*', + '.logs-endpoint.action.responses-*', + ], + privileges: ['auto_configure', 'create_doc'], + }, + ], + }, + }, + { meta: true } + ); + + expect(privileges.has_all_requested).to.be(true); + }); + }); + + it('should return a 400 with a user without the correct ES permissions', async () => { + await supertestWithoutAuth + .post(`/api/fleet/logstash_api_keys`) + .auth(testUsers.fleet_all_int_all.username, testUsers.fleet_all_int_all.password) + .set('kbn-xsrf', 'xxx') + .expect(400); + }); + }); +} diff --git a/x-pack/test/functional/apps/index_patterns/feature_controls/index.ts b/x-pack/test/functional/apps/data_views/feature_controls/index.ts similarity index 78% rename from x-pack/test/functional/apps/index_patterns/feature_controls/index.ts rename to x-pack/test/functional/apps/data_views/feature_controls/index.ts index 8eca3e20cd0d1..17a8da9af0d6b 100644 --- a/x-pack/test/functional/apps/index_patterns/feature_controls/index.ts +++ b/x-pack/test/functional/apps/data_views/feature_controls/index.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('feature controls', function () { this.tags('skipFirefox'); - loadTestFile(require.resolve('./index_patterns_security')); - loadTestFile(require.resolve('./index_patterns_spaces')); + loadTestFile(require.resolve('./security')); + loadTestFile(require.resolve('./spaces')); }); } diff --git a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts b/x-pack/test/functional/apps/data_views/feature_controls/security.ts similarity index 96% rename from x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts rename to x-pack/test/functional/apps/data_views/feature_controls/security.ts index 20dd08fab1496..96682302b5713 100644 --- a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts +++ b/x-pack/test/functional/apps/data_views/feature_controls/security.ts @@ -27,7 +27,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); }); - describe('global index_patterns all privileges', () => { + describe('global data views all privileges', () => { before(async () => { await security.role.create('global_index_patterns_all_role', { elasticsearch: { @@ -87,7 +87,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); - describe('global index_patterns read-only privileges', () => { + describe('global data views read-only privileges', () => { before(async () => { await security.role.create('global_index_patterns_read_role', { elasticsearch: { @@ -142,7 +142,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); - describe('no index_patterns privileges', () => { + describe('no data views privileges', () => { before(async () => { await security.role.create('no_index_patterns_privileges_role', { elasticsearch: { @@ -183,7 +183,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(navLinks).to.eql(['Discover']); }); - it(`doesn't show Index Patterns in management side-nav`, async () => { + it(`doesn't show Data Views in management side-nav`, async () => { await PageObjects.common.navigateToActualUrl('management', '', { ensureCurrentUrl: false, shouldLoginIfPrompted: false, diff --git a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts b/x-pack/test/functional/apps/data_views/feature_controls/spaces.ts similarity index 96% rename from x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts rename to x-pack/test/functional/apps/data_views/feature_controls/spaces.ts index 10a25da4ef0fa..9b6105b21eecf 100644 --- a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts +++ b/x-pack/test/functional/apps/data_views/feature_controls/spaces.ts @@ -47,14 +47,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(navLinks).to.contain('Stack Management'); }); - it(`index pattern listing shows create button`, async () => { + it(`data views listing shows create button`, async () => { await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaIndexPatterns(); await testSubjects.existOrFail('createIndexPatternButton'); }); }); - describe('space with Index Patterns disabled', () => { + describe('space with Data Views disabled', () => { before(async () => { // we need to load the following in every situation as deleting // a space deletes all of the associated saved objects diff --git a/x-pack/test/functional/apps/index_patterns/index.ts b/x-pack/test/functional/apps/data_views/index.ts similarity index 82% rename from x-pack/test/functional/apps/index_patterns/index.ts rename to x-pack/test/functional/apps/data_views/index.ts index bf9acf29cc2c1..3b3f7b3608113 100644 --- a/x-pack/test/functional/apps/index_patterns/index.ts +++ b/x-pack/test/functional/apps/data_views/index.ts @@ -8,8 +8,9 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function advancedSettingsApp({ loadTestFile }: FtrProviderContext) { - describe('Index Patterns', function indexPatternsTestSuite() { + describe('Data Views', function indexPatternsTestSuite() { this.tags('ciGroup2'); loadTestFile(require.resolve('./feature_controls')); + loadTestFile(require.resolve('./spaces')); }); } diff --git a/x-pack/test/functional/apps/data_views/spaces/index.ts b/x-pack/test/functional/apps/data_views/spaces/index.ts new file mode 100644 index 0000000000000..0d5bccd156b0e --- /dev/null +++ b/x-pack/test/functional/apps/data_views/spaces/index.ts @@ -0,0 +1,55 @@ +/* + * 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 { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects([ + 'common', + 'spaceSelector', + 'home', + 'header', + 'security', + 'settings', + ]); + const spacesService = getService('spaces'); + const esArchiver = getService('esArchiver'); + const testSubjects = getService('testSubjects'); + + describe('spaces', function () { + this.tags('skipFirefox'); + + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); + await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); + }); + + it('it can add a space', async () => { + await spacesService.create({ + id: 'custom_space', + name: 'custom_space', + disabledFeatures: [], + }); + + await PageObjects.settings.navigateTo(); + await PageObjects.settings.clickKibanaIndexPatterns(); + await PageObjects.settings.createIndexPattern('log*'); + + await PageObjects.settings.clickKibanaIndexPatterns(); + + // click manage spaces on first entry + await (await testSubjects.findAll('manageSpacesButton', 10000))[0].click(); + + // select custom space + await testSubjects.click('sts-space-selector-row-custom_space'); + await testSubjects.click('sts-save-button'); + + // verify custom space has been added to list + await testSubjects.existOrFail('space-avatar-custom_space'); + }); + }); +} diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/aggregated_scripted_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/aggregated_scripted_job.ts index 4edf87ab8d1fb..e5b2fb30d4e45 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/aggregated_scripted_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/aggregated_scripted_job.ts @@ -16,7 +16,6 @@ export default function ({ getService }: FtrProviderContext) { const supportedTestSuites = [ { suiteTitle: 'supported job with aggregation field', - // @ts-expect-error not convertable to Job type jobConfig: { job_id: `fq_supported_aggs_${ts}`, job_type: 'anomaly_detector', @@ -103,7 +102,6 @@ export default function ({ getService }: FtrProviderContext) { }, { suiteTitle: 'supported job with scripted field', - // @ts-expect-error not convertable to Job type jobConfig: { job_id: `fq_supported_script_${ts}`, job_type: 'anomaly_detector', @@ -178,7 +176,6 @@ export default function ({ getService }: FtrProviderContext) { const unsupportedTestSuites = [ { suiteTitle: 'unsupported job with bucket_script aggregation field', - // @ts-expect-error not convertable to Job type jobConfig: { job_id: `fq_unsupported_aggs_${ts}`, job_type: 'anomaly_detector', @@ -283,7 +280,6 @@ export default function ({ getService }: FtrProviderContext) { }, { suiteTitle: 'unsupported job with partition by of a scripted field', - // @ts-expect-error not convertable to Job type jobConfig: { job_id: `fq_unsupported_script_${ts}`, job_type: 'anomaly_detector', diff --git a/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts b/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts index a31b9faa169f9..c3d0ee718cecd 100644 --- a/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts +++ b/x-pack/test/functional/apps/ml/stack_management_jobs/export_jobs.ts @@ -11,7 +11,6 @@ import type { DataFrameAnalyticsConfig } from '../../../../../plugins/ml/public/ const testADJobs: Array<{ job: Job; datafeed: Datafeed }> = [ { - // @ts-expect-error not full interface job: { job_id: 'fq_single_1_smv', groups: ['farequote', 'automated', 'single-metric'], @@ -64,7 +63,6 @@ const testADJobs: Array<{ job: Job; datafeed: Datafeed }> = [ }, }, { - // @ts-expect-error not full interface job: { job_id: 'fq_single_2_smv', groups: ['farequote', 'automated', 'single-metric'], @@ -117,7 +115,6 @@ const testADJobs: Array<{ job: Job; datafeed: Datafeed }> = [ }, }, { - // @ts-expect-error not full interface job: { job_id: 'fq_single_3_smv', groups: ['farequote', 'automated', 'single-metric'], diff --git a/x-pack/test/functional/apps/snapshot_restore/home_page.ts b/x-pack/test/functional/apps/snapshot_restore/home_page.ts index b2893ace7b20a..c29135e089bfa 100644 --- a/x-pack/test/functional/apps/snapshot_restore/home_page.ts +++ b/x-pack/test/functional/apps/snapshot_restore/home_page.ts @@ -12,9 +12,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['common', 'snapshotRestore']); const log = getService('log'); const es = getService('es'); + const security = getService('security'); describe('Home page', function () { before(async () => { + await security.testUser.setRoles(['snapshot_restore_user'], false); await pageObjects.common.navigateToApp('snapshotRestore'); }); @@ -46,9 +48,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('cleanup repository', async () => { await pageObjects.snapshotRestore.viewRepositoryDetails('my-repository'); - await pageObjects.common.sleep(25000); const cleanupResponse = await pageObjects.snapshotRestore.performRepositoryCleanup(); - await pageObjects.common.sleep(25000); expect(cleanupResponse).to.contain('results'); expect(cleanupResponse).to.contain('deleted_bytes'); expect(cleanupResponse).to.contain('deleted_blobs'); @@ -57,6 +57,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await es.snapshot.deleteRepository({ name: 'my-repository', }); + await security.testUser.restoreDefaults(); }); }); }); diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 9e70c8d4ed7fd..66b32dac8e4b7 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -53,7 +53,7 @@ export default async function ({ readConfigFile }) { resolve(__dirname, './apps/dev_tools'), resolve(__dirname, './apps/apm'), resolve(__dirname, './apps/api_keys'), - resolve(__dirname, './apps/index_patterns'), + resolve(__dirname, './apps/data_views'), resolve(__dirname, './apps/index_management'), resolve(__dirname, './apps/index_lifecycle_management'), resolve(__dirname, './apps/ingest_pipelines'), @@ -551,6 +551,25 @@ export default async function ({ readConfigFile }) { }, ], }, + // https://www.elastic.co/guide/en/elasticsearch/reference/master/snapshots-register-repository.html#snapshot-repo-prereqs + snapshot_restore_user: { + elasticsearch: { + cluster: [ + 'monitor', + 'manage_slm', + 'cluster:admin/snapshot', + 'cluster:admin/repository', + ], + }, + kibana: [ + { + feature: { + advancedSettings: ['read'], + }, + spaces: ['*'], + }, + ], + }, ingest_pipelines_user: { elasticsearch: { diff --git a/x-pack/test/functional/page_objects/snapshot_restore_page.ts b/x-pack/test/functional/page_objects/snapshot_restore_page.ts index 216b2bfff9d7e..e1fc50ed86fa2 100644 --- a/x-pack/test/functional/page_objects/snapshot_restore_page.ts +++ b/x-pack/test/functional/page_objects/snapshot_restore_page.ts @@ -49,12 +49,15 @@ export function SnapshotRestorePageProvider({ getService }: FtrProviderContext) const repoToView = repos.filter((r) => (r.repoName = name))[0]; await repoToView.repoLink.click(); } - await retry.waitForWithTimeout(`Repo title should be ${name}`, 10000, async () => { + await retry.waitForWithTimeout(`Repo title should be ${name}`, 25000, async () => { return (await testSubjects.getVisibleText('title')) === name; }); }, async performRepositoryCleanup() { await testSubjects.click('cleanupRepositoryButton'); + await retry.waitForWithTimeout(`wait for code block to be visible`, 25000, async () => { + return await testSubjects.isDisplayed('cleanupCodeBlock'); + }); return await testSubjects.getVisibleText('cleanupCodeBlock'); }, }; diff --git a/x-pack/test/functional/services/ml/navigation.ts b/x-pack/test/functional/services/ml/navigation.ts index da34c97ff127f..4341fb1247119 100644 --- a/x-pack/test/functional/services/ml/navigation.ts +++ b/x-pack/test/functional/services/ml/navigation.ts @@ -55,7 +55,7 @@ export function MachineLearningNavigationProvider({ async navigateToAlertsAndAction() { await PageObjects.common.navigateToApp('triggersActions'); await testSubjects.click('rulesTab'); - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); }, async assertTabsExist(tabTypeSubject: string, areaSubjects: string[]) { diff --git a/x-pack/test/functional/services/uptime/alerts.ts b/x-pack/test/functional/services/uptime/alerts.ts index 9275b9049ab09..76bea59cc4207 100644 --- a/x-pack/test/functional/services/uptime/alerts.ts +++ b/x-pack/test/functional/services/uptime/alerts.ts @@ -21,7 +21,7 @@ export function UptimeAlertsProvider({ getService }: FtrProviderContext) { await testSubjects.click('xpack.uptime.toggleTlsAlertFlyout'); } // ensure the flyout has opened - await testSubjects.exists('alertNameInput'); + await testSubjects.exists('ruleNameInput'); }, async openMonitorStatusAlertType(alertType: string) { await testSubjects.click(`xpack.uptime.alerts.${alertType}-SelectOption`); @@ -34,7 +34,7 @@ export function UptimeAlertsProvider({ getService }: FtrProviderContext) { } }, async setAlertName(name: string) { - await testSubjects.setValue('alertNameInput', name); + await testSubjects.setValue('ruleNameInput', name); }, async setAlertInterval(value: string) { await testSubjects.setValue('intervalInput', value); @@ -104,11 +104,11 @@ export function UptimeAlertsProvider({ getService }: FtrProviderContext) { await testSubjects.click('uptimeAlertAddFilter.monitor.type'); await testSubjects.click('uptimeCreateStatusAlert.filter_scheme'); }, - async clickSaveAlertButton() { - await testSubjects.click('saveAlertButton'); + async clickSaveRuleButton() { + await testSubjects.click('saveRuleButton'); }, async clickSaveAlertsConfirmButton() { - await testSubjects.click('confirmAlertSaveModal > confirmModalConfirmButton', 20000); + await testSubjects.click('confirmRuleSaveModal > confirmModalConfirmButton', 20000); }, }; } diff --git a/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts index b44c5f08bdbc6..6db82801a5bdd 100644 --- a/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts +++ b/x-pack/test/functional_basic/apps/ml/permissions/full_ml_access.ts @@ -20,7 +20,9 @@ export default function ({ getService }: FtrProviderContext) { { user: USER.ML_POWERUSER_SPACES, discoverAvailable: false }, ]; - describe('for user with full ML access', function () { + // FLAKY: https://github.com/elastic/kibana/issues/124413 + // FLAKY: https://github.com/elastic/kibana/issues/122838 + describe.skip('for user with full ML access', function () { for (const testUser of testUsers) { describe(`(${testUser.user})`, function () { const ecIndexPattern = 'ft_module_sample_ecommerce'; diff --git a/x-pack/test/functional_execution_context/config.ts b/x-pack/test/functional_execution_context/config.ts index a934b6e763437..e11f345ceaf77 100644 --- a/x-pack/test/functional_execution_context/config.ts +++ b/x-pack/test/functional_execution_context/config.ts @@ -58,6 +58,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '--logging.loggers[2].name=http.server.response', '--logging.loggers[2].level=all', `--logging.loggers[2].appenders=${JSON.stringify(['file'])}`, + `--xpack.alerting.minimumScheduleInterval="1s"`, ], }, }; diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts index 95ff24fc8beef..1db679d6f1286 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts @@ -41,7 +41,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { async function defineEsQueryAlert(alertName: string) { await pageObjects.triggersActionsUI.clickCreateAlertButton(); - await testSubjects.setValue('alertNameInput', alertName); + await testSubjects.setValue('ruleNameInput', alertName); await testSubjects.click(`.es-query-SelectOption`); await testSubjects.click('selectIndexExpression'); const indexComboBox = await find.byCssSelector('#indexSelectSearchBox'); @@ -57,13 +57,13 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); await testSubjects.click('closePopover'); // need this two out of popup clicks to close them - const nameInput = await testSubjects.find('alertNameInput'); + const nameInput = await testSubjects.find('ruleNameInput'); await nameInput.click(); } async function defineIndexThresholdAlert(alertName: string) { await pageObjects.triggersActionsUI.clickCreateAlertButton(); - await testSubjects.setValue('alertNameInput', alertName); + await testSubjects.setValue('ruleNameInput', alertName); await testSubjects.click(`.index-threshold-SelectOption`); await testSubjects.click('selectIndexExpression'); const indexComboBox = await find.byCssSelector('#indexSelectSearchBox'); @@ -79,7 +79,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); await testSubjects.click('closePopover'); // need this two out of popup clicks to close them - const nameInput = await testSubjects.find('alertNameInput'); + const nameInput = await testSubjects.find('ruleNameInput'); await nameInput.click(); await testSubjects.click('whenExpression'); @@ -101,7 +101,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { async function defineAlwaysFiringAlert(alertName: string) { await pageObjects.triggersActionsUI.clickCreateAlertButton(); - await testSubjects.setValue('alertNameInput', alertName); + await testSubjects.setValue('ruleNameInput', alertName); await testSubjects.click('test.always-firing-SelectOption'); } @@ -157,7 +157,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { 'test message {{alert.actionGroup}} some additional text {{rule.id}}' ); - await testSubjects.click('saveAlertButton'); + await testSubjects.click('saveRuleButton'); const toastTitle = await pageObjects.common.closeToast(); expect(toastTitle).to.eql(`Created rule "${alertName}"`); await pageObjects.triggersActionsUI.searchAlerts(alertName); @@ -207,7 +207,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('addNewActionConnectorActionGroup-1'); await testSubjects.click('addNewActionConnectorActionGroup-1-option-other'); - await testSubjects.click('saveAlertButton'); + await testSubjects.click('saveRuleButton'); const toastTitle = await pageObjects.common.closeToast(); expect(toastTitle).to.eql(`Created rule "${alertName}"`); await pageObjects.triggersActionsUI.searchAlerts(alertName); @@ -228,16 +228,16 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const alertName = generateUniqueKey(); await defineAlwaysFiringAlert(alertName); - await testSubjects.click('saveAlertButton'); - await testSubjects.existOrFail('confirmAlertSaveModal'); - await testSubjects.click('confirmAlertSaveModal > confirmModalCancelButton'); - await testSubjects.missingOrFail('confirmAlertSaveModal'); - await find.existsByCssSelector('[data-test-subj="saveAlertButton"]:not(disabled)'); + await testSubjects.click('saveRuleButton'); + await testSubjects.existOrFail('confirmRuleSaveModal'); + await testSubjects.click('confirmRuleSaveModal > confirmModalCancelButton'); + await testSubjects.missingOrFail('confirmRuleSaveModal'); + await find.existsByCssSelector('[data-test-subj="saveRuleButton"]:not(disabled)'); - await testSubjects.click('saveAlertButton'); - await testSubjects.existOrFail('confirmAlertSaveModal'); - await testSubjects.click('confirmAlertSaveModal > confirmModalConfirmButton'); - await testSubjects.missingOrFail('confirmAlertSaveModal'); + await testSubjects.click('saveRuleButton'); + await testSubjects.existOrFail('confirmRuleSaveModal'); + await testSubjects.click('confirmRuleSaveModal > confirmModalConfirmButton'); + await testSubjects.missingOrFail('confirmRuleSaveModal'); const toastTitle = await pageObjects.common.closeToast(); expect(toastTitle).to.eql(`Created rule "${alertName}"`); @@ -258,15 +258,15 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('should show discard confirmation before closing flyout without saving', async () => { await pageObjects.triggersActionsUI.clickCreateAlertButton(); - await testSubjects.click('cancelSaveAlertButton'); - await testSubjects.missingOrFail('confirmAlertCloseModal'); + await testSubjects.click('cancelSaveRuleButton'); + await testSubjects.missingOrFail('confirmRuleCloseModal'); await pageObjects.triggersActionsUI.clickCreateAlertButton(); await testSubjects.setValue('intervalInput', '10'); - await testSubjects.click('cancelSaveAlertButton'); - await testSubjects.existOrFail('confirmAlertCloseModal'); - await testSubjects.click('confirmAlertCloseModal > confirmModalCancelButton'); - await testSubjects.missingOrFail('confirmAlertCloseModal'); + await testSubjects.click('cancelSaveRuleButton'); + await testSubjects.existOrFail('confirmRuleCloseModal'); + await testSubjects.click('confirmRuleCloseModal > confirmModalCancelButton'); + await testSubjects.missingOrFail('confirmRuleCloseModal'); }); it('should successfully test valid es_query alert', async () => { @@ -281,9 +281,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.existOrFail('testQuerySuccess'); await testSubjects.missingOrFail('testQueryError'); - await testSubjects.click('cancelSaveAlertButton'); - await testSubjects.existOrFail('confirmAlertCloseModal'); - await testSubjects.click('confirmAlertCloseModal > confirmModalConfirmButton'); + await testSubjects.click('cancelSaveRuleButton'); + await testSubjects.existOrFail('confirmRuleCloseModal'); + await testSubjects.click('confirmRuleCloseModal > confirmModalConfirmButton'); }); it('should show error when es_query is invalid', async () => { @@ -301,19 +301,19 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('should show all rule types on click euiFormControlLayoutClearButton', async () => { await pageObjects.triggersActionsUI.clickCreateAlertButton(); - await testSubjects.setValue('alertNameInput', 'alertName'); - const ruleTypeSearchBox = await find.byCssSelector('[data-test-subj="alertSearchField"]'); + await testSubjects.setValue('ruleNameInput', 'alertName'); + const ruleTypeSearchBox = await find.byCssSelector('[data-test-subj="ruleSearchField"]'); await ruleTypeSearchBox.type('notexisting rule type'); await ruleTypeSearchBox.pressKeys(browser.keys.ENTER); - const ruleTypes = await find.allByCssSelector('.triggersActionsUI__alertTypeNodeHeading'); + const ruleTypes = await find.allByCssSelector('.triggersActionsUI__ruleTypeNodeHeading'); expect(ruleTypes).to.have.length(0); const searchClearButton = await find.byCssSelector('.euiFormControlLayoutClearButton'); await searchClearButton.click(); const ruleTypesClearFilter = await find.allByCssSelector( - '.triggersActionsUI__alertTypeNodeHeading' + '.triggersActionsUI__ruleTypeNodeHeading' ); expect(ruleTypesClearFilter.length).to.above(0); }); diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts index 2b45a12790107..0f6e99ccf27f3 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list.ts @@ -108,7 +108,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const searchClearButton = await find.byCssSelector('.euiFormControlLayoutClearButton'); await searchClearButton.click(); await find.byCssSelector( - '.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)' + '.euiBasicTable[data-test-subj="rulesList"]:not(.euiBasicTable-loading)' ); const searchResultsAfterClear = await pageObjects.triggersActionsUI.getAlertsList(); expect(searchResultsAfterClear.length).to.equal(2); @@ -257,7 +257,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('collapsedItemActions'); - await testSubjects.click('deleteAlert'); + await testSubjects.click('deleteRule'); await testSubjects.existOrFail('deleteIdsConfirmation'); await testSubjects.click('deleteIdsConfirmation > confirmModalConfirmButton'); await testSubjects.missingOrFail('deleteIdsConfirmation'); @@ -365,7 +365,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await createAlert({ supertest, objectRemover }); await refreshAlertsList(); - await testSubjects.existOrFail('alertsTable-P50ColumnName'); + await testSubjects.existOrFail('rulesTable-P50ColumnName'); await testSubjects.existOrFail('P50Percentile'); await retry.try(async () => { @@ -385,7 +385,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await searchClearButton.click(); await testSubjects.missingOrFail('percentileSelectablePopover-selectable'); - await testSubjects.existOrFail('alertsTable-P95ColumnName'); + await testSubjects.existOrFail('rulesTable-P95ColumnName'); await testSubjects.existOrFail('P95Percentile'); }); }); @@ -427,8 +427,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const refreshResults = await pageObjects.triggersActionsUI.getAlertsListWithStatus(); expect(refreshResults.map((item: any) => item.status).sort()).to.eql(['Error', 'Ok']); }); - await testSubjects.click('alertStatusFilterButton'); - await testSubjects.click('alertStatuserrorFilerOption'); // select Error status filter + await testSubjects.click('ruleStatusFilterButton'); + await testSubjects.click('ruleStatuserrorFilerOption'); // select Error status filter await retry.try(async () => { const filterErrorOnlyResults = await pageObjects.triggersActionsUI.getAlertsListWithStatus(); @@ -453,7 +453,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); const alertsErrorBannerWhenNoErrors = await find.allByCssSelector( - '[data-test-subj="alertsErrorBanner"]' + '[data-test-subj="rulesErrorBanner"]' ); expect(alertsErrorBannerWhenNoErrors).to.have.length(0); @@ -461,7 +461,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await retry.try(async () => { await refreshAlertsList(); const alertsErrorBannerExistErrors = await find.allByCssSelector( - '[data-test-subj="alertsErrorBanner"]' + '[data-test-subj="rulesErrorBanner"]' ); expect(alertsErrorBannerExistErrors).to.have.length(1); expect( @@ -472,21 +472,21 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); await refreshAlertsList(); - expect(await testSubjects.getVisibleText('totalAlertsCount')).to.be('Showing: 2 of 2 rules.'); - expect(await testSubjects.getVisibleText('totalActiveAlertsCount')).to.be('Active: 0'); - expect(await testSubjects.getVisibleText('totalOkAlertsCount')).to.be('Ok: 1'); - expect(await testSubjects.getVisibleText('totalErrorAlertsCount')).to.be('Error: 1'); - expect(await testSubjects.getVisibleText('totalPendingAlertsCount')).to.be('Pending: 0'); - expect(await testSubjects.getVisibleText('totalUnknownAlertsCount')).to.be('Unknown: 0'); + expect(await testSubjects.getVisibleText('totalRulesCount')).to.be('Showing: 2 of 2 rules.'); + expect(await testSubjects.getVisibleText('totalActiveRulesCount')).to.be('Active: 0'); + expect(await testSubjects.getVisibleText('totalOkRulesCount')).to.be('Ok: 1'); + expect(await testSubjects.getVisibleText('totalErrorRulesCount')).to.be('Error: 1'); + expect(await testSubjects.getVisibleText('totalPendingRulesCount')).to.be('Pending: 0'); + expect(await testSubjects.getVisibleText('totalUnknownRulesCount')).to.be('Unknown: 0'); }); it('should filter alerts by the alert type', async () => { await createAlert({ supertest, objectRemover }); const failingAlert = await createFailingAlert({ supertest, objectRemover }); await refreshAlertsList(); - await testSubjects.click('alertTypeFilterButton'); - expect(await (await testSubjects.find('alertType0Group')).getVisibleText()).to.eql('Alerts'); - await testSubjects.click('alertTypetest.failingFilterOption'); + await testSubjects.click('ruleTypeFilterButton'); + expect(await (await testSubjects.find('ruleType0Group')).getVisibleText()).to.eql('Alerts'); + await testSubjects.click('ruleTypetest.failingFilterOption'); await retry.try(async () => { const filterFailingAlertOnlyResults = await pageObjects.triggersActionsUI.getAlertsList(); @@ -529,7 +529,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(filterWithSlackOnlyResults[0].interval).to.equal('1 min'); expect(filterWithSlackOnlyResults[0].duration).to.match(/\d{2,}:\d{2}/); }); - await testSubjects.click('alertTypeFilterButton'); + await testSubjects.click('ruleTypeFilterButton'); // de-select action type filter await testSubjects.click('actionTypeFilterButton'); diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts index d350e88bcf248..b280e9a3e78c5 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/details.ts @@ -124,7 +124,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first alert await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(rule.name); @@ -260,20 +260,20 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first rule await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(ruleName); - const editButton = await testSubjects.find('openEditAlertFlyoutButton'); + const editButton = await testSubjects.find('openEditRuleFlyoutButton'); await editButton.click(); expect(await testSubjects.exists('hasActionsDisabled')).to.eql(false); - await testSubjects.setValue('alertNameInput', updatedRuleName, { + await testSubjects.setValue('ruleNameInput', updatedRuleName, { clearWithKeyboard: true, }); - await find.clickByCssSelector('[data-test-subj="saveEditedAlertButton"]:not(disabled)'); + await find.clickByCssSelector('[data-test-subj="saveEditedRuleButton"]:not(disabled)'); const toastTitle = await pageObjects.common.closeToast(); expect(toastTitle).to.eql(`Updated '${updatedRuleName}'`); @@ -291,26 +291,26 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first rule await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(updatedRuleName); - const editButton = await testSubjects.find('openEditAlertFlyoutButton'); + const editButton = await testSubjects.find('openEditRuleFlyoutButton'); await editButton.click(); - await testSubjects.setValue('alertNameInput', uuid.v4(), { + await testSubjects.setValue('ruleNameInput', uuid.v4(), { clearWithKeyboard: true, }); - await testSubjects.click('cancelSaveEditedAlertButton'); - await testSubjects.existOrFail('confirmAlertCloseModal'); - await testSubjects.click('confirmAlertCloseModal > confirmModalConfirmButton'); - await find.waitForDeletedByCssSelector('[data-test-subj="cancelSaveEditedAlertButton"]'); + await testSubjects.click('cancelSaveEditedRuleButton'); + await testSubjects.existOrFail('confirmRuleCloseModal'); + await testSubjects.click('confirmRuleCloseModal > confirmModalConfirmButton'); + await find.waitForDeletedByCssSelector('[data-test-subj="cancelSaveEditedRuleButton"]'); await editButton.click(); - const nameInputAfterCancel = await testSubjects.find('alertNameInput'); + const nameInputAfterCancel = await testSubjects.find('ruleNameInput'); const textAfterCancel = await nameInputAfterCancel.getAttribute('value'); expect(textAfterCancel).to.eql(updatedRuleName); }); @@ -345,7 +345,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // delete connector await pageObjects.triggersActionsUI.changeTabs('connectorsTab'); @@ -362,7 +362,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.triggersActionsUI.changeTabs('rulesTab'); await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(rule.name); - const editButton = await testSubjects.find('openEditAlertFlyoutButton'); + const editButton = await testSubjects.find('openEditRuleFlyoutButton'); await editButton.click(); expect(await testSubjects.exists('hasActionsDisabled')).to.eql(false); @@ -409,7 +409,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // delete connector await pageObjects.triggersActionsUI.changeTabs('connectorsTab'); @@ -426,7 +426,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.triggersActionsUI.changeTabs('rulesTab'); await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(alert.name); - const editButton = await testSubjects.find('openEditAlertFlyoutButton'); + const editButton = await testSubjects.find('openEditRuleFlyoutButton'); await editButton.click(); expect(await testSubjects.exists('hasActionsDisabled')).to.eql(false); @@ -479,7 +479,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first rule await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(rule.name); @@ -501,7 +501,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first rule await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(rule.name); @@ -527,7 +527,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first rule await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(rule.name); @@ -735,7 +735,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first rule await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(rule.name); diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/home_page.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/home_page.ts index 8ebb720930364..255a0d6c09bee 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/home_page.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/home_page.ts @@ -79,7 +79,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(url).to.contain(`/rules`); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); }); it('navigates to an alert details page', async () => { @@ -103,7 +103,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await pageObjects.header.waitUntilLoadingHasFinished(); // Verify content - await testSubjects.existOrFail('alertsList'); + await testSubjects.existOrFail('rulesList'); // click on first alert await pageObjects.triggersActionsUI.clickOnAlertInAlertsList(createdAlert.name); diff --git a/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts b/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts index 1d8a172e57b78..2ad2da6d227c2 100644 --- a/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts +++ b/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts @@ -88,7 +88,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); it('can save alert', async () => { - await alerts.clickSaveAlertButton(); + await alerts.clickSaveRuleButton(); await alerts.clickSaveAlertsConfirmButton(); await pageObjects.common.closeToast(); }); @@ -178,7 +178,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); it('can save alert', async () => { - await alerts.clickSaveAlertButton(); + await alerts.clickSaveRuleButton(); await alerts.clickSaveAlertsConfirmButton(); await pageObjects.common.closeToast(); }); diff --git a/x-pack/test/functional_with_es_ssl/config.ts b/x-pack/test/functional_with_es_ssl/config.ts index b8010c089ad03..e180259fa55f3 100644 --- a/x-pack/test/functional_with_es_ssl/config.ts +++ b/x-pack/test/functional_with_es_ssl/config.ts @@ -66,6 +66,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { `--elasticsearch.hosts=https://${servers.elasticsearch.hostname}:${servers.elasticsearch.port}`, `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, `--plugin-path=${join(__dirname, 'fixtures', 'plugins', 'alerts')}`, + `--xpack.alerting.minimumScheduleInterval="1s"`, `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, `--xpack.actions.preconfiguredAlertHistoryEsIndex=false`, `--xpack.actions.preconfigured=${JSON.stringify({ diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json index 8c798aa3fbe0a..2dd7fcc0c4986 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json @@ -1,6 +1,6 @@ { "id": "alertingFixture", - "owner": { "name": "Alerting Services", "githubTeam": "kibana-alerting-services" }, + "owner": { "name": "Response Ops", "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", "requiredPlugins": ["alerting", "triggersActionsUi", "features"], diff --git a/x-pack/test/functional_with_es_ssl/page_objects/rule_details.ts b/x-pack/test/functional_with_es_ssl/page_objects/rule_details.ts index 9e958d4207e56..01d7c24be2f41 100644 --- a/x-pack/test/functional_with_es_ssl/page_objects/rule_details.ts +++ b/x-pack/test/functional_with_es_ssl/page_objects/rule_details.ts @@ -16,10 +16,10 @@ export function RuleDetailsPageProvider({ getService }: FtrProviderContext) { return { async getHeadingText() { - return await testSubjects.getVisibleText('alertDetailsTitle'); + return await testSubjects.getVisibleText('ruleDetailsTitle'); }, async getRuleType() { - return await testSubjects.getVisibleText('alertTypeLabel'); + return await testSubjects.getVisibleText('ruleTypeLabel'); }, async getActionsLabels() { return { @@ -98,20 +98,20 @@ export function RuleDetailsPageProvider({ getService }: FtrProviderContext) { }, async isViewInAppDisabled() { await retry.try(async () => { - const viewInAppButton = await testSubjects.find(`alertDetails-viewInApp`); + const viewInAppButton = await testSubjects.find(`ruleDetails-viewInApp`); expect(await viewInAppButton.getAttribute('disabled')).to.eql('true'); }); return true; }, async isViewInAppEnabled() { await retry.try(async () => { - const viewInAppButton = await testSubjects.find(`alertDetails-viewInApp`); + const viewInAppButton = await testSubjects.find(`ruleDetails-viewInApp`); expect(await viewInAppButton.getAttribute('disabled')).to.not.eql('true'); }); return true; }, async clickViewInApp() { - return await testSubjects.click('alertDetails-viewInApp'); + return await testSubjects.click('ruleDetails-viewInApp'); }, async getNoOpAppTitle() { await retry.try(async () => { diff --git a/x-pack/test/functional_with_es_ssl/page_objects/triggers_actions_ui_page.ts b/x-pack/test/functional_with_es_ssl/page_objects/triggers_actions_ui_page.ts index a49873c6d47b5..c715800abd37e 100644 --- a/x-pack/test/functional_with_es_ssl/page_objects/triggers_actions_ui_page.ts +++ b/x-pack/test/functional_with_es_ssl/page_objects/triggers_actions_ui_page.ts @@ -21,17 +21,17 @@ export function TriggersActionsPageProvider({ getService }: FtrProviderContext) function getRowItemData(row: CustomCheerio, $: CustomCheerioStatic) { return { - name: $(row).findTestSubject('alertsTableCell-name').find('.euiTableCellContent').text(), + name: $(row).findTestSubject('rulesTableCell-name').find('.euiTableCellContent').text(), duration: $(row) - .findTestSubject('alertsTableCell-duration') + .findTestSubject('rulesTableCell-duration') .find('.euiTableCellContent') .text(), interval: $(row) - .findTestSubject('alertsTableCell-interval') + .findTestSubject('rulesTableCell-interval') .find('.euiTableCellContent') .text(), tags: $(row) - .findTestSubject('alertsTableCell-tagsPopover') + .findTestSubject('rulesTableCell-tagsPopover') .find('.euiTableCellContent') .text(), }; @@ -68,13 +68,13 @@ export function TriggersActionsPageProvider({ getService }: FtrProviderContext) ); }, async searchAlerts(searchText: string) { - const searchBox = await testSubjects.find('alertSearchField'); + const searchBox = await testSubjects.find('ruleSearchField'); await searchBox.click(); await searchBox.clearValue(); await searchBox.type(searchText); await searchBox.pressKeys(ENTER_KEY); await find.byCssSelector( - '.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)' + '.euiBasicTable[data-test-subj="rulesList"]:not(.euiBasicTable-loading)' ); }, async getConnectorsList() { @@ -96,42 +96,42 @@ export function TriggersActionsPageProvider({ getService }: FtrProviderContext) }); }, async getAlertsList() { - const table = await find.byCssSelector('[data-test-subj="alertsList"] table'); + const table = await find.byCssSelector('[data-test-subj="rulesList"] table'); const $ = await table.parseDomContent(); - return $.findTestSubjects('alert-row') + return $.findTestSubjects('rule-row') .toArray() .map((row) => { return getRowItemData(row, $); }); }, async getAlertsListWithStatus() { - const table = await find.byCssSelector('[data-test-subj="alertsList"] table'); + const table = await find.byCssSelector('[data-test-subj="rulesList"] table'); const $ = await table.parseDomContent(); - return $.findTestSubjects('alert-row') + return $.findTestSubjects('rule-row') .toArray() .map((row) => { const rowItem = getRowItemData(row, $); return { ...rowItem, status: $(row) - .findTestSubject('alertsTableCell-status') + .findTestSubject('rulesTableCell-status') .find('.euiTableCellContent') .text(), }; }); }, async isAlertsListDisplayed() { - const table = await find.byCssSelector('[data-test-subj="alertsList"] table'); + const table = await find.byCssSelector('[data-test-subj="rulesList"] table'); return table.isDisplayed(); }, async isAnEmptyAlertsListDisplayed() { await retry.try(async () => { - const table = await find.byCssSelector('[data-test-subj="alertsList"] table'); + const table = await find.byCssSelector('[data-test-subj="rulesList"] table'); const $ = await table.parseDomContent(); - const rows = $.findTestSubjects('alert-row').toArray(); + const rows = $.findTestSubjects('rule-row').toArray(); expect(rows.length).to.eql(0); const emptyRow = await find.byCssSelector( - '[data-test-subj="alertsList"] table .euiTableRow' + '[data-test-subj="rulesList"] table .euiTableRow' ); expect(await emptyRow.getVisibleText()).to.eql('No items found'); }); @@ -139,7 +139,7 @@ export function TriggersActionsPageProvider({ getService }: FtrProviderContext) }, async clickOnAlertInAlertsList(name: string) { await this.searchAlerts(name); - await find.clickDisplayedByCssSelector(`[data-test-subj="alertsList"] [title="${name}"]`); + await find.clickDisplayedByCssSelector(`[data-test-subj="rulesList"] [title="${name}"]`); }, async changeTabs(tab: 'rulesTab' | 'connectorsTab') { await testSubjects.click(tab); @@ -150,16 +150,16 @@ export function TriggersActionsPageProvider({ getService }: FtrProviderContext) }, async clickCreateAlertButton() { const createBtn = await find.byCssSelector( - '[data-test-subj="createAlertButton"],[data-test-subj="createFirstAlertButton"]' + '[data-test-subj="createRuleButton"],[data-test-subj="createFirstRuleButton"]' ); await createBtn.click(); }, async setAlertName(value: string) { - await testSubjects.setValue('alertNameInput', value); + await testSubjects.setValue('ruleNameInput', value); await this.assertAlertName(value); }, async assertAlertName(expectedValue: string) { - const actualValue = await testSubjects.getAttribute('alertNameInput', 'value'); + const actualValue = await testSubjects.getAttribute('ruleNameInput', 'value'); expect(actualValue).to.eql(expectedValue); }, async setAlertInterval(value: number, unit?: 's' | 'm' | 'h' | 'd') { @@ -178,8 +178,8 @@ export function TriggersActionsPageProvider({ getService }: FtrProviderContext) } }, async saveAlert() { - await testSubjects.click('saveAlertButton'); - const isConfirmationModalVisible = await testSubjects.isDisplayed('confirmAlertSaveModal'); + await testSubjects.click('saveRuleButton'); + const isConfirmationModalVisible = await testSubjects.isDisplayed('confirmRuleSaveModal'); expect(isConfirmationModalVisible).to.eql(true, 'Expect confirmation modal to be visible'); await testSubjects.click('confirmModalConfirmButton'); }, diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json b/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json index 42cfa0f766e3e..2117704cbef8d 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json +++ b/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json @@ -1,8 +1,8 @@ { "id": "eventLogFixture", "owner": { - "name": "Kibana Alerting", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json index 0171004f1c7b5..151e49c08016c 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json @@ -1,8 +1,8 @@ { "id": "sampleTaskPlugin", "owner": { - "name": "Alerting Services", - "githubTeam": "kibana-alerting-services" + "name": "Response Ops", + "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json index 995427773ad92..b7fad9c245313 100644 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json @@ -1,6 +1,6 @@ { "id": "taskManagerPerformance", - "owner": { "name": "Alerting Services", "githubTeam": "kibana-alerting-services" }, + "owner": { "name": "Response Ops", "githubTeam": "response-ops" }, "version": "1.0.0", "kibanaVersion": "kibana", "requiredPlugins": ["taskManager"], diff --git a/x-pack/test/rule_registry/common/config.ts b/x-pack/test/rule_registry/common/config.ts index 6b920a6f5dbf2..51058edcb303f 100644 --- a/x-pack/test/rule_registry/common/config.ts +++ b/x-pack/test/rule_registry/common/config.ts @@ -78,6 +78,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...xPackApiIntegrationTestsConfig.get('kbnTestServer.serverArgs'), `--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`, `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, + `--xpack.alerting.minimumScheduleInterval="1s"`, '--xpack.eventLog.logEntries=true', ...disabledPlugins .filter((k) => k !== 'security') diff --git a/x-pack/test/rule_registry/security_and_spaces/tests/basic/index.ts b/x-pack/test/rule_registry/security_and_spaces/tests/basic/index.ts index e4512798db7d3..229f31375200a 100644 --- a/x-pack/test/rule_registry/security_and_spaces/tests/basic/index.ts +++ b/x-pack/test/rule_registry/security_and_spaces/tests/basic/index.ts @@ -10,8 +10,7 @@ import { createSpacesAndUsers, deleteSpacesAndUsers } from '../../../common/lib/ // eslint-disable-next-line import/no-default-export export default ({ loadTestFile, getService }: FtrProviderContext): void => { - // FAILING: https://github.com/elastic/kibana/issues/110153 - describe.skip('rules security and spaces enabled: basic', function () { + describe('rules security and spaces enabled: basic', function () { // Fastest ciGroup for the moment. this.tags('ciGroup5'); @@ -24,10 +23,12 @@ export default ({ loadTestFile, getService }: FtrProviderContext): void => { }); // Basic - loadTestFile(require.resolve('./get_alert_by_id')); - loadTestFile(require.resolve('./update_alert')); - loadTestFile(require.resolve('./bulk_update_alerts')); - loadTestFile(require.resolve('./find_alerts')); - loadTestFile(require.resolve('./get_alerts_index')); + // FAILING: https://github.com/elastic/kibana/issues/110153 + // loadTestFile(require.resolve('./get_alert_by_id')); + // loadTestFile(require.resolve('./update_alert')); + // loadTestFile(require.resolve('./bulk_update_alerts')); + // loadTestFile(require.resolve('./find_alerts')); + // loadTestFile(require.resolve('./get_alerts_index')); + loadTestFile(require.resolve('./search_strategy')); }); }; diff --git a/x-pack/test/rule_registry/security_and_spaces/tests/basic/search_strategy.ts b/x-pack/test/rule_registry/security_and_spaces/tests/basic/search_strategy.ts new file mode 100644 index 0000000000000..2124cb8a1d04b --- /dev/null +++ b/x-pack/test/rule_registry/security_and_spaces/tests/basic/search_strategy.ts @@ -0,0 +1,138 @@ +/* + * 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 expect from '@kbn/expect'; +import { AlertConsumers } from '@kbn/rule-data-utils'; + +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { RuleRegistrySearchResponse } from '../../../../../plugins/rule_registry/common/search_strategy'; +import { + deleteSignalsIndex, + createSignalsIndex, + deleteAllAlerts, + getRuleForSignalTesting, + createRule, + waitForSignalsToBePresent, + waitForRuleSuccessOrStatus, +} from '../../../../detection_engine_api_integration/utils'; +import { ID } from '../../../../detection_engine_api_integration/security_and_spaces/tests/generating_signals'; +import { QueryCreateSchema } from '../../../../../plugins/security_solution/common/detection_engine/schemas/request'; + +// eslint-disable-next-line import/no-default-export +export default ({ getService }: FtrProviderContext) => { + const esArchiver = getService('esArchiver'); + const supertest = getService('supertest'); + const bsearch = getService('bsearch'); + const log = getService('log'); + + const SPACE1 = 'space1'; + + describe('ruleRegistryAlertsSearchStrategy', () => { + describe('logs', () => { + beforeEach(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/observability/alerts'); + }); + afterEach(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts'); + }); + it('should return alerts from log rules', async () => { + const result = await bsearch.send({ + supertest, + options: { + featureIds: [AlertConsumers.LOGS], + }, + strategy: 'ruleRegistryAlertsSearchStrategy', + }); + expect(result.rawResponse.hits.total).to.eql(5); + const consumers = result.rawResponse.hits.hits.map((hit) => { + return hit.fields?.['kibana.alert.rule.consumer']; + }); + expect(consumers.every((consumer) => consumer === AlertConsumers.LOGS)); + }); + }); + + describe('siem', () => { + beforeEach(async () => { + await deleteSignalsIndex(supertest, log); + await createSignalsIndex(supertest, log); + }); + + afterEach(async () => { + await deleteSignalsIndex(supertest, log); + await deleteAllAlerts(supertest, log); + }); + + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts'); + }); + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/auditbeat/hosts'); + }); + + it('should return alerts from siem rules', async () => { + const rule: QueryCreateSchema = { + ...getRuleForSignalTesting(['auditbeat-*']), + query: `_id:${ID}`, + }; + const { id: createdId } = await createRule(supertest, log, rule); + await waitForRuleSuccessOrStatus(supertest, log, createdId); + await waitForSignalsToBePresent(supertest, log, 1, [createdId]); + + const result = await bsearch.send({ + supertest, + options: { + featureIds: [AlertConsumers.SIEM], + }, + strategy: 'ruleRegistryAlertsSearchStrategy', + }); + expect(result.rawResponse.hits.total).to.eql(1); + const consumers = result.rawResponse.hits.hits.map( + (hit) => hit.fields?.['kibana.alert.rule.consumer'] + ); + expect(consumers.every((consumer) => consumer === AlertConsumers.SIEM)); + }); + }); + + describe('apm', () => { + beforeEach(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/rule_registry/alerts'); + }); + afterEach(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/rule_registry/alerts'); + }); + + it('should return alerts from apm rules', async () => { + const result = await bsearch.send({ + supertest, + options: { + featureIds: [AlertConsumers.APM], + }, + strategy: 'ruleRegistryAlertsSearchStrategy', + space: SPACE1, + }); + expect(result.rawResponse.hits.total).to.eql(2); + const consumers = result.rawResponse.hits.hits.map( + (hit) => hit.fields?.['kibana.alert.rule.consumer'] + ); + expect(consumers.every((consumer) => consumer === AlertConsumers.APM)); + }); + }); + + describe('empty response', () => { + it('should return an empty response', async () => { + const result = await bsearch.send({ + supertest, + options: { + featureIds: [], + }, + strategy: 'ruleRegistryAlertsSearchStrategy', + space: SPACE1, + }); + expect(result.rawResponse).to.eql({}); + }); + }); + }); +}; diff --git a/x-pack/test/security_solution_cypress/config.ts b/x-pack/test/security_solution_cypress/config.ts index 383b7b31206a1..fde617bcf1ce4 100644 --- a/x-pack/test/security_solution_cypress/config.ts +++ b/x-pack/test/security_solution_cypress/config.ts @@ -43,6 +43,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '--xpack.ruleRegistry.write.enabled=true', '--xpack.ruleRegistry.write.cache.enabled=false', '--xpack.ruleRegistry.unsafe.indexUpgrade.enabled=true', + // Without below line, default interval for rules is 1m + // See https://github.com/elastic/kibana/pull/125396 for details + '--xpack.alerting.minimumScheduleInterval=1s', '--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true', `--xpack.securitySolution.enableExperimental=${JSON.stringify([ 'riskyHostsEnabled', diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index 3f057d198a25c..ae1db94292639 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -6,15 +6,9 @@ */ import expect from '@kbn/expect'; -import { DeepPartial } from 'utility-types'; -import { merge } from 'lodash'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PolicyTestResourceInfo } from '../../services/endpoint_policy'; import { IndexedHostsAndAlertsResponse } from '../../../../plugins/security_solution/common/endpoint/index_data'; -import { FullAgentPolicyInput } from '../../../../plugins/fleet/common'; -import { PolicyConfig } from '../../../../plugins/security_solution/common/endpoint/types'; -import { ManifestSchema } from '../../../../plugins/security_solution/common/endpoint/schema/manifest'; -import { policyFactory } from '../../../../plugins/security_solution/common/endpoint/models/policy_config'; import { popupVersionsMap } from '../../../../plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions'; export default function ({ getPageObjects, getService }: FtrProviderContext) { @@ -32,210 +26,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const policyTestResources = getService('policyTestResources'); const endpointTestResources = getService('endpointTestResources'); - type FullAgentPolicyEndpointInput = Omit & { - policy: PolicyConfig; - artifact_manifest: ManifestSchema; - }; - - /** - * Returns the Fleet Agent Policy Input that represents an Endpoint Policy. Use it to - * validate expecte output when looking at the Fleet Agent policy to validate that updates - * to the Endpoint Policy are making it through to the overall Fleet Agent Policy - * - * @param overrides - */ - const getExpectedAgentPolicyEndpointInput = ( - overrides: DeepPartial = {} - ): FullAgentPolicyInput => { - return merge( - { - id: '123', - revision: 2, - data_stream: { namespace: 'default' }, - name: 'Protect East Coast', - meta: { - package: { - name: 'endpoint', - version: '1.0', - }, - }, - artifact_manifest: { - artifacts: { - 'endpoint-exceptionlist-linux-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-exceptionlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-exceptionlist-macos-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-exceptionlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-exceptionlist-windows-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-exceptionlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-hostisolationexceptionlist-linux-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-hostisolationexceptionlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-hostisolationexceptionlist-macos-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-hostisolationexceptionlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-hostisolationexceptionlist-windows-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-hostisolationexceptionlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-trustlist-linux-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-trustlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-trustlist-macos-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-trustlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-trustlist-windows-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-trustlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-eventfilterlist-linux-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-eventfilterlist-linux-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-eventfilterlist-macos-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-eventfilterlist-macos-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - 'endpoint-eventfilterlist-windows-v1': { - compression_algorithm: 'zlib', - decoded_sha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - decoded_size: 14, - encoded_sha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', - encoded_size: 22, - encryption_algorithm: 'none', - relative_url: - '/api/fleet/artifacts/endpoint-eventfilterlist-windows-v1/d801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', - }, - }, - manifest_version: '1', - schema_version: 'v1', - }, - policy: merge(policyFactory(), { - windows: { - popup: { - malware: { - message: 'Elastic Security {action} {filename}', - }, - ransomware: { - message: 'Elastic Security {action} {filename}', - }, - memory_protection: { - message: 'Elastic Security {action} {rule}', - }, - behavior_protection: { - message: 'Elastic Security {action} {rule}', - }, - }, - }, - mac: { - popup: { - malware: { - message: 'Elastic Security {action} {filename}', - }, - behavior_protection: { - message: 'Elastic Security {action} {rule}', - }, - memory_protection: { - message: 'Elastic Security {action} {rule}', - }, - }, - }, - linux: { - popup: { - malware: { - message: 'Elastic Security {action} {filename}', - }, - behavior_protection: { - message: 'Elastic Security {action} {rule}', - }, - memory_protection: { - message: 'Elastic Security {action} {rule}', - }, - }, - }, - }), - type: 'endpoint', - use_output: 'default', - }, - overrides - ); - }; - describe('When on the Endpoint Policy Details Page', function () { let indexedData: IndexedHostsAndAlertsResponse; @@ -400,34 +190,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { policyInfo.agentPolicy.id ); - expect(agentFullPolicy.inputs).to.eql([ - getExpectedAgentPolicyEndpointInput({ - id: policyInfo.packagePolicy.id, - name: policyInfo.packagePolicy.name, - meta: { - package: { - version: policyInfo.packageInfo.version, - }, - }, - artifact_manifest: agentFullPolicy.inputs[0].artifact_manifest, - policy: { - linux: { - events: { - file: false, - }, - advanced: { - agent: { - connection_delay: 'true', - }, - }, - }, - mac: { - events: { file: false }, - }, - windows: { events: { file: false } }, - }, - }), - ]); + expect(agentFullPolicy.inputs[0].policy.linux.advanced.agent.connection_delay).to.eql( + 'true' + ); + expect(agentFullPolicy.inputs[0].policy.linux.events.file).to.eql(false); + expect(agentFullPolicy.inputs[0].policy.mac.events.file).to.eql(false); + expect(agentFullPolicy.inputs[0].policy.windows.events.file).to.eql(false); }); it('should have cleared the advanced section when the user deletes the value', async () => { @@ -446,28 +214,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { policyInfo.agentPolicy.id ); - expect(agentFullPolicy.inputs).to.eql([ - getExpectedAgentPolicyEndpointInput({ - id: policyInfo.packagePolicy.id, - name: policyInfo.packagePolicy.name, - revision: agentFullPolicy.inputs[0].revision, - meta: { - package: { - version: policyInfo.packageInfo.version, - }, - }, - artifact_manifest: agentFullPolicy.inputs[0].artifact_manifest, - policy: { - linux: { - advanced: { - agent: { - connection_delay: 'true', - }, - }, - }, - }, - }), - ]); + expect(agentFullPolicy.inputs[0].policy.linux.advanced.agent.connection_delay).to.eql( + 'true' + ); // Clear the value await advancedPolicyField.click(); @@ -483,19 +232,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { policyInfo.agentPolicy.id ); - expect(agentFullPolicyUpdated.inputs).to.eql([ - getExpectedAgentPolicyEndpointInput({ - id: policyInfo.packagePolicy.id, - name: policyInfo.packagePolicy.name, - revision: agentFullPolicyUpdated.inputs[0].revision, - meta: { - package: { - version: policyInfo.packageInfo.version, - }, - }, - artifact_manifest: agentFullPolicyUpdated.inputs[0].artifact_manifest, - }), - ]); + expect(agentFullPolicyUpdated.inputs[0].policy.linux.advanced).to.eql(undefined); }); }); diff --git a/x-pack/test/security_solution_endpoint/services/endpoint_artifacts.ts b/x-pack/test/security_solution_endpoint/services/endpoint_artifacts.ts index f36c59722de77..f304e110df266 100644 --- a/x-pack/test/security_solution_endpoint/services/endpoint_artifacts.ts +++ b/x-pack/test/security_solution_endpoint/services/endpoint_artifacts.ts @@ -18,6 +18,7 @@ import { TRUSTED_APPS_EXCEPTION_LIST_DEFINITION } from '../../../plugins/securit import { EndpointError } from '../../../plugins/security_solution/common/endpoint/errors'; import { EVENT_FILTER_LIST_DEFINITION } from '../../../plugins/security_solution/public/management/pages/event_filters/constants'; import { HOST_ISOLATION_EXCEPTIONS_LIST_DEFINITION } from '../../../plugins/security_solution/public/management/pages/host_isolation_exceptions/constants'; +import { BLOCKLISTS_LIST_DEFINITION } from '../../../plugins/security_solution/public/management/pages/blocklist/constants'; export interface ArtifactTestData { artifact: ExceptionListItemSchema; @@ -108,4 +109,13 @@ export class EndpointArtifactsTestResources extends FtrService { return this.createExceptionItem(artifact); } + + async createBlocklist( + overrides: Partial = {} + ): Promise { + await this.ensureListExists(BLOCKLISTS_LIST_DEFINITION); + const blocklist = this.exceptionsGenerator.generateBlocklistForCreate(overrides); + + return this.createExceptionItem(blocklist); + } } diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/host_isolation_exceptions.ts b/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/host_isolation_exceptions.ts index ffa7473e95416..5e1166d03f0d5 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/host_isolation_exceptions.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/host_isolation_exceptions.ts @@ -11,7 +11,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PolicyTestResourceInfo } from '../../../security_solution_endpoint/services/endpoint_policy'; import { ArtifactTestData } from '../../../security_solution_endpoint/services/endpoint_artifacts'; -import { BY_POLICY_ARTIFACT_TAG_PREFIX } from '../../../../plugins/security_solution/common/endpoint/service/artifacts'; +import { + BY_POLICY_ARTIFACT_TAG_PREFIX, + GLOBAL_ARTIFACT_TAG, +} from '../../../../plugins/security_solution/common/endpoint/service/artifacts'; import { createUserAndRole, deleteUserAndRole, @@ -29,6 +32,7 @@ export default function ({ getService }: FtrProviderContext) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const endpointPolicyTestResources = getService('endpointPolicyTestResources'); const endpointArtifactTestResources = getService('endpointArtifactTestResources'); + const log = getService('log'); type ApiCallsInterface = Array<{ method: keyof Pick; @@ -67,7 +71,10 @@ export default function ({ getService }: FtrProviderContext) { { method: 'post', path: EXCEPTION_LIST_ITEM_URL, - getBody: () => exceptionsGenerator.generateHostIsolationExceptionForCreate(), + getBody: () => + exceptionsGenerator.generateHostIsolationExceptionForCreate({ + tags: [GLOBAL_ARTIFACT_TAG], + }), }, { method: 'put', @@ -77,6 +84,7 @@ export default function ({ getService }: FtrProviderContext) { id: existingExceptionData.artifact.id, item_id: existingExceptionData.artifact.item_id, _version: existingExceptionData.artifact._version, + tags: [GLOBAL_ARTIFACT_TAG], }), }, ]; @@ -214,11 +222,17 @@ export default function ({ getService }: FtrProviderContext) { await supertest[apiCall.method](apiCall.path) .set('kbn-xsrf', 'true') + .on('error', (error) => { + log.error(JSON.stringify(error?.response?.body ?? error, null, 2)); + }) .send(body) .expect(200); const deleteUrl = `${EXCEPTION_LIST_ITEM_URL}?item_id=${body.item_id}&namespace_type=${body.namespace_type}`; - await supertest.delete(deleteUrl).set('kbn-xsrf', 'true'); + + log.info(`cleaning up: ${deleteUrl}`); + + await supertest.delete(deleteUrl).set('kbn-xsrf', 'true').expect(200); }); } }); diff --git a/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/trusted_apps.ts b/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/trusted_apps.ts index 7caf4f085694a..60b479c5b37d9 100644 --- a/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/trusted_apps.ts +++ b/x-pack/test/security_solution_endpoint_api_int/apis/endpoint_artifacts/trusted_apps.ts @@ -11,7 +11,10 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PolicyTestResourceInfo } from '../../../security_solution_endpoint/services/endpoint_policy'; import { ArtifactTestData } from '../../../security_solution_endpoint/services//endpoint_artifacts'; -import { BY_POLICY_ARTIFACT_TAG_PREFIX } from '../../../../plugins/security_solution/common/endpoint/service/artifacts'; +import { + BY_POLICY_ARTIFACT_TAG_PREFIX, + GLOBAL_ARTIFACT_TAG, +} from '../../../../plugins/security_solution/common/endpoint/service/artifacts'; import { ExceptionsListItemGenerator } from '../../../../plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator'; import { createUserAndRole, @@ -91,7 +94,9 @@ export default function ({ getService }: FtrProviderContext) { { method: 'post', path: EXCEPTION_LIST_ITEM_URL, - getBody: () => exceptionsGenerator.generateTrustedAppForCreate(), + getBody: () => { + return exceptionsGenerator.generateTrustedAppForCreate({ tags: [GLOBAL_ARTIFACT_TAG] }); + }, }, { method: 'put', @@ -100,6 +105,7 @@ export default function ({ getService }: FtrProviderContext) { exceptionsGenerator.generateTrustedAppForUpdate({ id: trustedAppData.artifact.id, item_id: trustedAppData.artifact.item_id, + tags: [GLOBAL_ARTIFACT_TAG], }), }, ]; diff --git a/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts b/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts index 20fc34f77dbf8..e7769f2761f3f 100644 --- a/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts +++ b/x-pack/test/upgrade/apps/reporting/reporting_smoke_tests.ts @@ -71,6 +71,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { } const advOpt = await find.byXPath(`//button[descendant::*[text()='Advanced options']]`); await advOpt.click(); + // Workaround for: https://github.com/elastic/kibana/issues/126540 + const isUrlTooLong = await testSubjects.exists('urlTooLongErrorMessage'); + if (isUrlTooLong) { + // Save dashboard + await PageObjects.dashboard.switchToEditMode(); + await PageObjects.dashboard.clickQuickSave(); + await PageObjects.share.openShareMenuItem(link); + if (type === 'pdf_optimize') { + await testSubjects.click('usePrintLayout'); + } + const advOpt2 = await find.byXPath( + `//button[descendant::*[text()='Advanced options']]` + ); + await advOpt2.click(); + } const postUrl = await find.byXPath(`//button[descendant::*[text()='Copy POST URL']]`); await postUrl.click(); const url = await browser.getClipboardValue(); diff --git a/yarn.lock b/yarn.lock index 3a4e8503fc8fa..1994a2f42e4a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2142,6 +2142,11 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" @@ -2371,12 +2376,12 @@ dependencies: "@elastic/ecs-helpers" "^1.1.0" -"@elastic/elasticsearch@npm:@elastic/elasticsearch-canary@8.1.0-canary.2": - version "8.1.0-canary.2" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch-canary/-/elasticsearch-canary-8.1.0-canary.2.tgz#7676b3bdad79a37be4b4ada38f97751314a33a52" - integrity sha512-nmr7yZbvlTqA5SHu/IJZFsU6v14+Y2nx0btMKB9Hjd0vardaibCAdovO9Bp1RPxda2g6XayEkKEzwq5s79xR1g== +"@elastic/elasticsearch@npm:@elastic/elasticsearch-canary@8.1.0-canary.3": + version "8.1.0-canary.3" + resolved "https://registry.yarnpkg.com/@elastic/elasticsearch-canary/-/elasticsearch-canary-8.1.0-canary.3.tgz#a84669ad45ea465e533d860bf99aa55aed781cb3" + integrity sha512-rpsMiJX5sAAlPjfWzZhijQgpu7ZlPwjcJQHCT3wNz03DTDnokLCqkhc8gsU+uqesbQ/GqYUlSL9erCk4GqjOLg== dependencies: - "@elastic/transport" "^8.1.0-beta.1" + "@elastic/transport" "^8.0.2" tslib "^2.3.0" "@elastic/ems-client@8.0.0": @@ -2559,17 +2564,17 @@ ts-node "^10.2.1" typescript "^4.3.5" -"@elastic/transport@^8.1.0-beta.1": - version "8.1.0-beta.1" - resolved "https://registry.yarnpkg.com/@elastic/transport/-/transport-8.1.0-beta.1.tgz#37fde777cf83226f1ea46bf0a22e51a3e43efb85" - integrity sha512-aqncMX86d3r6tNGlve6HEy+NF8XZXetMxDXpplrOAcShL20mHXkMFTJyUyML01tgfkbbgwXnN714YEjin1u1Xg== +"@elastic/transport@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@elastic/transport/-/transport-8.0.2.tgz#715f06c7739516867508108df30c33973ca8e81c" + integrity sha512-OlDz3WO3pKE9vSxW4wV/mn7rYCtBmSsDwxr64h/S1Uc/zrIBXb0iUsRMSkiybXugXhjwyjqG2n1Wc7jjFxrskQ== dependencies: debug "^4.3.2" hpagent "^0.1.2" ms "^2.1.3" secure-json-parse "^2.4.0" tslib "^2.3.0" - undici "^4.7.0" + undici "^4.14.1" "@emotion/babel-plugin-jsx-pragmatic@^0.1.5": version "0.1.5" @@ -7582,10 +7587,10 @@ resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.28.tgz#9ce8fa048c1e8c85cb71d7fe4d704e000226036f" integrity sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA== -"@types/selenium-webdriver@^4.0.16": - version "4.0.16" - resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.0.16.tgz#c3205c6691a1d645cf4163684bd119230a60e6f5" - integrity sha512-0UAzu2lFXpLK4lU4yhgUtM/KxoN8hIpyI+q22KAwzIDHNk4kLJ/Ut5mJZLFSxfQx58OBQ9SJXZkSL065fe/WdQ== +"@types/selenium-webdriver@^4.0.18": + version "4.0.18" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.0.18.tgz#98f6e1ccd2d92f6fddaccfc7c148d2e158da0f92" + integrity sha512-gkrUo3QldGr8V9im/DjgKkX4UVd1rtflfEBuPG9hPSA1keu7A0rF8h/MQjpTMm2EPVhBCd2K8tn5nlC9Vsd5Xw== "@types/semver@^7": version "7.3.4" @@ -9587,10 +9592,10 @@ bach@^1.0.0: async-settle "^1.0.0" now-and-later "^2.0.0" -backport@7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/backport/-/backport-7.0.1.tgz#021f70db76b89699b2c7b826cb3040e9c1d991c9" - integrity sha512-f/7+NDzLFd307c85Tz60cfBzoRd4HlFlNOm3MYFynQwI4igMmKd4J9bFxLgc3KdToaVWDmZ37Gx9nRkYgMfUkA== +backport@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/backport/-/backport-7.3.1.tgz#c5c57e03c87f5883f769e30efc0e7193ce7670f2" + integrity sha512-F1gjJx/pxn9zI74Np6FlTD8ovqeUbzzgzGyBpoYypAdDTJG8Vxt1jcrcwZtRIaSd7McfXCSoQsinlFzO4qlPcA== dependencies: "@octokit/rest" "^18.12.0" axios "^0.25.0" @@ -9608,7 +9613,7 @@ backport@7.0.1: strip-json-comments "^3.1.1" terminal-link "^2.1.1" utility-types "^3.10.0" - winston "^3.5.1" + winston "^3.6.0" yargs "^17.3.1" yargs-parser "^21.0.0" @@ -10749,10 +10754,10 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^97.0.2: - version "97.0.2" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-97.0.2.tgz#b6c26f6667ad40dc8cf08818878cc064787116fc" - integrity sha512-sOAfKCR3WsHvmKedZoWa+3tBVGdPtxq4zKxgKZCoJ2c924olBTW4Bnha6SHl93Yo7+QqsNn6ZpAC0ojhutacAg== +chromedriver@^98.0.0: + version "98.0.0" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-98.0.0.tgz#b2c3c1941fad4cdfadad5d4c46923e02f089fd30" + integrity sha512-Oi6Th5teK+VI4nti+423/dFkENYHEMOdUvqwJHzOaNwXqLwZ8FuSaKBybgALCctGapwJbd+tmPv3qSd6tUUIHQ== dependencies: "@testim/chrome-version" "^1.1.2" axios "^0.24.0" @@ -11595,10 +11600,10 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== -core-js@^3.0.4, core-js@^3.21.0, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: - version "3.21.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.0.tgz#f479dbfc3dffb035a0827602dd056839a774aa71" - integrity sha512-YUdI3fFu4TF/2WykQ2xzSiTQdldLB4KVuL9WeAy5XONZYt5Cun/fpQvctoKbCgvPhmzADeesTk/j2Rdx77AcKQ== +core-js@^3.0.4, core-js@^3.21.1, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.1.tgz#f2e0ddc1fc43da6f904706e8e955bc19d06a0d94" + integrity sha512-FRq5b/VMrWlrmCzwRrpDYNxyHP9BcAZC+xHJaqTgIE5091ZV1NTmyh0sGOg5XqpnHvR0svdy0sv1gWA1zmhxig== core-util-is@1.0.2, core-util-is@^1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -20101,6 +20106,17 @@ logform@^2.3.2: safe-stable-stringify "^1.1.0" triple-beam "^1.3.0" +logform@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/logform/-/logform-2.4.0.tgz#131651715a17d50f09c2a2c1a524ff1a4164bcfe" + integrity sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw== + dependencies: + "@colors/colors" "1.5.0" + fecha "^4.2.0" + ms "^2.1.1" + safe-stable-stringify "^2.3.1" + triple-beam "^1.3.0" + loglevel@^1.6.8: version "1.6.8" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.8.tgz#8a25fb75d092230ecd4457270d80b54e28011171" @@ -29147,10 +29163,10 @@ undertaker@^1.2.1: object.reduce "^1.0.0" undertaker-registry "^1.0.0" -undici@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-4.7.0.tgz#3bda286d67bf45d0ab1b94ca6c84e546dcb3b0d4" - integrity sha512-O1q+/EIs4g0HnVMH8colei3qODGiYBLpavWYv3kI+JazBBsBIndnZfUqZ2MEfPJ12H9d56yVdwZG1/nV/xcoSQ== +undici@^4.14.1: + version "4.14.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-4.14.1.tgz#7633b143a8a10d6d63335e00511d071e8d52a1d9" + integrity sha512-WJ+g+XqiZcATcBaUeluCajqy4pEDcQfK1vy+Fo+bC4/mqXI9IIQD/XWHLS70fkGUT6P52Drm7IFslO651OdLPQ== unfetch@^4.2.0: version "4.2.0" @@ -30808,7 +30824,7 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -winston-transport@^4.4.2: +winston-transport@^4.4.2, winston-transport@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa" integrity sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q== @@ -30817,7 +30833,7 @@ winston-transport@^4.4.2: readable-stream "^3.6.0" triple-beam "^1.3.0" -winston@^3.0.0, winston@^3.3.3, winston@^3.5.1: +winston@^3.0.0, winston@^3.3.3: version "3.5.1" resolved "https://registry.yarnpkg.com/winston/-/winston-3.5.1.tgz#b25cc899d015836dbf8c583dec8c4c4483a0da2e" integrity sha512-tbRtVy+vsSSCLcZq/8nXZaOie/S2tPXPFt4be/Q3vI/WtYwm7rrwidxVw2GRa38FIXcJ1kUM6MOZ9Jmnk3F3UA== @@ -30833,6 +30849,22 @@ winston@^3.0.0, winston@^3.3.3, winston@^3.5.1: triple-beam "^1.3.0" winston-transport "^4.4.2" +winston@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/winston/-/winston-3.6.0.tgz#be32587a099a292b88c49fac6fa529d478d93fb6" + integrity sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w== + dependencies: + "@dabh/diagnostics" "^2.0.2" + async "^3.2.3" + is-stream "^2.0.0" + logform "^2.4.0" + one-time "^1.0.0" + readable-stream "^3.4.0" + safe-stable-stringify "^2.3.1" + stack-trace "0.0.x" + triple-beam "^1.3.0" + winston-transport "^4.5.0" + wkt-parser@^1.2.4: version "1.3.2" resolved "https://registry.yarnpkg.com/wkt-parser/-/wkt-parser-1.3.2.tgz#deeff04a21edc5b170a60da418e9ed1d1ab0e219"