{"_id":"@doralhw-org/coql-query-builder","_rev":"4-306bb9e6759adae2f44df7593a1839bf","name":"@doralhw-org/coql-query-builder","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@doralhw-org/coql-query-builder","version":"0.1.0","keywords":["zoho","crm","coql","query-builder","typescript","zoho-crm","query","builder"],"author":{"name":"doralhw-org"},"license":"MIT","_id":"@doralhw-org/coql-query-builder@0.1.0","maintainers":[{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},{"name":"jverges-doral","email":"jverges@doralhw.org"}],"homepage":"https://github.com/doralhw-org/coql-query-builder#readme","bugs":{"url":"https://github.com/doralhw-org/coql-query-builder/issues"},"dist":{"shasum":"0f29c54364c59471d6c5419399a735b710896a8f","tarball":"https://registry.npmjs.org/@doralhw-org/coql-query-builder/-/coql-query-builder-0.1.0.tgz","fileCount":87,"integrity":"sha512-lVKkQLJFx9vZ0sM/yOW8tY9gRHf/97kkj4Nz/RR6Xg/5REpcHILzDDjamAumeOo2drnFNUTMiPALkKRx2YySug==","signatures":[{"sig":"MEQCIHHF5h0fXjErIWZOdhEujvxrAbskOx1otvC8jH7hwwk5AiA6UPWl8Z1NrNEOTC+ubI4GfSXYlVBgy2N79JNH6sokMw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78592},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"77d44613089dcad421ea583e3320bb72be6654a1","scripts":{"lint":"eslint lib --ext .ts","test":"jest","build":"pnpm run clean && tsc -p tsconfig.build.json","clean":"rimraf dist","prepack":"pnpm run build","lint:fix":"eslint lib --ext .ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage","prepublishOnly":"pnpm run build && pnpm test"},"_npmUser":{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},"repository":{"url":"git+https://github.com/doralhw-org/coql-query-builder.git","type":"git"},"_npmVersion":"9.5.1","description":"A lightweight query builder for Zoho CRM that abstracts the COQL queries and provides a fluent API for building them.","directories":{},"_nodeVersion":"18.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.0.5","eslint":"^9.32.0","rimraf":"^6.0.1","globals":"^16.3.0","ts-jest":"^29.4.0","@eslint/js":"^9.32.0","typescript":"^5.8.3","@types/jest":"^30.0.0 ","@types/node":"^24.1.0","typescript-eslint":"^8.38.0","@typescript-eslint/parser":"^8.38.0","@typescript-eslint/eslint-plugin":"^8.38.0"},"_npmOperationalInternal":{"tmp":"tmp/coql-query-builder_0.1.0_1754947577325_0.879494063097199","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@doralhw-org/coql-query-builder","version":"0.2.0","keywords":["zoho","crm","coql","query-builder","typescript","zoho-crm","query","builder"],"author":{"name":"doralhw-org"},"license":"MIT","_id":"@doralhw-org/coql-query-builder@0.2.0","maintainers":[{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},{"name":"jverges-doral","email":"jverges@doralhw.org"}],"homepage":"https://github.com/doralhw-org/coql-query-builder#readme","bugs":{"url":"https://github.com/doralhw-org/coql-query-builder/issues"},"dist":{"shasum":"0b27a348416898782ce11130f00cfbed0b40daac","tarball":"https://registry.npmjs.org/@doralhw-org/coql-query-builder/-/coql-query-builder-0.2.0.tgz","fileCount":87,"integrity":"sha512-O9OjLRQ5fExuqxH8pvpmPWkvqo/PJsnCWiWo5Omk//Tslcb7Xm0XzGYnUny3fKGndn+AJDwOhRVOII51RGxneQ==","signatures":[{"sig":"MEQCIH7UMIH3uXqbsFlU8CLxDJQsBqHYFxRRw09t6lg3gNWRAiBKdvbjXP3EApVh8rviyHOMcSZJZWlCdUteMR6XXfZ0eg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80080},"main":"dist/index.js","_from":"file:doralhw-org-coql-query-builder-0.2.0.tgz","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"lint":"eslint lib --ext .ts","test":"jest","build":"pnpm run clean && tsc -p tsconfig.build.json","clean":"rimraf dist","lint:fix":"eslint lib --ext .ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},"_resolved":"/tmp/f69587156a940b04a36dad5d52bd80e8/doralhw-org-coql-query-builder-0.2.0.tgz","_integrity":"sha512-O9OjLRQ5fExuqxH8pvpmPWkvqo/PJsnCWiWo5Omk//Tslcb7Xm0XzGYnUny3fKGndn+AJDwOhRVOII51RGxneQ==","repository":{"url":"git+https://github.com/doralhw-org/coql-query-builder.git","type":"git"},"_npmVersion":"9.5.1","description":"A lightweight query builder for Zoho CRM that abstracts the COQL queries and provides a fluent API for building them.","directories":{},"_nodeVersion":"18.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.0.5","eslint":"^9.32.0","rimraf":"^6.0.1","globals":"^16.3.0","ts-jest":"^29.4.0","@eslint/js":"^9.32.0","typescript":"^5.8.3","@types/jest":"^30.0.0 ","@types/node":"^24.1.0","typescript-eslint":"^8.38.0","@typescript-eslint/parser":"^8.38.0","@typescript-eslint/eslint-plugin":"^8.38.0"},"_npmOperationalInternal":{"tmp":"tmp/coql-query-builder_0.2.0_1756174261628_0.11902628471820775","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@doralhw-org/coql-query-builder","version":"0.2.1","keywords":["zoho","crm","coql","query-builder","typescript","zoho-crm","query","builder"],"author":{"name":"doralhw-org"},"license":"MIT","_id":"@doralhw-org/coql-query-builder@0.2.1","maintainers":[{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},{"name":"jverges-doral","email":"jverges@doralhw.org"}],"homepage":"https://github.com/doralhw-org/coql-query-builder#readme","bugs":{"url":"https://github.com/doralhw-org/coql-query-builder/issues"},"dist":{"shasum":"8dbbba2728f61da54c49cbe3ecc36da057ac17c8","tarball":"https://registry.npmjs.org/@doralhw-org/coql-query-builder/-/coql-query-builder-0.2.1.tgz","fileCount":87,"integrity":"sha512-gEv9MeFNj22Nhy+SkBSRGSDVMdZRenvt71G7kdFjemu9spYjgbNFhmVjKGehVeVCsEBei5hGwB+0vJxl1gekFQ==","signatures":[{"sig":"MEQCIHWyL/OfgqkSYqoQKeeYThYHdUSXWMa5hZYUG/RRXFZOAiBLppGyq9uhmZp9IKgOmNmZIyMRY1QfftY3vTpuisM5fg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80855},"main":"dist/index.js","_from":"file:doralhw-org-coql-query-builder-0.2.1.tgz","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"lint":"eslint lib --ext .ts","test":"jest","build":"pnpm run clean && tsc -p tsconfig.build.json","clean":"rimraf dist","lint:fix":"eslint lib --ext .ts --fix","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},"_resolved":"/tmp/8902a20e7956713b53688cec9ae10d84/doralhw-org-coql-query-builder-0.2.1.tgz","_integrity":"sha512-gEv9MeFNj22Nhy+SkBSRGSDVMdZRenvt71G7kdFjemu9spYjgbNFhmVjKGehVeVCsEBei5hGwB+0vJxl1gekFQ==","repository":{"url":"git+https://github.com/doralhw-org/coql-query-builder.git","type":"git"},"_npmVersion":"9.5.1","description":"A lightweight query builder for Zoho CRM that abstracts the COQL queries and provides a fluent API for building them.","directories":{},"_nodeVersion":"18.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.0.5","eslint":"^9.32.0","rimraf":"^6.0.1","globals":"^16.3.0","ts-jest":"^29.4.0","@eslint/js":"^9.32.0","typescript":"^5.8.3","@types/jest":"^30.0.0 ","@types/node":"^24.1.0","typescript-eslint":"^8.38.0","@typescript-eslint/parser":"^8.38.0","@typescript-eslint/eslint-plugin":"^8.38.0"},"_npmOperationalInternal":{"tmp":"tmp/coql-query-builder_0.2.1_1756416413539_0.5752704460860585","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@doralhw-org/coql-query-builder","version":"0.2.2","description":"A lightweight query builder for Zoho CRM that abstracts the COQL queries and provides a fluent API for building them.","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js","import":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/doralhw-org/coql-query-builder.git"},"homepage":"https://github.com/doralhw-org/coql-query-builder#readme","bugs":{"url":"https://github.com/doralhw-org/coql-query-builder/issues"},"keywords":["zoho","crm","coql","query-builder","typescript","zoho-crm","query","builder"],"author":{"name":"doralhw-org"},"license":"MIT","devDependencies":{"@eslint/js":"^9.32.0","@types/jest":"^30.0.0 ","@types/node":"^24.1.0","@typescript-eslint/eslint-plugin":"^8.38.0","@typescript-eslint/parser":"^8.38.0","eslint":"^9.32.0","globals":"^16.3.0","jest":"30.0.5","rimraf":"^6.0.1","ts-jest":"^29.4.0","typescript":"^5.8.3","typescript-eslint":"^8.38.0"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"scripts":{"build":"pnpm run clean && tsc -p tsconfig.build.json","clean":"rimraf dist","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint lib --ext .ts","lint:fix":"eslint lib --ext .ts --fix"},"_id":"@doralhw-org/coql-query-builder@0.2.2","_integrity":"sha512-32ggqRea5mFMFC8rAy/TLEFEGj3fcxLm6KZu5l2B4rxhzlWD/QlXdFm/sPV2KpQSNQXTaVMLDnSKqbnu2Y/B8Q==","_resolved":"/tmp/da5e5b952d0088dea66d46ba3ed70a15/doralhw-org-coql-query-builder-0.2.2.tgz","_from":"file:doralhw-org-coql-query-builder-0.2.2.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-32ggqRea5mFMFC8rAy/TLEFEGj3fcxLm6KZu5l2B4rxhzlWD/QlXdFm/sPV2KpQSNQXTaVMLDnSKqbnu2Y/B8Q==","shasum":"17438acac2ea837a9748a9744042d56f6f3ca625","tarball":"https://registry.npmjs.org/@doralhw-org/coql-query-builder/-/coql-query-builder-0.2.2.tgz","fileCount":87,"unpackedSize":81134,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEv4JsL8e779d4FjADmfqVb3OeBEQwWMqiXCFejdWbvGAiBd3vTaxoM4ap5rwYxckLX/1b3i3UquKVfIpAxecdDHpQ=="}]},"_npmUser":{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},"directories":{},"maintainers":[{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},{"name":"jverges-doral","email":"jverges@doralhw.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/coql-query-builder_0.2.2_1779226969763_0.8907109917977158"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-11T21:26:17.134Z","modified":"2026-05-19T21:42:50.093Z","0.1.0":"2025-08-11T21:26:17.514Z","0.2.0":"2025-08-26T02:11:01.830Z","0.2.1":"2025-08-28T21:26:53.732Z","0.2.2":"2026-05-19T21:42:49.949Z"},"bugs":{"url":"https://github.com/doralhw-org/coql-query-builder/issues"},"author":{"name":"doralhw-org"},"license":"MIT","homepage":"https://github.com/doralhw-org/coql-query-builder#readme","keywords":["zoho","crm","coql","query-builder","typescript","zoho-crm","query","builder"],"repository":{"type":"git","url":"git+https://github.com/doralhw-org/coql-query-builder.git"},"description":"A lightweight query builder for Zoho CRM that abstracts the COQL queries and provides a fluent API for building them.","maintainers":[{"name":"ahernandez-doralhw","email":"arturo.hernandez.work@gmail.com"},{"name":"jverges-doral","email":"jverges@doralhw.org"}],"readme":"# COQL Query Builder\n\nA lightweight query builder for Zoho CRM that abstracts the COQL queries and provides a fluent API for building them.\n\nThis library is an independent open-source project and is not affiliated with or endorsed by Zoho Corporation. ‘Zoho’ is trademarks of Zoho Corporation, used here only to describe compatibility.\n\n## Installation\n\n```bash\nnpm install @doralhw-org/coql-query-builder\n```\n\n## Usage\n\nYou'll need to create a object of the query builder and pass it a function that can fetch the data with the provided query. This function must return the data in the same format as the Zoho CRM API response.\n\n```ts\nimport { CoqlQueryBuilder } from \"@doralhw-org/coql-query-builder\";\n\nconst coqlQueryBuilder = new CoqlQueryBuilder({\n  queryFunction: queryCrm,\n});\n```\n\n### Fetching data\n\nAfter creating the query builder object you can use the `select` method to fetch the data. The query passed will then be turned to one or more COQL queries and executed. The data will then be merged together and returned as an array of records.\n\n```ts\nconst records = await coqlQueryBuilder.select({\n  columns: [\n    \"id\",\n    \"Name\",\n    \"Age\",\n    \"Role\",\n    \"Email\",\n    { column: \"Address_Line_1\", alias: \"Address\" },\n  ],\n  from: \"Contacts\",\n  where: [{ equals: [{ column: \"id\" }, { value: \"123\" }] }],\n});\n```\n\nThis merge is performed based on the `id` column. If the `id` column is not added as a column to the query, it will be added to the queries generated. If the `id` column has a different name, or you want to group based on a different identifier column, you may alias the column to `id` .\n\nAlternatively, you can use the `buildQuery` method to build the query and then execute it on your own. The method will return one or more COQL queries depending on the workarounds required to obtain the data based on the limitations of the Zoho CRM API.\n\n```ts\nconst queries = coqlQueryBuilder.buildQuery({\n  columns: [\n    \"id\",\n    \"Name\",\n    \"Age\",\n    \"Role\",\n    \"Email\",\n    { column: \"Address_Line_1\", alias: \"Address\" },\n  ],\n  from: \"Contacts\",\n  where: [{ equals: [{ column: \"id\" }, { value: \"123\" }] }],\n});\n```\n\n## Documentation\n\nFor comprehensive documentation including detailed usage patterns, limitations, and workarounds for each query clause, see the [Query Builder Documentation](./lib/query-builder/README.md).\n\n### Where Conditions\n\nThe available where conditions are:\n\n- `equals`\n- `greaterThan`\n- `lessThan`\n- `greaterThanOrEquals`\n- `lessThanOrEquals`\n- `between`\n- `in`\n- `like`\n\nThese can be negated by wrapping the condition object within a `not` attribute and combined with the `and` and `or` operators. The where clause array will join the conditions with the `and` operator by default.\n\n```ts\nwhere: [\n  { not: { equals: [{ column: \"id\" }, { value: \"123\" }] } },\n  {\n    and: [\n      { greaterThan: [{ column: \"Age\" }, { value: \"30\" }] },\n      { lessThan: [{ column: \"Age\" }, { value: \"40\" }] },\n    ],\n  },\n  {\n    or: [\n      { in: { column: \"Name\", valueSet: [\"John\", \"Jane\"] } },\n      { like: { column: \"Name\", pattern: \"John%\" } },\n    ],\n  },\n  {\n    like: { column: \"Email\", pattern: \"%@example.com\" },\n  },\n];\n```\n\nFor detailed information about where clause structure, limitations, and workarounds, see the [Where Clause section](./lib/query-builder/README.md#where-clause) in the full documentation.\n","readmeFilename":"README.md"}