{"id":16515148,"url":"https://github.com/jacobwgillespie/elastic-ts","last_synced_at":"2025-04-16T06:14:49.919Z","repository":{"id":31897705,"uuid":"130754756","full_name":"jacobwgillespie/elastic-ts","owner":"jacobwgillespie","description":"TypeScript + Elasticsearch + magic ✨","archived":false,"fork":false,"pushed_at":"2024-09-26T08:15:44.000Z","size":1309,"stargazers_count":41,"open_issues_count":5,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-29T05:09:01.612Z","etag":null,"topics":["elasticsearch","query-builder","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobwgillespie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-23T20:46:31.000Z","updated_at":"2025-03-16T05:14:10.000Z","dependencies_parsed_at":"2025-02-24T01:02:16.044Z","dependency_job_id":"33e3461a-db13-4f7b-9a68-7d33dcc480c6","html_url":"https://github.com/jacobwgillespie/elastic-ts","commit_stats":{"total_commits":366,"total_committers":6,"mean_commits":61.0,"dds":"0.17486338797814205","last_synced_commit":"391e09909d687224a1a3d1e36f5ec90c2c0f746a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Felastic-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Felastic-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Felastic-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwgillespie%2Felastic-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwgillespie","download_url":"https://codeload.github.com/jacobwgillespie/elastic-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249207218,"owners_count":21230028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","query-builder","typescript"],"created_at":"2024-10-11T16:15:32.403Z","updated_at":"2025-04-16T06:14:49.898Z","avatar_url":"https://github.com/jacobwgillespie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✨ elastic-ts\n\n[![Build Status](https://travis-ci.org/jacobwgillespie/elastic-ts.svg?branch=master)](https://travis-ci.org/jacobwgillespie/elastic-ts)\n![Status: Alpha](https://img.shields.io/badge/status-alpha-red.svg)\n[![npm](https://img.shields.io/npm/dm/elastic-ts.svg)](https://www.npmjs.com/package/elastic-ts)\n[![npm](https://img.shields.io/npm/v/elastic-ts.svg)](https://www.npmjs.com/package/elastic-ts)\n![Powered by TypeScript](https://img.shields.io/badge/powered%20by-typescript-blue.svg)\n\nA TypeScript module for working with Elasticsearch.\n\n### Goals\n\n- Provide TypeScript types for Elasticsearch queries\n- Provide a typed query body builder with an immutable API\n\n### Non-goals\n\n- Replace the official Elasticsearch API client\n\n## Requirements\n\n- TypeScript 2.8 - this project uses conditional types which were introduced in TypeScript 2.8\n\n## Installation\n\n```\nyarn add elastic-ts\n```\n\n## Usage\n\n### Types\n\n```typescript\nimport {SearchBody} from 'elastic-ts'\n\nconst body: SearchBody = {\n  query: {\n    match_all: {},\n  },\n}\n```\n\n### Builder\n\n```typescript\nimport {esBuilder} from 'elastic-ts'\n\nconst body = esBuilder()\n  .query('match_all', {})\n  .filter('terms', 'field', ['one', 'two'])\n  .build()\n```\n\n### Credits\n\nThe query builder API is heavily inspired by [bodybuilder](https://github.com/danpaz/bodybuilder), although there are subtle API and behavioral differences.\n\n### Contributing\n\nYou can build the project by running `yarn build`, or can be continuously built with `yarn watch`. Tests are executed by running `yarn test`.\n\n**NOTE:** the tests run against the _built_ output files, so you will need to run `yarn build` or `yarn watch` before running `yarn test`.\n\n### License\n\nThe MIT license. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwgillespie%2Felastic-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwgillespie%2Felastic-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwgillespie%2Felastic-ts/lists"}