GithubHelp home page GithubHelp logo

seafile-js's Introduction

About

This is JavaScript API for Seafile.

Usage

Install seafile-js package:

npm install seafile-js

In your project:

const { SeafileAPI } = require('seafile-js')

const server = 'xxx'
const username = 'xxx'
const password = 'xxx'
const seafileAPI = new SeafileAPI()

seafileAPI.init({ server, username, password })

seafileAPI.login().then((response) => {
	seafileAPI.authPing().then((response) => {
		console.log(response)
	}).catch((err) => {
		console.log('error', err);
	})
})
.catch((err) => {
	console.log('error',err.config)
})

seafile-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seafile-js's Issues

Properties not set in the seafileAPI constructor

Hey,
I use webpack but it may be unrelated.
When I try this code:

const { SeafileAPI } = require('seafile-js')
const seafileAPI = new SeafileAPI(server, username, password)
seafileAPI.login().then((response) => {
})

It doesn't work. The code run in a Thunderbird extension.
But if I add this line:

seafileAPI.init({ server: server.value, username: username.value, password: password.value });

It works like a charm ! It's just like the server, username and password properties are not set.
I didn't try without webpack.

readme 里的代码跑不起来

readme 里的代码跑不起来,new SeafileAPI() 会调用 constructor() ,但是你这源码里根本没有,公司是没人了吗?

How can i receive http status code?

Can you add global interceptor for axios, like this: axios_instance.interceptors.response.use(res => {return res;},error => {return Promise.reject(error.response.data)});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.