@elastic/esql 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elastic/esql",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "author": "Kibana ES|QL team",
5
5
  "description": "A set of ts tools to parse, build and transform ES|QL queries programmatically.",
6
6
  "packageManager": "yarn@1.22.22",
@@ -38,7 +38,7 @@
38
38
  "lint:fix": "eslint . --fix",
39
39
  "format": "prettier --write .",
40
40
  "format:check": "prettier --check .",
41
- "build": "tsup && tsc",
41
+ "build": "tsup && tsc -p tsconfig.build.json",
42
42
  "build:watch": "tsup --watch --onSuccess \"tsc\"",
43
43
  "prebuild:antlr4": "brew bundle --file=./.buildkite/scripts/antlr4_tools/brewfile",
44
44
  "build:antlr4": "npm run build:antlr4:esql && npm run build:antlr4:promql",
@@ -67,12 +67,12 @@
67
67
  "@semantic-release/github": "12.0.6",
68
68
  "@semantic-release/npm": "13.1.5",
69
69
  "@semantic-release/release-notes-generator": "14.1.0",
70
- "@storybook/react-vite": "10.3.5",
70
+ "@storybook/react-vite": "10.3.6",
71
71
  "@types/jest": "30.0.0",
72
72
  "@types/react": "^19.2.14",
73
- "eslint": "10.2.1",
73
+ "eslint": "10.3.0",
74
74
  "eslint-config-prettier": "10.1.8",
75
- "eslint-plugin-storybook": "10.3.5",
75
+ "eslint-plugin-storybook": "10.3.6",
76
76
  "husky": "9.1.7",
77
77
  "jest": "30.3.0",
78
78
  "lint-staged": "16.4.0",
@@ -80,11 +80,11 @@
80
80
  "react": "19.2.5",
81
81
  "react-dom": "19.2.5",
82
82
  "semantic-release": "25.0.3",
83
- "storybook": "10.3.5",
83
+ "storybook": "10.3.6",
84
84
  "ts-jest": "29.4.9",
85
85
  "tsup": "8.5.1",
86
86
  "typescript": "6.0.3",
87
- "typescript-eslint": "8.59.1",
87
+ "typescript-eslint": "8.59.2",
88
88
  "vite": "8.0.10"
89
89
  },
90
90
  "dependencies": {
@@ -1,4 +0,0 @@
1
- export declare const smallest = "FROM a";
2
- export declare const sortCommandFromDocs = "FROM employees\n| KEEP first_name, last_name, height\n| SORT height";
3
- export declare const large = "\n// This is a comment, not a \"string\"\nFROM index, metrics:index, \"another_index\", \"\"\"index\"\"\", metrics-metrics-metrics METADATA _id, _index\n /* This is a multiline\n comment */\n// | FORK (WHERE ?param.test == \"asdf\" | LIMIT 123) (LIMIT 123)\n | EVAL kb = bytes / 1024 * -1.23e456 + ?param <= 3, a = 5 WEEKS, foo = \"baasdfr\", ? <= ?asdf\n | WHERE process.name == \"curl.exe /* asdf */\" AND ?42 == 123 OR ?\n | WHERE event_duration > /* very big number */ 5000000\n | WHERE message LIKE \"Connected*\"\n | KEEP kb, destination.address, date, ip, email, num, avg.avg.avg\n // The ten is\n // very sensible number\n | LIMIT 10\n | STATS bytes = (SUM(destination.bytes, true))::INTEGER\n | SORT asdf\n | WHERE MATCH( aws.s3.bucket.name, ?variable, {\n \"minimum_should_match\": ?min_should_match,\n \"fuzziness\": 2,\n \"key\": \"value\",\n \"nil\": NULL,\n \"another_param\": ?param\n })\n | SORT @timestamp DESC, @timestamp ASC\n | SORT kb, date ASC NULLS FIRST, ip DESC NULLS LAST\n | DROP date, ip, `AVG(FALSE, null, { \"this\": \"is\", \"map\": 123 })`\n | RENAME field AS another_field, another_field AS field\n | RENAME unique_queries AS `Unique Queries`\n /**\n * Description, not \"string\"\n * @description This is a description\n * @color #0077ff\n */\n | DISSECT field \"\"\"%{date} - %{msg} - %{ip}\"\"\"\n | GROK dns.question.name \"asdf\"\n | ENRICH languages_policy ON a WITH name = language_name, more\n | MV_EXPAND column\n | INLINESTATS count = COUNT(ROUND(AVG(\n MV_AVG(department.salary_change)), 10))\n BY languages\n | LOOKUP JOIN join_index ON x.foo";
4
- //# sourceMappingURL=fixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,WAAW,CAAC;AAEjC,eAAO,MAAM,mBAAmB,wEAElB,CAAC;AAEf,eAAO,MAAM,KAAK,koDAwCkB,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const query1 = "\nfrom kibana_sample_data_logs\n| EVAL timestamp=DATE_TRUNC(3 hour, @timestamp), status = CASE( to_integer(response.keyword) >= 200 and to_integer(response.keyword) < 400, \"HTTP 2xx and 3xx\", to_integer(response.keyword) >= 400 and to_integer(response.keyword) < 500, \"HTTP 4xx\", \"HTTP 5xx\")\n| stats results = count(*) by `Over time` = BUCKET(timestamp, 50, ?_tstart, ?_tend), status\n";
2
- export declare const query2 = "\nfrom kibana_sample_data_logs\n| sort @timestamp\n| eval t = now()\n| eval key = case(timestamp < t - 1 hour and timestamp > t - 2 hour, \"Last hour\", \"Other\")\n| stats sum = sum(bytes), count = count_distinct(clientip) by key, extension.keyword\n| eval sum_last_hour = case(key == \"Last hour\", sum), sum_rest = case(key == \"Other\", sum), count_last_hour = case(key == \"Last hour\", count), count_rest = case(key == \"Other\", count)\n| stats sum_last_hour = max(sum_last_hour), sum_rest = max(sum_rest), count_last_hour = max(count_last_hour), count_rest = max(count_rest) by key, extension.keyword\n| eval total_bytes = to_double(coalesce(sum_last_hour, 0::long) + coalesce(sum_rest, 0::long))\n| eval total_visits = to_double(coalesce(count_last_hour, 0::long) + coalesce(count_rest, 0::long))\n| eval bytes_transform = round(total_bytes / 1000000.0, 1)\n| eval bytes_transform_last_hour = round(sum_last_hour / 1000.0, 2)\n| keep count_last_hour, total_visits, bytes_transform, bytes_transform_last_hour, extension.keyword\n| stats count_last_hour = sum(count_last_hour), total_visits = sum(total_visits), bytes_transform = sum(bytes_transform), bytes_transform_last_hour = sum(bytes_transform_last_hour) by extension.keyword\n| rename total_visits as `Unique Visits (Total)`, count_last_hour as `Unique Visits (Last hour)`, bytes_transform as `Bytes(Total - MB)`, bytes_transform_last_hour as `Bytes(Last hour - KB)`, extension.keyword as `Type`\n";
3
- export declare const query3 = "\nfrom kibana_sample_data_logs\n| keep bytes, clientip, url.keyword, response.keyword\n| EVAL type = CASE(to_integer(response.keyword) >= 400 and to_integer(response.keyword) < 500, \"4xx\", to_integer(response.keyword) >= 500, \"5xx\", \"Other\")\n| stats Visits = count(), Unique = count_distinct(clientip), p95 = percentile(bytes, 95), median = median(bytes) by type, url.keyword\n| eval count_4xx = case(type == \"4xx\", Visits), count_5xx = case(type == \"5xx\", Visits), count_rest = case(type == \"Other\", Visits)\n| stats count_4xx = sum(count_4xx), count_5xx = sum(count_5xx), count_rest = sum(count_rest), Unique = sum(Unique),`95th percentile of bytes` = max(p95), `Median of bytes` = max(median) BY url.keyword\n| eval count_4xx = COALESCE(count_4xx, 0::LONG), count_5xx = COALESCE(count_5xx, 0::LONG), count_rest = COALESCE(count_rest, 0::LONG)\n| eval total_records = TO_DOUBLE(count_4xx + count_5xx + count_rest)\n| eval percentage_4xx = count_4xx / total_records, percentage_5xx = count_5xx / total_records\n| eval percentage_4xx = round(100 * percentage_4xx, 2)\n| eval percentage_5xx = round(100 * percentage_5xx, 2)\n| drop count_4xx, count_rest, total_records\n| RENAME percentage_4xx as `HTTP 4xx`, percentage_5xx as `HTTP 5xx`\n";
4
- export declare const query4 = "\nfrom kibana_sample_data_logs, kibana_sample_data_flights, kibana_sample_data_ecommerce,\n index1, my-data-2024-*, my-data-2025-01-*, xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx, yyyy-yyyy-yyyy-yyyy-yyyy-yyyy-yyyy-yyyy-yyyy\n METADATA _index, _id, _type, _score\n\n| sort @timestamp\n| eval t = now()\n| eval key = case(timestamp < t - 1 hour and timestamp > t - 2 hour, \"Last hour\", \"Other\")\n| stats sum = sum(bytes), count = count_distinct(clientip) by key, extension.keyword\n| eval sum_last_hour = case(key == \"Last hour\", sum), sum_rest = case(key == \"Other\", sum), count_last_hour = case(key == \"Last hour\", count), count_rest = case(key == \"Other\", count)\n| stats sum_last_hour = max(sum_last_hour), sum_rest = max(sum_rest), count_last_hour = max(count_last_hour), count_rest = max(count_rest) by key, extension.keyword\n| eval total_bytes = to_double(coalesce(sum_last_hour, 0::long) + coalesce(sum_rest, 0::long))\n| eval total_visits = to_double(coalesce(count_last_hour, 0::long) + coalesce(count_rest, 0::long))\n| eval bytes_transform = round(total_bytes / 1000000.0, 1)\n| eval bytes_transform_last_hour = round(sum_last_hour / 1000.0, 2)\n| keep count_last_hour, total_visits, bytes_transform, bytes_transform_last_hour, extension.keyword\n| stats count_last_hour = sum(count_last_hour), total_visits = sum(total_visits), bytes_transform = sum(bytes_transform), bytes_transform_last_hour = sum(bytes_transform_last_hour) by extension.keyword\n| rename total_visits as `Unique Visits (Total)`, count_last_hour as `Unique Visits (Last hour)`, bytes_transform as `Bytes(Total - MB)`, bytes_transform_last_hour as `Bytes(Last hour - KB)`, extension.keyword as `Type`\n";
5
- //# sourceMappingURL=fixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/pretty_print/__tests__/fixtures.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,uZAIlB,CAAC;AAEF,eAAO,MAAM,MAAM,07CAelB,CAAC;AAEF,eAAO,MAAM,MAAM,2uCAclB,CAAC;AAEF,eAAO,MAAM,MAAM,kqDAkBlB,CAAC"}