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

yp-media-upload-update-service

v1.4.8

Published

#### 介绍

Downloads

12

Readme

yp-media-upload-update-service

介绍

yp-media-upload-update-service 用于内部使用的多媒体上传插件(更新后)

安装教程

npm install yp-media-upload-update-service
yarn add yp-media-upload-update-service

使用说明

使用示例
/** 引入 */
import { ypMediaUploadUpdate } from "yp-media-upload-update-service"

ypMediaUploadUpdate({
  headerConfig: {
			// 请求头header 参数
			appId: 101,
			system: 'android',
			env: YP_ENV === 'develop' ? 'dev' : (YP_ENV as any),
			timeout: 600,
			token,
			...headers,
		},
		paramConfig: {
			// 请求 body 参数
			fileList: (shouldUploadList as unknown) as IFileListItem[],
			entryId: 0,
    	processType:  4
			...data,
		},
  onUploadProgress: (progressArr) => { // 上传进度(单个文件的每次上传进度更新就会触发回调一次)
    console.log(progressArr)
  },
  onSuccess: (fileItem, fileList) => { // 上传成功(单个文件上传成功后,就会触发回调一次)
    console.log(fileItem, fileList, "onSuccess")
  },
  onError: (fileItem, fileList) => { // 上传失败(单个文件上传失败后,就会触发回调一次)
    console.log(fileItem, fileList, "onError")
  },
})

}

参数说明

  1. 请求头 headerConfig 参数 |参数|类型|说明|必传| |---|:---|:---|---| |appId|number|业务应用 id每个业务独立进行申请DEV 环境可以用:125|- [x]| |token|string|用户登录态 token|- [ ]| |headers|Object|内部约定请求头|- [ ]|

  2. 请求 paramConfig 参数 |参数|类型|说明|必传| |---|:---|:---|---| |processType|number|资源类型 id,这个开发时须向有关产品或后端咨询|- [x]| |entryId|number|入口场景 id,这个开发时须向有关产品或后端咨询|- [x]| |type|number|资源类型,0:图片,1 视频,2 音频|- [x]| |file|IFileItem[]|文件数组,具体类型可参考代码内提示|- [x]| |city|string|城市|- [ ]| |address|number|水印类型,2 音频可以为空|- [ ]| |wmId|number|水印类型,2 音频可以为空|- [ ]| |wmcInfo|object|水印相关扩展信息,2 音频可以为空|- [ ]| |uid|number|鱼泡 uid|- [ ]|

  3. 回调方法参数 |方法|返回参数|说明|必返| |---|:---|:---|---| |onUploadProgress|progressArr|单个文件上传进度变化时,将传入的 fileList 原样返回并更新每个 item 的 persent(上传进度)|- [x]| |onSuccess|fileItem, fileList|单个文件上传成功时,回调当前成功的 fileItem, 及原样返回且修改了 status 的 fileList|- [x]| |onError|fileItem, fileList|同 onSuccess 一样,只是在单个文件上传失败时触发回调|- [x]|