{"id":14563551,"url":"https://github.com/onlang-org/onst","last_synced_at":"2025-09-04T06:32:11.251Z","repository":{"id":225232210,"uuid":"765412052","full_name":"onlang-org/onst","owner":"onlang-org","description":"Helper repository for on-lang. Provides sample schema and example objects.","archived":false,"fork":false,"pushed_at":"2024-03-12T23:02:30.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-13T23:05:57.100Z","etag":null,"topics":["commander","github","inquirer","json","octokit","onl","onlang","schema"],"latest_commit_sha":null,"homepage":"http://onlang.js.org/","language":"JavaScript","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/onlang-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-29T21:40:26.000Z","updated_at":"2024-03-11T22:20:08.000Z","dependencies_parsed_at":"2024-09-07T03:20:19.776Z","dependency_job_id":"49a764f1-e017-478d-af14-516319497849","html_url":"https://github.com/onlang-org/onst","commit_stats":null,"previous_names":["rajatasusual/onl-schema-tools","rajatasusual/onlang-schema-tools"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlang-org%2Fonst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlang-org%2Fonst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlang-org%2Fonst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlang-org%2Fonst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onlang-org","download_url":"https://codeload.github.com/onlang-org/onst/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231940610,"owners_count":18449183,"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":["commander","github","inquirer","json","octokit","onl","onlang","schema"],"created_at":"2024-09-07T02:02:42.563Z","updated_at":"2024-12-31T03:30:40.012Z","avatar_url":"https://github.com/onlang-org.png","language":"JavaScript","funding_links":[],"categories":["json"],"sub_categories":[],"readme":"[npm]: https://www.npmjs.com/package/@onlang-org/onst\n[github]: https://github.com/onlang-org/onst\n[readme]: https://github.com/onlang-org/onst/blob/main/README.md\n\n\u003cimg src=\"https://raw.githubusercontent.com/rajatasusual/rajatasusual/master/onlang_shorthand.png\" alt=\"onlang_shorthand\" height=\"100\" href=\"https://onlang.js.org\"\u003e\n\n# @onlang-org/onst (onst)\n\n\u003e fetch JSON schema from [onst GitHub repository](https://github.com/onlang-org/onst) or [SchemaStore](https://www.schemastore.org). THe package exposes helper functions and also can be installed globally to be used via its interactive CLI built using [inquirer](https://www.npmjs.com/package/inquirer)\n\n[![codeQL](https://github.com/onlang-org/onst/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/onlang-org/onst/actions/workflows/github-code-scanning/codeql)\n[![npm version](https://img.shields.io/npm/v/@onlang-org/onst.svg)](https://www.npmjs.com/package/@onlang-org/onst)\n[![npm downloads](https://img.shields.io/npm/dm/@onlang-org/onst.svg)](https://www.npmjs.com/package/@onlang-org/onst)\n[![license](https://img.shields.io/github/license/onlang-org/onst.svg)](https://github.com/onlang-org/onst/blob/master/LICENSE.md)\n[![forks](https://img.shields.io/github/forks/onlang-org/onst.svg)](https://github.com/onlang-org/onst/network)\n\nThe package uses [onst-schemastore](https://www.npmjs.com/package/@onlang-org/onst-schemastore) to simplify fetching and categorising SchemaStore catalog into topics and download in bulk. (eg. download all schemata for AWS in one go). Read more about it [here](https://github.com/onlang-org/onst-schemastore). It leverages the GitHub [Octokit](https://github.com/octokit/octokit.js) API for working with schema files hosted on [onst github repository](https://github.com/onlang-org/onst).\n\nonst provides a convenient CLI interface designed using [inquirer](https://www.npmjs.com/package/inquirer). You can fetch schema files, show the schema list, and generate example ONL (ONLang) files from the schema.\n\n\u003e **_This project lives with [on-lang](https://github.com/onlang-org/onlang)_**\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Current Available Schemas](#current-available-schemas)\n- [Architecture](#architecture)\n- [Extending onst](#extending-onst)\n- [Contributing](#contributing)\n- [Code of Conduct](#code-of-conduct)\n- [License](#license)\n\n## Prerequisites\n\nBefore using the package, ensure you have the following set up:\n\n- Node.js 14+ or higher [https://nodejs.org/en/]\n- [npm](https://www.npmjs.com/)\n\n## Installation\n\nInstall the package using npm:\n\n```bash\nnpm install -g @onlang-org/onst\n```\n\n## Usage\n\n**Show Help**\n\n```\nonst help\n```\nThis command shows help information about the available commands and their usage.\n\n**Show Version**\n```\nonst version\n```\nThis command displays the version of the ONLang CLI.\n\n**Fetch Schema Files**\n```\nonst fetch [-s]\n-s, --schemastore: Use Schemastore.org (default is false).\n```\nThis command fetches schema files from the onst GitHub repository for ONLang.\n\n**Show Schema List**\n```\nonst show [-s]\n-s, --schemastore: Use Schemastore.org (default is false).\n```\nThis command shows the list of schemata available in the onst GitHub repository for ONLang.\n\n**Generate Example ONL**\n```\nonst example [-s] [-w] [-r] [-e] [-f \u003cfile\u003e] [-d \u003cdestination\u003e]\n\n-s, --schemastore: Use Schemastore.org (default is false).\n-w, --write: write the generated ONL files.\n-r, --random: Use fake values for optional properties.\n-e, --example: Use example values for required properties.\n-f, --file \u003cpath\u003e: Specify the file name for the generated ONL file.\n-d, --destination \u003cpath\u003e: Specify the destination path where the generated ONL will be saved.\n```\nThis command generates ONL files from the schema.\n\n### Examples\n\n```\nonst example -w -r -f example.onl -d ./output\n```\nThis example generates an ONL file, uses random values for optional properties, writes the file with the name example.onl, and stores it in the ./output directory.\n\n## Current Available Schemas\n\n- Qualtrics\n    - [Survey](/schema/qualtrics.survey.d.json)\n    - [Dataset](/schema/qualtrics.dataset.d.json)\n    - [Contact](/schema/qualtrics.contact.d.json)\n\n## Architecture\n\n**GitHub Interaction**: Utilizes the GitHub API through the Octokit library for fetching repository content.\n\n**User Interaction**: Employs the Inquirer library for interactive command-line prompts.\n\n**File Operations**: Utilizes Node.js File System (fs) for reading, saving, and searching files.\n\n**Configuration**: Relies on environment variables for GitHub credentials and repository details.\n\n**Example Generation**: Generates example ONL files based on the schema and uses [json-schema-faker](https://github.com/json-schema-faker/json-schema-faker) and then transpiles it into ONL using [json-to-pretty-yaml](https://www.npmjs.com/package/json-to-pretty-yaml)\n\n\n## Extending onst\n\nonst by default gets the schema list from the onst GitHub repository. To fetch schema files from a different repository, usethe env variables `GITHUB_OWNER`, `GITHUB_PATH` and `GITHUB_REPO`.\n\n- GITHUB_OWNER: The username of the repository to fetch schema files from.\n- GITHUB_REPO: The name of the repository to fetch schema files from.\n- GITHUB_PATH: The path within the repository to fetch schema files from.\n\n### Examples\n\n- [JSON](/examples/json)\n- [ONL](/examples/onl)\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute.\n\n## Code of Conduct\n\nSee [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for details on the code of conduct.\n\n## License\n\nSee [LICENSE.md](LICENSE.md) for details on the license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlang-org%2Fonst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonlang-org%2Fonst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlang-org%2Fonst/lists"}