{"_id":"@async3619/haunted","_rev":"1-7e898e066e048093fd280fb5b280e365","name":"@async3619/haunted","dist-tags":{"latest":"1.2.0"},"versions":{"1.1.1":{"name":"@async3619/haunted","version":"1.1.1","description":"music metadata retrieving server","author":{"name":"Sophia","email":"me@sophia-dev.io","url":"sophia-dev.io"},"license":"MIT","types":"index.d.ts","main":"","dependencies":{"@trpc/server":"*"},"publishConfig":{"access":"public"},"gitHead":"58de7177f4f5ec1c30d3e30a40eff3af896028f4","_id":"@async3619/haunted@1.1.1","_nodeVersion":"18.15.0","_npmVersion":"9.6.3","dist":{"integrity":"sha512-oniuw1g+F4fD+z/om4lto8gDDDOjgVO+U7KiqMHRci2cf8sH32cmr2iX6b8ltyCy+v569cbIkpYa7BI5H5279g==","shasum":"0bca11c20e9c33aeaef0287788ac29e831745d61","tarball":"https://registry.npmjs.org/@async3619/haunted/-/haunted-1.1.1.tgz","fileCount":4,"unpackedSize":8336,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFx6lDrbxvtdJ1D084GKNK75EOeMLqoc8T8l5xaF3C7JAiB3u/o2cd6TPgyGcIhi+/rpNDfdArEMvHUce37xWA1HGg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLi6dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnDg/+JdS+sIoPvMrMd6fsS9u641FDVCA2AcY0AqenLSAM9tFI13AR\r\n3eC7yFw3IHuulQSD62rShL8hoVwf1bCca8Ca7kc4UunnK6c1VEAjwKsYcBN2\r\nzSgAswKY9voJORmi29yzKbyJsP5FNPhxi8aHjnvk83Vo92p4VodPp752080n\r\nDf2FHlBP9fYd3WP38JsA3kuUht2Du+jiJevYSDslpcZTCjFE2yxxdIJO8hFK\r\nxPjqMz30MAHMmWNJVg7nFe1wMRizr1t4eR2FMR5IE3yZmG5SETqyc5vH+Tvw\r\n4C/JTxymKHc3fIzznszV1ERGyTDQ4DZjFO3Y5EahB57NDykex1rneOVqD5H0\r\nr8byd2ZvTViydKbIqgvC7F/JDcxfXEvV4XTEbaKcI0DLoVx0QdCMPK74PIYs\r\nuDaWPSLAdwwCnJnn//jDpMAT0CSizLxTFnznrlYRSGucuDsdImCnKhZxQ2ae\r\nl8ib506pzgWV0VVZ9dJIkG3Y5frWMSsU/fyy2b0V8+xaEYGnq8ZwOWwZ9C0W\r\nexGsJV38H8Pdh42m+ZnoI6PazE8TeD3QWDrr/ixLoWL2uoCi7x4CkTu0uQM8\r\nSSUnzyQPLeFuL6bhNwJ7tLYsoKb22eACFwvwo7Z7wANAJ7NT0aLKf+JhqJb/\r\nvR/QnOgru7sZqN4T+BwOoRfu9kiEd32vCJM=\r\n=fzWk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"async3619","email":"async3619@naver.com"},"directories":{},"maintainers":[{"name":"async3619","email":"async3619@naver.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/haunted_1.1.1_1680748189189_0.9348246431814882"},"_hasShrinkwrap":false},"1.2.0":{"name":"@async3619/haunted","version":"1.2.0","description":"music metadata retrieving server","author":{"name":"Sophia","email":"me@sophia-dev.io","url":"sophia-dev.io"},"license":"MIT","types":"index.d.ts","main":"","dependencies":{"@trpc/server":"*"},"publishConfig":{"access":"public"},"gitHead":"96e1c733ae14cfbb9e36bf4e3ed1dfcf56fdc8d4","_id":"@async3619/haunted@1.2.0","_nodeVersion":"18.15.0","_npmVersion":"9.6.3","dist":{"integrity":"sha512-RphXpw28NLgKuSbQCzUbZWbUuHruXZ8iq/Xs5nnR/JjezFQlFGajw0c3vcip/3MAakqMIzG+IgadHZTVHeeZ3A==","shasum":"3e20cd5b6adfde649d4d1a4dee86633d6294065f","tarball":"https://registry.npmjs.org/@async3619/haunted/-/haunted-1.2.0.tgz","fileCount":4,"unpackedSize":13129,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHC6ftTd4RNXa4vc++lb24VRqkFX2ta84YVMHOdajMmQAiEAw8QUTosaf7UXGYwV9A5jj5PSuobImgb8LZCQwtJdsNE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMq3OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDPA/7BWwHiwH+jugwf41JaTqGf/YMCqqKoV6/CLp7suBSyLJF7Tgz\r\nWg/Phjc+OR/WE0gx3SZJ6kO26qVv/9/9Wj1kcWHKKiFjVsiNhqd8IXFi84Lq\r\nnxn8G9wcPXQYfTlsRC9FU821vRNw0+VRh5Fyb7DBkHN4oA+WFVNWjv7JwJYu\r\n0+6dtW715Uzbfeiji0h0DYqLc8YKV8Y9m558JQeqnjMHna1ptVtBQXedZ8PS\r\n5LZoRpesCybQk1jnUCVPJrglUreKPPAbXXdLPaeLoBgcnM6LL/V3tYw4tJpv\r\nWy2MO3dvo14fvKz5QG631zYL/FQ2IExwiDC3NriDgoiyD2avaMaaF+0sthiw\r\nza6HWEwz8Wqu1cNJRk8BvKJjXtvoOH9uQMm66NwTHYhPYwEpmZmGuTG/Zs5l\r\nY2mTvC1nWfd+C8q+qmUAkgGowAjDbEknrk7mpaF2ThipxkH/MZifrnabpeqr\r\nuRNIZWn0B4X1WOrKNyxNbUwzJBpaM2Fd6Ot7n5dL4p1I9rOojrtaG0pTmXRW\r\nJCud19IfjMWGBeLsjb2ODZPriKVcN0jJg1ktE4lA4d2MulF9ko4zwUn/35N6\r\nGszTQLerxKrnghyWLg+sclJkrJSg5OMY8utkjC+LPrjvPnFcHnfUj++bCrWI\r\n+DVN0cj7n3WJzG5M82x5PqxJIJ2pie8mZLA=\r\n=8JuY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"async3619","email":"async3619@naver.com"},"directories":{},"maintainers":[{"name":"async3619","email":"async3619@naver.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/haunted_1.2.0_1681042893878_0.6494819298063252"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-06T02:29:49.132Z","1.1.1":"2023-04-06T02:29:49.344Z","modified":"2023-04-09T12:21:34.138Z","1.2.0":"2023-04-09T12:21:34.036Z"},"maintainers":[{"name":"async3619","email":"async3619@naver.com"}],"description":"music metadata retrieving server","author":{"name":"Sophia","email":"me@sophia-dev.io","url":"sophia-dev.io"},"license":"MIT","readme":"<h1 align=\"center\">\n  <br />\n  👻\n  <br />\n  Haunted\n  <sup>\n    <br />\n    <br />\n  </sup>    \n</h1>\n\n<div align=\"center\">\n    <a href=\"https://github.com/async3619/haunted/blob/main/LICENSE\">\n        <img src=\"https://img.shields.io/github/license/async3619/haunted.svg?style=flat-square\" alt=\"MIT License\" />\n    </a>\n    <a href=\"https://codecov.io/gh/async3619/haunted\">\n        <img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/async3619/haunted?style=flat-square&token=DF3uhBCl9j\">\n    </a>\n    <a href=\"https://hub.docker.com/r/async3619/haunted\">\n        <img alt=\"Docker Image Version (tag latest semver)\" src=\"https://img.shields.io/docker/v/async3619/haunted/latest?label=docker&style=flat-square\">\n    </a>\n    <a href=\"https://www.npmjs.com/package/@async3619/haunted\">\n        <img alt=\"npm\" src=\"https://img.shields.io/npm/v/@async3619/haunted?style=flat-square\" />\n    </a>\n    <br />\n    <sup>music metadata retrieving server</sup>\n    <br />\n    <br />\n</div>\n\n## 📖 About\n\nHaunted is music metadata retrieving server. this server retrieves metadata from several sources and serves it to client.\n\nThis server is mainly used for [Cruise](https://github.com/async3619/cruise). but you can use it for everything you want.\n\n## 🚀 Getting Started\n\n### 📦 Using Docker\n\n```bash\ndocker run -d -p 3000:3000 async3619/haunted:latest\n```\n\n### 📦 Using Docker Compose\n\n```yaml\nversion: \"3.7\"\n\nservices:\n    haunted:\n        image: async3619/haunted:latest\n        ports:\n            - \"3000:3000\"\n        volumes:\n            - ./config.json:/home/node/config.json:ro\n```\n\n## 📝 Usage\n\nBefore using this server in client side, you need to launch this server. see [Getting Started](#-getting-started) section.\n\n### 📡 TRPC\n\nyou can use this server with [TRPC](https://trpc.io/). we provide a type-safe client for TRPC. we also provide \nserver-side router types for client usage. all you need to do is to import `Router` type from `@async3619/haunted`.\n\nnow, you should install `@async3619/haunted` package in your client project to get type definitions.\n\n```bash\nnpm install @async3619/haunted \n\n# or\n\nyarn add @async3619/haunted\n\n# or\n\npnpm add @async3619/haunted\n```\n\nnow you can use this server with TRPC:\n\n```ts\nimport { createTRPCProxyClient, httpBatchLink } from \"@trpc/client\";\nimport { Router } from \"@async3619/haunted\";\n//       ^^^^^^ this will make you comfy and type-safe with your IDE\n\n// ...\n\nconst client = createTRPCProxyClient<Router>({\n    links: [httpBatchLink({ url: \"http://localhost:3000/trpc\" })],\n});\n\nconst result = await client.searchAlbums({ query: \"독립음악\", limit: 5, locale: \"ko_KR\" });\nconsole.log(result); // [{ ... }]\n```\n\n### 📡 GraphQL\n\nIn addition to TRPC, you can use this server with GraphQL. we provide [schema definitions](./schema.graphqls) for \nGraphQL. you can use `./schema.graphql` file to generate your client-side code with your favorite GraphQL client \ngenerator such as `apollo-codegen` or `graphql-codegen`.\n\n```ts\nimport { ApolloClient, InMemoryCache, gql } from \"@apollo/client\"; // or your favorite GraphQL client\n\nconst client = new ApolloClient({\n    uri: \"http://localhost:3000/graphql\",\n    cache: new InMemoryCache(),\n});\n\nconst result = await client.query({\n    query: gql`\n        query SearchAlbums($input: SearchInput!) {\n            searchAlbums(input: $input) {\n                title\n                artists\n            }\n        }\n    `,\n    variables: {\n        query: \"독립음악\",\n    },\n});\n\nconsole.log(result.data); // { searchAlbums: [{ ... }] }\n```\n\n## 🛠️ Configuration\n\nThis server uses `config.json` file from current working directory. we provide the configuration schema in\n`config.schema.json` file. you can use this file to validate your configuration file in your IDE.\n\n```json5\n{\n    servers: {\n        trpc: {\n            path: \"/trpc\",\n        },\n        graphql: {\n            path: \"/graphql\",\n        },\n    },\n    cacheTTL: 3600, // cache TTL in seconds\n    resolvers: {\n        // whatever resolvers you want to use\n        spotify: {\n            clientId: \"<your spotify client id>\",\n            clientSecret: \"<your spotify client secret>\",\n        },\n    },\n}\n```\n\n## 🎵 Resolvers\n\nCurrently, this server supports Spotify resolver only. but we are planning to add more resolvers in the future.\n\n### Supported Resolvers\n\n| Service       | Support? |\n| ------------- | :------: |\n| Spotify       |    ✅    |\n| YouTube Music |    ❌    |\n| Apple Music   |    ❌    |\n| Deezer        |    ❌    |\n","readmeFilename":"README.md"}