{"_id":"@brandonireland/umgutilities","_rev":"5-84d15d225139b98028cace3b20e0c84d","name":"@brandonireland/umgutilities","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"version":"0.1.0","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@brandonireland/umgutilities","author":{"name":"Brandon Ireland"},"module":"dist/umgutilities.esm.js","size-limit":[{"path":"dist/umgutilities.cjs.production.min.js","limit":"10 KB"},{"path":"dist/umgutilities.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^6.0.3","husky":"^7.0.2","size-limit":"^6.0.3","tsdx":"^0.14.1","tslib":"^2.3.1","typescript":"^4.4.4"},"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","_id":"@brandonireland/umgutilities@0.1.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-FWoIJ38AWmbuNdfv7phT/UR9IAWB/b0o1xMWwHxAx2toTh842cIm41a8vFnLToamvniqLBJSpBPtXLfae0JafQ==","shasum":"f9262e1357a0fc4b2282c8cc0adc75b287c3a2ef","tarball":"https://registry.npmjs.org/@brandonireland/umgutilities/-/umgutilities-0.1.0.tgz","fileCount":16,"unpackedSize":285283,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkbhrtLUq0UJsaNZKMd5q+ETpMllqAPoElc5Jyoe4gmwIgP0gqaoAlVWAAkVYvbOvWdiBp/etJMrcz3SwUNort+Fs="}]},"_npmUser":{"name":"brandonireland","email":"brandonsireland@gmail.com"},"directories":{},"maintainers":[{"name":"brandonireland","email":"brandonsireland@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/umgutilities_0.1.0_1634530053895_0.6953843183191204"},"_hasShrinkwrap":false},"0.1.1":{"version":"0.1.1","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@brandonireland/umgutilities","author":{"name":"Brandon Ireland"},"module":"dist/umgutilities.esm.js","size-limit":[{"path":"dist/umgutilities.cjs.production.min.js","limit":"10 KB"},{"path":"dist/umgutilities.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^6.0.3","husky":"^7.0.2","size-limit":"^6.0.3","tsdx":"^0.14.1","tslib":"^2.3.1","typescript":"^4.4.4"},"dependencies":{"contentful":"^9.1.3"},"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","_id":"@brandonireland/umgutilities@0.1.1","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-/5tfIx68jDLR/xEf/npR8OTOslpV0ocSszUBFW7VomcKkc6WoypzoRlrn94bBvq2YQM64cIKftavvmKN8vDZGw==","shasum":"949b0654a40afb8ef2f2c2f7aebe2917d64ece0e","tarball":"https://registry.npmjs.org/@brandonireland/umgutilities/-/umgutilities-0.1.1.tgz","fileCount":16,"unpackedSize":285335,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3YwhMJJDdNs0WNJ1EnIULrJeHk0rboyUz2nkz7QOv7AIgJAkvXbun1iGu+3cCeFPdxen60E+Pp7VpiZEgvIMUAnE="}]},"_npmUser":{"name":"brandonireland","email":"brandonsireland@gmail.com"},"directories":{},"maintainers":[{"name":"brandonireland","email":"brandonsireland@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/umgutilities_0.1.1_1634531795031_0.8901750922751976"},"_hasShrinkwrap":false},"0.1.2":{"version":"0.1.2","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@brandonireland/umgutilities","author":{"name":"Brandon Ireland"},"module":"dist/umgutilities.esm.js","size-limit":[{"path":"dist/umgutilities.cjs.production.min.js","limit":"10 KB"},{"path":"dist/umgutilities.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^6.0.3","husky":"^7.0.2","size-limit":"^6.0.3","tsdx":"^0.14.1","tslib":"^2.3.1","typescript":"^4.4.4"},"dependencies":{"contentful":"^9.1.3"},"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","_id":"@brandonireland/umgutilities@0.1.2","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-bS2QjtE1CKvUJCSxRLfvtVB1QzO7nKBwYOZJI0u35n/oJrQf06sRBMgAkrOoRWk8FgUENTPeNS70+vlmq/jJ8Q==","shasum":"45d4f3f2c6c117b492d3ff65589d5238975caef2","tarball":"https://registry.npmjs.org/@brandonireland/umgutilities/-/umgutilities-0.1.2.tgz","fileCount":16,"unpackedSize":285374,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0lza9KLTZC/amJWVjcaYx4HBENyST4gPkokxg0XN8cQIhAP0IF+uNsxADOrByPuCCs4EsO9u4Ds8NwaTpSqZjhxwv"}]},"_npmUser":{"name":"brandonireland","email":"brandonsireland@gmail.com"},"directories":{},"maintainers":[{"name":"brandonireland","email":"brandonsireland@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/umgutilities_0.1.2_1634532140414_0.3452024752313272"},"_hasShrinkwrap":false},"0.1.3":{"version":"0.1.3","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"name":"@brandonireland/umgutilities","author":{"name":"Brandon Ireland"},"module":"dist/umgutilities.esm.js","size-limit":[{"path":"dist/umgutilities.cjs.production.min.js","limit":"10 KB"},{"path":"dist/umgutilities.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^6.0.3","husky":"^7.0.2","size-limit":"^6.0.3","tsdx":"^0.14.1","tslib":"^2.3.1","typescript":"^4.4.4"},"dependencies":{"contentful":"^9.1.3"},"description":"The purpose of this library is to provide reusable API fetches to both Spotify & Contentful without the need to rewrite the same logic across multiple projects. Due to the time limit & nature of this project, there is plenty of room for expanding the libr","_id":"@brandonireland/umgutilities@0.1.3","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-/8k2/b9OhHN5ldnsJ/18nUCO/zgRlWTY3gnkb+sD0Bunz7hj96DuB3GH/KIQW16qxjocSBshXzgxNsJnuOof2g==","shasum":"49fb0db96d540b61e1fe1dc806dbada83d5a3ad4","tarball":"https://registry.npmjs.org/@brandonireland/umgutilities/-/umgutilities-0.1.3.tgz","fileCount":16,"unpackedSize":287971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzZuiCRA9TVsSAnZWagAAK6YQAJP8hCl0V2q3Gp/XgAXr\ngCo8wOeWBf47p5WDyQ3WpD6iQEV350zke6PBElpM+kjpzf+BQS4PncXVsIgr\nIKseqoGtV27qe9RdMgP/B8GxR9fFhsqgC62WjzyWijcNAij+43g5QmPbohZH\nQdKsDNgtN6GlCV+4KDi86J71N7+1o0dNF5HKYrnN8izNvJXD3AJ5K2sLupDW\nrdAHtkjl5Ptek5jntWLtNE1QlgeRmLVAJhmgKh1MMbiIxP5dDoQCfIHpOKr7\nLe0s0Beu1oQ5UmtKEg4I0Fvkjyrw2nLUxROKtos3suExzxaVIMenkY3Uy54i\n5x8nKTNiPfZi+VedW3Qa3EpDplyEch3Nw7Vmu+8sEqe9xcqgCgNXbSFBoHCx\nCKv37pWNtBD4Q9J9Ptib/ABkf82ZaeGS36NQWJdeUPVrHXTKYNw+TAhJ1s6g\n/51dtQLA2RrxOHeIR//MXTyZkyK7eBhV23x/Gd99bHVqqsySaacIm3D9Lx9G\nef3dzeVeciBObJOO4U1V3FIYXgKP9F/CQUBJ7qW4YwjawiNdTgn4Akg0Ag3d\nA4uiz4jWkUI5+0i8US6itFQsPHEOeqs/KkvMKqzGx+T/yTn2oYS7ruuwlOK0\nGhIpvXPL9jcolF3++vFjJ4hfoRVaz1V3g4LbCQjzNBVGpbDM2VMJVhE+0gei\nAti5\r\n=6SMM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEg+oNg3xiZcR9LzyzfjNKscrlb1cpMF8mAfJWYvYjgEAiAavULRIeTZZpyJmvRlDn+cvuzkqkNOTs6b+WT4kIPd0Q=="}]},"_npmUser":{"name":"brandonireland","email":"brandonsireland@gmail.com"},"directories":{},"maintainers":[{"name":"brandonireland","email":"brandonsireland@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/umgutilities_0.1.3_1634539285885_0.42494659254560196"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-18T04:07:33.775Z","0.1.0":"2021-10-18T04:07:34.035Z","modified":"2022-04-04T20:25:16.226Z","0.1.1":"2021-10-18T04:36:35.205Z","0.1.2":"2021-10-18T04:42:20.577Z","0.1.3":"2021-10-18T06:41:26.063Z"},"maintainers":[{"name":"brandonireland","email":"brandonsireland@gmail.com"}],"description":"The purpose of this library is to provide reusable API fetches to both Spotify & Contentful without the need to rewrite the same logic across multiple projects. Due to the time limit & nature of this project, there is plenty of room for expanding the libr","author":{"name":"Brandon Ireland"},"license":"MIT","readme":"# UMG Utility Library\n\nThe purpose of this library is to provide reusable API fetches to both Spotify & Contentful without the need to rewrite the same logic across multiple projects. Due to the time limit & nature of this project, there is plenty of room for expanding the libraries functionality. Some of these ideas can be found under the [Expanding the Library](expanding-the-libary) section.\n\n## Table of Contents\n\n1.  [Installation & Setup](installation-and-setup)\n2.  [Spotify Requirements](spotify-requirements)\n3.  [Contentful Requirements](contentful-requirements)\n4.  [Spotify Utilities](spotify)\n5.  [Contentful Utilities](contentful)\n6.  [Expanding the Library](expanding-the-libary)\n\n## Installation and Setup\n\nInstall the library via `npm` or `yarn`\n`npm i @brandonireland/umgutilities` or `yarn install @brandonireland/umgutilities`\n\n#### Spotify Requirements\n\nThe Spotify utilities & endpoints this library provides requires a `client ID` as well as a `client secret` and an app that has a Redirect URI. The details of the authentication process for Spotify can be found [here](https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow) for reference.\n\nQuick tutorial for local development:\n\n1. Create a Spotify developer account found [here](https://developer.spotify.com/) and fill in your details.\n2. In your Spotify Developer Dashboard, click `Create An App` and provide a Name and Description.\n3. To use this locally while developing, click on your newly developed app in your Dashboard, go to `Edit Settings` in the navigation and under `Redirect URIs` and add in a callback URI. For example, `https://localhost:3000/callback`\n4. Your `client ID` as well as `client secret` can be found in your applications dashboard.\n\n#### Contentful Requirements\n\nTo utilize the Contentful methods this library provides, requires a `space`, `environment`, `accessToken` & `host` provided by Contentful.\n\nQuick Tutorial for local development:\n\n1. Create a Contentful Account [here](https://www.contentful.com/).\n2. Create an Organization and a space for your project.\n3. In your Spaces home, navigate to the settings tab and click on `API Keys`.\n4. On the top right of the page, select `Add API Key`, then name your API key and click save.\n5. The `space ID`, `Content Preview API - access token` , & `environment` value will be needed. For development purposes our `host` key will be `preview.contentful.com`.\n\n## Using the Library\n\n### Spotify Example\n\n```\nimport  React, { useEffect, useState } from  'react';\nimport { SpotifyHelpers } from  '@brandonireland/umgutilities';\n\nconst  SpotifyData  = () => {\n\tconst [data, setData] = useState(null);\n\n\tuseEffect(() => {\n\t\tasync function fetchData() {\n\t\t\tconst spotify = new SpotifyHelpers({ clientId: '<CLIENT_ID>', secret: '<SECRET>' });\n\t\t\tspotify.artistId = '2YZyLoL8N0Wb9xBt1NhZWg';\n\t\t\tconst data = await spotify.getArtist();\n\t\t\tsetData(data);\n\t\t}\n\t\tfetchData();\n\t}, []);\n\n\treturn (\n\t\t<div>Hello World!</div>\n\t);\n}\nexport  default  SpotifyData;\n\n```\n\nThe Library provides these Methods:\n| Method | Parameters | Type | Description |\n|--------------------|-------------------|------------------------|----------------------------|\n| getArtist | Id | String | Returns Artist Data |\n| getArtists | [Id] | String[] | Returns Array of Artists |\n| getArtistTopTracks | Id, market | String[], String | Returns Artists Top Tracks |\n| getRelatedArtists | Id | String | Returns Related Artists |\n| getArtistAlbums | Id, market, limit | String, String, Number | Returns Artists Albums |\n| getAlbums | [Id] | String[] | Returns Array of Albums |\n| getAlbum | Id | String | Returns Album |\n| getAlbumTracks | Id, market, limit | String, String, Number | Returns Album Tracks |\n\nThe Library provides these Getters\n\n| Get      | Type   | Default Value | Description       |\n| -------- | ------ | ------------- | ----------------- |\n| artistId | String |               | Returns Artist Id |\n| limit    | Number | 10            | Returns Limit     |\n| market   | String | 'US'          | Returns Market    |\n\nThe Library provides these Setters\n| Set | Type | Description |\n|----------|--------|--------------------|\n| artistId | String | Sets the Artist Id |\n| limit | Number | Sets the Limit |\n| market | String | Sets the Market |\n\n### Contentful Example\n\n```\nimport  React, { useEffect, useState } from  'react';\nimport { ContentfulHelpers } from  '@brandonireland/umgutilities';\n\nconst  ContentfulData  = () => {\n\tconst [data, setData] = useState(null);\n\n\tuseEffect(() => {\n\t\tasync  function  fetchData() {\n\t\t\tconst  contentful = new const contentful = new ContentfulHelpers({ space: '<SPACE_ID>', environment: '<ENVIRONMENT>', accessToken: '<CONTENTFUL_PREVIEW_TOKEN>', host: 'preview.contentful.com' });\n\n\t\t\tconst data = await contentful.getEntries({id: <ENTRY_ID>, limit: 1, include: 10});\n\t\t\tsetData(data);\n\t\t}\n\t\tfetchData();\n\t}, []);\n\n\treturn (\n\t\t<div>Hello World!</div>\n\t);\n}\nexport  default  ContentfulData;\n\n```\n\nThe Library provides these Getters\n| Get | Type | Default Value | Description |\n|---------|--------|---------------|------------------|\n| limit | Number | 1 | Returns Limit |\n| include | Number | 10 | Returns included |\n\nThe Library provides these Setters\n\n| Set     | Type   | Description                |\n| ------- | ------ | -------------------------- |\n| limit   | Number | Sets the Limit             |\n| include | Number | Sets the amount to include |\n\n## Expanding the Library\n\nThis library could be expanded in many directions. Firstly, the Spotify methods could be expanded to hit different spotify endpoints like Search, Playlists, Shows, etc. The Spotify api can be found [here for reference](https://developer.spotify.com/documentation/web-api/reference/#reference-index) to give a few ideas.\n\nSecondly, the Contentful Methods could be expanded into returning data in a formatted way thats easy to work with.\nThirdly, the library could add new classes to support other API's that UMG utilizes frequently.\n","readmeFilename":"README.md"}