{"_id":"@djuk1csrdjan/lotr-sdk","_rev":"2-11f9d24d85a8fc72a8d8e24d6cb804e6","name":"@djuk1csrdjan/lotr-sdk","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@djuk1csrdjan/lotr-sdk","version":"1.0.0","description":"JS SDK for The One API","main":"./sdk/lotr-sdk.js","scripts":{"test":"mocha"},"keywords":["lotr"],"type":"module","author":{"name":"Srdjan Djukic"},"license":"UNLICENSED","devDependencies":{"mocha":"^10.2.0"},"gitHead":"5c8b4a10e1f5cbd6ca868a1fee4ea56b02eb3d80","_id":"@djuk1csrdjan/lotr-sdk@1.0.0","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-L6KQSOIFhJoa/JbFLP8HVA29a6BftDqyFqQlxL1EEB+SPDoHGbhfQ97c5Yf+Q5ViwMqwOrq4oaG56z+Ktgvpdw==","shasum":"d7829836d5f2ad761af6594dc0ab6e5e15265e4f","tarball":"https://registry.npmjs.org/@djuk1csrdjan/lotr-sdk/-/lotr-sdk-1.0.0.tgz","fileCount":10,"unpackedSize":13478,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDdgu8we6YRctxGg+5FFCEJFdPekwYWf0XaHKUkS/cW7AiBPA8o6vChoZ08aY07WlwAWWmGPu1+m002CtcxY4+/7cQ=="}]},"_npmUser":{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"},"directories":{},"maintainers":[{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotr-sdk_1.0.0_1689482328406_0.7315117951729508"},"_hasShrinkwrap":false},"1.0.1":{"name":"@djuk1csrdjan/lotr-sdk","version":"1.0.1","description":"JS SDK for The One API","main":"./sdk/lotr-sdk.js","scripts":{"test":"mocha"},"keywords":["lotr"],"type":"module","author":{"name":"Srdjan Djukic"},"license":"UNLICENSED","devDependencies":{"mocha":"^10.2.0"},"gitHead":"e17bad2f1ed7f54b4b0003cd202af13f7f429b8c","_id":"@djuk1csrdjan/lotr-sdk@1.0.1","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-xXXa/tR37+Sk5zHJqPk6r2mWuw82+smsG6FI5oIJce2oanshYBuTzUNYy/72lgB+6UdsDU0u6psVPigkfImktg==","shasum":"d531790f3c8835d481446ba52b1d3d5001c0f818","tarball":"https://registry.npmjs.org/@djuk1csrdjan/lotr-sdk/-/lotr-sdk-1.0.1.tgz","fileCount":8,"unpackedSize":11706,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHBf27V2RHk4Zeusp1koqsXpUV3fS+66sIr6UKmQcIbQAiAvfUbegX9QClHAHl/vX08PMPxvBLsDLQo3Cm2H4C5kSA=="}]},"_npmUser":{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"},"directories":{},"maintainers":[{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotr-sdk_1.0.1_1689484260760_0.5068349294764378"},"_hasShrinkwrap":false},"1.0.2":{"name":"@djuk1csrdjan/lotr-sdk","version":"1.0.2","description":"JS SDK for The One API","main":"./sdk/lotr-sdk.js","scripts":{"test":"mocha"},"keywords":["lotr"],"type":"module","author":{"name":"Srdjan Djukic"},"license":"UNLICENSED","devDependencies":{"mocha":"^10.2.0"},"gitHead":"98ef081cdd6ea461631adcc2f274b7c2fe42b87a","_id":"@djuk1csrdjan/lotr-sdk@1.0.2","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-JNRX18FRt3MkKghE0KlzC7Ltw1A7d9bbybAvlO1F99l5yXNZP2h8J3o0Q0fwq2V+IDyTRmj7RV+evnIq0CFjlA==","shasum":"07d643f13efa25900733832a6fbbdf562055c7e9","tarball":"https://registry.npmjs.org/@djuk1csrdjan/lotr-sdk/-/lotr-sdk-1.0.2.tgz","fileCount":8,"unpackedSize":11801,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2fza/TwuQmvFGVsc2UZacx/FZkN0W3yecWjb1UNAY+QIgMBLhsXzD5Jx8kJtWilpYM5w+TrwZnA+xZRn0xp88iy0="}]},"_npmUser":{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"},"directories":{},"maintainers":[{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lotr-sdk_1.0.2_1689517774189_0.6194509792763525"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-16T04:38:48.335Z","1.0.0":"2023-07-16T04:38:48.601Z","modified":"2023-07-16T14:29:34.566Z","1.0.1":"2023-07-16T05:11:00.931Z","1.0.2":"2023-07-16T14:29:34.388Z"},"maintainers":[{"name":"djuk1csrdjan","email":"djukic.srki@gmail.com"}],"description":"JS SDK for The One API","keywords":["lotr"],"author":{"name":"Srdjan Djukic"},"license":"UNLICENSED","readme":"# LotrSDK\nSDK for [The One API](https://the-one-api.dev/)\n## Prerequisites\nYou will need to obtain a APIKey from The One API\nClicking [here](https://the-one-api.dev/sign-up) takes you to dev sign up!\n## Installation:\n`npm install @djuk1csrdjan/lotr-sdk`\n## Get started:\n```\nimport LotrSDK from '@djuk1csrdjan/lotr-sdk';\nconst sdkInstance = new LotrSDK('YOUR_API_KEY');\n```\nQuick mention that The One API has Limited usage to 100r/10min\n## Supported Endpoints\n* Movies\n* Quotes\n\n   **SDK methods for these endpoints:**\n* `getAllMovies(qOptions)` - **qOptions** representing a [filter](#filter)\n* `getMovieById(id)` - **id** - id of a movie\n* `getMovieQuites(id, qOptions)` - **id** - id of a movie, **qOptions** representing a [filter](#filter)\n* `getAllQuotes(qOptions)` - **qOptions** representing a [filter](#filter)\n* `getQuoteById(id)` - **id** - id of a quote\n\n## Filter\n\nFilter is a JS object, you can form it like following:\n```\n{\n    paging: {\n        limit: 3,\n        page: 1,\n        offset: 2\n    },\n    sort: {\n        fieldName: 'character',\n        direction: 'desc' | 'asc'\n    },\n    filters: {\n        regularFilters: [\n            {\n                character: ['5cd99d4bde30eff6ebccfd0d'], //multiple (race: ['Orc','Human','Hobbit'])\n                operation: '='\n            }\n        ],\n        fieldExistsFilters : ['name', '!chapterName']\n    }\n}\n```\n\n## Method examples\n**All quotes:**\n```\nsdkInstance.getAllQuotes();\n```\n**Movie by id:**\n```\nsdkInstance.getMovieById('5cd95395de30eff6ebccde5d');\n```\n**Pagination example**\n```\nsdkInstance.getAllQuotes({\n    paging: {\n        limit: 5,\n        page: 2\n    }\n});\n```\n**Sorting example**\n```\nsdkInstance.getAllQuotes({\n    sort: {\n        fieldName: 'character',\n        direction: 'desc'\n    }\n});\n```\n**Filtering example**\n```\nsdkInstance.getAllMovies({\n    filters: {\n        regularFilters : [\n            {\n                budgetInMillions: [94],\n                operation: '<' \n            },\n            {\n                academyAwardWins: [3],\n                operation: '>='\n            }\n        ],\n    }\n})\n```","readmeFilename":"README.md"}