ivangreene / arena-js Goto Github PK
View Code? Open in Web Editor NEWare.na API wrapper for JavaScript
License: MIT License
are.na API wrapper for JavaScript
License: MIT License
Always getting 25 results no matter what I pass into the query.
Testing from the demo code in the readme.
arena.channel('arena-influences').contents({ page: 1, per: 3 })
.then(content => {
console.log(content.length)
})
.catch(err => console.log(err));
If I dig into the axios request - everything looks to be included, but no dice. Tested in choo and CRA.
Axios ^0.17.1
dependency is out of date, and running $ yarn/npm audit
throws a moderate vulnerability. ⤵
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.18.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://www.npmjs.com/advisories/880 │
└───────────────┴──────────────────────────────────────────────────────────────┘
From the npm advisory ⤵
Overview
Versions of axios prior to 0.18.1 are vulnerable to Denial of Service. If a request exceeds the maxContentLength property, the package prints an error but does not stop the request. This may cause high CPU usage and lead to Denial of Service.
Remediation
Upgrade to 0.18.1 or later.
Resources
Think this might be also be getting caught by some twitchy anti-virus software, but will update when I figure out.
Just a heads up for the readme example, noticed that attempts to create a block using arena.block().create("great-websites", "are.na/")
yielded a
.../node_modules/are.na/index.js:128
if (opts.content.match(/^https?:\/\//)) {
^
TypeError: Cannot read property 'match' of undefined
error. This appears to be addressed by passing an object rather than a string as the argument:
const newBlock = {
content: "are.na",
title: "Your Title",
description: "Your desc"
}
arena.block().create("great-websites", newBlock);
Hey, is it possible to only search for text/image/attachement blocks based on the arena filters when searching?
Docs say users/:id/channels shouldn't require auth, but may of the users/ endpoints do, even for public info.
https://dev.are.na/documentation/users#Block59785
https://api.are.na/v2/users/10097/channels
{"code":401,"message":"Unauthorized","description":"Invalid credentials."}
Need to find a more sane way to run tests. Shouldn't bog down the live API with requests.
Currently tests are very repetitive and only test path construction and parameter interpolation for each method.
Hello, is it possible to add custom metadata to blocks?
Something like Tags o custom fields? I tried to integrate YAML attributes on markdown blocks but it seems not to be working.
Thanks in advance!
Manuel
Using channel().get()
the docs mention that it will return a total_pages
attribute in the Channel
Object when using pagination, the following call does not.
Am i missing something?
let p = await arena.channel(CHANNELSLUG).get({
page: 1,
per: 100,
});
Provide simple, fully functioning examples/
for consumers of this module to experiment with and base their own implementations on.
I have yet to test this module in-browser, GET requests should already work in theory. Axios has options to automatically make the appropriate requests for other methods. Possibly allow a second parameter to the constructor for options/config to pass directly to Axios?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.