{"id":13534174,"url":"https://github.com/YsarocK/fetch-appwrite-types","last_synced_at":"2025-04-01T22:31:17.057Z","repository":{"id":94086123,"uuid":"608064631","full_name":"YsarocK/fetch-appwrite-types","owner":"YsarocK","description":"Generate Typescript file from Appwrite Databases","archived":false,"fork":false,"pushed_at":"2024-11-16T13:53:44.000Z","size":657,"stargazers_count":38,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T08:19:58.105Z","etag":null,"topics":["appwrite","cli","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/YsarocK.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-01T08:45:24.000Z","updated_at":"2025-02-08T07:08:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce6ccd04-278b-4323-8e82-6bab4f302611","html_url":"https://github.com/YsarocK/fetch-appwrite-types","commit_stats":{"total_commits":165,"total_committers":6,"mean_commits":27.5,"dds":0.4666666666666667,"last_synced_commit":"1886779dd8979e29fde574e9a67dc20342f1b08a"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YsarocK%2Ffetch-appwrite-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YsarocK%2Ffetch-appwrite-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YsarocK%2Ffetch-appwrite-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YsarocK%2Ffetch-appwrite-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YsarocK","download_url":"https://codeload.github.com/YsarocK/fetch-appwrite-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246720518,"owners_count":20822914,"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":["appwrite","cli","typescript"],"created_at":"2024-08-01T07:01:27.388Z","updated_at":"2025-04-01T22:31:17.052Z","avatar_url":"https://github.com/YsarocK.png","language":"TypeScript","readme":"![fetch-appwrite-types banner](./readme-banner.jpg)\n\n# Generate Typesript types from Appwrite Databases\n\n![npm](https://img.shields.io/npm/dt/fetch-appwrite-types)\n![npm](https://img.shields.io/npm/v/fetch-appwrite-types)\n![tests](https://github.com/YsarocK/fetch-appwrite-types/actions/workflows/tests.yml/badge.svg)\n\n## Quick usage\nMake sure ton add the following values to your ```.env``` :\n```APPWRITE_ENDPOINT```\n```APPWRITE_PROJECT_ID```\n```APPWRITE_API_KEY```\n\nThen run the following command :\n\n```bash\nnpx fetch-appwrite-types\n```\n\n## Installation\n```bash\n# yarn\nyarn add fetch-appwrite-types\n\n# npm\nnpm install fetch-appwrite-types\n```\n\nMake sure ton add the following values to your ```.env``` :\n```APPWRITE_ENDPOINT```\n```APPWRITE_PROJECT_ID```\n```APPWRITE_API_KEY```\n\n```javascript\nimport { FetchNewTypes } from \"fetch-appwrite-types/dist/main\";\n\nawait FetchNewTypes();\n```\n\n## Parameters\n| Name    | Default value            | Description                                       |\n|---------|--------------------------|---------------------------------------------------|\n| outDir  | ```\"/types\"``` | The folder where the type file will be generated  |\n| outFileName   | `\"appwrite\"`  | The name of the generated type file               |\n| includeDBName | ```false```              | Add the collection name at start of types         |\n| hardTypes   | ```false```              | Creates an Email type and an URL types. [More](#hard-types). |\n\n### Usage\n#### CLI\nParams can be passed as arguments in any order, except for the outDir which might be followed by the path.\n```bash\nnpx fetch-appwrite-types includeDBName outDir /types outFileName appwrite hardTypes\n```\n\n#### Library\n```javascript\nawait FetchNewTypes({\n    outDir: \"/types\",\n    outFileName: \"appwrite\",\n    includeDBName: true,\n    hardTypes: true\n})\n```\n\n## Handled types\n\n| Appwrite type | Generated type (simple) | Generated type (hard)      |\n|---------------|-------------------------|----------------------------|\n| String        | ```string```                  | ```string```               |\n| Integer       | ```integer```                 | ```integer```              |\n| Float         | ```integer```                 | ```integer```              |\n| Boolean       | ```boolean```                 | ```boolean```              |\n| DateTime      | ```string```                  | ```Date```                 |\n| Email         | ```string```                  | [```Email```](#hard-types) |\n| IP            | ```string```                  | ```string```               |\n| URL           | ```string```                  | [```URL```](#hard-types)   |\n| Enum          | ```Enum```                    | ```Enum```                 |\n| Relationship  | Reference to Type       | Reference to Type          |\n\n### Hard types\nThe hard types are types that are not native to typescript, but are often used in the context of a web application. They are generated as classes with methods to validate and parse the data.\n\n| Name | Value |\n|------|-------|\n| Email | ```${string}@${string}.${string}``` |\n| URL | ```${string}://${string}.${string}``` |\n","funding_links":[],"categories":["Tools"],"sub_categories":["Community-Built SDKs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYsarocK%2Ffetch-appwrite-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYsarocK%2Ffetch-appwrite-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYsarocK%2Ffetch-appwrite-types/lists"}