@nanawan/axle 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 pui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ <div align="center">
2
+ <a href="https://axle.puijs.org">
3
+ <img src="https://raw.githubusercontent.com/puijs/axle/main/packages/docs/public/logo.svg" width="150">
4
+ </a>
5
+ <h1>AXLE</h1>
6
+ <p>Progressive request tool based on axios.</p>
7
+ <p>
8
+ <a href="https://axle.puijs.org">Documentation</a> |
9
+ <a href="https://github.com/puijs/axle/blob/main/README.zh-CN.md">中文介绍</a>
10
+ </p>
11
+ <p>
12
+ <img src="https://img.shields.io/npm/v/@pui/axle?style=flat-square" alt="version">
13
+ <img src="https://img.shields.io/github/stars/puijs/axle" alt="stars">
14
+ <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
15
+ <img src="https://img.shields.io/npm/l/@pui/axle.svg" alt="license">
16
+ </p>
17
+ </div>
18
+
19
+ ---
20
+
21
+ ### Intro
22
+
23
+ Progressive request tool based on [axios](https://axios-http.com/). It does not destroy the original abilities of axios, and helps you process requests more easily.
24
+
25
+ ### Features
26
+
27
+ - 🚀 &nbsp; Normalized request functions with expanded methods for different response types
28
+ - 💪 &nbsp; Vue Composition API support with loading status, error status, upload/download progress, lifecycle, and more
29
+ - 🛠️ &nbsp; Built-in practical request/response interceptors
30
+ - 💡 &nbsp; Enhanced API definition with `createApi`
31
+ - 🌍 &nbsp; Full compatibility with axios configuration
32
+
33
+ ### Install
34
+
35
+ ```shell
36
+ # npm
37
+ npm i @pui/axle -S
38
+
39
+ # yarn
40
+ yarn add @pui/axle
41
+
42
+ # pnpm
43
+ pnpm add @pui/axle
44
+ ```
45
+
46
+ ### Basic Usage
47
+
48
+ ```js
49
+ import { createAxle } from '@pui/axle'
50
+
51
+ const axle = createAxle(/** @see https://axios-http.com **/)
52
+
53
+ axle.get('/url', { current: 1, pageSize: 10 }, { headers: {} })
54
+ axle.post('/url', { name: 'Axle' }, { headers: {} })
55
+ ```
56
+
57
+ ### Documentation
58
+
59
+ For full documentation, please visit the [documentation site](https://axle.puijs.org).
@@ -0,0 +1,59 @@
1
+ <div align="center">
2
+ <a href="https://axle.puijs.org">
3
+ <img src="https://raw.githubusercontent.com/puijs/axle/main/packages/docs/public/logo.svg" width="150">
4
+ </a>
5
+ <h1>AXLE</h1>
6
+ <p>基于 axios 的渐进式请求工具。</p>
7
+ <p>
8
+ <a href="https://axle.puijs.org">文档</a> |
9
+ <a href="https://github.com/puijs/axle/blob/main/README.md">ENGLISH README</a>
10
+ </p>
11
+ <p>
12
+ <img src="https://img.shields.io/npm/v/@pui/axle?style=flat-square" alt="version">
13
+ <img src="https://img.shields.io/github/stars/puijs/axle" alt="stars">
14
+ <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
15
+ <img src="https://img.shields.io/npm/l/@pui/axle.svg" alt="license">
16
+ </p>
17
+ </div>
18
+
19
+ ---
20
+
21
+ ### 介绍
22
+
23
+ 基于 [axios](https://axios-http.com/) 的渐进式请求工具。它不会破坏 `axios` 原有的能力,帮助您更轻松地处理请求。
24
+
25
+ ### 特性
26
+
27
+ - 🚀 &nbsp; 归一化请求函数参数,并扩展了不同响应类型的请求方法
28
+ - 💪 &nbsp; 支持 Vue 组合式 API,封装了加载状态、错误状态、上传下载进度、生命周期等
29
+ - 🛠️ &nbsp; 内置实用的请求/响应拦截器
30
+ - 💡 &nbsp; 通过 `createApi` 增强 API 定义能力
31
+ - 🌍 &nbsp; 完全兼容 axios 配置
32
+
33
+ ### 安装
34
+
35
+ ```shell
36
+ # npm
37
+ npm i @pui/axle -S
38
+
39
+ # yarn
40
+ yarn add @pui/axle
41
+
42
+ # pnpm
43
+ pnpm add @pui/axle
44
+ ```
45
+
46
+ ### 基本用法
47
+
48
+ ```js
49
+ import { createAxle } from '@pui/axle'
50
+
51
+ const axle = createAxle(/** @see https://axios-http.com **/)
52
+
53
+ axle.get('/url', { current: 1, pageSize: 10 }, { headers: {} })
54
+ axle.post('/url', { name: 'Axle' }, { headers: {} })
55
+ ```
56
+
57
+ ### 文档
58
+
59
+ 完整文档请访问[文档站](https://axle.puijs.org)。
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@nanawan/axle",
3
+ "version": "1.0.1",
4
+ "description": "Progressive request tool based on axios",
5
+ "keywords": [
6
+ "axios",
7
+ "axle",
8
+ "composition api",
9
+ "helpers",
10
+ "vue3"
11
+ ],
12
+ "bugs": {
13
+ "url": "https://github.com/puijs/axle/issues"
14
+ },
15
+ "license": "MIT",
16
+ "author": "haoziqaq <357229046@qq.com>",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/puijs/axle.git"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "type": "module",
25
+ "sideEffects": false,
26
+ "main": "dist/index.mjs",
27
+ "module": "dist/index.mjs",
28
+ "types": "dist/index.d.mts",
29
+ "typesVersions": {
30
+ "*": {
31
+ "use": [
32
+ "dist/use.d.mts"
33
+ ],
34
+ "api": [
35
+ "dist/api.d.mts"
36
+ ]
37
+ }
38
+ },
39
+ "exports": {
40
+ ".": {
41
+ "types": "./dist/index.d.mts",
42
+ "import": "./dist/index.mjs"
43
+ },
44
+ "./use": {
45
+ "types": "./dist/use.d.mts",
46
+ "import": "./dist/use.mjs"
47
+ },
48
+ "./api": {
49
+ "types": "./dist/api.d.mts",
50
+ "import": "./dist/api.mjs"
51
+ },
52
+ "./*": "./*"
53
+ },
54
+ "scripts": {
55
+ "build": "vp pack",
56
+ "clean": "rt clean",
57
+ "dev": "vp pack --watch",
58
+ "docs:build": "vitepress build docs",
59
+ "docs:dev": "vitepress dev docs",
60
+ "docs:preview": "vitepress preview docs",
61
+ "lint": "vp lint --fix",
62
+ "format": "vp fmt",
63
+ "release": "pnpm build && rt release"
64
+ },
65
+ "dependencies": {
66
+ "axios": "^1.18.1",
67
+ "crypto-js": "^4.2.0",
68
+ "lodash": "4.17.21",
69
+ "qs": "^6.11.0",
70
+ "rattail": "^2.0.3"
71
+ },
72
+ "devDependencies": {
73
+ "@types/crypto-js": "^4.2.1",
74
+ "@types/lodash": "4.14.202",
75
+ "@types/qs": "^6.9.7",
76
+ "oxc-minify": "^0.125.0",
77
+ "typescript": "5.3.3",
78
+ "vite-plus": "0.1.18",
79
+ "vitepress": "2.0.0-alpha.17",
80
+ "vue": "3.5.32"
81
+ },
82
+ "peerDependencies": {
83
+ "vue": "^3.2.0"
84
+ },
85
+ "engines": {
86
+ "pnpm": ">=10.0.0"
87
+ },
88
+ "packageManager": "pnpm@10.0.0",
89
+ "pnpm": {
90
+ "overrides": {
91
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.18",
92
+ "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.18"
93
+ }
94
+ }
95
+ }