{"id":13847153,"url":"https://github.com/cloudblue/javascript-rql","last_synced_at":"2026-04-07T11:04:26.180Z","repository":{"id":52685101,"uuid":"284049749","full_name":"cloudblue/javascript-rql","owner":"cloudblue","description":"Javascript RQL lib to transform js object to rql query string","archived":false,"fork":false,"pushed_at":"2025-06-23T12:35:32.000Z","size":150,"stargazers_count":23,"open_issues_count":2,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-22T23:59:11.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudblue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-31T14:01:45.000Z","updated_at":"2025-08-25T16:53:50.000Z","dependencies_parsed_at":"2022-08-22T06:41:07.657Z","dependency_job_id":null,"html_url":"https://github.com/cloudblue/javascript-rql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cloudblue/javascript-rql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fjavascript-rql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fjavascript-rql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fjavascript-rql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fjavascript-rql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudblue","download_url":"https://codeload.github.com/cloudblue/javascript-rql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fjavascript-rql/sbom","scorecard":{"id":292370,"data":{"date":"2025-08-11","repo":{"name":"github.com/cloudblue/javascript-rql","commit":"330d1fd1e868d6d963c0dc02a39d3ff6d11a00c0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":7,"reason":"Found 7/9 approved changesets -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"48 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T18:35:58.863Z","repository_id":52685101,"created_at":"2025-08-17T18:35:58.863Z","updated_at":"2025-08-17T18:35:58.863Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31509946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-04T18:00:56.431Z","updated_at":"2026-04-07T11:04:26.149Z","avatar_url":"https://github.com/cloudblue.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Javascript RQL\n[![Build Status](https://travis-ci.org/cloudblue/javascript-rql.svg?branch=master)](https://travis-ci.org/cloudblue/javascript-rql)\n[![codecov](https://codecov.io/gh/cloudblue/javascript-rql/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudblue/javascript-rql)\n[![npm](https://img.shields.io/npm/v/javascript-rql)](https://img.shields.io/npm/v/javascript-rql)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=javascript-rql\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=javascript-rql)\n\nThe javascript-rql is a simple and powerful library to transform javascript object to valid rql query string. Supports queries of any complexity (any nesting).\n\n## RQL\n\nRQL (Resource query language) is designed for modern application development. It is built for the web, ready for NoSQL, and highly extensible with simple syntax.\nThis is a query language fast and convenient database interaction. RQL was designed for use in URLs to request object-style data structures.\n\n\n[RQL Reference](https://connect.cloudblue.com/community/api/rql/)\n\n[RQL for Web](https://www.sitepen.com/blog/resource-query-language-a-query-language-for-the-web-nosql/)\n\n[Django RQL](https://github.com/cloudblue/django-rql)\n\n## Install\n\nTo install the javascript-rql from a terminal window type:\n\n```sh\n$ npm install --save javascript-rql\n```\n\n## Interface\n\nJavascript object with rql expressions should implement the following interface (typescript example):\n```typescript\ninterface IRQLExpression {\n    $eq?: string|number,\n    $ne?: string|number,\n    $not?: IRQLExpression,\n    $gt?: number,\n    $ge?: number,\n    $lt?: number,\n    $le?: number,\n    $like?: string,\n    $ilike?: string,\n    $in?: Array\u003cnumber|string\u003e,\n    $out?: Array\u003cnumber|string\u003e,\n    $range?: {\n        min: number,\n        max: number,\n    },\n}\n \ninterface IRQL {\n    $and? Array\u003cIRQL\u003e\n    $or?: Array\u003cIRQL\u003e;\n    $ordering?: Array\u003cstring\u003e;\n    $select?: Array\u003cstring\u003e;\n    limit?: number;\n    offset?: number;\n    [key: string]?: string|number|Array\u003cstring|number\u003e|boolean|IRQLExpression;\n}\n```\n## Usage\nYou can import rql function:\n```js\nimport { rql } from 'javascript-rql';\n```\nor\n```js\nconst { rql } = require('javascript-rql');\n```\n\nand use:\n```js\nrql(rqlObject);\n```\n\n\n## Examples\n\n##### Simple filters\n```js\nconst filter = {\n  name: 'eugene',\n  age: 13,\n};\n \nrql(filter); // 'name=eugene\u0026age=13'\n```\n\n##### Filters with text matching\n```js\nconst filter = {\n  name: {\n    $like: 'vasya*',\n    $ilike: '***New',\n  },\n  city: {\n    $like: {\n      start: 'M',\n      end: 'w',\n    },\n    $ilike: {\n      start: 'M',\n    },\n  },\n  country: {\n    $like: {\n      end: 'a',\n    },\n    $ilike: {\n      pattern: '*u*ss*',\n      start: 'R',\n      end: 'a',\n    },\n  },\n  area: {\n    $ilike: true,\n    $like: {\n      invalidKey: 'qwe',\n    },\n  },\n};\n \nrql(filter); //'like(name,*vasya\\**)\u0026ilike(name,*\\*\\*\\*New*)\u0026like(city,M*w)\u0026ilike(city,M*)\u0026like(country,*a)\u0026ilike(country,R*a)\u0026ilike(country,*u*ss*)like(name,*vasya\\**)\u0026ilike(name,*\\*\\*\\*New*)\u0026like(city,M*w)\u0026ilike(city,M*)\u0026like(country,*a)\u0026ilike(country,R*a)\u0026ilike(country,*u*ss*)'\n```\n\n##### Filter with list\n```js\nconst filter = {\n  age: {\n    $out: [1, 2],\n  },\n  num: {\n    $in: [3, 4, 5],\n  },\n};\n \nrql(filter); //'out(age,(1,2))\u0026in(num,(3,4,5))'\n```\n\n##### Filters with range\n```js\nconst filter = {\n  age: {\n    $range: {\n      max: 5,\n      min: 9,\n    },\n  },\n};\n \nrql(filter); //'range(age,9,5)'\n```\n\n##### Filters with relationals\n```js\nconst filter = {\n  name: {\n    $eq: 'vasya',\n  },\n  age: {\n    $gt: 1,\n    $lt: 8,\n  },\n  num: {\n    $lte: 9,\n    $gte: 4,\n  },\n};\n\nrql(filter); //'eq(name,vasya)\u0026gt(age,1)\u0026lt(age,8)\u0026lte(num,9)\u0026gte(num,4)'\n```\n\n##### Filters with logical NOT\n```js\nconst filter = {\n  name: {\n    $not: [{\n      $eq: 'vasya',\n    }, {\n      $eq: 'petya',\n    }],\n  },\n  age: {\n    $not: {\n      $eq: 10,\n      $in: [1, 2, 3],\n    },\n  },\n};\n\nrql(filter); //'not(eq(name,vasya))\u0026not(eq(name,petya))\u0026not(eq(age,10))\u0026not(in(age,(1,2,3)))'\n```\n\n##### Filters with logical OR\n```js\nconst filter = {\n  // You can use $or inside field\n  color: {\n    $or: [\n      // Inside { } may be some conditions and for all them is used logical operator AND\n      { $eq: 'red' },\n      { $eq: 'blue' },\n      { $eq: 'yellow' },\n    ],\n  },\n \n  // Also you can use $or in root level, then inside must be objects array with fields name\n  $or: [\n    // Inside { } may be some fields with conditions and for all them is used logical operator AND\n    { product: 'TV' },\n    { product: 'Computer' },\n  ],\n};\n \nrql(filter); //'(((eq(color,red))|(eq(color,blue)))|(eq(color,yellow)))\u0026((product=TV)|(product=Computer))'\n```\n\n##### Combine AND and OR filters\n```js\n// When you need to use same keys in and conditions (for example with OR) you can use special logical AND:\nconst filter = {\n  $and: [\n    {\n      $or: [\n        {status: 'new'},\n        {type: 'program'},\n      ],\n    },\n    {\n      $or: [\n        {status: 'done'},\n        {type: 'service'},\n      ]\n    },\n  ]\n};\n \nrql(filter); // \"(((status=new)|(type=program)))\u0026(((status=done)|(type=service)))\"\n```\n\n##### Filters with control operators\nWe support 2 key for ordering: ordering and sort. Use the one which is implemented by the backend.\n```js\nconst filter = {\n  $select: ['products', 'agreements'],\n  $ordering: '-created',\n  $sort: ['-name'],\n  $limit: { start: 10, count: 100 },\n};\n \nrql(filter); //Result: 'select(products,agreements)\u0026ordering(-created)\u0026sort(-name)\u0026limit(10,100)'\n```\n\n##### Combine any filters in one query\n```js\nconst combinationFilter = {\n  offset: 0,\n  limit: 10,\n  $select: ['products', 'agreements'],\n  $ordering: ['title', '-created'],\n  $or: [\n    {\n      type: 'distribution',\n      owner: { $eq: 'me' },\n    },\n    {\n      type: { $in: ['sourcing', 'service'] },\n      owner: { $not: { $eq: 'me' } },\n    },\n  ],\n  name: {\n    $or: [\n      { $like: 'my test' },\n      { $like: 'my' },\n      { $ilike: '***CONTRACT' },\n    ],\n  },\n};\n\nrql(filter); //'offset=0\u0026limit=10\u0026select(products,agreements)\u0026ordering(title,-created)\u0026((type=distribution\u0026eq(owner,me))|(in(type,(sourcing,service))\u0026not(eq(owner,me))))\u0026(((like(name,\"*my test*\"))|(like(name,*my*)))|(ilike(name,*\\*\\*\\*CONTRACT*)))'\n```\n\n##### Filters with empty values \n```js\n// If values are empty, null, undefined then they will not be in the query.\nconst filter = {\n  $select: [],\n  $ordering: [],\n  name: '',\n  age: null,\n  $or: [{name: undefined}],\n  type: 'pending',\n};\n\nrql(filter); //'type=pending'\n```\n\n## Contribute\n\nIf you want to contribute to the javascript-rql development feel free to open issues or fork the github repository and submit your pull request.\n\n\n## License\n\nThe javascript-rql is licensed under the [*Apache License 2.0*](http://www.apache.org/licenses/LICENSE-2.0).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudblue%2Fjavascript-rql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudblue%2Fjavascript-rql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudblue%2Fjavascript-rql/lists"}