reqwise-react 1.1.0 → 1.1.4
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/.turbo/turbo-build.log +7 -11
- package/README.md +317 -0
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -8
- package/src/ReqwiseClient.ts +2 -2
- package/src/ReqwiseDevTools.tsx +5 -4
- package/src/index.ts +4 -4
- package/tsconfig.json +1 -2
- package/tsup.config.ts +2 -4
- package/dist/index.d.mts +0 -44
- package/dist/index.d.ts +0 -44
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> reqwise-react@1.
|
|
2
|
+
> reqwise-react@1.1.3 build C:\Users\PC\Desktop\Code\reqwise\packages\react
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,13 +10,9 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
12
|
[34mESM[39m Build start
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in 602ms
|
|
21
|
-
[32mDTS[39m [1mdist\index.d.ts [22m[32m2.17 KB[39m
|
|
22
|
-
[32mDTS[39m [1mdist\index.d.mts [22m[32m2.17 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist\index.mjs [22m[32m2.96 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist\index.mjs.map [22m[32m5.45 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 11ms
|
|
16
|
+
[32mCJS[39m [1mdist\index.js [22m[32m4.92 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist\index.js.map [22m[32m5.62 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 11ms
|
package/README.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# Reqwise React 🚀
|
|
2
|
+
|
|
3
|
+
> **Reqwise** is a powerful, production-ready React component that captures, logs, and visualizes HTTP API requests (Axios/Fetch) within React applications.
|
|
4
|
+
|
|
5
|
+
It operates like a mini **Postman** or **Chrome DevTools Network** panel embedded directly inside your React app. Through a floating aside panel, developers can inspect requests in real-time, browse page history, analyze API endpoints, and send manual test requests with a single click.
|
|
6
|
+
|
|
7
|
+
**Version:** 1.1.3 | **Status:** Production Ready | **React:** 17+
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## ✨ Core Features
|
|
12
|
+
|
|
13
|
+
### 🔄 HTTP Interception & Logging
|
|
14
|
+
- **Full HTTP Capture:** Automatically logs all request/response payloads (method, URL, headers, body, status, duration)
|
|
15
|
+
- **Axios & Fetch Support:** Works seamlessly with Axios interceptors or native fetch API
|
|
16
|
+
- **Request Timing:** Precise measurement of round-trip duration for performance analysis
|
|
17
|
+
- **Error Tracking:** Captures network errors, timeouts, and HTTP error responses with stack traces
|
|
18
|
+
|
|
19
|
+
### 💾 Smart Persistence
|
|
20
|
+
- **localStorage Integration:** Stores all request history under `reqwise_history_v1` key
|
|
21
|
+
- **Auto-Cleanup:** Configurable `maxItems` limit with oldest-first eviction strategy
|
|
22
|
+
- **TTL Support:** Automatic deletion of entries older than configurable `historyTTL` (in days)
|
|
23
|
+
|
|
24
|
+
### 🛡️ Security & Privacy
|
|
25
|
+
- **Header Masking:** Redact sensitive headers like `Authorization`, `Cookie`, `X-API-Key`
|
|
26
|
+
- **Field Masking:** Obfuscate nested JSON fields like `password`, `token`, `ssn`, `cvv`
|
|
27
|
+
- **Smart Ignore Patterns:** Skip unwanted URLs with regex/substring matching
|
|
28
|
+
- **No Data Transmission:** All data stays local; no external calls made
|
|
29
|
+
|
|
30
|
+
### 🌍 Internationalization (i18n)
|
|
31
|
+
- **15 Languages Built-in:** English, Turkish, Azerbaijani, Russian, German, French, Spanish, Portuguese, Chinese, Japanese, Arabic, Korean, Italian, Polish, Dutch
|
|
32
|
+
- **Runtime Switching:** Language selector in the panel
|
|
33
|
+
- **Smart Detection:** Auto-detects browser language
|
|
34
|
+
|
|
35
|
+
### ⌨️ Keyboard & Hotkey Support
|
|
36
|
+
- **Customizable Hotkeys:** Toggle panel with keyboard shortcut (default: `ctrl+shift+e`)
|
|
37
|
+
- **Cross-platform:** Works on Windows, Mac, Linux
|
|
38
|
+
|
|
39
|
+
### 🎨 UI & UX Enhancements
|
|
40
|
+
- **4 Tabbed Interface:**
|
|
41
|
+
- **Current Tab:** Requests from current page
|
|
42
|
+
- **History Tab:** All captured requests with filtering (method, status, page)
|
|
43
|
+
- **Send Tab:** Mini HTTP client — compose and send test requests
|
|
44
|
+
- **Endpoints Tab:** Auto-discovered API endpoints with statistics
|
|
45
|
+
- **Placement Flexibility:** 4 positions (top, right, bottom, left)
|
|
46
|
+
- **Theme Support:** Dark, Light, and System themes
|
|
47
|
+
- **Responsive Sizing:** 4 size presets (sm, md, lg, full)
|
|
48
|
+
- **Opacity Control:** Configurable opacity (0.0–1.0)
|
|
49
|
+
|
|
50
|
+
### 🔍 Filtering & Search
|
|
51
|
+
- **Method Filter:** GET, POST, PUT, PATCH, DELETE
|
|
52
|
+
- **Status Filter:** All, Success (2xx), Client Errors (4xx), Server Errors (5xx)
|
|
53
|
+
- **URL Search:** Text filter by URL patterns
|
|
54
|
+
|
|
55
|
+
### 📊 Endpoint Intelligence
|
|
56
|
+
- **Auto-Discovery:** Learns all API endpoints from captured requests
|
|
57
|
+
- **Statistics:** Per-endpoint hit count, HTTP methods, parameter types
|
|
58
|
+
- **Example Collection:** Stores real-world parameter examples
|
|
59
|
+
|
|
60
|
+
### 📤 Advanced Features
|
|
61
|
+
- **Callback Hooks:**
|
|
62
|
+
- `onRequest(entry)` — fires when request starts
|
|
63
|
+
- `onResponse(entry)` — fires on successful response
|
|
64
|
+
- `onError(entry)` — fires on HTTP error
|
|
65
|
+
- **Request Grouping:** Group by URL, method, status, or page
|
|
66
|
+
- **Highlight Mode:** Highlight error or slow requests
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 📦 Installation
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install reqwise-react axios
|
|
74
|
+
# or
|
|
75
|
+
pnpm add reqwise-react axios
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Note:** Axios is optional but recommended for auto-capture. You can use Reqwise without it via manual recording.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 🚀 Quick Start
|
|
83
|
+
|
|
84
|
+
### Basic Setup
|
|
85
|
+
```jsx
|
|
86
|
+
import { ReqwiseDevTools } from 'reqwise-react'
|
|
87
|
+
import axios from 'axios'
|
|
88
|
+
|
|
89
|
+
export default function App() {
|
|
90
|
+
const api = axios.create({
|
|
91
|
+
baseURL: 'https://api.example.com'
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<ReqwiseDevTools axiosInstance={api} />
|
|
97
|
+
{/* Your app */}
|
|
98
|
+
</>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Production Configuration
|
|
104
|
+
```jsx
|
|
105
|
+
import { ReqwiseDevTools } from 'reqwise-react'
|
|
106
|
+
import axios from 'axios'
|
|
107
|
+
|
|
108
|
+
const api = axios.create({
|
|
109
|
+
baseURL: 'https://api.example.com',
|
|
110
|
+
timeout: 5000,
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
export default function App() {
|
|
114
|
+
return (
|
|
115
|
+
<ReqwiseDevTools
|
|
116
|
+
axiosInstance={api}
|
|
117
|
+
enabled={process.env.NODE_ENV === 'development'}
|
|
118
|
+
placement="right"
|
|
119
|
+
theme="dark"
|
|
120
|
+
show="detailed"
|
|
121
|
+
size="lg"
|
|
122
|
+
defaultOpen={false}
|
|
123
|
+
maxItems={500}
|
|
124
|
+
persistHistory={true}
|
|
125
|
+
hotkey="ctrl+shift+e"
|
|
126
|
+
langs={['en', 'tr']}
|
|
127
|
+
defaultLang="en"
|
|
128
|
+
ignore={['/health', '/ping']}
|
|
129
|
+
maskHeaders={['Authorization', 'X-API-Key']}
|
|
130
|
+
maskFields={['password', 'token', 'secret']}
|
|
131
|
+
groupBy="url"
|
|
132
|
+
highlight="error"
|
|
133
|
+
onRequest={(e) => console.log('Request:', e.method, e.url)}
|
|
134
|
+
onResponse={(e) => console.log('Response:', e.status, e.duration)}
|
|
135
|
+
onError={(e) => console.error('Error:', e.status, e.url)}
|
|
136
|
+
/>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Props API
|
|
144
|
+
|
|
145
|
+
### Core Configuration
|
|
146
|
+
|
|
147
|
+
| Prop | Type | Default | Description |
|
|
148
|
+
|------|------|---------|-------------|
|
|
149
|
+
| `axiosInstance` | AxiosInstance | - | Axios instance to monitor (required for auto-capture) |
|
|
150
|
+
| `enabled` | boolean | true | Enable/disable panel |
|
|
151
|
+
| `placement` | 'left' \| 'right' \| 'top' \| 'bottom' | 'right' | Panel position |
|
|
152
|
+
| `defaultOpen` | boolean | false | Open on mount |
|
|
153
|
+
| `theme` | 'dark' \| 'light' \| 'system' | 'system' | Color theme |
|
|
154
|
+
| `hotkey` | string | 'ctrl+shift+e' | Keyboard shortcut to toggle |
|
|
155
|
+
|
|
156
|
+
### Display Options
|
|
157
|
+
|
|
158
|
+
| Prop | Type | Default | Description |
|
|
159
|
+
|------|------|---------|-------------|
|
|
160
|
+
| `show` | 'general' \| 'detailed' | 'general' | Request card detail level |
|
|
161
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| 'full' | 'md' | Panel size |
|
|
162
|
+
| `opacity` | number | 1 | Panel opacity (0-1) |
|
|
163
|
+
|
|
164
|
+
### Data Management
|
|
165
|
+
|
|
166
|
+
| Prop | Type | Default | Description |
|
|
167
|
+
|------|------|---------|-------------|
|
|
168
|
+
| `maxItems` | number | 500 | Max requests to store |
|
|
169
|
+
| `persistHistory` | boolean | true | Save to localStorage |
|
|
170
|
+
| `ignore` | string[] | [] | URL patterns to ignore |
|
|
171
|
+
| `maskHeaders` | string[] | [] | Headers to mask |
|
|
172
|
+
| `maskFields` | string[] | [] | JSON fields to mask |
|
|
173
|
+
|
|
174
|
+
### Grouping & Highlighting
|
|
175
|
+
|
|
176
|
+
| Prop | Type | Default | Description |
|
|
177
|
+
|------|------|---------|-------------|
|
|
178
|
+
| `groupBy` | 'url' \| 'method' \| 'status' \| 'page' | - | Group requests by |
|
|
179
|
+
| `highlight` | 'error' \| 'slow' | 'error' | Highlight type |
|
|
180
|
+
|
|
181
|
+
### Localization
|
|
182
|
+
|
|
183
|
+
| Prop | Type | Default | Description |
|
|
184
|
+
|------|------|---------|-------------|
|
|
185
|
+
| `langs` | string[] | ['en'] | Supported languages |
|
|
186
|
+
| `defaultLang` | string | 'en' | Initial language |
|
|
187
|
+
|
|
188
|
+
### Callbacks
|
|
189
|
+
|
|
190
|
+
| Prop | Type | Description |
|
|
191
|
+
|------|------|-------------|
|
|
192
|
+
| `onRequest` | (entry) => void | Called when request starts |
|
|
193
|
+
| `onResponse` | (entry) => void | Called on successful response |
|
|
194
|
+
| `onError` | (entry) => void | Called on HTTP error |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 🎯 Use Cases
|
|
199
|
+
|
|
200
|
+
### 1. Development Debugging
|
|
201
|
+
```jsx
|
|
202
|
+
<ReqwiseDevTools
|
|
203
|
+
axiosInstance={api}
|
|
204
|
+
show="detailed"
|
|
205
|
+
defaultOpen={true}
|
|
206
|
+
/>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 2. API Documentation
|
|
210
|
+
```jsx
|
|
211
|
+
<ReqwiseDevTools
|
|
212
|
+
axiosInstance={api}
|
|
213
|
+
placement="right"
|
|
214
|
+
size="lg"
|
|
215
|
+
// Auto-discovers endpoints from actual traffic
|
|
216
|
+
/>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 3. Performance Monitoring
|
|
220
|
+
```jsx
|
|
221
|
+
<ReqwiseDevTools
|
|
222
|
+
axiosInstance={api}
|
|
223
|
+
highlight="slow"
|
|
224
|
+
onResponse={(e) => {
|
|
225
|
+
if (e.duration && e.duration > 1000) {
|
|
226
|
+
console.warn('Slow API:', e.url, e.duration + 'ms')
|
|
227
|
+
}
|
|
228
|
+
}}
|
|
229
|
+
/>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 4. Error Tracking
|
|
233
|
+
```jsx
|
|
234
|
+
<ReqwiseDevTools
|
|
235
|
+
axiosInstance={api}
|
|
236
|
+
onError={(e) => {
|
|
237
|
+
// Send to Sentry, LogRocket, etc.
|
|
238
|
+
errorTracker.captureException({
|
|
239
|
+
status: e.status,
|
|
240
|
+
url: e.url,
|
|
241
|
+
error: e.error?.message,
|
|
242
|
+
})
|
|
243
|
+
}}
|
|
244
|
+
/>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 🔒 Security & Privacy
|
|
250
|
+
|
|
251
|
+
1. **No Network Calls:** Reqwise never sends data anywhere
|
|
252
|
+
2. **Masking Works Offline:** Sensitive data redacted before storage
|
|
253
|
+
3. **Development-Only:** Disable in production
|
|
254
|
+
4. **localStorage Isolation:** Uses dedicated key `reqwise_history_v1`
|
|
255
|
+
5. **GDPR Friendly:** TTL support for auto-deletion
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 🚀 Performance
|
|
260
|
+
|
|
261
|
+
- **Bundle Size:** ~8KB gzipped (React wrapper only)
|
|
262
|
+
- **Runtime Overhead:** <2ms per request
|
|
263
|
+
- **Memory Usage:** ~100KB for 200 entries
|
|
264
|
+
- **No Memory Leaks:** Proper cleanup on unmount
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 🌐 Browser Support
|
|
269
|
+
|
|
270
|
+
- Chrome/Edge 90+
|
|
271
|
+
- Firefox 88+
|
|
272
|
+
- Safari 14+
|
|
273
|
+
- All modern React versions (17+)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 📝 TypeScript Support
|
|
278
|
+
|
|
279
|
+
Full TypeScript support with type definitions included:
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
import { ReqwiseDevTools } from 'reqwise-react'
|
|
283
|
+
import type { ReqwiseEntry, ReqwiseConfig } from 'reqwise-core'
|
|
284
|
+
import axios from 'axios'
|
|
285
|
+
|
|
286
|
+
const api = axios.create()
|
|
287
|
+
|
|
288
|
+
const handleResponse = (entry: ReqwiseEntry) => {
|
|
289
|
+
console.log(entry.status, entry.duration)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function App() {
|
|
293
|
+
return (
|
|
294
|
+
<ReqwiseDevTools
|
|
295
|
+
axiosInstance={api}
|
|
296
|
+
onResponse={handleResponse}
|
|
297
|
+
/>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## 📚 Resources
|
|
305
|
+
|
|
306
|
+
- [Reqwise Core](https://www.npmjs.com/package/reqwise-core) — Core package
|
|
307
|
+
- [GitHub](https://github.com/reqwise/reqwise) — Source code & issues
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 📄 License
|
|
312
|
+
|
|
313
|
+
MIT © Ali Zadeh
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
**Reqwise** makes debugging HTTP requests in React apps dramatically easier. Enjoy! 🎉
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
46
46
|
|
|
47
47
|
// src/ReqwiseDevTools.tsx
|
|
48
48
|
var import_react = require("react");
|
|
49
|
-
var
|
|
49
|
+
var import_reqwise_core2 = require("reqwise-core");
|
|
50
50
|
|
|
51
51
|
// src/ReqwiseClient.ts
|
|
52
52
|
var ReqwiseClient_exports = {};
|
|
@@ -62,47 +62,47 @@ __export(ReqwiseClient_exports, {
|
|
|
62
62
|
record: () => record,
|
|
63
63
|
wrapAxios: () => wrapAxios
|
|
64
64
|
});
|
|
65
|
-
var
|
|
65
|
+
var import_reqwise_core = __toESM(require("reqwise-core"));
|
|
66
66
|
var _axiosInstance = null;
|
|
67
67
|
function init(cfg) {
|
|
68
|
-
|
|
68
|
+
import_reqwise_core.default.ReqwiseClient.init(cfg);
|
|
69
69
|
}
|
|
70
70
|
function wrapAxios(instance) {
|
|
71
71
|
_axiosInstance = instance;
|
|
72
|
-
|
|
72
|
+
import_reqwise_core.default.ReqwiseClient.wrapAxios(instance);
|
|
73
73
|
}
|
|
74
74
|
async function get(url, cfg) {
|
|
75
75
|
if (_axiosInstance && typeof _axiosInstance.get === "function") {
|
|
76
76
|
return _axiosInstance.get(url, cfg);
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return import_reqwise_core.default.ReqwiseClient.get(url, cfg);
|
|
79
79
|
}
|
|
80
80
|
async function post(url, body, cfg) {
|
|
81
81
|
if (_axiosInstance && typeof _axiosInstance.post === "function") {
|
|
82
82
|
return _axiosInstance.post(url, body, cfg);
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return import_reqwise_core.default.ReqwiseClient.post(url, body, cfg);
|
|
85
85
|
}
|
|
86
86
|
async function put(url, body, cfg) {
|
|
87
87
|
if (_axiosInstance && typeof _axiosInstance.put === "function") {
|
|
88
88
|
return _axiosInstance.put(url, body, cfg);
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return import_reqwise_core.default.ReqwiseClient.put(url, body, cfg);
|
|
91
91
|
}
|
|
92
92
|
async function patch(url, body, cfg) {
|
|
93
93
|
if (_axiosInstance && typeof _axiosInstance.patch === "function") {
|
|
94
94
|
return _axiosInstance.patch(url, body, cfg);
|
|
95
95
|
}
|
|
96
|
-
return
|
|
96
|
+
return import_reqwise_core.default.ReqwiseClient.patch(url, body, cfg);
|
|
97
97
|
}
|
|
98
98
|
async function del(url, cfg) {
|
|
99
99
|
if (_axiosInstance && typeof _axiosInstance.delete === "function") {
|
|
100
100
|
return _axiosInstance.delete(url, cfg);
|
|
101
101
|
}
|
|
102
|
-
return
|
|
102
|
+
return import_reqwise_core.default.ReqwiseClient.delete(url, cfg);
|
|
103
103
|
}
|
|
104
|
-
var fetch =
|
|
105
|
-
var record =
|
|
104
|
+
var fetch = import_reqwise_core.default.ReqwiseClient.fetch;
|
|
105
|
+
var record = import_reqwise_core.default.ReqwiseClient.record;
|
|
106
106
|
var ReqwiseClient_default = {
|
|
107
107
|
init,
|
|
108
108
|
wrapAxios,
|
|
@@ -124,15 +124,18 @@ function ReqwiseDevTools(props) {
|
|
|
124
124
|
if (props.axiosInstance) {
|
|
125
125
|
wrapAxios(props.axiosInstance);
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
(0, import_reqwise_core2.rendererSetConfig)(props);
|
|
128
|
+
import_reqwise_core2.panel.setRenderer(import_reqwise_core2.renderer);
|
|
129
|
+
import_reqwise_core2.panel.mount({
|
|
129
130
|
defaultOpen: props.defaultOpen,
|
|
130
131
|
placement: props.placement,
|
|
131
132
|
hotkey: props.hotkey,
|
|
132
|
-
theme: props.theme
|
|
133
|
+
theme: props.theme,
|
|
134
|
+
size: props.size,
|
|
135
|
+
opacity: props.opacity
|
|
133
136
|
});
|
|
134
137
|
return () => {
|
|
135
|
-
|
|
138
|
+
import_reqwise_core2.panel.unmount();
|
|
136
139
|
};
|
|
137
140
|
} catch (e) {
|
|
138
141
|
console.error("[reqwise] ReqwiseDevTools error", e);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/ReqwiseDevTools.tsx","../src/ReqwiseClient.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/ReqwiseDevTools.tsx","../src/ReqwiseClient.ts"],"sourcesContent":["export { ReqwiseDevTools } from './ReqwiseDevTools'\r\nexport * from './ReqwiseClient'\r\n\r\nimport * as ReqwiseClient from './ReqwiseClient'\r\nimport { ReqwiseDevTools } from './ReqwiseDevTools'\r\n\r\nconst _default = {\r\n\tReqwiseDevTools,\r\n\t...ReqwiseClient,\r\n}\r\n\r\nexport default _default\r\n","import React, { useEffect } from 'react'\r\nimport { panel, renderer, rendererSetConfig } from 'reqwise-core'\r\nimport * as ReqwiseClient from './ReqwiseClient'\r\nimport type { ReqwiseConfig } from 'reqwise-core'\r\n\r\ntype ReqwiseDevToolsProps = ReqwiseConfig & {\r\n enabled?: boolean\r\n}\r\n\r\nexport function ReqwiseDevTools(props: ReqwiseDevToolsProps): React.ReactElement | null {\r\n // No-op if disabled\r\n if (props.enabled === false) return null\r\n\r\n useEffect(() => {\r\n try {\r\n // Initialize core client with config\r\n ReqwiseClient.init(props)\r\n\r\n // Wrap axios instance if provided\r\n if (props.axiosInstance) {\r\n ReqwiseClient.wrapAxios(props.axiosInstance)\r\n }\r\n\r\n // Set renderer config and mount\r\n rendererSetConfig(props)\r\n panel.setRenderer(renderer)\r\n\r\n // Mount panel into document.body\r\n panel.mount({\r\n defaultOpen: props.defaultOpen,\r\n placement: props.placement,\r\n hotkey: props.hotkey,\r\n theme: props.theme,\r\n size: props.size,\r\n opacity: props.opacity,\r\n })\r\n\r\n return () => {\r\n panel.unmount()\r\n }\r\n } catch (e) {\r\n console.error('[reqwise] ReqwiseDevTools error', e)\r\n }\r\n }, [])\r\n\r\n // Nothing to render in React tree — aside renders directly to document.body\r\n return null\r\n}\r\n","import Core from 'reqwise-core'\r\nimport type { ReqwiseConfig, RequestConfig } from 'reqwise-core'\r\n\r\nlet _axiosInstance: any = null\r\n\r\nexport function init(cfg?: Partial<ReqwiseConfig>) {\r\n Core.ReqwiseClient.init(cfg)\r\n}\r\n\r\nexport function wrapAxios(instance: any) {\r\n _axiosInstance = instance\r\n Core.ReqwiseClient.wrapAxios(instance)\r\n}\r\n\r\nexport async function get(url: string, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.get === 'function') {\r\n return _axiosInstance.get(url, cfg)\r\n }\r\n return Core.ReqwiseClient.get(url, cfg)\r\n}\r\n\r\nexport async function post(url: string, body?: any, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.post === 'function') {\r\n return _axiosInstance.post(url, body, cfg)\r\n }\r\n return Core.ReqwiseClient.post(url, body, cfg)\r\n}\r\n\r\nexport async function put(url: string, body?: any, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.put === 'function') {\r\n return _axiosInstance.put(url, body, cfg)\r\n }\r\n return Core.ReqwiseClient.put(url, body, cfg)\r\n}\r\n\r\nexport async function patch(url: string, body?: any, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.patch === 'function') {\r\n return _axiosInstance.patch(url, body, cfg)\r\n }\r\n return Core.ReqwiseClient.patch(url, body, cfg)\r\n}\r\n\r\nexport async function del(url: string, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.delete === 'function') {\r\n return _axiosInstance.delete(url, cfg)\r\n }\r\n return Core.ReqwiseClient.delete(url, cfg)\r\n}\r\n\r\nexport const fetch = Core.ReqwiseClient.fetch\r\nexport const record = Core.ReqwiseClient.record\r\n\r\nexport default {\r\n init,\r\n wrapAxios,\r\n get,\r\n post,\r\n put,\r\n patch,\r\n delete: del,\r\n fetch,\r\n record,\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAiC;AACjC,IAAAA,uBAAmD;;;ACDnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiB;AAGjB,IAAI,iBAAsB;AAEnB,SAAS,KAAK,KAA8B;AACjD,sBAAAC,QAAK,cAAc,KAAK,GAAG;AAC7B;AAEO,SAAS,UAAU,UAAe;AACvC,mBAAiB;AACjB,sBAAAA,QAAK,cAAc,UAAU,QAAQ;AACvC;AAEA,eAAsB,IAAI,KAAa,KAAqB;AAC1D,MAAI,kBAAkB,OAAO,eAAe,QAAQ,YAAY;AAC9D,WAAO,eAAe,IAAI,KAAK,GAAG;AAAA,EACpC;AACA,SAAO,oBAAAA,QAAK,cAAc,IAAI,KAAK,GAAG;AACxC;AAEA,eAAsB,KAAK,KAAa,MAAY,KAAqB;AACvE,MAAI,kBAAkB,OAAO,eAAe,SAAS,YAAY;AAC/D,WAAO,eAAe,KAAK,KAAK,MAAM,GAAG;AAAA,EAC3C;AACA,SAAO,oBAAAA,QAAK,cAAc,KAAK,KAAK,MAAM,GAAG;AAC/C;AAEA,eAAsB,IAAI,KAAa,MAAY,KAAqB;AACtE,MAAI,kBAAkB,OAAO,eAAe,QAAQ,YAAY;AAC9D,WAAO,eAAe,IAAI,KAAK,MAAM,GAAG;AAAA,EAC1C;AACA,SAAO,oBAAAA,QAAK,cAAc,IAAI,KAAK,MAAM,GAAG;AAC9C;AAEA,eAAsB,MAAM,KAAa,MAAY,KAAqB;AACxE,MAAI,kBAAkB,OAAO,eAAe,UAAU,YAAY;AAChE,WAAO,eAAe,MAAM,KAAK,MAAM,GAAG;AAAA,EAC5C;AACA,SAAO,oBAAAA,QAAK,cAAc,MAAM,KAAK,MAAM,GAAG;AAChD;AAEA,eAAsB,IAAI,KAAa,KAAqB;AAC1D,MAAI,kBAAkB,OAAO,eAAe,WAAW,YAAY;AACjE,WAAO,eAAe,OAAO,KAAK,GAAG;AAAA,EACvC;AACA,SAAO,oBAAAA,QAAK,cAAc,OAAO,KAAK,GAAG;AAC3C;AAEO,IAAM,QAAQ,oBAAAA,QAAK,cAAc;AACjC,IAAM,SAAS,oBAAAA,QAAK,cAAc;AAEzC,IAAO,wBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AACF;;;ADrDO,SAAS,gBAAgB,OAAwD;AAEtF,MAAI,MAAM,YAAY,MAAO,QAAO;AAEpC,8BAAU,MAAM;AACd,QAAI;AAEF,MAAc,KAAK,KAAK;AAGxB,UAAI,MAAM,eAAe;AACvB,QAAc,UAAU,MAAM,aAAa;AAAA,MAC7C;AAGA,kDAAkB,KAAK;AACvB,iCAAM,YAAY,6BAAQ;AAG1B,iCAAM,MAAM;AAAA,QACV,aAAa,MAAM;AAAA,QACnB,WAAW,MAAM;AAAA,QACjB,QAAQ,MAAM;AAAA,QACd,OAAO,MAAM;AAAA,QACb,MAAM,MAAM;AAAA,QACZ,SAAS,MAAM;AAAA,MACjB,CAAC;AAED,aAAO,MAAM;AACX,mCAAM,QAAQ;AAAA,MAChB;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,mCAAmC,CAAC;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAGL,SAAO;AACT;;;ADzCA,IAAM,WAAW;AAAA,EAChB;AAAA,EACA,GAAG;AACJ;AAEA,IAAO,gBAAQ;","names":["import_reqwise_core","Core"]}
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/ReqwiseDevTools.tsx
|
|
8
8
|
import { useEffect } from "react";
|
|
9
|
-
import { panel, renderer } from "
|
|
9
|
+
import { panel, renderer, rendererSetConfig } from "reqwise-core";
|
|
10
10
|
|
|
11
11
|
// src/ReqwiseClient.ts
|
|
12
12
|
var ReqwiseClient_exports = {};
|
|
@@ -22,7 +22,7 @@ __export(ReqwiseClient_exports, {
|
|
|
22
22
|
record: () => record,
|
|
23
23
|
wrapAxios: () => wrapAxios
|
|
24
24
|
});
|
|
25
|
-
import Core from "
|
|
25
|
+
import Core from "reqwise-core";
|
|
26
26
|
var _axiosInstance = null;
|
|
27
27
|
function init(cfg) {
|
|
28
28
|
Core.ReqwiseClient.init(cfg);
|
|
@@ -84,12 +84,15 @@ function ReqwiseDevTools(props) {
|
|
|
84
84
|
if (props.axiosInstance) {
|
|
85
85
|
wrapAxios(props.axiosInstance);
|
|
86
86
|
}
|
|
87
|
+
rendererSetConfig(props);
|
|
87
88
|
panel.setRenderer(renderer);
|
|
88
89
|
panel.mount({
|
|
89
90
|
defaultOpen: props.defaultOpen,
|
|
90
91
|
placement: props.placement,
|
|
91
92
|
hotkey: props.hotkey,
|
|
92
|
-
theme: props.theme
|
|
93
|
+
theme: props.theme,
|
|
94
|
+
size: props.size,
|
|
95
|
+
opacity: props.opacity
|
|
93
96
|
});
|
|
94
97
|
return () => {
|
|
95
98
|
panel.unmount();
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ReqwiseDevTools.tsx","../src/ReqwiseClient.ts","../src/index.ts"],"sourcesContent":["import React, { useEffect } from 'react'\r\nimport { panel, renderer } from '
|
|
1
|
+
{"version":3,"sources":["../src/ReqwiseDevTools.tsx","../src/ReqwiseClient.ts","../src/index.ts"],"sourcesContent":["import React, { useEffect } from 'react'\r\nimport { panel, renderer, rendererSetConfig } from 'reqwise-core'\r\nimport * as ReqwiseClient from './ReqwiseClient'\r\nimport type { ReqwiseConfig } from 'reqwise-core'\r\n\r\ntype ReqwiseDevToolsProps = ReqwiseConfig & {\r\n enabled?: boolean\r\n}\r\n\r\nexport function ReqwiseDevTools(props: ReqwiseDevToolsProps): React.ReactElement | null {\r\n // No-op if disabled\r\n if (props.enabled === false) return null\r\n\r\n useEffect(() => {\r\n try {\r\n // Initialize core client with config\r\n ReqwiseClient.init(props)\r\n\r\n // Wrap axios instance if provided\r\n if (props.axiosInstance) {\r\n ReqwiseClient.wrapAxios(props.axiosInstance)\r\n }\r\n\r\n // Set renderer config and mount\r\n rendererSetConfig(props)\r\n panel.setRenderer(renderer)\r\n\r\n // Mount panel into document.body\r\n panel.mount({\r\n defaultOpen: props.defaultOpen,\r\n placement: props.placement,\r\n hotkey: props.hotkey,\r\n theme: props.theme,\r\n size: props.size,\r\n opacity: props.opacity,\r\n })\r\n\r\n return () => {\r\n panel.unmount()\r\n }\r\n } catch (e) {\r\n console.error('[reqwise] ReqwiseDevTools error', e)\r\n }\r\n }, [])\r\n\r\n // Nothing to render in React tree — aside renders directly to document.body\r\n return null\r\n}\r\n","import Core from 'reqwise-core'\r\nimport type { ReqwiseConfig, RequestConfig } from 'reqwise-core'\r\n\r\nlet _axiosInstance: any = null\r\n\r\nexport function init(cfg?: Partial<ReqwiseConfig>) {\r\n Core.ReqwiseClient.init(cfg)\r\n}\r\n\r\nexport function wrapAxios(instance: any) {\r\n _axiosInstance = instance\r\n Core.ReqwiseClient.wrapAxios(instance)\r\n}\r\n\r\nexport async function get(url: string, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.get === 'function') {\r\n return _axiosInstance.get(url, cfg)\r\n }\r\n return Core.ReqwiseClient.get(url, cfg)\r\n}\r\n\r\nexport async function post(url: string, body?: any, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.post === 'function') {\r\n return _axiosInstance.post(url, body, cfg)\r\n }\r\n return Core.ReqwiseClient.post(url, body, cfg)\r\n}\r\n\r\nexport async function put(url: string, body?: any, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.put === 'function') {\r\n return _axiosInstance.put(url, body, cfg)\r\n }\r\n return Core.ReqwiseClient.put(url, body, cfg)\r\n}\r\n\r\nexport async function patch(url: string, body?: any, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.patch === 'function') {\r\n return _axiosInstance.patch(url, body, cfg)\r\n }\r\n return Core.ReqwiseClient.patch(url, body, cfg)\r\n}\r\n\r\nexport async function del(url: string, cfg?: RequestConfig) {\r\n if (_axiosInstance && typeof _axiosInstance.delete === 'function') {\r\n return _axiosInstance.delete(url, cfg)\r\n }\r\n return Core.ReqwiseClient.delete(url, cfg)\r\n}\r\n\r\nexport const fetch = Core.ReqwiseClient.fetch\r\nexport const record = Core.ReqwiseClient.record\r\n\r\nexport default {\r\n init,\r\n wrapAxios,\r\n get,\r\n post,\r\n put,\r\n patch,\r\n delete: del,\r\n fetch,\r\n record,\r\n}\r\n","export { ReqwiseDevTools } from './ReqwiseDevTools'\r\nexport * from './ReqwiseClient'\r\n\r\nimport * as ReqwiseClient from './ReqwiseClient'\r\nimport { ReqwiseDevTools } from './ReqwiseDevTools'\r\n\r\nconst _default = {\r\n\tReqwiseDevTools,\r\n\t...ReqwiseClient,\r\n}\r\n\r\nexport default _default\r\n"],"mappings":";;;;;;;AAAA,SAAgB,iBAAiB;AACjC,SAAS,OAAO,UAAU,yBAAyB;;;ACDnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAO,UAAU;AAGjB,IAAI,iBAAsB;AAEnB,SAAS,KAAK,KAA8B;AACjD,OAAK,cAAc,KAAK,GAAG;AAC7B;AAEO,SAAS,UAAU,UAAe;AACvC,mBAAiB;AACjB,OAAK,cAAc,UAAU,QAAQ;AACvC;AAEA,eAAsB,IAAI,KAAa,KAAqB;AAC1D,MAAI,kBAAkB,OAAO,eAAe,QAAQ,YAAY;AAC9D,WAAO,eAAe,IAAI,KAAK,GAAG;AAAA,EACpC;AACA,SAAO,KAAK,cAAc,IAAI,KAAK,GAAG;AACxC;AAEA,eAAsB,KAAK,KAAa,MAAY,KAAqB;AACvE,MAAI,kBAAkB,OAAO,eAAe,SAAS,YAAY;AAC/D,WAAO,eAAe,KAAK,KAAK,MAAM,GAAG;AAAA,EAC3C;AACA,SAAO,KAAK,cAAc,KAAK,KAAK,MAAM,GAAG;AAC/C;AAEA,eAAsB,IAAI,KAAa,MAAY,KAAqB;AACtE,MAAI,kBAAkB,OAAO,eAAe,QAAQ,YAAY;AAC9D,WAAO,eAAe,IAAI,KAAK,MAAM,GAAG;AAAA,EAC1C;AACA,SAAO,KAAK,cAAc,IAAI,KAAK,MAAM,GAAG;AAC9C;AAEA,eAAsB,MAAM,KAAa,MAAY,KAAqB;AACxE,MAAI,kBAAkB,OAAO,eAAe,UAAU,YAAY;AAChE,WAAO,eAAe,MAAM,KAAK,MAAM,GAAG;AAAA,EAC5C;AACA,SAAO,KAAK,cAAc,MAAM,KAAK,MAAM,GAAG;AAChD;AAEA,eAAsB,IAAI,KAAa,KAAqB;AAC1D,MAAI,kBAAkB,OAAO,eAAe,WAAW,YAAY;AACjE,WAAO,eAAe,OAAO,KAAK,GAAG;AAAA,EACvC;AACA,SAAO,KAAK,cAAc,OAAO,KAAK,GAAG;AAC3C;AAEO,IAAM,QAAQ,KAAK,cAAc;AACjC,IAAM,SAAS,KAAK,cAAc;AAEzC,IAAO,wBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AACF;;;ADrDO,SAAS,gBAAgB,OAAwD;AAEtF,MAAI,MAAM,YAAY,MAAO,QAAO;AAEpC,YAAU,MAAM;AACd,QAAI;AAEF,MAAc,KAAK,KAAK;AAGxB,UAAI,MAAM,eAAe;AACvB,QAAc,UAAU,MAAM,aAAa;AAAA,MAC7C;AAGA,wBAAkB,KAAK;AACvB,YAAM,YAAY,QAAQ;AAG1B,YAAM,MAAM;AAAA,QACV,aAAa,MAAM;AAAA,QACnB,WAAW,MAAM;AAAA,QACjB,QAAQ,MAAM;AAAA,QACd,OAAO,MAAM;AAAA,QACb,MAAM,MAAM;AAAA,QACZ,SAAS,MAAM;AAAA,MACjB,CAAC;AAED,aAAO,MAAM;AACX,cAAM,QAAQ;AAAA,MAChB;AAAA,IACF,SAAS,GAAG;AACV,cAAQ,MAAM,mCAAmC,CAAC;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAGL,SAAO;AACT;;;AEzCA,IAAM,WAAW;AAAA,EAChB;AAAA,EACA,GAAG;AACJ;AAEA,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reqwise-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -11,10 +11,6 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsup",
|
|
16
|
-
"type-check": "tsc -p tsconfig.json --noEmit"
|
|
17
|
-
},
|
|
18
14
|
"peerDependencies": {
|
|
19
15
|
"axios": ">=1.0.0",
|
|
20
16
|
"react": ">=17.0.0"
|
|
@@ -25,9 +21,16 @@
|
|
|
25
21
|
}
|
|
26
22
|
},
|
|
27
23
|
"dependencies": {
|
|
28
|
-
"
|
|
24
|
+
"reqwise-core": "^1.1.5"
|
|
29
25
|
},
|
|
30
26
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^25.8.0"
|
|
27
|
+
"@types/node": "^25.8.0",
|
|
28
|
+
"@types/react": "^18.0.0",
|
|
29
|
+
"typescript": "^5.0.0",
|
|
30
|
+
"tsup": "^8.5.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"type-check": "tsc -p tsconfig.json --noEmit"
|
|
32
35
|
}
|
|
33
|
-
}
|
|
36
|
+
}
|
package/src/ReqwiseClient.ts
CHANGED
package/src/ReqwiseDevTools.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
|
-
import { panel, renderer } from '
|
|
2
|
+
import { panel, renderer, rendererSetConfig } from 'reqwise-core'
|
|
3
3
|
import * as ReqwiseClient from './ReqwiseClient'
|
|
4
|
-
import type { ReqwiseConfig } from '
|
|
4
|
+
import type { ReqwiseConfig } from 'reqwise-core'
|
|
5
5
|
|
|
6
6
|
type ReqwiseDevToolsProps = ReqwiseConfig & {
|
|
7
7
|
enabled?: boolean
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export function ReqwiseDevTools(props: ReqwiseDevToolsProps): React.ReactElement | null {
|
|
11
11
|
// No-op if disabled
|
|
12
12
|
if (props.enabled === false) return null
|
|
13
13
|
|
|
@@ -21,7 +21,8 @@ export default function ReqwiseDevTools(props: ReqwiseDevToolsProps): React.Reac
|
|
|
21
21
|
ReqwiseClient.wrapAxios(props.axiosInstance)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// Set renderer
|
|
24
|
+
// Set renderer config and mount
|
|
25
|
+
rendererSetConfig(props)
|
|
25
26
|
panel.setRenderer(renderer)
|
|
26
27
|
|
|
27
28
|
// Mount panel into document.body
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import * as ReqwiseClient from './ReqwiseClient'
|
|
3
|
-
|
|
4
|
-
export { ReqwiseDevTools }
|
|
1
|
+
export { ReqwiseDevTools } from './ReqwiseDevTools'
|
|
5
2
|
export * from './ReqwiseClient'
|
|
6
3
|
|
|
4
|
+
import * as ReqwiseClient from './ReqwiseClient'
|
|
5
|
+
import { ReqwiseDevTools } from './ReqwiseDevTools'
|
|
6
|
+
|
|
7
7
|
const _default = {
|
|
8
8
|
ReqwiseDevTools,
|
|
9
9
|
...ReqwiseClient,
|
package/tsconfig.json
CHANGED
package/tsup.config.ts
CHANGED
|
@@ -3,10 +3,8 @@ import { defineConfig } from 'tsup'
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
entry: ['src/index.ts'],
|
|
5
5
|
format: ['cjs', 'esm'],
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
compilerOptions: { skipLibCheck: true }
|
|
9
|
-
},
|
|
6
|
+
external: ['reqwise-core'],
|
|
7
|
+
dts: false,
|
|
10
8
|
sourcemap: true,
|
|
11
9
|
clean: true,
|
|
12
10
|
splitting: false,
|
package/dist/index.d.mts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as _reqwise_core from '@reqwise/core';
|
|
2
|
-
import { ReqwiseConfig, RequestConfig } from '@reqwise/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
type ReqwiseDevToolsProps = ReqwiseConfig & {
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare function ReqwiseDevTools(props: ReqwiseDevToolsProps): React.ReactElement | null;
|
|
9
|
-
|
|
10
|
-
declare function init(cfg?: Partial<ReqwiseConfig>): void;
|
|
11
|
-
declare function wrapAxios(instance: any): void;
|
|
12
|
-
declare function get(url: string, cfg?: RequestConfig): Promise<any>;
|
|
13
|
-
declare function post(url: string, body?: any, cfg?: RequestConfig): Promise<any>;
|
|
14
|
-
declare function put(url: string, body?: any, cfg?: RequestConfig): Promise<any>;
|
|
15
|
-
declare function patch(url: string, body?: any, cfg?: RequestConfig): Promise<any>;
|
|
16
|
-
declare function del(url: string, cfg?: RequestConfig): Promise<any>;
|
|
17
|
-
declare const fetch: (input: RequestInfo, init?: RequestInit & RequestConfig) => Promise<Response>;
|
|
18
|
-
declare const record: (entry: Partial<_reqwise_core.ReqwiseEntry>) => void;
|
|
19
|
-
|
|
20
|
-
declare const _default: {
|
|
21
|
-
init(cfg?: Partial<_reqwise_core.ReqwiseConfig>): void;
|
|
22
|
-
wrapAxios(instance: any): void;
|
|
23
|
-
get(url: string, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
24
|
-
post(url: string, body?: any, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
25
|
-
put(url: string, body?: any, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
26
|
-
patch(url: string, body?: any, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
27
|
-
del(url: string, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
28
|
-
fetch: (input: RequestInfo, init?: RequestInit & _reqwise_core.RequestConfig) => Promise<Response>;
|
|
29
|
-
record: (entry: Partial<_reqwise_core.ReqwiseEntry>) => void;
|
|
30
|
-
default: {
|
|
31
|
-
init: typeof init;
|
|
32
|
-
wrapAxios: typeof wrapAxios;
|
|
33
|
-
get: typeof get;
|
|
34
|
-
post: typeof post;
|
|
35
|
-
put: typeof put;
|
|
36
|
-
patch: typeof patch;
|
|
37
|
-
delete: typeof del;
|
|
38
|
-
fetch: (input: RequestInfo, init?: RequestInit & _reqwise_core.RequestConfig) => Promise<Response>;
|
|
39
|
-
record: (entry: Partial<_reqwise_core.ReqwiseEntry>) => void;
|
|
40
|
-
};
|
|
41
|
-
ReqwiseDevTools: typeof ReqwiseDevTools;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export { ReqwiseDevTools, _default as default, del, fetch, get, init, patch, post, put, record, wrapAxios };
|
package/dist/index.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as _reqwise_core from '@reqwise/core';
|
|
2
|
-
import { ReqwiseConfig, RequestConfig } from '@reqwise/core';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
type ReqwiseDevToolsProps = ReqwiseConfig & {
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare function ReqwiseDevTools(props: ReqwiseDevToolsProps): React.ReactElement | null;
|
|
9
|
-
|
|
10
|
-
declare function init(cfg?: Partial<ReqwiseConfig>): void;
|
|
11
|
-
declare function wrapAxios(instance: any): void;
|
|
12
|
-
declare function get(url: string, cfg?: RequestConfig): Promise<any>;
|
|
13
|
-
declare function post(url: string, body?: any, cfg?: RequestConfig): Promise<any>;
|
|
14
|
-
declare function put(url: string, body?: any, cfg?: RequestConfig): Promise<any>;
|
|
15
|
-
declare function patch(url: string, body?: any, cfg?: RequestConfig): Promise<any>;
|
|
16
|
-
declare function del(url: string, cfg?: RequestConfig): Promise<any>;
|
|
17
|
-
declare const fetch: (input: RequestInfo, init?: RequestInit & RequestConfig) => Promise<Response>;
|
|
18
|
-
declare const record: (entry: Partial<_reqwise_core.ReqwiseEntry>) => void;
|
|
19
|
-
|
|
20
|
-
declare const _default: {
|
|
21
|
-
init(cfg?: Partial<_reqwise_core.ReqwiseConfig>): void;
|
|
22
|
-
wrapAxios(instance: any): void;
|
|
23
|
-
get(url: string, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
24
|
-
post(url: string, body?: any, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
25
|
-
put(url: string, body?: any, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
26
|
-
patch(url: string, body?: any, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
27
|
-
del(url: string, cfg?: _reqwise_core.RequestConfig): Promise<any>;
|
|
28
|
-
fetch: (input: RequestInfo, init?: RequestInit & _reqwise_core.RequestConfig) => Promise<Response>;
|
|
29
|
-
record: (entry: Partial<_reqwise_core.ReqwiseEntry>) => void;
|
|
30
|
-
default: {
|
|
31
|
-
init: typeof init;
|
|
32
|
-
wrapAxios: typeof wrapAxios;
|
|
33
|
-
get: typeof get;
|
|
34
|
-
post: typeof post;
|
|
35
|
-
put: typeof put;
|
|
36
|
-
patch: typeof patch;
|
|
37
|
-
delete: typeof del;
|
|
38
|
-
fetch: (input: RequestInfo, init?: RequestInit & _reqwise_core.RequestConfig) => Promise<Response>;
|
|
39
|
-
record: (entry: Partial<_reqwise_core.ReqwiseEntry>) => void;
|
|
40
|
-
};
|
|
41
|
-
ReqwiseDevTools: typeof ReqwiseDevTools;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export { ReqwiseDevTools, _default as default, del, fetch, get, init, patch, post, put, record, wrapAxios };
|