{"_id":"ts-json-api","_rev":"30-9c9d31a03dc88686c76a7eae10c457ca","name":"ts-json-api","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","dist-tags":{"latest":"1.2.0","next":"1.1.0-alpha.0"},"versions":{"0.0.1":{"name":"ts-json-api","version":"0.0.1","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"types":"index.d.ts","_id":"ts-json-api@0.0.1","dist":{"shasum":"1b628adb63c44feeb4d16ca85d948b1a53147e38","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.0.1.tgz","integrity":"sha512-erfHeDuftkihHDae4gL2ba9MzJMHDg1v3FfJe52xeZDP58Fg5jEMFyf9IYJYzerR0NZqre8/XEtIK2xaRhTZ0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2gCZJiIbYa58cxIeMUCnMLQHQ7zc6zN8wWd7TbpYLYQIhAPL95LiajEvBWWLtz2PshWKzP9ccuhw8eOc9ZY1d89p/"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api-0.0.1.tgz_1507496471999_0.049611070891842246"},"directories":{}},"0.2.0-beta":{"name":"ts-json-api","version":"0.2.0-beta","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/ts-json-api.js","types":"index.d.ts","scripts":{"build":"rimraf ./dist && tsc","test":"jest"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","jest":"^21.2.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","tslint":"^5.8.0","typescript":"^2.6.1"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"dependencies":{"ramda":"^0.25.0"},"gitHead":"faec9a75dc62aa5fc65d3aabf6f5b2f3c80c2aa1","_id":"ts-json-api@0.2.0-beta","_shasum":"b0049e942f58da3231517a64818d5afcbcb5a192","_from":".","_npmVersion":"3.10.6","_nodeVersion":"8.9.0","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"b0049e942f58da3231517a64818d5afcbcb5a192","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.2.0-beta.tgz","integrity":"sha512-3FmBysHfAOma7FB8saNQ8TtvlgvFBXICCOxjEFq/8Coa8GkqSB5cHvsvV16jkHU7OlU6QBziyVY6btlXKY9CJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH/KQIFqaOIGHgKEIJaX/S5mTiCZZejOIwzb6TYyKqaQIhAJq92nAHiHtVzRUwG1DdvP7l0UH69bc8dsui9MHjM/VT"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api-0.2.0-beta.tgz_1512570740982_0.7476100462954491"},"directories":{}},"0.2.0-beta.2":{"name":"ts-json-api","version":"0.2.0-beta.2","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/ts-json-api.js","types":"index.d.ts","scripts":{"build":"rimraf ./dist && tsc","test":"jest"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","jest":"^21.2.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","tslint":"^5.8.0","typescript":"^2.6.1"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"dependencies":{"ramda":"^0.25.0"},"gitHead":"40175b703b1f758bc1a131ad8af2e287497cd613","_id":"ts-json-api@0.2.0-beta.2","_shasum":"a30b3e50cd720b13f7489165c31ed5f2b5a8641b","_from":".","_npmVersion":"3.10.6","_nodeVersion":"8.9.0","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"a30b3e50cd720b13f7489165c31ed5f2b5a8641b","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.2.0-beta.2.tgz","integrity":"sha512-46yRSed+caz55H8p+ExfOSXZq66qCICsiworIEAKr3TnjiT1CKEB2m0DQz3N3qMjPLSj5s/2gThajNaL/CtkPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4kqq87Q6RAvp58FnRKtGi5Ulzjq1/Bi9ypRUcxpk0IAiEAuxaWSQrUe0QWVSCdB/EiVXduQIRGEVaahyoLR9K0mTI="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api-0.2.0-beta.2.tgz_1512656000483_0.5361088165082037"},"directories":{}},"0.2.0-beta.3":{"name":"ts-json-api","version":"0.2.0-beta.3","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/index.js","types":"index.d.ts","scripts":{"build":"rimraf ./dist && tsc","test":"jest"},"dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","jest":"^21.2.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","tslint":"^5.8.0","typescript":"^2.6.1"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"7165781351c15e5b6f3442c5af307b9a457d05bb","_id":"ts-json-api@0.2.0-beta.3","_shasum":"f2bfaac6379d0a73190f72a20654a03713e0b1f6","_from":".","_npmVersion":"3.10.6","_nodeVersion":"8.9.0","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"f2bfaac6379d0a73190f72a20654a03713e0b1f6","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.2.0-beta.3.tgz","integrity":"sha512-JuYnSrEwPARWHSnca01EE5546mePhvLvNPn6eZkg1xQVwC81/Md/cKdMBiliIpR2WrmQeq5AaWftEar7/QJsLw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC2FAlaXvpasPImNKbNQQKUew0xsI9CCfpHm2vVuGPFyAiB9IinrRRPXWIk2PeL6P6smHrtqZBp4Vgx86Jao+YfW4Q=="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api-0.2.0-beta.3.tgz_1515421284281_0.3431620867922902"},"directories":{}},"0.9.0-beta.1":{"name":"ts-json-api","version":"0.9.0-beta.1","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/index.js","scripts":{"build":"rimraf ./dist && rimraf ./types && tsc","lint":"eslint **/*.ts","test":"jest"},"types":"./types","dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","eslint":"^4.18.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^21.2.1","prettier":"^1.11.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","typescript":"^2.8.0","typescript-eslint-parser":"^14.0.0"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there are a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of `ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to target specifc response types, it is recommend you use those more specific interfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also: `ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of individual pieces. We recommend taking a look at `src/structure.ts` for reference. Should you need to target more specific pieces of a response, it should be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'first-name': string;\n        'last-name': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is coming, but feel free to browse around `src/fp`. All functions are curried for all you functional programming geeks.\n","readmeFilename":"README.md","gitHead":"7d7547cedd1db824b469452ff05664b7f8d1008c","_id":"ts-json-api@0.9.0-beta.1","_npmVersion":"5.6.0","_nodeVersion":"9.8.0","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"integrity":"sha512-9+J36UB0HxX7ZO8MpUw7UI9vRhswccIic0Lbzl3NlA8iK4dX7CVmXOdxWacHaJJoUay3Y7ascymVWZCPYE8uaA==","shasum":"37566e62513f2ced9625c090fcdaab7615d857e4","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.9.0-beta.1.tgz","fileCount":35,"unpackedSize":167305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa02DWCRA9TVsSAnZWagAA+AMQAJKz8fPH3o0NLMDZ3jG0\n043LeQaOFzjec6kYCMDoIeb07dmff/CJarBtnWgV8Tamv9CHVsDHpxYrRRma\nn20X5VsFLJsVXugf2vQDicq+AoUS+4dCZItzlCflTu+0wj32JeEgG+stLCPV\n2dW0Oh/iQju10ck68eHThjEB+CkNVSKRLJxxvm0rE4PlnnV2ihtmXqVaOkr6\nBQUYnlc9XV+MY7SFFtMjcRus7FwEI+kHgiQCrV+rzAfTOX4mJrBkPW5oZVua\nJRVspJ5OeadapBk4Ewfj/cD92JcFtzhltdqn8+/98uDzr0EkrthfMg0TAQGz\noZtPULn7SqQCS5xYZIPOcp6A1+v9VtZ3cW651touWWS4FjqIJAZEZ4OSJ1UG\nSUVObshf2488+wYLCM7ZrvSB0yEB1InQcv7bW3rCXAAkeMp2WFvqg3eGKXtS\nS3PeyxrJQWvLC7yU8hfpaZtBzYqMB1Bu0B5r/YLxrOXx44Ca//YFgy+a/QpD\nKPMWbHBb/AKVsLDz0Aen0Rw+/7LsnrHhSSe39mXU+lGZFfqbD71dXBCpkgI7\n7CoLajJ/1NCFwcy2tydlTQOqrXreVB5Yar6fHv0GwTFRyEl60hPeP6HJ+igH\nXevMumeDFtN/pASgCRWxPKV84YUOmbpAw/4IV28v4JQyn2MgDThH0FKyowp/\nJlky\r\n=YHKM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYjNoER0XjGxyKFlCxql0NA9fKy2hooRyGwB2ktgsKcAIgOTwHpIUVh15lINOuo4Xj8xhrgP3kwZNh36NStlznB7g="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_0.9.0-beta.1_1523802325830_0.9614154441163087"},"_hasShrinkwrap":false},"0.9.0-beta.2":{"name":"ts-json-api","version":"0.9.0-beta.2","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/index.js","scripts":{"build":"rimraf ./dist && rimraf ./types && tsc","lint":"eslint **/*.ts","test":"jest"},"types":"./types","dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","eslint":"^4.18.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^21.2.1","prettier":"^1.11.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","typescript":"^2.8.0","typescript-eslint-parser":"^14.0.0"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"7d7547cedd1db824b469452ff05664b7f8d1008c","_id":"ts-json-api@0.9.0-beta.2","_npmVersion":"5.6.0","_nodeVersion":"9.8.0","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"integrity":"sha512-+2Z05QolfDHR59vLp7I+LezJMmcpU9Ai6Jrfsb2K4+dV29XNzuffV2BVWWhqjaXKtUtusNF5ht4FeX8GDHu88w==","shasum":"58008c7cf6216ad5c82f45aabf6b9b723b2268b8","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.9.0-beta.2.tgz","fileCount":24,"unpackedSize":31252,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa02QDCRA9TVsSAnZWagAAXxoP/3X3lsAub93fGnMWDAn2\nILbTsZMX7o4UCEUxTajSu+xYMqoHip8AuMQDC0b7woQQFu0dsItMkFNzuLmF\nzdm+YO3x16vvcqNPSGScO8DR2dRwFmX+IZgDfI49Du36Hc49FWW1ZdNBpOkO\nTD7VtuesEzCsLpzgFxMCqO59P2WggDgdY9mytSsULpzXxYpmYiAbZoLA55C7\npGZ5Dl+4kSh+TXo3NgeM5imAlYaKCK8zXyzRJw+3RgAtMjRXFlfS3WmB7/tI\nOiZ3/QRmpxIG+rjtMni985AHEv/iiGZEuBy9++SvcYInCSuOHdi8TgPLhdu5\nZc3Uweqwsivq68+8GMcKhXM9ONAOyir6TpFsB1M9hK6tQnCT7DhwKGsaf938\nh1AL6bcg/p/0u/1Lgu6UiodsQHczEe5JHRI3hEcMu1uMqPXrZBR9YYBYsCON\nCao6UX21EHnxPkRBen0yTzio3O/3iXDzJiC14V4crPNLyDizhJBl7Tr1VO6n\nghJlRviPrc8NWUeciqEmCzb71l7Pu+iD/mWp3XSUnPiG2fgDhAIVNif5KrAY\noyllEnbfq26aD0VZ0gDN/4v+SZw2nwE9904WRmJCBsaITfHgxJRQCOrlR0u5\nrwl5Yw2UkpvgNrtc7JUtuK0Rg2petMgRZZNZtUCKzcgP6XEWUg0O0tA1LbWJ\nINpW\r\n=8K3k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOhosf8GTEIdrykrAWHX7ATnk3NnP+aC7myGq70wdDJAiEA9Aqf2Gx50SN29F7mg7SMVtzep6cBUQwZViCyjJIFWGE="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_0.9.0-beta.2_1523803137815_0.47859979192778157"},"_hasShrinkwrap":false},"0.9.0-beta.3":{"name":"ts-json-api","version":"0.9.0-beta.3","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/index.js","scripts":{"build":"rimraf ./dist && rimraf ./types && tsc","lint":"eslint **/*.ts","test":"jest"},"types":"./types","dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","eslint":"^4.18.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^21.2.1","prettier":"^1.11.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","typescript":"^2.8.0","typescript-eslint-parser":"^14.0.0"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"7d7547cedd1db824b469452ff05664b7f8d1008c","_id":"ts-json-api@0.9.0-beta.3","_npmVersion":"5.6.0","_nodeVersion":"9.8.0","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"integrity":"sha512-8evr1f1oe3wCItklr8iZZTPP8z5GTLFfba4FRaZvq7aIhoZ7h7NkcfFcpuRLQYsB+SpZh0Cma8Qfax8xNWVkVA==","shasum":"383478e1274a31fe686f9dc9ae7d177463603b34","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.9.0-beta.3.tgz","fileCount":24,"unpackedSize":32521,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa02cgCRA9TVsSAnZWagAAZHIP/ROclljyTedlEV6i2ps9\nTDA9ob9qkAzAnA8qpm+f31BrK1hmjdUq+p9ae3FnaZgkUQdqBU1ZWEITHb2b\nRQ+JoIjviuDUDxghTH6reqbAkXbLUqlOVKZRUYftmduajdj8nsfCsjjXK1Zg\ne7gzLtDb36S3h8/JrJu6+okN9jfw0HfausFuqhAdOlk83V4hotB6U7Egd82w\n0dJmhOipLDc05JX++1TdnCu5b5rGTCxUmQKGqQCSUqc1X8Tqa+vrW9/1hWaw\nP1BxIb4ealoCHNYWTY8bnf5cyxFYpddWnrd2UpHO2uOuYTBVkPMPsJlDlZm2\nUoacbfK2+MPcxIg5k0pAqbXN1V3HxleiqMfzcyKMiw6aOifwtMzBQmQchGr0\nYjPA02q2GBf2PNImCRukL8oo2PkEWNs/l1VlclqDnTFCQCcAH6bGfsQqQsFo\ntWAWInb1grB1GyZDST1oAyLWFD/crj9o6UScsjjxsmTpDrzIkJB5Vie+0RsS\n3AgLGTBliYlu5RQ0XtqJD5cb5YaFooWVEaRB8C53mauqQ4LeP8H4n+CXVMM5\nomIeMnnnpD7VklU3h/YHVuw4yYciuKYznYEoOYyJ0GNhniX+aeFpIFosrBfY\nZp7gPAM2pyKdJgt1qgMPIOrGF/ZOO7JNDDzxGAB39E7IpB2FdIHop/jzC34B\nUfl5\r\n=jaff\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVOWcSQ590dr1+LBHLZXGPtIKOZodj9cCdmsNwua2OvAiEAqPjX4Ltd7iNPpEiRreybsDJZ63WifAjv2GGWjpY0WL8="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_0.9.0-beta.3_1523803935645_0.7863965201236989"},"_hasShrinkwrap":false},"0.9.0":{"name":"ts-json-api","version":"0.9.0","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"main":"./dist/index.js","scripts":{"build":"rimraf ./dist && rimraf ./types && tsc","lint":"eslint **/*.ts","test":"jest"},"types":"./types","dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","eslint":"^4.18.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^21.2.1","prettier":"^1.11.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","typescript":"^2.8.0","typescript-eslint-parser":"^14.0.0"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"da3c0293bddbd3c7b13a6c34866f7b9e066fcea7","_id":"ts-json-api@0.9.0","_npmVersion":"5.6.0","_nodeVersion":"9.11.1","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"integrity":"sha512-tqGtg8UNTEKnG9N0DFHBidn/u7woV/mTepVuek5zhhUTVMR3t3HIqcKz0mn2mTlK1KaOclTaP8OPNq5b6zrxpA==","shasum":"a578ddd1c481a6c61c762a276def28a99dc3afc8","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.9.0.tgz","fileCount":24,"unpackedSize":32640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa05FiCRA9TVsSAnZWagAAUQ4P/0yHgBlQXRrERH2lB4js\nNLxD5hmhvciWPPAtI/HYvRKI21Q6Ugl8i847QO1+cZrBEzEBszZ09EDs9d9a\n5oFiEgApnZgkdW9Lm5uGcQE71EjUHx99hXHGF6IlcRukaq54E0Tp+jF0AIUM\nKHmgc6OhxScCe30P1QNZatvyqBcWBk0VzVlk2VrZ1G0DxvuVMaWok38daNQL\nRQ2FkTt0lzEtYquzmMl7E9BoWl91GvPdBUom7UfoaozpYbpbv/BW4Mau9/YJ\nnFLV6Kcxxg/sg2WalKUfp7IMbYe6nyp73kFc4q2kRJBS9oqvQ4I5VgLlwuSV\nHxecegMoM+UqO0A+lRzyttzMehvRgwT9S3IXV61GxBuqR5vULIVMSeHaCXeq\nQWxuGl+EVlY8Fh3mzaQB5kdTIEyiDBSZZNO1V2avEAwzUsK+OlZNx8dupMF/\nxt3cpJQTu/AlRfP+s200I+603V+1fxorRPY8Ce8YAflNVU3BGt9T7GG+S48+\nQrSQ3xX/+7KE0MIgeNaTY4SRRuHo5hAGcHOAcwF25vGMZhedh+rl2r/MuJID\nSUORchExaHjD3Wg3YqzWX0NFNt2nO50alYb1YpW0ksq720/45gp1LVnGZTlU\nmfnuP2PhGZIx9Ygb/wZX81fVeaevkVeZo03k1tUgg3lsJF1f3eD2eoMPtnZv\nDHyD\r\n=s3PC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFsfVoKqX11TgWqKFZuEPgOjNlLcy+s9kQBCq+ywuYXNAiEAlCgjrmil5BAp2Q6y6JsnV0UMtnJ9zGJrWnzZywEAYfU="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_0.9.0_1523814754565_0.07417759026667947"},"_hasShrinkwrap":false},"0.9.1":{"name":"ts-json-api","version":"0.9.1","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"keywords":["typescript","jsonapi","json api","jsonapi.org"],"homepage":"https://github.com/rmarganti/ts-json-api#readme","repository":{"type":"git","url":"git+https://github.com/rmarganti/ts-json-api.git"},"main":"./dist/index.js","scripts":{"build":"rimraf ./dist && rimraf ./types && tsc","lint":"eslint **/*.ts","test":"jest"},"types":"./types","dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","eslint":"^4.18.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^21.2.1","prettier":"^1.11.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","typescript":"^2.8.0","typescript-eslint-parser":"^14.0.0"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"daa10dd9843cc31b6b4526c01c8d8314acc024e8","bugs":{"url":"https://github.com/rmarganti/ts-json-api/issues"},"_id":"ts-json-api@0.9.1","_shasum":"1e832bc71582d0b358d6f886003c0c0fa39c3d66","_from":".","_npmVersion":"3.10.6","_nodeVersion":"8.11.1","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"1e832bc71582d0b358d6f886003c0c0fa39c3d66","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.9.1.tgz","fileCount":25,"unpackedSize":32970,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDryxCRA9TVsSAnZWagAAlgoP/R8sdvPOC0ot7fQcmU9S\n713HDg8lAkZZhO83RL8LCio/bEtEZgzTUFmYcEN0HgCgu+Fg06sNN+2nu7cI\nzeAVjZ9W4SN/HhwB7a65wRmHHmw6l8MSCFJ+XP1mmbVChvFEYRoQ6MsaCcpT\nkMUAu5dMkC4JmBdG4XSWykr505swGqsurW7DgbLg7rEky7Lq5SU7sQDf3/St\n6b3TQx7MBUGBqqTaJ41g+XN9eIpdYN+1jvcZsdjBSTVU0kl4XBzKfvQQqY+v\nptP3PZy2+ZkNlN6MDCodPUg579N5LRcRuTogJ+qrX7UB4OG470aS87SnNmOc\nB4y5khrJtUS1flh2kR/RzP/UgQno13fJVuOKKvLX690dQrVGX/drkDsGHApe\nVumK6WtSo4LE1diAigK/621D6b5Cp8MCeDKzkpcSw1InDlDUzzbi+cEgSwGd\nQhi6oMP3yHHi586+DgrKuI+DFlb8VsGsn9VtErFuVh88ukxAVncR4K+SppLt\nm6IVgELMhXHkR2VcOSuGLrXDERk6ZFHkzninfyXPsCXycWF8YCV/XJrzEgZM\n0NpyxiZv5bxxLCPuYEVw3Npg8IRk2Pz3RBD6lX1K5NgCFuFWEIVgcls8SAyO\n/On8F1rLFak8XhHX9etpsgA4RNaE4k0cIdwxkA5xIB03fIHk3xTIhbT6ECQl\nn7qu\r\n=vqvU\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-Ux2WzXJ5+n2011NcpIiqdA9LopFCIPgfOv1/fx9ULrThwfbj63K/+p4kAHZF0Vkr8sVkyKVr++V/jbS1ezjRiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVAXoNv65Sx8U8+YZHUDGKJwbZ+Yoq8v3dMZEg6No8uAIgRfcK4YFYwDTvVtItkt2bjYOtswRNB3aZjorEXYZpxwg="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_0.9.1_1527692463974_0.2031105053474005"},"_hasShrinkwrap":false},"0.9.3":{"name":"ts-json-api","version":"0.9.3","license":"MIT","description":"Typescript definitions for jsonapi.org schema","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"keywords":["typescript","jsonapi","json api","jsonapi.org"],"homepage":"https://github.com/rmarganti/ts-json-api#readme","repository":{"type":"git","url":"git+https://github.com/rmarganti/ts-json-api.git"},"main":"./dist/index.js","scripts":{"build":"rimraf ./dist && rimraf ./types && tsc","lint":"eslint **/*.ts","test":"jest"},"types":"./types","dependencies":{"ramda":"^0.25.0"},"devDependencies":{"@types/jest":"^21.1.6","@types/node":"^8.0.53","@types/ramda":"^0.25.6","eslint":"^4.18.1","eslint-config-prettier":"^2.9.0","eslint-plugin-prettier":"^2.6.0","jest":"^21.2.1","prettier":"^1.11.1","rimraf":"^2.6.2","ts-jest":"^21.2.3","typescript":"^2.8.0","typescript-eslint-parser":"^14.0.0"},"jest":{"transform":{".(ts|tsx)":"<rootDir>/__tests__/preprocessor.js"},"testRegex":"(\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js","json"]},"gitHead":"cca77a76c9a23c2b8d235729827bbee69f36c0d3","bugs":{"url":"https://github.com/rmarganti/ts-json-api/issues"},"_id":"ts-json-api@0.9.3","_shasum":"bd1e7cb27e194eadc1655bd81fd05cb4c9ee7558","_from":".","_npmVersion":"3.10.6","_nodeVersion":"8.11.1","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"bd1e7cb27e194eadc1655bd81fd05cb4c9ee7558","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-0.9.3.tgz","fileCount":25,"unpackedSize":35036,"integrity":"sha512-HRJqgyFez5Y2DiU4cTMQpeTbDPAsF02szAPTYGTunLGPYodm7eiA0g4OVFNC0egSKOje90/3O+wKFJNSOJYrug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC912+Ze01GdWx7gzpC9DaU0gJpOUzLkDMjytFqINaneAiBKr/SP7KlBUOdOCWqssWA8cOSVfQhKTIOioCYXR/a1eA=="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_0.9.3_1530893736875_0.454957316852467"},"_hasShrinkwrap":false},"1.0.0-beta2":{"name":"ts-json-api","version":"1.0.0-beta2","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"license":"MIT","main":"dist/index.js","umd:main":"dist/ts-json-api-next.umd.production.js","module":"dist/ts-json-api-next.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"peerDependencies":{},"dependencies":{"ramda":"^0.26.1"},"devDependencies":{"@types/jest":"^24.0.13","@types/ramda":"^0.26.8","husky":"^2.3.0","prettier":"^1.17.1","pretty-quick":"^1.11.0","tsdx":"^0.6.0","tslib":"^1.9.3","typescript":"^3.4.5"},"jest":{"testMatch":["<rootDir>/src/**/*.(spec|test).{ts,tsx}"]},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there are a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of `ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to target specifc response types, it is recommend you use those more specific interfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also: `ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of individual pieces. We recommend taking a look at `src/structure.ts` for reference. Should you need to target more specific pieces of a response, it should be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'firstName': string;\n        'lastName': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is coming, but feel free to browse around `src/fp`. All functions are curried for all you functional programming geeks.\n","readmeFilename":"README.md","gitHead":"23de0af75c57d0623d338effb585a273c7bdd40a","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.0.0-beta2","_shasum":"aef9b633d64e8faf6600c0ff60b6dcc5d1574941","_from":".","_npmVersion":"3.10.6","_nodeVersion":"10.15.3","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"aef9b633d64e8faf6600c0ff60b6dcc5d1574941","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.0.0-beta2.tgz","integrity":"sha512-FV+U8ptzFhYjVqqs+7MMOt13JvtAiK9g0WITo4eFsHv4aSj26tqLzWrz4Q6CGHcU1V5/9ZHAOo3d2meJq0pflA==","fileCount":34,"unpackedSize":167767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFko+CRA9TVsSAnZWagAAR3IP/i3eTEdBB5kK44s0i3mX\nKbsTOuGT7bdrCn+eJgX16iE0Qb9tVN//fdVv3H/YP1O0yz9uan0T0fUhdKt+\n6BXyiWbELMUlWjhLhB2dVXTeZlCtIwDCtIz+V7nvOkJK1bNhu4Ewxpzb3kHU\nlWL/UTS7yA1Y5c/LZnvGl9VgnC9Y8Ay9bkEXfRvrYsfQ6LkTr5wN0+jCqWYV\nHNo9oqvLD7UdjubgnOk2+F4XHBFScvtURbON8VVoWf0BraKdsUOZ6GhmU4Ot\n2a6zpntTiFMXAd7ts5imnentx+UCkBNA5o6Y+w5Sk+W2JnO6jdoR1ePFEj9j\nO1Itc7od/L2T0KkMhJKC99vD/CTMOSNRNGxP/DfVWMcps5oqB4tOaQTOqFjh\ny0ani0cJKbx25Dn+t2Kr4cTB8O2MF8D1k5+eMQqkoHrEjxkf/r97T26shV+Q\nWkuBpxRtgIwvXOyE14tmPJngTzzNWGzTNNETORw/zS6Arqy+ba6P/Xv0J51b\n/8LcsymJoc/01OH0x1ElLkBrwl1p2VMWhhbECMk96haMsz/Ryq3u+APYRC0Y\nVBOLKJ3qWOTjAB+nxwUb/Ned2/BafGil3SymSaDbFCF+kEyuz/+qndehU1Uw\nzDRw+pQnqlKK24z4tDXrc50ayFIuOMph41+B90AbTMVlFp3U7EgXEVWCx8kN\nsZfw\r\n=umR3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDgbvjcIleWta/HNrp40XrfcxeXyFUBTdFhJuc0YLDcYAiEAmoRk4xHyBnkO00OBJSekzPxRXN7S4ZoW73mTjdFyhSU="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.0.0-beta2_1561741885789_0.8812541494982271"},"_hasShrinkwrap":false,"deprecated":"Reverting to alpha."},"1.0.0-beta3":{"name":"ts-json-api","version":"1.0.0-beta3","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"license":"MIT","main":"dist/index.js","umd:main":"dist/ts-json-api-next.umd.production.js","module":"dist/ts-json-api-next.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"peerDependencies":{},"dependencies":{"ramda":"^0.26.1"},"devDependencies":{"@types/jest":"^24.0.13","@types/ramda":"^0.26.8","husky":"^2.3.0","prettier":"^1.17.1","pretty-quick":"^1.11.0","tsdx":"^0.6.0","tslib":"^1.9.3","typescript":"^3.4.5"},"jest":{"testMatch":["<rootDir>/src/**/*.(spec|test).{ts,tsx}"]},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there are a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of `ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to target specifc response types, it is recommend you use those more specific interfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also: `ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of individual pieces. We recommend taking a look at `src/structure.ts` for reference. Should you need to target more specific pieces of a response, it should be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'firstName': string;\n        'lastName': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is coming, but feel free to browse around `src/fp`. All functions are curried for all you functional programming geeks.\n","readmeFilename":"README.md","gitHead":"d42d8c531be5f27d8d6a9415fe0b5ac7f499f847","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.0.0-beta3","_shasum":"e30a56fda2f4fe159af68e39eef7220e543ece32","_from":".","_npmVersion":"3.10.6","_nodeVersion":"10.15.3","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"e30a56fda2f4fe159af68e39eef7220e543ece32","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.0.0-beta3.tgz","integrity":"sha512-rfuQu/vODM8PoHeZYA/FmchPHyVha1nJbTJ7H16TYizFI5PSqX9a6ddsCVinMS8ltL8LrJqOXhgrOBiB4XhGyw==","fileCount":34,"unpackedSize":167781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOv3DCRA9TVsSAnZWagAAsx4P/iJTzE7BJ3rwfSTxDoEH\nhYqa8tuQV6Gd2lSdDoX4+QE5iqwkomnUjxiXveJKl2dpo1pCwG8wqmQaZDnZ\nIPqYRgJbOnZgEWSvYrLEZfHzrMEqu6rBKlszFJ0JxmydkOh8j6c+oYVF7OTK\nq2EyTWKBSO223XcDmRXC6pXZyRcOTYI4Mt/HoTgz5Hl7wttdLdjnH+eBeNxb\n8im5nPmpsVjFGUlnizjzLD3HuU8wLKZgwwuXQhgd28thrn0CJjaZtTYk84zx\nR35/6gnxX4C6sK4df1xd2DitwAc8hMkDOBC4PPSa6jxHSChED9M8mRKT3k+u\nM+0TzihdZQ3HPlbLdBUUTYvYG3WLv5Spkk0CXW7BR7PDmBty9WG/m8HgEkJe\nhyWVh1oIuDc4d0OSdJM78/ohARxl1X7RgrkBErP7CUin6rm7EaOEPPh749ni\niGXVxbrWTG225ny5Dq8q+9bGAAW3ypodPXAGP1E9/qJmWCIMKB16EQzi7NGO\nWpFZfYGSrQe2rx0bhgQhj5u/V9iA8O0tuguukHYOWzdKxYtJw2zs47l6G04M\nhbraP004I2LD9NNqA5qKIXR3EjB3Jp4ynqxATIE2bjWRR/iPf9kxsvlND6B/\nxCUISeuyfVTNS61T8k7JAPaSD12EqtydJfOLCr0Qw/6zceZdUjzKSCAtIkqT\nBXVt\r\n=yotD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5EvAlpF3OeLM3/hAek6wHn+JiMiPyxzPwra7RrjIoIgIhAJkcarYXxkpQH3mCqNVmvyRER6hqxxoGvxnjFe+l/alw"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.0.0-beta3_1564147139060_0.542106898281578"},"_hasShrinkwrap":false,"deprecated":"Reverting to alpha."},"1.0.0-alpha.0":{"name":"ts-json-api","version":"1.0.0-alpha.0","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"license":"MIT","main":"dist/index.js","umd:main":"dist/ts-json-api-next.umd.production.js","module":"dist/ts-json-api-next.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test"},"peerDependencies":{},"dependencies":{"ramda":"^0.26.1"},"devDependencies":{"@types/jest":"^24.0.13","@types/ramda":"^0.26.8","husky":"^2.3.0","prettier":"^1.17.1","pretty-quick":"^1.11.0","tsdx":"^0.6.0","tslib":"^1.9.3","typescript":"^3.4.5"},"jest":{"testMatch":["<rootDir>/src/**/*.(spec|test).{ts,tsx}"]},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"gitHead":"1361ab229ef3535852cc7b95329e729767d4caa8","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.0.0-alpha.0","_shasum":"b224dc9c412a9f7f4c5bff7901ce89159611f2fe","_from":".","_npmVersion":"3.10.6","_nodeVersion":"10.15.3","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"b224dc9c412a9f7f4c5bff7901ce89159611f2fe","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.0.0-alpha.0.tgz","integrity":"sha512-w9xJ0RsCcLYEPLlz63Eu0HX+f+h3GsvuhWZQI5cC5cnsY5tP/7r9Wf37tCKEPUwdAeP5G/Lb07eAAZwpmpNI0w==","fileCount":34,"unpackedSize":167783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOwEHCRA9TVsSAnZWagAAP9wP/1zcj99ko6vP9pyOXO6n\ndXGgobns26PPld71CLJH4ThHPQ6OPCIHy+PguLPn/IMj8kv0ut0TWirm3qst\n1hW+2/8OGJTH9GVXov54obOtqON3w/4e41jptMb7voQtS38JeDwLMR0vU8xP\nt1sVCUWu4vQeTt5RnUgV3BnByrMu2gb2biWy+QzbdOWM9eZ6DBqDyW5xtbmT\nNGI3n9tXeEDkLtowiIJUmXqSQ7WYuYI/PWsX2TuiUmO2adrgf+ctXWoW56DI\nsDRJt/TV1LKULlKlEVUDLg2renB8ueo4Edt1j17fbI821dOpQwWF2Wh4hZlx\nJKf4dbmPhvyLnKjOgs+ubnYvxuj/MHcncl2nwnBl2n406p4CfeGu8eyfCY2v\n1fL3XESDnxlZzyxFtNMQARkgm9FkysUTWUvuYyE6GyTZ9AaLTR360myAYp7R\nJv/AXLEfxljsiJe4GAw1WDXOyd30S3iCEtGu7mmwiyVtdRG6w97PXBy8xfIk\nmlAB9QMYzhphFgzAirjJEqINQ+PBh9dEshttK1Sv3wg7QheCw4X6dUNOyytc\n8KgjXHYG75qngnJ8u8C48iCCaZkSeNUIPlbvd56Jdg75ZXqugmC2ye/RGdUj\nmpkyz3EKyd0AEkbg68SJFjYRgMNSSQIcfAT4fhX+fPvXbC4hM1vBPy2EBHnF\n37ZP\r\n=6twG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGRMmhEt/PyjHHraO5Tygsof7yDOmzAZ/LUc1nncEyfgIgICVg8he9lcaO1Kr32WyPIg3+fdYHQWMdqn+Io6Kbnvk="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.0.0-alpha.0_1564147974435_0.1648054263022638"},"_hasShrinkwrap":false},"1.0.0-alpha.1":{"name":"ts-json-api","version":"1.0.0-alpha.1","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"license":"MIT","main":"dist/index.js","umd:main":"dist/ts-json-api-next.umd.production.js","module":"dist/ts-json-api-next.es.production.js","typings":"dist/index.d.ts","scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","prepublish":"yarn build"},"peerDependencies":{},"dependencies":{"ramda":"^0.26.1"},"devDependencies":{"@types/jest":"^24.0.13","@types/ramda":"^0.26.8","husky":"^2.3.0","prettier":"^1.17.1","pretty-quick":"^1.11.0","tsdx":"^0.6.0","tslib":"^1.9.3","typescript":"^3.4.5"},"jest":{"testMatch":["<rootDir>/src/**/*.(spec|test).{ts,tsx}"]},"husky":{"hooks":{"pre-commit":"pretty-quick --staged"}},"readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there are a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of `ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to target specifc response types, it is recommend you use those more specific interfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also: `ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of individual pieces. We recommend taking a look at `src/structure.ts` for reference. Should you need to target more specific pieces of a response, it should be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'firstName': string;\n        'lastName': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is coming, but feel free to browse around `src/fp`. All functions are curried for all you functional programming geeks.\n","readmeFilename":"README.md","gitHead":"dafbcb2471a3f918a47261c8090d70d18e655bb8","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.0.0-alpha.1","_shasum":"8bab473d2e876c97817695d8f4fb43195df40b7e","_from":".","_npmVersion":"3.10.6","_nodeVersion":"10.15.3","_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"dist":{"shasum":"8bab473d2e876c97817695d8f4fb43195df40b7e","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.0.0-alpha.1.tgz","integrity":"sha512-MgPx6Yab5fTjA9k3Kx6Wpq7W9nMHwToA6H6WO1h0GZGocK3+f41pn0zX9oGGnBaOapN0mTjzdcAZh6zxhe2VOg==","fileCount":34,"unpackedSize":167820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOwK7CRA9TVsSAnZWagAAsncP/jONEzCXBkqyjV++bw/H\nOVNOvTCFsSrqEOtk6fQ0sQf37NhovjJhylT4kQ8vDhJDxjMALZko32FxK9R7\nfBFcK94a0nGlAcCd5KKUA0y1+yeRGLD50IQ+HElrbQfHgoGrsCFlNQ0DureO\nuCZbhHNij+bHUPdmBuT3F0wBxFUs4jw7oXYbgvn8cz5W/wr6UiMV428/YWig\n9Lh+tgx5LB2ek0vvecAHmeQR+3p0J93u+xhDujrUf3M7l2HYsLru2CJsfD0s\naliPiDsSUPGulBt3uJCBZ+HSFewvATsT+kRVKm9LxU2Ige4UwPGfXD6ML+03\nKd8Hkb+ZDEpk7PGCl64ueB/ue0QPzZu1Z/tnHzhcY2UVhHZNz+ayCzKepd+K\ntUAfcViewK2HG7uEJTmWHo36zyRjKAAptZP8kh8VHhuBH6+5h5lneUue4ivA\nzLpVwzecQeah3J8a1z6hjAP+j8xNDtKRrOTVo+rwlNhd5Hqfasbk8COf/1em\nX887UQA5TX9OhMsVexR1BZXmpm19VFPCEheNy/g4pG/LQHWtXFDyIBd/bale\ncqikG9LXzC+OYIbHVuDrWtyHj+DtLoPcRcR1+uPfjPGvzt8RmuyCMUFIVG+H\nyk8xy9AEItfrDDCHJhguT18V/4V1VYDYaKo9lcI2aeRC6m5rhFVgnvjWbGGe\nlYUL\r\n=lyfG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz2+/bpeyLb2u38JL7i/laeRmlIFpY/VAqA8Cm6yi4kgIhALcgSdUHo8k0gVo2c6PMg1zLj9TRuiyPlhL8X6KUhRui"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.0.0-alpha.1_1564148410464_0.48370854212071945"},"_hasShrinkwrap":false},"1.0.0-beta.4":{"name":"ts-json-api","version":"1.0.0-beta.4","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"tsdx watch","build":"tsdx build","test":"tsdx test --env=jsdom","lint":"tsdx lint","prepublish":"yarn build"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there are a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of `ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to target specifc response types, it is recommend you use those more specific interfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also: `ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of individual pieces. We recommend taking a look at `src/structure.ts` for reference. Should you need to target more specific pieces of a response, it should be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'firstName': string;\n        'lastName': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is coming, but feel free to browse around `src/fp`. All functions are curried for all you functional programming geeks.\n","readmeFilename":"README.md","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.0.0-beta.4","_nodeVersion":"10.17.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-MjpGssB/iOdc86xJR7PeBuzoCud05/Uhg5nT8Cexyed3bv1NXOcGPH0mpdeyZirqy/u7KrP32CmLRhOCn5GAPQ==","shasum":"447350823005314fccd2a3a8ceaadf977f165c9e","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.0.0-beta.4.tgz","fileCount":30,"unpackedSize":118094,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMF9jCRA9TVsSAnZWagAAXwQP/jvNOW9Qi4zMrtztSZ9X\njqfXyLXn8yhZ0rr5zvrarfw5GTULtynGUx8DPLkiqb2CkDvg0EMFNat1KUV6\nJ8rFlEqqJ14gd/BLi+RLqy4A+hPuH/4Dx7y6jeYKN1MtiWEgH4kYgLi+Dsz0\nR4TnrfWgdS2EctqIGM5BW+J0WBbQinOD+Al2964mq4tJ3dvvlaDMomrcoEqn\niWtyZIh0fvtFCS/lfMguqspK7R7NKwNlJemzLf+3C8DKu2eelKSlRDDQiN1E\ntmeLL+EsTri3q0EyMXJqFCG3xI/vl5jlQ+08H3vXTp8qaoTz/mTFnOr3adgh\n5nUTxFyWHv0bn8uRYVzEyFsW2qbT4V2KCat26z5FWGrgePX83G32HKr75+/a\n8H6qtJGV/lCyVpgYH0umQuvcTV3JIUzSt1y74wSLzxkCOJY6b51rNwtBBBxq\nsSr2Qg0qteUsYKLyTHhhCPTqlmI0VrzPIP/k/JPtVan8X3Z6fXm9/2c+BmNJ\n5VQV/vJpuG/13PlkC3RF80SJG+kFr06yhiPNcvqIokIFK0Slxm7DjhbZWG+Y\n22wi97CpaBpKtr7fxEm2UT1lXs55W8luFS7oR5fFvirYQQvqivgXh7yekgfY\nn3XRq/dBGSkCnm4pbZ79aYK+trGpeoP1HKytcvPVSJiigulwLsWMicQPH05s\nTVIH\r\n=GEFz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZ6DzxCT3W7mlTisQbcg+J9FZ48b+KvMaeYUukhnl+FgIhAI3GRS61+4ZIpIVPoG1+eu7CR2O5BBImQvHAQn+6YRN5"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.0.0-beta.4_1580228450609_0.24177500139673702"},"_hasShrinkwrap":false},"1.0.0":{"name":"ts-json-api","version":"1.0.0","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"tsdx watch","build":"tsdx build","test":"tsdx test --env=jsdom","lint":"tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"d8367331b83a056d4f9c9e37723c041cf836c22b","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.0.0","_nodeVersion":"12.16.0","_npmVersion":"lerna/3.20.2/node@v12.16.0+x64 (linux)","dist":{"integrity":"sha512-kOFZ8OFn4l5Qq7mSc5LlNlDBlK8UrDxpu8rNTmD6i7nudUL8fsEJVI7UllrHNQvyWD1MSAPBYSMM3Unwrg6mlA==","shasum":"6a6d9955ec533e87354099b351ce1e3c1f95cb24","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.0.0.tgz","fileCount":30,"unpackedSize":118118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSwH8CRA9TVsSAnZWagAAySMP/jFTRdhHNRVOLJYIIj6h\nZBobsEL9io2bUPcr25qOZH//517ICcm6euVuC0rIm5gbJROb8Eg+yA70qZLg\nvKYkZ629R+vObJeL3Jcy8lDAL3W54XUooXyufz6p1MjlQ7P2xmaZMiEluApq\ne+lHZncX9u+4PyqdVYSAqjdas7btsWIpKKc5H1/RZO30ZWffP/5F+w2c/zEM\nBbMqi5nsz6ZAeG/r4jz8HvmatM/VY+lVW/+XLGRT3hMi8Sz8t0AMIhJEfOKJ\nfTwAyc+WI/l0DyIAz0UyN6fIFStmyHbYr5UfxLf5xPejiol8GTOA3Y4lAHFj\nOCeiMTvkFRO3Zs5qqQ27JOPcJsi+zN922WCOcjk4cF2eITNZYRxkoK3kZhk6\nBv0cTXLUlWylPHu++gaQ3FEZJJN0sdDPqdsRxNec3nJsP6Cs338U2e58mTDM\n6jRTwWpfkXM/c3uOq9r7hGw9PDNmwEEzgW36UL1T4pEd+pUwMCWEYov51bza\ndf2mC9tI+c6zfj0QxSH2mJkViQ5ZQWNGaKIwqwOZshoANgDicNToYWRz9e+9\nu1Gq1MNoTXu++S6nyJ9NSYPlSvk0aRMZ1pqB4+rgLwlcWHn2wGc+w1i8lLpN\n551i1hjd2GlDxq+BV5A2Y/jch5XbBTXm8DjvzqnsXULFFL/sTlASi4cwUDcc\nYK4w\r\n=Hh9t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCddzdS9+3ZDMHOCzMXTx+2oEPws1vR3t5s98+5tN9lZgIhAPK4MoOjxnN/NQSMyXzBq3SF0Toxkd3mcHeH1G4SoNCu"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.0.0_1581974011703_0.47415582905662923"},"_hasShrinkwrap":false},"1.1.0-alpha.0":{"name":"ts-json-api","version":"1.1.0-alpha.0","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"tsdx watch","build":"tsdx build","test":"tsdx test --env=jsdom","lint":"tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"f67b08e948aa98a4bee80343f7b5c6fb1594bf78","readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there are a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of `ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to target specifc response types, it is recommend you use those more specific interfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also: `ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of individual pieces. We recommend taking a look at `src/structure.ts` for reference. Should you need to target more specific pieces of a response, it should be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'firstName': string;\n        'lastName': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is coming, but feel free to browse around `src/fp`. All functions are curried for all you functional programming geeks.\n","readmeFilename":"README.md","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.1.0-alpha.0","_nodeVersion":"10.17.0","_npmVersion":"lerna/3.22.0/node@v10.17.0+x64 (darwin)","dist":{"integrity":"sha512-lZDq7sHxtoZ08pkYnRKPc8H0FBMa1sucihoh2gOkc8lMnqLYSvycny8xHEY4U/CBLeMXWzA4/bbpvBzc8+h75A==","shasum":"e41737b7c0b5ef50a49529aa9be99f0273bd0666","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.1.0-alpha.0.tgz","fileCount":30,"unpackedSize":118035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0XC2CRA9TVsSAnZWagAAFdoP/3BF5y97JXjz8mjM2e27\n0mkUo1rEINgJh6a9TQv0L9cONuUI2Pd6CP1xi+2XUI2DNsPreaQHYTiPoJt1\n+MuAf+VIAtNUoH1f8lESphjg9eApf0TpJNZJL0Qc97PbHL7M5KJMXQOUlXXV\nAwvxWH8DEduSVx2WZO5rEKQff9Cdlp7dFstwy6kYThkyCAq75N5Ad67kcK9/\nWX11I4udWWaCAN4UpcLdYQCSnRjM49+yuwXSaeZ4YhC4Zn206I2geHhc7ZPE\n6aloPuckgY1K5pxLW1jHHXLy+MbZWwjbDTIE7bmQ6D9FV0RovkxmNomWzS9x\n2eNi1MahfTBrHg9oOhFneI9KbTDkVDk4+WkQWdOMxRqpPRS96Wc+vb3EHxv4\n87bOxm5NEzvkizbCbS5XZ0F+29cQC/QnRFFe/DLiOeGD2Fy4cw2t1hxtShF5\nK1MfC7lNKq0ltR49nEr4jZPpS7hLFsz1fhM9+pfD/f7Xy/EmwL2DNXPs0bO0\nsc2k709rwrC3OErLogL8uz8/Q58u9XODeL7P2WPJq6sSGKDvcUpU/uktO+b1\nr4FxKD2m3qzEF1nBxRmqNY8Q14pnkfuY1UWKvTg8390V1lGiqc7C3lPgXL2G\nNM+UccWQehSWMiUve0QU+rUTJ4rPpIdV/5OySid/YsDrIdxCnLd/9WjgFEFU\nCCJL\r\n=vgId\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1HMCF5wTIUdrERFLjxFwk5V5PjPp3lOpk2YhD7zhR+wIhALQM+AoTWzl8PbfvPdGV+VAA1nsvGnJ04KWNrwnp0BI5"}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.1.0-alpha.0_1590784182236_0.8924677833526526"},"_hasShrinkwrap":false},"1.1.0":{"name":"ts-json-api","version":"1.1.0","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"tsdx watch","build":"tsdx build","test":"tsdx test --env=jsdom","lint":"tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"a794df322233facc7a0d44d9087cf7592d367f49","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.1.0","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.0/node@v12.18.2+x64 (darwin)","dist":{"integrity":"sha512-99YyLyBlxcpr44I9C2bQIxnpz1V4PvIGTbKmn6sLtgjrZLgf1CFg+5/9DlORKmz9ulGZIt5pvosM+bH6SD1LEA==","shasum":"9f335c36b87d9ce3350636fc1858ce64ab9e72aa","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.1.0.tgz","fileCount":30,"unpackedSize":118027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/kKuCRA9TVsSAnZWagAAXzYP/AnaV05yCqYvYnnSainZ\nUD9xH5Vf+koGMif2GLQirZ2XvY+kK/HqQbYJNGWy4HD5FeXDVSXiOP1x9wm0\nVpqxmuZ7EdD3ERw8znCz0OIsLgrXYrIU5c4PFxkR117cRMznBsAVQ2yX4q24\nF/aD34LXpjzHfNJBxxjc6WPCTaFE3Li/fVsebaiPCQHikopX8aMUbVF8eiSw\nHJDCtBWqMnUBShBHZvKWIjfITExBDgR/I1h05HkTGtQium3I247rBKkqnX8w\njOUm4sK5iHfIAqIl6MoRnXL9li+KZPw/f+GKDGd+0L0qMqsJYXMQUKbJlfZ0\nQA/f9ex4eWcksp55NpnbDiSqYcnsCv9u97HIzBxqkhvbWnsSzbY1iBMbl9f/\nJrOac0EoiokEDocej0CJxCId1Zo5US8mQAmV6CfiRCZRUtBRdvQhnXVAOwMK\nRbmXcA3VAARmzh6gWKVOm98qawodcvKNn8AtLBEhMDD4QSWb1+ZrdNiKd8L0\n4BOS2snNnXYwrLgmzV9N5qppusIQgQuRoLFMiG7Uhdy/kGm4OTdA9v+jH4dx\nQX+Ymwy02fMzGDH71qojKs9VgOtyN/b7qU9FwFPrMSGy6weJj/4g42IV+61B\nfTyMMNVyH4N9MpRltxnzkApiTiJEQojXYrWZudVGS1I9kK4XfE4o5PEnhvmO\nAl67\r\n=bAPL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGrsHZROeC/BOspdiwn/8A+/KhEfd13rGDrp29wXzO4xAiAwfD0W12SMtWfXJw4MEalonwIcDDla8XzWmLX//HEpIQ=="}]},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.1.0_1593721518322_0.20697079630511794"},"_hasShrinkwrap":false},"1.1.1":{"name":"ts-json-api","version":"1.1.1","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"yarn tsdx watch","build":"yarn tsdx build","test":"yarn tsdx test --env=jsdom","lint":"yarn tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"5f059fbb8ff641d9ebbf0518050d52cdba4d1865","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.1.1","_nodeVersion":"12.18.2","_npmVersion":"lerna/3.22.0/node@v12.18.2+x64 (darwin)","dist":{"integrity":"sha512-epIo/Qx650gvfMjDovEGqAYmSRnIvdctNK698cBp0eYKmhCBdWDG8v0uwTFYvqVrishor1gAfkfQO4VrN/bLlg==","shasum":"c0a5b4c2b80051818b518e58e8a2075f8c942362","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.1.1.tgz","fileCount":30,"unpackedSize":118652,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDcYyCRA9TVsSAnZWagAALmsQAJ7kADQ5eRL007y9mLGY\nYhXCxbejFun4FHm5hH1fSuQ0CUEHx9OR5BbeBO6NE6B/elxm+x5TccDQZVEH\nIW1vOeqaC7IwfQ1Slbo2xaKayzE63x2gQVrnFzadp4RgX8SgyENWa9gjAr2U\nvN1YVyw0y80fmORMOlxT5ahh3Hz/tHdVExosEcspaDY+KhLu0K4TDd+fnhAD\ncpnTy9yq5AVHCjMKIglSjgHy9sLPUpOwKg2phn2WbyG+8M+wI9TZM93ejck3\nI9UKJM9/iPxcdyoyyeXqmYw+O2czMhjUFE6UvdpUo2qusvS7rZHMIQoTYjaG\nF5Q5iIwdrX4FB9Q2iXn33oL8BVaVRhXS/NC5Pftq4ctwx+Rfr1GrmAkCJFkM\n4JNdxEfZuTbbeDCfqhGRKOGWiD+1zdI6l4qCsng6esZP0SJlEVotOBqBY1lJ\nbQQ9xa0BwFN7fWfeDLohpcgNdhwsc3XrEJnq+NS1cAcK83JoHT0266UZKTQp\nqWyA1NMVHtbpf7YOU0L5hdmG2JSQHvwFkKwSp0OcboOpJF/qIsop7b82zOJd\nRdXUrEK/PWvHY+jzyDORVc9ckNDFKi+0098mcc5c055GY5tAokfFFMoKO3cn\n6o77POXY/0UVwgt9Svd3rd6bBg4gfOvuUDj6b9/IUfy1MPnuXypxI/ebMvbo\nWIk6\r\n=uBG7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCP+nylzE8rLEdxFK1M+lQNEuw/9/e6y6gy6bgrmUFlZgIgBlQTi99Tvqv9838mGTdpObfR6I9RdxnB/sWL/dG5a0s="}]},"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.1.1_1611515441707_0.34131021875960155"},"_hasShrinkwrap":false},"1.1.2":{"name":"ts-json-api","version":"1.1.2","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"yarn tsdx watch","build":"yarn tsdx build","test":"yarn tsdx test --env=jsdom","lint":"yarn tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"4aae17bb103f6044645affbc784cc22802a6a3ad","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.1.2","_nodeVersion":"16.5.0","_npmVersion":"lerna/3.22.0/node@v16.5.0+x64 (darwin)","dist":{"integrity":"sha512-phWIjwShoziMH6bzIfMhRA5uRm779CvkNSadkpiWJOEqR/VvZT7aDhYIBypmIkwAUAWyax0aGTGeyWMM6zDYbw==","shasum":"f2fcb197732bc1f3891d15ea84fd35cd26878cc1","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.1.2.tgz","fileCount":30,"unpackedSize":118737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQPNbCRA9TVsSAnZWagAAmb0P/23leMAViYhVWOHDy7Iz\nIuxKfFrtlebUfKK+cyf+DVmKAzC+r5RcEkApCX0S9USwtqQLsMRBgA+PnZaX\n83+eLoe6h66I2iZPue19oDxro0hzNYRESm2TFvWlffdGgeZxLKDttEVCbBpm\n8b5m9rZCA4KpSjEXJfIiG0U6rFk6CZk6m5Pw9U2hTe6v+iZlaYcXdTC34R1e\n/hao07CC9DQS0RIzprgDOFXLLwL5SVRD/JjEm+1QqBh0c3zUjWMVLAWOXh/j\n8/Uj8Mk3oyObqhzKnYPT2pc0tjiGknyTPrJ8THPjvm3KNlVfrRax8HwcWpVI\nhWXs9CCCtTXsj6dzInfmL8zftH5Rkzq79Aepbf9wuGnho7swnRWUBewVXNJq\nmpNpOvv3LFACH3gupt21l5pY2dGJhKkYqqYQbQ5QsJq0efRBrJWWfeTuiOpH\n3Gqh0nG+MPhZFhjeJuzc5qsqtDpyLdZrNTSuOpS/1RE80ls7ykQXxSpkx9oF\nrmgmP/QXvobR3/bR6Jmj4RfXjW+Br5QrsOqpMsY4vGUcmj0Ugsip6XKwjM5K\nrXUvMM3vMK1RMTBIH0Oag9HBNZOuk5Dwv/cspFrkBlvHQPU5Z3tSFLI6MVMS\nyOssLcqOvxyMrvbT280h5RjBD5Jx0Hq8KFYztIeCrg3mR+cA4jeTnaJ32oSE\nZLqp\r\n=el0j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpzS/9w0Aw9OqR4Tvl8gCxbsrv2MzzQmOGdLoOEhJXhAiEAsz7ZqmFsxA4jrJbUQEA4tocImFhrvGUbLda2vsqqMFo="}]},"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.1.2_1631646554859_0.7990904488601214"},"_hasShrinkwrap":false},"1.1.3":{"name":"ts-json-api","version":"1.1.3","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"https://github.com/rmarganti/json-api/tree/master/packages/ts-json-api"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"yarn tsdx watch","build":"yarn tsdx build","test":"yarn tsdx test --env=jsdom","lint":"yarn tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"9081cc3ff6b2ac9c3a188131ffb5862838574453","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","_id":"ts-json-api@1.1.3","_nodeVersion":"16.15.0","_npmVersion":"lerna/3.22.0/node@v16.15.0+x64 (darwin)","dist":{"integrity":"sha512-d9PBZz3zWL3F24FHzKSKSqrVXQlzyzHovvhEMIrIfbeikcul7DWmflSnOe7bcql4pCIZMEFHGzVQju/2YZW/Wg==","shasum":"3efd6ceaf382dc3dda36f5b887592f823f03ecdb","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.1.3.tgz","fileCount":30,"unpackedSize":118761,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiU3GsRedC5g1FdCNeqOaMERBZ9KZahWZITegq2alTmwIgX7hNTptnWuvps7uDs3MAl4fSHvdKC97A0OApIh/afdc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimMXRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3xQ/7B3E6H3scmet4WRXM5WNs56gMMrncQARIDsgvmecZgzqYHey6\r\n+//RrexwcRqrIveO6OO8tZAG296E4lLBS1W7CLGWFv2VK+UcjrTPz7Z9QpbS\r\n0MCTakYQDJOeJOyMZruPyYcssuhL2tlB4xl6UQ9bQTb02pfvmypTLkpsdiAP\r\ng70WQlWSbWdWZ3AhhBX9TFgqZ+sA1Saas9jEk/FW3qItYusPcu98SP+kVuU0\r\nbOWsbDZb0puSkMFup7odcqEQdaBZ9LvEWprm9k/P9DMdRned68neHHDAk0Wj\r\ngPefrbBHfmRyrTZIKvaLFB1V9ncffRB9cRWgvtFWpC1MjJ6hKFlv+OOHdkSV\r\n/IATAf2qnynwXU9CmkYa0zTNiS6vFT4HSz1zxOxDmbltt7s6GQYfELyZiEFn\r\n8WIt+hFlvV0s0Of+9E4DHGfXcDLDSVMVDydcXpFM2a51ufO+hSXm1Q4PJRk8\r\n5RsFRN8g9NlwPrJmtpo6s6w2NvSz7Wh1nFzdY1urSzhbRUsAKTrZt9wBCYRK\r\nar5/Aj4DZjsavihhfW6lPdWlfWsmScCS2RDiI1fFtJvW0NHpQUmDueSJB0NU\r\nWCFzvufMioHRe/vDGUnzU8yLXpGUizzCes4w0boMHG6RLx8fEaCTbYKWErHV\r\nnI/NtzxaYojcKJPUt5T2rJJAuTt4/AJA+mA=\r\n=cVao\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.1.3_1654179281083_0.43778717495223374"},"_hasShrinkwrap":false},"1.2.0":{"name":"ts-json-api","version":"1.2.0","author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"repository":{"type":"git","url":"git+https://github.com/rmarganti/json-api.git#master"},"license":"MIT","main":"dist/index.js","module":"dist/ts-json-api.esm.js","typings":"dist/index.d.ts","scripts":{"dev":"yarn tsdx watch","build":"yarn tsdx build","test":"yarn tsdx test --env=jsdom","lint":"yarn tsdx lint","prepublish":"yarn build"},"husky":{"hooks":{"pre-commit":"tsdx lint src && yarn test"}},"jest":{"moduleNameMapper":{"^__mocks__(/?.*)":"<rootDir>/__mocks__/$1","^__tests__(/?.*)":"<rootDir>/__tests__/$1"}},"dependencies":{"ramda":"^0.26.1"},"gitHead":"56b5f81f97c1834eab7a15b96f755a257b761c67","description":"A collection of TypeScript interfaces and classes for working with [JSONAPI.org](http://jsonapi.org/)-standard requests/responses.","bugs":{"url":"https://github.com/rmarganti/json-api/issues"},"homepage":"https://github.com/rmarganti/json-api/tree/master#readme","_id":"ts-json-api@1.2.0","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-hrH/m9KvidS6gHIfZwH3v/9Jb92CVZvJvFYQrpBDyHhBgWcKa2ol9hPAifEn8u4dpjnvuHG6xZoJgxHfGM5ouw==","shasum":"4936a9c5f82cda7be895272567d61dbb55c5b522","tarball":"https://registry.npmjs.org/ts-json-api/-/ts-json-api-1.2.0.tgz","fileCount":29,"unpackedSize":118269,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHUfLamv9YJHTZbWP0C5vJ1Tf0x7HyRGjkSGEIhHU6dRAiATkf57NnTuIX3FSk91EIO7gvsSZiPvlV/77fIpO1JGdg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRaibACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVKA//dll5ujosDnXjmtMQpxH/WZbeY+V1neVSGICpUW97ueKvcbdh\r\nPi6zkHcG9muTp9ZUumEJzWagzdvABLJCzXQtLzP8s6/R/j/JOpLbBMaelEU9\r\ndDLHgwtdaDacxfuzauFD3AdO/u0LyR1+TDfM4AR8eJoAN/Z931JI9BDNdhrB\r\nO5l/lM5bHOTqhgIek7QsWMqK3U0ddrXeXYNTxzL/KE18zXx3ZmjB+OuA0mNy\r\n5DlcwFIS4oD0MZ7VbrrXawxsvnqk0VAg2J4I5vImwRWa3ua/n7DJCkcJSIin\r\nGmhipNXmK6pT0UjHtUvfxof43ebMZl/ylAaWJKef5i2iMKsxDxL1Ji/s7wEV\r\n9w0VfUTxn1ndXFABGiEJ6eMDOomSCr5RSweAagO2syZaVGUJqW+3FZ0HZGlI\r\nIJBWFzZP3bNh+YXIr3ndu4s6FEbjHk4Mia8Pr7kAF5ZXbLEJMJMH07FtUXsD\r\nMxFxuwEapaO870ItgnCOUVG4QCSgjbdPApRjUAU2LD1Jwh7xRmGQkOymYBtV\r\nSbxzvohg5EvD0fRz4IE7SVYBDrG+NpTiLW4oUcqQU43FDld8jqU4BYOZUjmG\r\nBKbK/WAbL6lXFpIHV8x+W1i1eP0FR/skm8kNPzbdGyfGHbwaucCVfbpsZQS4\r\npiFit2oRkKvYdjrdraguMxZSnx7Tscz0t4w=\r\n=2X2g\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"},"directories":{},"maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-json-api_1.2.0_1665509530762_0.9668165351121694"},"_hasShrinkwrap":false}},"readme":"# ts-json-api\n\nA collection of TypeScript interfaces and classes for working with\n[JSONAPI.org](http://jsonapi.org/)-standard requests/responses.\n\n## Interfaces\n\nThere library supports JSONAPI standard in all its variations. Therefore, there\nare a number of interfaces you may find useful.\n\n### Response\n\nThis is the main interface. It works with any acceptable combination of\n`ResponseWithData`, `ResponseWithErrors`, & `ResponseWithMeta`. If you need to\ntarget specifc response types, it is recommend you use those more specific\ninterfaces (covered below).\n\nSee also: `ResponseWithData`, `ResponseWithErrors`, and `ResponseWithMeta`.\n\n### ResourceObject\n\nThis represents a single ResourceObject in a JSONAPI response. See also:\n`ResourceObjects` and `ResourceObjectOrObjects`.\n\n### Other interfaces\n\nDue to JSONAPI's nested structure, it is constructed of a decent number of\nindividual pieces. We recommend taking a look at [src/types/index.ts](./src/types/index.ts) for\nreference. Should you need to target more specific pieces of a response, it\nshould be pretty self-explanitory.\n\n### Example Interface usage\n\n```js\nimport { Relationship, ResourceObject, Response } as JsonApi from 'ts-json-api';\n\ninterface Article extends ResourceObject {\n    type: 'articles';\n    attributes: {\n        title: string;\n    };\n    relationships: {\n        author: Relationship<Person>;\n        comments: Relationship<Comment[]>;\n    };\n}\n\ntype ArticleItemResponse = Response<Article>;\ntype ArticleCollectionResponse = Response<Article[]>;\n\ninterface Person extends ResourceObject {\n    type: 'people';\n    attributes: {\n        'firstName': string;\n        'lastName': string;\n        twitter: string;\n    };\n}\n\ninterface Comment extends ResourceObject {\n    type: 'comments';\n    attributes: {\n        body: string;\n    };\n}\n```\n\n## The `ApiResourceObject` class\n\n`ts-json-api` provides an ResourceObject class that is helpful for acessing Resource Object data and updating it in an immutable way. All functions on the `ApiResourceObject` class will return a new `ResourceObject`, unaffecting the original.\n\n### Example Usage\n\n```js\nimport { ApiResourceObject } from 'ts-json-api';\n\nconst exampleInput = {\n    \"type\": \"articles\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"title\": \"JSON API paints my bikeshed!\"\n    },\n    \"relationships\": {\n      \"author\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/author\",\n          \"related\": \"http://example.com/articles/1/author\"\n        },\n        \"data\": { \"type\": \"people\", \"id\": \"9\" }\n      },\n      \"comments\": {\n        \"links\": {\n          \"self\": \"http://example.com/articles/1/relationships/comments\",\n          \"related\": \"http://example.com/articles/1/comments\"\n        },\n        \"data\": [\n          { \"type\": \"comments\", \"id\": \"5\" },\n          { \"type\": \"comments\", \"id\": \"12\" }\n        ]\n      }\n    },\n    \"links\": {\n      \"self\": \"http://example.com/articles/1\"\n    }\n  }\n};\n\nconst article = new ApiResourceObject(exampleInput);\n\nconsole.log(article.type());\n// \"articles\"\n\nconsole.log(article.id());\n// \"1\"\n\nconsole.log(article.attributes());\n/// {\n///     \"title\": \"JSON API paints my bikeshed!\"\n/// }\n\nconsole.log(article.attribute('title'));\n// \"JSON API paints my bikeshed\"\n\nconst updatedArticle = article.update({ title: \"New Title\" });\n\nconsole.log(updatedArticle.attribute('title'));\n// \"New Title\"\n\nconsole.log(article.attribute('title'))\n// \"JSON API paints my bikeshed\"\n// > NOTE: The original `article` is not affected\n\n\n/**\n * Relationships\n */\nconst relationships = article.relationships();\n\nconsole.log(relationships.author.id());\n// \"9\"\n// Note that all relationship(s)-fetching methods return ResourceObject/ResourceObjects representing those relationship objects\n\nconsole.log(\n    relationships.comments[0].id(),\n    relationships.comments[1].id()\n);\n// \"5\", \"12\"\n\nconsole.log(article.relationship('author').id());\n// \"9\"\n\n// You \"add\" a relationship when the relationship represents a collection (ie. comments).\nconst updatedArticle = article.addRelationship('comments', 'comments', '432');\nconst updatedArticle = article.addRelationship('comments', CommentResourceObject);\n\n// You \"set\" a relationships when the relationship represents a single item (ie. author)\nconst updatedArticle = article.setRelationship('editor', 'people', '123');\nconst updatedArticle = article.setRelationship('editor', PeopleResourceObject);\n\n// You can also remove a relationship\nconst updatedArticle = article.removeRelationship('comments', '9');\n\n/**\n *  Other helpful methods\n */\n\n// Helpful for posting to an API and/or working with other libraries\narticle.toJSON()\n\n// Maybe your API call doesn't want to include relationship info\narticle.withoutRelationships().toJSON()\n```\n\n## Utility Functions\n\nThis package exposes all of its useful utility functions. Documentation is\ncoming, but feel free to browse around `src/fp`. All functions are curried for\nall you functional programming geeks.\n","maintainers":[{"name":"rmarganti","email":"ryanmarganti@soulsizzle.com"}],"time":{"modified":"2022-10-11T17:32:11.052Z","created":"2017-10-08T21:01:12.105Z","0.0.1":"2017-10-08T21:01:12.105Z","0.2.0-beta":"2017-12-06T14:32:21.908Z","0.2.0-beta.2":"2017-12-07T14:13:20.580Z","0.2.0-beta.3":"2018-01-08T14:21:25.276Z","0.9.0-beta.1":"2018-04-15T14:25:25.905Z","0.9.0-beta.2":"2018-04-15T14:38:57.919Z","0.9.0-beta.3":"2018-04-15T14:52:15.773Z","0.9.0":"2018-04-15T17:52:34.657Z","0.9.1":"2018-05-30T15:01:04.074Z","0.9.3":"2018-07-06T16:15:36.967Z","1.0.0-beta":"2019-05-30T16:33:29.662Z","1.0.0-beta2":"2019-06-28T17:11:25.925Z","1.0.0-beta3":"2019-07-26T13:18:59.250Z","1.0.0-alpha.0":"2019-07-26T13:32:54.717Z","1.0.0-alpha.1":"2019-07-26T13:40:10.620Z","1.0.0-beta.4":"2020-01-28T16:20:50.697Z","1.0.0":"2020-02-17T21:13:31.813Z","1.1.0-alpha.0":"2020-05-29T20:29:42.370Z","1.1.0":"2020-07-02T20:25:18.427Z","1.1.1":"2021-01-24T19:10:41.873Z","1.1.2":"2021-09-14T19:09:15.042Z","1.1.3":"2022-06-02T14:14:41.270Z","1.2.0":"2022-10-11T17:32:10.986Z"},"author":{"name":"Ryan Marganti","email":"ryanmarganti@soulsizzle.com"},"license":"MIT","readmeFilename":"README.md","repository":{"type":"git","url":"git+https://github.com/rmarganti/json-api.git#master"},"homepage":"https://github.com/rmarganti/json-api/tree/master#readme","bugs":{"url":"https://github.com/rmarganti/json-api/issues"}}