{"id":15818850,"url":"https://github.com/fmalcher/npm-seafile-api","last_synced_at":"2025-06-25T18:34:19.142Z","repository":{"id":65493524,"uuid":"43708388","full_name":"fmalcher/npm-seafile-api","owner":"fmalcher","description":"npm module for Seafile Web API","archived":false,"fork":false,"pushed_at":"2016-10-02T13:26:11.000Z","size":10,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T23:35:16.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmalcher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-05T19:28:33.000Z","updated_at":"2019-11-10T01:34:10.000Z","dependencies_parsed_at":"2023-01-25T21:05:11.225Z","dependency_job_id":null,"html_url":"https://github.com/fmalcher/npm-seafile-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fmalcher/npm-seafile-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmalcher%2Fnpm-seafile-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmalcher%2Fnpm-seafile-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmalcher%2Fnpm-seafile-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmalcher%2Fnpm-seafile-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmalcher","download_url":"https://codeload.github.com/fmalcher/npm-seafile-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmalcher%2Fnpm-seafile-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261931214,"owners_count":23232037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T06:20:27.450Z","updated_at":"2025-06-25T18:34:19.099Z","avatar_url":"https://github.com/fmalcher.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seafile-api\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n\n`seafile-api` is a small npm module for accessing the [Seafile Web API](http://manual.seafile.com/develop/web_api.html) and thus controlling a [Seafile](https://www.seafile.com/en/home/) instance from within a Node.js application.\n\n\u003e **Though there are quite many API methods, at the moment this module just implements a small subset of the available functions.**\n\n# Documentation\n## Installation\n```\n$ npm install seafile-api\n```\n\n## Initialization\nYou will need a valid access token to make API requests. See the API docs for further information on how to obtain a token: [Web API | Quick Start](http://manual.seafile.com/develop/web_api.html#quick-start).\nAt the moment, this module does not support obtainment of access tokens.\n\n```js\nvar SeafileAPI = require('seafile-api');\nvar sf = new SeafileAPI('https://cloud.seafile.com', 'accesstoken123456789');\n```\n\n## Usage\n\nSee the official [API docs](http://manual.seafile.com/develop/web_api.html) for detailed information about the methods and used parameters.\nDefault values are used if optional parameters are not set.\n\n\n### listAccounts(params, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#list-accounts)\n\n```js\nsf.listAccounts({\n  start: 0,\n  limit: 100,\n  scope: 'DB'\n}, function(err, accounts, httpcode){\n  if(err) console.error('Error:', err);\n  console.log(accounts);\n});\n```\n\n* All parameters are optional\n\n\n### getAccountInfo(email, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#get-account)\n\n```js\nsf.getAccountInfo('johndoe@example.com', function(err, body, httpcode){\n    console.log(body);\n});\n```\n\n\n### createAccount(params, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#create-account)\n\n```js\nsf.createAccount({\n  email: 'johndoe@example.com',\n  password: 'foobar123',\n  is_staff: 0,\n  is_active: 1\n}, function(err, data, httpcode){\n  console.log(data);\n});\n```\n\n* `email`: required\n* `password`: required\n* `is_staff`: optional\n* `is_active`: optional\n\n\n### updateAccount(params, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#update-account)\n\n```js\nsf.updateAccount({\n  email: 'johndoe@example.com',\n  name: 'John Doe',\n  is_staff: 0,\n  is_active: 1\n}, function(err, body, httpcode){\n  console.log(body);\n});\n```\n\n* `email`: required\n* all other params are optional\n\n\n### deleteAccount(email, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#delete-account)\n\n```js\nsf.deleteAccount('johndoe@example.com', function(err, body, httpcode){\n  console.log(body);\n});\n```\n\n\n\n### addGroupMember(options, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#add-a-group-member)\n\n```js\nsf.addGroupMember({\n  user_name: 'johndoe@example.com',\n  group_id: 1\n}, function(err, body){\n    console.log(body);\n});\n```\n\n* `user_name`: required\n* `group_id`: required\n\n### deleteGroupMember(options, callback)\n[Seafile API Docs](http://manual.seafile.com/develop/web_api.html#delete-a-group-member)\n\n```js\nsf.deleteGroupMember({\n  user_name: 'johndoe@example.com',\n  group_id: 1\n}, function(err, body){\n    console.log(body);\n});\n```\n\n* `user_name`: required\n* `group_id`: required\n\n\n### moveMultiple(options, callback)\n[Seafile API Docs](https://manual.seafile.com/develop/web_api.html#multiple-files-directories-move)\n\n```js\nsf.moveMultiple({\n    src_repo: 'source_repo_id',\n    dst_repo: 'dest_repo_id',\n    file_names: [\n        'file.txt',\n        'image.jpg'\n    ],\n    dst_path: '/',\n    p: '/'\n}, function(err, body){\n    console.log(body);\n});\n```\n\n* `src_repo`: required\n* `dst_repo`: required\n* `file_name`: required\n* all other params are optional\n\n\n\n### renameDirectory(options, callback)\n[Seafile API Docs](https://manual.seafile.com/develop/web_api.html#rename-directory)\n\n```js\nsf.renameDirectory({\n    repo_id: 'repo_id',\n    p: 'foo',\n    newname: 'pinkfloyd_newfolder'\n}, function(err, body){\n  console.log(body);\n});\n```\n\n* `repo_id`: required\n* `p`: required\n* `newname`: required\n\n\n\n### createDirectory(options, callback)\n[Seafile API Docs](https://manual.seafile.com/develop/web_api.html#create-new-directory)\n\n```js\nsf.createDirectory({\n    repo_id: 'repo_id',\n    p: 'bar',\n}, function(err, body){\n  console.log(body);\n});\n```\n\n* `repo_id`: required\n* `p`: required\n\n\n\n\n\n\n# License\n[MIT](https://opensource.org/licenses/MIT)\n\n\n[npm-image]: https://img.shields.io/npm/v/seafile-api.svg\n[npm-url]: https://npmjs.org/package/seafile-api\n[node-version-image]: http://img.shields.io/node/v/seafile-api.svg\n[node-version-url]: http://nodejs.org/download/\n[downloads-image]: https://img.shields.io/npm/dm/seafile-api.svg\n[downloads-url]: https://npmjs.org/package/seafile-api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmalcher%2Fnpm-seafile-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmalcher%2Fnpm-seafile-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmalcher%2Fnpm-seafile-api/lists"}