npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@webdevep/fm-module-vue

v1.2.3

Published

file-manager-module

Downloads

514

Readme

Модуль для фронтэнда на vue, работающий с сервисом файлового менеджера

Ссылка для скачивания данной документации https://modules.dev-webdevep.ru/filemanager-module/VUE.md

Установка npm модуля

Для установки через npm, выполните команду:

npm i @webdevep/fm-module-vue

Работа с модулем

Параметры модуля

  • baseUrl - Урл сервера (используется в fetch)
  • chunkSize - Размер чанка в килобайтах
  • fileDownloadUrl - Ссылка для загрузки файла (без id - "https://server.com/file-manager-service/api/v1/file")
import { FilemanagerModule } from "@webdevep-modules/fm-module-vue";

const filemanager = new FilemanagerModule({
  baseUrl: "https://server.com/file-manager-service/api/v1",
  chunkSize: 1000,
  fileDownloadUrl: "https://server.com/file-manager-service/api/v1/file",
});

Публичные методы модуля

async getList(root)

Аргументы:

  • body - object
{
  root: string|null
  ordering: string
  limit: number
  offset: number
}

Возвращаемое значение:

{
  "ok": true,
  "objects": [],
  "total_objects": 0
} 

async getFileInfo(id)

Аргументы:

  • id - string

Возвращаемое значение:

{
  "ok": "true",
  "info": "{ <file-info object> }"
}

async createFolder(body)

Аргументы:

  • body - object
{
  name: string
  root: string|null
  metadata: JSON
}

Возвращаемое значение:

{
  "ok": "true",
  "name": "<folder name>",
  "folder_id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}

async setFileMode(body)

Аргументы:

  • body - object
{
  id: string
  mode: string ("public"|"private")
}

Возвращаемое значение:

{
  "ok": "true"
}

async createFileLink(body)

Аргументы:

  • body - object
{
  id: string
}

Возвращаемое значение:

{
  "ok": "true",
  "link_token": "some-link-token"
}

async shareFile(body)

Аргументы:

  • body - object
{
  id: string
  uid: string
}

Возвращаемое значение:

{
  "ok": "true"
}

async unshareFile(body)

Аргументы:

  • body - object
{
  id: string
  uid: string
}

Возвращаемое значение:

{
  "ok": "true"
}

async deleteFiles(ids)

Аргументы:

  • ids - array[string]

Возвращаемое значение:

{
  "ok": "true"
}

async updateInfo(id, info)

Аргументы:

  • id - string
  • info - object
{
  name: string
  metadata: string
  mime_type: string
  root: string|null
}

Возвращаемое значение:

{
  "ok": "true"
}

async renameFile(id, name)

Аргументы:

  • id - string
  • name - string

Возвращаемое значение:

{
  "ok": "true"
}

async moveFile(id, root)

Аргументы:

  • id - string
  • root - string|null

Возвращаемое значение:

{
  "ok": "true"
}

async updateMetadata(id, metadata)

Аргументы:

  • id - string
  • metadata - object

Возвращаемое значение:

{
  "ok": "true"
}

async uploadFile({ file, mode = "private", root = null })

Аргументы:

  • file - File
  • mode - string ("public"|"private")
  • root - string|null

Возвращаемое значение:

{
  "ok": "true"
}

downloadFile(id)

Аргументы:

  • id - string

Возвращаемое значение: _