{"_id":"@4-us-4-others/are.na","_rev":"4-a492c11177cf753797a8ba7ea52dc9ae","name":"@4-us-4-others/are.na","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.3":{"name":"@4-us-4-others/are.na","version":"0.1.3","description":"Interface to are.na API. A fork of @ivangreene's are.na package (https://github.com/ivangreene/arena-js).","main":"index.js","scripts":{"pretest":"find test/staged | grep \\? | sed -e 's#^.*api.are.na/v2/##' | cat test/staged/list.txt - | sort | uniq -u | wget -cx -P test/staged/get -B https://api.are.na/v2/ -i - --header=\"Authorization: Bearer $ARENA_ACCESS_TOKEN\"","test":"mocha","test:watch":"nodemon -e js,txt --exec 'yarn test'","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/4-us-4-others/arena-js.git"},"keywords":["are.na","api","axios","request","rest","oauth"],"author":{"name":"Ivan Greene"},"license":"MIT","bugs":{"url":"https://github.com/4-us-4-others/arena-js/issues"},"homepage":"https://github.com/4-us-4-others/arena-js#readme","dependencies":{"axios":"^0.18.1","qs":"^6.5.1"},"devDependencies":{"chai":"^4.1.2","chai-as-promised":"^7.1.1","mocha":"^4.0.1","nodemon":"^1.12.7","sinon":"^4.1.2","sinon-chai":"^2.14.0"},"licenseText":"MIT License\n\nCopyright (c) 2017 Ivan Greene\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@4-us-4-others/are.na@0.1.3","dist":{"shasum":"b12db028ec9e6f3af557e8677cca53f9a3a86dbc","integrity":"sha512-k/hu95Hp4Fc15VpWNpo4Iaoy2tqovhAH0be6GRYArhlVexSCoHS4lPywztH2p545xokvQbkuETAVRs3KMFqVDw==","tarball":"https://registry.npmjs.org/@4-us-4-others/are.na/-/are.na-0.1.3.tgz","fileCount":5,"unpackedSize":13847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjluhCRA9TVsSAnZWagAAA84P/A8FQ43FhfeOPNQJhZAt\nsGsJr8lGp3sl9F92TZgDAUVqN2rLwcI5gKQmBFoEbAo87PDokBnr/jUrNCm3\nIxQdxwKqJ3IDhaY3BSnWc8rKQ1wdI26VzgO50aHZzcxx7KFfSp7Mrec1U1kT\nYXgiN84cxeSKqUcNK5Z5PAf1VqrwjhQ3RIGJuJ0aNr7uOnnTBeE18BM2H+KF\nd7qSaQNh16x97nDetMob9mHoKjd0F51+f5AG40TuuxnUc9HiUwTJS9Z1SI66\nb9WYj2WU/uvs14WXXFtYGAPNBvoJFon6SAM4j560raBeS6D6xvoziau/uvH9\nhulyAYk6hJ6hcF3oP135vji3iXL/7lNOY8/uqRaPen9XWB5/MqwhGtsZ3Lrk\n/Bj0KfscANmPIGV9+wxCuIWmWKrSHPTNapVcsQh3rELwEx4nlDY3B2BWWfmN\nRox1LtNxDWnism09Jo9ZJuzNgzUtqLGjj9JZ/vEMHva8t1YBmnQmPLVVt4iq\nvcw/5/2JmCZkPb/cXp/u66wZR8mr6z9gu3dKd7R2lF5TdGvSeQTOwC9GpsCd\n0oxkT1wNRpnHVP5mCw+SS5tv4tucfcsPvW3SYtHUykC/2ItttWagcO5w8A1u\nBv0o1F95esa9ia2/aflgdqrLQp5jFMhHwiT5t/NcfF8wm8XslMwU5QmS513D\nKJBE\r\n=MIbx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBXRk7tnduwX12V+gUbuoRGzgaF1LvjIeF5NI+N3osAAiEA1ihRW6tLnng9xY0+e71akoyor+wbl38RLOzjxiHD3rM="}]},"maintainers":[{"name":"mwvd","email":"mwvdavidson@gmail.com"}],"_npmUser":{"name":"mwvd","email":"mwvdavidson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/are.na_0.1.3_1569610656871_0.4045148186263823"},"_hasShrinkwrap":false},"0.1.5":{"name":"@4-us-4-others/are.na","version":"0.1.5","description":"Interface to are.na API. A fork of @ivangreene's are.na package (https://github.com/ivangreene/arena-js).","main":"index.js","scripts":{"pretest":"find test/staged | grep \\? | sed -e 's#^.*api.are.na/v2/##' | cat test/staged/list.txt - | sort | uniq -u | wget -cx -P test/staged/get -B https://api.are.na/v2/ -i - --header=\"Authorization: Bearer $ARENA_ACCESS_TOKEN\"","test":"mocha","test:watch":"nodemon -e js,txt --exec 'yarn test'","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/4-us-4-others/arena-js.git"},"keywords":["are.na","api","axios","request","rest","oauth"],"author":{"name":"Ivan Greene"},"license":"MIT","bugs":{"url":"https://github.com/4-us-4-others/arena-js/issues"},"homepage":"https://github.com/4-us-4-others/arena-js#readme","dependencies":{"axios":"^0.18.1","qs":"^6.5.1"},"devDependencies":{"chai":"^4.1.2","chai-as-promised":"^7.1.1","mocha":"^4.0.1","nodemon":"^1.12.7","sinon":"^4.1.2","sinon-chai":"^2.14.0"},"gitHead":"3b11d3b41d2b5f8bb8ddc0a3361e8e61154c76d2","_id":"@4-us-4-others/are.na@0.1.5","_nodeVersion":"10.16.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-DULZ2m5AAcHbUVrox/nJd//OdDqRRtqAw9KUoqWRmfVd7jLtLqvt0KXDzzQDIuYd3mcQwjaYNnIcSKjYgO+tmw==","shasum":"81bdea9b865aa29c3028825db94b8ffda9c4c6ca","tarball":"https://registry.npmjs.org/@4-us-4-others/are.na/-/are.na-0.1.5.tgz","fileCount":4,"unpackedSize":13942,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjmxNCRA9TVsSAnZWagAAqh4P/1Eh4dW5agGeNfrFhbIQ\nDuSSyQX7vS5c09tDFE50P7hdjyVc8ySRHnblf6rZRJmkwIjq9FahYqnWT21C\n7dwXWLNCezhOVAmxOV1UL/EdMtCYBLNGuQNAg9+2j/EsKDu/E62j6fVUpi0b\nkbkxQspTjQiI+4iJrbuW0+trBrhE1ToeJ8vdtqZYibJ+NQHd+jPv/+iudv5L\nncM93gxp1bt6drCPkjM5JANawMgZQ5m/WC/nQjt9Cs2rdcbRK8S9SNGndZlY\n84E/3QskJSfRFZlmicTcjrmNrMHD0vqH/+e7OJSwCmos5ZbcpmBBKsJU8MDn\n0+CD9BQ7uLW7lecLCDtkwkZjnaDInXo/KVHI0a9pVdhJeqU4+ryJhXLlUh0W\nYMiR0LcyTsBXc/0dsRdJKV3oPT7vJj/xThgrJEZCzY3uRJILb3++DVBovvhj\n6tPKRr6l8pQU12OFQ3pUKbsKJQicKqDjFMDAHgdykm0NJ20X23P5g6cIKCwX\nlnZclqwRhjusuBLEqJv6Z19Btic8a1gG2F7KCzZAkuOy4KwLk9Zoq3fwkRZk\nWesib9h8ZgS2vGcZFV4crrLeFLTta6b9Z+b38eLqWZV2bOkUYsBidhSVG4mP\nS7bdTkuy9sBXn45hBtBjwYQiS2H0bxT0hlKzsqkc4GXzfywjEWr3P5sA87IL\n8LH5\r\n=cZYS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCodyMsrICSFXCblNOHI5tK6qz2k+BWpcRnB7efN9YqhwIga3HODr1Nac1czYnCe0+IO6gBfuyFPMsZ1xXij3qQKf0="}]},"maintainers":[{"name":"mwvd","email":"mwvdavidson@gmail.com"}],"_npmUser":{"name":"mwvd","email":"mwvdavidson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/are.na_0.1.5_1569614924733_0.7397320861257033"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-27T18:57:36.641Z","0.1.3":"2019-09-27T18:57:36.995Z","modified":"2022-04-04T10:45:35.078Z","0.1.5":"2019-09-27T20:08:44.939Z"},"maintainers":[{"name":"mwvd","email":"mwvdavidson@gmail.com"}],"description":"Interface to are.na API. A fork of @ivangreene's are.na package (https://github.com/ivangreene/arena-js).","homepage":"https://github.com/4-us-4-others/arena-js#readme","keywords":["are.na","api","axios","request","rest","oauth"],"repository":{"type":"git","url":"git+https://github.com/4-us-4-others/arena-js.git"},"author":{"name":"Ivan Greene"},"bugs":{"url":"https://github.com/4-us-4-others/arena-js/issues"},"license":"MIT","readme":"# are.na API wrapper for JavaScript\n\nUses [Axios](https://github.com/axios/axios), which is Promise-based and compatible with Node.js/io.js or modern browsers. Use it server side, or in your React, Vue or Angular apps.\n\n## What is this fork?\n\nThis repo is our fork of @ivangreene's [arena-js ↗](https://github.com/ivangreene/arena-js).\n\nAt the moment, we're publishing it to provide some quick fixes to dependency vulnerabilities, and maybe pushing some small updates.\n\n⚠️ `Experimental` — Don't use this!\n\n## Installation\n\nAvailable from npm:\n```bash\n$ npm install are.na\n\n# or:\n\n$ yarn add are.na\n```\n\n## Example\n\n```js\nconst Arena = require('are.na');\n\nconst arena = new Arena();\n\narena.channel('arena-influences').get()\n  .then(chan => {\n    chan.contents.map(item => {\n      console.log(item.title);\n    });\n  })\n  .catch(err => console.log(err));\n```\n\n## Usage\n\nThe class is organized hierarchically as nested objects. Emulates the [are.na api documentation](https://dev.are.na/documentation/) structure.\n\n### - `new Arena([config])`\n  - Config can optionally be passed as an object:\n    - `accessToken`: Your are.na API access token\n    - `baseURL`: Base URL to make requests on (default: `https://api.are.na/v2/`)\n#### Example:\n```js\nlet arena = new Arena({ accessToken: 'abcd' });\n```\n\nMethods that resolve with an Array will have an `attrs` property that contains the other data returned. For example, `channel(slug).connections()` will resolve with an Array of the channel's block's connections, and an `attrs` property containing properties like `length`, `total_pages`, `current_page`, etc.\n\nSome methods have pagination available. Pass `params` as an object, in the form `{ page: 3, per: 10 }`.\n\n### `channel([slug || id][, params])`\n\n\nMethod | Returns | Description\n--- | --- | ---\n`.get([params])` | *`Promise<Object>`* | Get the channel as an Object. Gets a list of public channels if slug/id not specified. Supports pagination.\n`.thumb([params])` | *`Promise<Object>`* | Limited view of the channel.\n`.connections([params])` | *`Promise<Array>`* | Get all of the connections of the channel (channels where this channel is connected). Supports pagination.\n`.channels([params])` | *`Promise<Array>`* | Get all of the channels connected to blocks in the channel. Supports pagination.\n`.contents([params])` | *`Promise<Array>`* | Get the channel's contents only, as an array. Supports pagination.\n`.collaborators([params])` | *`Promise<Array>`* | Get the channel's collaborators. Supports pagination.\n`.create([title \\|\\| status][, status])` | *`Promise<Object>`* | Creates a new channel. Can be called as `channel(title).create([status])` or `channel().create(title[, status])`. Title is required, status is optional.\n`.delete([slug])` | *`Promise`* | Delete the channel. Can be called as `channel(slug).delete()` or `channel().delete(slug)`.\n`.update(params)` | *`Promise<Object>`* | Update the channel's attributes. `params` should be an object and can include `title` and/or `status`. Currently it appears that the are.na API requires both values. If `title` is not set, an error will occur. If `status` is not set, it will default to \"public\".\n`.addCollaborators(...userIds)` | *`Promise<Array>`* | Add collaborators to a channel. Pass userIds as an Array or multiple arguments. `channel(slug).addCollaborators(123, 456)` or `channel(slug).addCollaborators([123, 456])` works.\n`.deleteCollaborators(...userIds)` | *`Promise<Array>`* | Remove collaborators from a channel. Accepts userIds in the same format as addCollaborators.\n`.createBlock(content\\|\\|source)` | *`Promise<Object>`* | Create a block and add it to the channel. Specify textual content or a source link.\n`.deleteBlock(blockId)` | *`Promise`* | Remove a block from the channel.\n\n#### Example:\n```js\n// Get first 3 pieces of content from a channel and print their titles\narena.channel('arena-influences').contents({ page: 1, per: 3 })\n  .then(contents => {\n    contents.map(content => {\n      console.log(content.title);\n    });\n  })\n  .catch(err => console.log(err));\n\n// Create a new channel called \"beautiful foods\" that is closed\narena.channel('beautiful foods').create('closed');\n// or\narena.channel().create('beautiful foods', 'closed')\n  .then(chan => console.log('Slug: ' + chan.slug))\n  .catch(err => console.log(err));\n```\n\n### `block([id][, params])`\nMethod | Returns | Description\n--- | --- | ---\n`.get([params])` | *`Promise<Object>`* | Get the block specified by id.\n`.channels([params])` | *`Promise<Array>`* | Get a list of the channels a block belongs to.\n`.create(channelSlug, content \\|\\| source)` | *`Promise<Object>`* | Create a block and add it to the channel. Specify textual content or a source link.\n`.update({ content, title, description })` | *`Promise`* | Update a block. Pass an object with one or more of content, title or description fields to update those fields.\n\n#### Example:\n```js\n// Get a block, print its title\narena.block(8693).get()\n  .then(block => console.log(block.title))\n  .catch(console.error);\n\n// Create a block in the channel 'great-websites'\narena.block().create('great-websites', 'https://are.na/');\n\n// Update a block\narena.block('65234').update({ content: 'New content', title: 'New title', description: 'New description' });\n```\n\n### `user(id || slug[, params])`\nMethod | Returns | Description\n--- | --- | ---\n`.get([params])` | *`Promise<Object>`* | Get a user specified by id.\n`.channels([params])` | *`Promise<Array>`* | Get a user's channels, as an array. Supports pagination.\n`.following([params])` | *`Promise<Array>`* | Get a list of users and/or blocks the user is following. Supports pagination.\n`.followers([params])` | *`Promise<Array>`* | Get a list of the user's followers. Supports pagination.\n\n#### Example:\n```js\n// Get a user, print their name\narena.user(23484).get().then(user => console.log(user.full_name));\n```\n\n### `search(query[, params])`\nAll methods support pagination.\n\nMethod | Returns | Description\n--- | --- | ---\n`.all([params])` | *`Promise<Object>`* | Search for channels, blocks, and users matching query. (The API currently only seems to return channels and blocks, and the users array will be empty?)\n`.users([params])` | *`Promise<Array>`* | Search for users.\n`.channels([params])` | *`Promise<Array>`* | Search for channels.\n`.blocks([params])` | *`Promise<Array>`* | Search for blocks.\n\n#### Example:\n```js\n// Get the 2nd page of 3 channel results for 'art',\n// print links to them\narena.search('art').channels({ page: 2, per: 3})\n  .then(channels => {\n    channels.map(chan => {\n      console.log('https://www.are.na/channels/' + chan.slug);\n    });\n  });\n```\n\n## Testing\n\nIn order to run tests, you will have to add an are.na _Personal Access Token_ as a shell variable (passed when running `$ yarn test`).\n\n1. Create an new app at [dev.are.na ↗](https://dev.are.na), and get your _Personal Access Token_.\n2. Add your _Personal Access Token_ to your shell config (`~/.bash_profile`, `.zshrc `, etc) ⤵\n   ```bash\n   export ARENA_ACCESS_TOKEN=\"YOUR_PERSONAL_ACCESS_TOKEN\"\n   ```","readmeFilename":"README.md","users":{"tg-z":true}}