{"id":22756788,"url":"https://github.com/tsmetadata/json-api-orm","last_synced_at":"2026-02-25T09:33:50.391Z","repository":{"id":264907812,"uuid":"883513797","full_name":"tsmetadata/json-api-orm","owner":"tsmetadata","description":"NoSQL object-relational mapping for JSON:API resource objects decorated with `@tsmetadata/json-api`.","archived":false,"fork":false,"pushed_at":"2024-12-09T04:02:19.000Z","size":205,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-24T18:44:01.986Z","etag":null,"topics":["api","json","metadata","orm","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@tsmetadata/json-api-orm","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/tsmetadata.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,"zenodo":null}},"created_at":"2024-11-05T05:08:36.000Z","updated_at":"2025-02-27T06:15:11.000Z","dependencies_parsed_at":"2024-12-08T03:24:41.507Z","dependency_job_id":"6ebb4416-ac72-4f7d-89aa-5b4c3c034aa4","html_url":"https://github.com/tsmetadata/json-api-orm","commit_stats":null,"previous_names":["ryanhaticus/json-api-orm","tsmetadata/json-api-orm"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tsmetadata/json-api-orm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmetadata%2Fjson-api-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmetadata%2Fjson-api-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmetadata%2Fjson-api-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmetadata%2Fjson-api-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsmetadata","download_url":"https://codeload.github.com/tsmetadata/json-api-orm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsmetadata%2Fjson-api-orm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29816095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: 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":["api","json","metadata","orm","typescript"],"created_at":"2024-12-11T07:15:08.989Z","updated_at":"2026-02-25T09:33:50.373Z","avatar_url":"https://github.com/tsmetadata.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON:API ORM\n\n`@tsmetadata/json-api-orm` provides a NoSQL object-relational mapping for JSON:API resource objects decorated with [@tsmetadata/json-api](https://github.com/tsmetadata/json-api).\n\n- [🌱 Install](#-install)\n- [🤖 Supported Drivers](#-supported-drivers)\n- [📋 Feature Set](#-feature-set)\n- [⚙️ Usage](#️-usage)\n- [❓ FAQ](#-faq)\n\n## 🌱 Install\n```bash\nnpm install @tsmetadata/json-api-orm@latest\n```\n\n## 🤖 Supported Drivers\n- DynamoDB (via. [AWS SDK for JavaScript v3](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/))\n  - To authenticate, please configure the global AWS SDK object or use environment variables.\n  - Table names match, by default, the resource type.\n\n## 📋 Feature Set\n- [✨ Actions](#actions)\n  - [Get](#get)\n  - [Put](#put)\n  - [Include](#include)\n\n## ⚙️ Usage\n### Actions\n#### Get\nThe `get(cls: new (..._: any[]) =\u003e any), id: string)` action will get the resource with the given class and id from the underlying database.\n\n```typescript\nimport { Resource, Id, Attribute } from '@tsmetadata/json-api';\nimport { get } from '@tsmetadata/json-api-orm';\n\n@Resource('users')\nclass User {\n  @Id()\n  customerId: string;\n\n  @Attribute()\n  active: boolean;\n}\n\nconst user1 = await get(User, 1);\n\nif(user1 !== undefined) {\n  console.log(user1.active)\n}\n```\n\n#### Put\nThe `put(classInstance: object)` action will put (create or update) the resource from the given class instance.\n\n```typescript\nimport { Resource, Id, Attribute } from '@tsmetadata/json-api';\nimport { put } from '@tsmetadata/json-api-orm';\n\n@Resource('users')\nclass User {\n  @Id()\n  customerId: string;\n\n  @Attribute()\n  active: boolean;\n}\n\nconst user = new User();\nuser.id = '1';\nuser.active = false;\n\nawait put(user);\n```\n\n#### Include\nThe `include(classInstance: object, relationshipKey: string, cls: new (..._: any[]) =\u003e any)` will get the full resource(s) for the given relationship.\n\n```typescript\nimport { Resource, Id, Attribute, Relationship, type JSONAPIResourceLinkage } from '@tsmetadata/json-api';\nimport { include } from '@tsmetadata/json-api-orm';\n\n@Resource('users')\nclass User {\n  @Id()\n  customerId: string;\n\n  @Attribute()\n  active: boolean;\n\n  @Relationship('author')\n  posts: Post[] | JSONAPIResourceLinkage;\n}\n\n@Resource('posts')\nclass Post {\n  @Id()\n  postId: string;\n\n  @Attribute()\n  description: string;\n\n  @Relationship('posts')\n  author: User | JSONAPIResourceLinkage;\n}\n\nconst user = await get(User, '1');\n\n/*\n  user.posts is an array of `JSONAPIResourceIdentifierObject`. To turn this into an array of\n  `Post`, we can do the following:\n*/\nawait include(User, 'posts', Post);\n```\n\n## ❓ FAQ\n\n### Q: Where can I learn more about JSON:API metadata decorators?\nA: We have a standard library complete with serializers, deserializers, and all object types [here](https://github.com/tsmetadata/json-api).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmetadata%2Fjson-api-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsmetadata%2Fjson-api-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsmetadata%2Fjson-api-orm/lists"}