1.0.2 • Published 2 years ago

arena-client v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Are.na API Wrapper

A typed javascript wrapper for the Are.na API. Currently implements all but 3 endpoints listed in the official documentation.

Note: Attributes returned from the API do not exactly match those within the documentation. As such there may be additional attributes returned from the API that are not defined within the types.

Installation

    npm install arena-client

or

    yarn add arena-client

Example Usage

import { ArenaClient } from 'arena-client'

// Initialize Objects
const arena = new ArenaClient()
const channel = arena.Channel('arena-influences')

// Generic Request
const channelAttributes = await channel.get()

// Authenticated Request
const newBlock = await channel.addBlock(process.env.ACCESS_TOKEN, {
        type: 'Text',
        data: 'Morbi vel ultrices elit, non blandit massa.'
    })

// Paginated Request
const content = await channel.getContent({
    page: 2,
    per: 5
})

Endpoints

Implemented

EntityEndpointFunctionAuthenticatedPaginated
UsersGET /v2/users/:idUser(id).get--
UsersGET /v2/users/:id/channelsUser(id).getChannelsyes-
UsersGET /v2/users/:id/followingUser(id).getFollowersyes-
BlockGET /v2/blocks/:idBlock(id).get--
BlockGET /v2/blocks/:id/channelsBlock(id).getChannels-yes
BlockPUT /v2/blocks/:idBlock(id).update-yes
ChannelGET /v2/channels/:slugChannel(idOrSlug).get--
ChannelPUT /v2/channels/:slugChannel(idOrSlug).updateyes-
ChannelDELETE /v2/channels/:slugChannel(idOrSlug).deleteyes-
ChannelPOST /v2/channelscreateChannelyes-
ChannelGET /v2/channelscreateChannelyes-
ChannelGET /v2/channels/:id/connectionsChannel(idOrSlug).getConnections-yes
ChannelGET /v2/channels/:id/channelsChannel(idOrSlug).getChannels-yes
ChannelGET /v2/channels/:id/contentsChannel(idOrSlug).getContent-yes
ChannelPOST /v2/channels/:id/blockChannel(idOrSlug).addBlockyes-
ChannelDELETE /v2/channels/:id/block/:idChannel(idOrSlug).deleteBlockyes-
ChannelGET /v2/channels/:id/collaboratorsChannel(idOrSlug).getCollaborators-yes
ChannelPOST /v2/channels/:id/collaboratorsChannel(idOrSlug).addCollaboratorsyesyes
ChannelDELETE /v2/channels/:id/collaboratorsChannel(idOrSlug).deleteCollaboratorsyesyes

Not Implemented

EntityEndpointReason
ChannelsGET /v2/channels/Successful request consistently responses with an error code of 500
ChannelsPUT /v2/channels/:channel_id/blocks/:id/selectionLimited documentation on use case & how to form a request
ChannelsPUT /v2/channels/:slug/sortLimited documentation on use case & how to form a request

Future Improvements

  • Unit test coverage
  • Under-go a discovery on the shape of the data returned from the API & update the types accordingly
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago