opencode-qwen-oauth 2.3.0 → 2.4.0
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/README.md +83 -73
- package/bin/install.js +1 -1
- package/dist/api-key-exchange.js +1 -1
- package/dist/api-key-exchange.js.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -443
- package/dist/index.js.map +1 -1
- package/dist/middleware/auth.middleware.d.ts +10 -0
- package/dist/middleware/auth.middleware.d.ts.map +1 -0
- package/dist/middleware/auth.middleware.js +102 -0
- package/dist/middleware/auth.middleware.js.map +1 -0
- package/dist/middleware/rate-limit.middleware.d.ts +10 -0
- package/dist/middleware/rate-limit.middleware.d.ts.map +1 -0
- package/dist/middleware/rate-limit.middleware.js +22 -0
- package/dist/middleware/rate-limit.middleware.js.map +1 -0
- package/dist/middleware/retry.middleware.d.ts +11 -0
- package/dist/middleware/retry.middleware.d.ts.map +1 -0
- package/dist/middleware/retry.middleware.js +43 -0
- package/dist/middleware/retry.middleware.js.map +1 -0
- package/dist/repositories/credential.repository.d.ts +13 -0
- package/dist/repositories/credential.repository.d.ts.map +1 -0
- package/dist/repositories/credential.repository.js +65 -0
- package/dist/repositories/credential.repository.js.map +1 -0
- package/dist/services/token.service.d.ts +20 -0
- package/dist/services/token.service.d.ts.map +1 -0
- package/dist/services/token.service.js +106 -0
- package/dist/services/token.service.js.map +1 -0
- package/dist/strategies/oauth.strategy.d.ts +9 -0
- package/dist/strategies/oauth.strategy.d.ts.map +1 -0
- package/dist/strategies/oauth.strategy.js +249 -0
- package/dist/strategies/oauth.strategy.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/logger.d.ts +24 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +32 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/mutex.d.ts +16 -0
- package/dist/utils/mutex.d.ts.map +1 -0
- package/dist/utils/mutex.js +54 -0
- package/dist/utils/mutex.js.map +1 -0
- package/dist/utils/pkce.d.ts +8 -0
- package/dist/utils/pkce.d.ts.map +1 -0
- package/dist/utils/pkce.js +17 -0
- package/dist/utils/pkce.js.map +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -15,14 +15,14 @@ Qwen OAuth authentication plugin for [OpenCode](https://opencode.ai) - authentic
|
|
|
15
15
|
|
|
16
16
|
- 🔐 **OAuth Device Flow** - PKCE-secured authentication, works in headless/CI environments
|
|
17
17
|
- 🔄 **Automatic Token Refresh** - Tokens are refreshed before expiry
|
|
18
|
+
- 💾 **Persistent Credentials** - Tokens saved to `~/.qwen/oauth_creds.json` for persistence across sessions
|
|
18
19
|
- 🌐 **Auto Browser Open** - Automatically opens browser for authentication
|
|
19
|
-
- 📝 **File Logging** - All OAuth activity logged to `~/.config/opencode/logs/qwen-oauth.log`
|
|
20
|
-
- 🐛 **Debug Mode** - Enable verbose output with `QWEN_OAUTH_DEBUG=true`
|
|
21
20
|
- 🚀 **Easy Install** - One-command installation with CLI tool
|
|
22
|
-
- 🎯 **Custom Headers** - Automatically adds Qwen-specific headers to API requests
|
|
21
|
+
- 🎯 **Custom Headers** - Automatically adds Qwen-specific headers (X-DashScope-*) to API requests
|
|
23
22
|
- ⚙️ **Optimized Parameters** - Pre-configured temperature and topP settings for Qwen models
|
|
24
23
|
- 🌍 **Environment Variables** - Exposes Qwen credentials to shell environments
|
|
25
|
-
-
|
|
24
|
+
- ⏱️ **Request Throttling** - Built-in rate limiting to avoid 429 errors
|
|
25
|
+
- 🏗️ **Clean Architecture** - Layered design (services, repositories, middleware) for maintainability
|
|
26
26
|
|
|
27
27
|
## Quick Start
|
|
28
28
|
|
|
@@ -58,37 +58,27 @@ Select **"Qwen Code (qwen.ai OAuth)"** and follow the device flow instructions.
|
|
|
58
58
|
### Use Qwen Models
|
|
59
59
|
|
|
60
60
|
```
|
|
61
|
-
/model qwen/
|
|
61
|
+
/model qwen/coder-model
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Models
|
|
65
65
|
|
|
66
|
-
| Model | Context | Features |
|
|
67
|
-
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
66
|
+
| Model | Context | Output | Features |
|
|
67
|
+
|-------|---------|--------|----------|
|
|
68
|
+
| `coder-model` | 1M tokens | 64K | Optimized for coding |
|
|
69
|
+
| `vision-model` | 128K tokens | 32K | Vision + language |
|
|
70
70
|
|
|
71
71
|
## Configuration
|
|
72
72
|
|
|
73
73
|
### Debug Mode
|
|
74
74
|
|
|
75
|
-
Enable verbose logging
|
|
75
|
+
Enable verbose logging:
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
78
|
QWEN_OAUTH_DEBUG=true opencode
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
All OAuth activity is logged to:
|
|
84
|
-
```
|
|
85
|
-
~/.config/opencode/logs/qwen-oauth.log
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
View logs in real-time:
|
|
89
|
-
```bash
|
|
90
|
-
tail -f ~/.config/opencode/logs/qwen-oauth.log
|
|
91
|
-
```
|
|
81
|
+
Logs are output to OpenCode's logging system and can be viewed in the OpenCode interface.
|
|
92
82
|
|
|
93
83
|
### Manual Configuration
|
|
94
84
|
|
|
@@ -106,13 +96,17 @@ If you prefer manual setup, add to `.opencode/opencode.json`:
|
|
|
106
96
|
"baseURL": "https://portal.qwen.ai/v1"
|
|
107
97
|
},
|
|
108
98
|
"models": {
|
|
109
|
-
"
|
|
110
|
-
"id": "
|
|
111
|
-
"name": "
|
|
99
|
+
"coder-model": {
|
|
100
|
+
"id": "coder-model",
|
|
101
|
+
"name": "Qwen Coder",
|
|
102
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
103
|
+
"modalities": { "input": ["text"], "output": ["text"] }
|
|
112
104
|
},
|
|
113
|
-
"
|
|
114
|
-
"id": "
|
|
115
|
-
"name": "
|
|
105
|
+
"vision-model": {
|
|
106
|
+
"id": "vision-model",
|
|
107
|
+
"name": "Qwen Vision",
|
|
108
|
+
"limit": { "context": 131072, "output": 32768 },
|
|
109
|
+
"modalities": { "input": ["text", "image"], "output": ["text"] },
|
|
116
110
|
"attachment": true
|
|
117
111
|
}
|
|
118
112
|
}
|
|
@@ -136,29 +130,13 @@ npx opencode-qwen-oauth --help
|
|
|
136
130
|
|
|
137
131
|
## Diagnostics
|
|
138
132
|
|
|
139
|
-
|
|
133
|
+
Verify Qwen OAuth endpoints are accessible:
|
|
140
134
|
|
|
141
135
|
```bash
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
This will check:
|
|
146
|
-
- ✓ OAuth base URL accessibility
|
|
147
|
-
- ✓ Device code endpoint functionality
|
|
148
|
-
- ✓ API endpoint availability
|
|
149
|
-
|
|
150
|
-
Example output:
|
|
136
|
+
curl -I https://chat.qwen.ai/api/v1/oauth2/device/code
|
|
151
137
|
```
|
|
152
|
-
[Base URL] https://chat.qwen.ai
|
|
153
|
-
Status: ✓ 200
|
|
154
138
|
|
|
155
|
-
|
|
156
|
-
Status: ✓ 200
|
|
157
|
-
|
|
158
|
-
[API Endpoints] Testing /chat/completions...
|
|
159
|
-
⚠ https://portal.qwen.ai/v1
|
|
160
|
-
Status: 401 (endpoint exists, requires auth)
|
|
161
|
-
```
|
|
139
|
+
This should return `200 OK` if endpoints are available.
|
|
162
140
|
|
|
163
141
|
## Troubleshooting
|
|
164
142
|
|
|
@@ -196,11 +174,18 @@ sudo dnf install xdg-utils
|
|
|
196
174
|
sudo pacman -S xdg-utils
|
|
197
175
|
```
|
|
198
176
|
|
|
199
|
-
###
|
|
200
|
-
|
|
201
|
-
|
|
177
|
+
### Credentials File
|
|
178
|
+
Credentials are saved to `~/.qwen/oauth_creds.json` (compatible with qwen-code CLI):
|
|
179
|
+
```
|
|
180
|
+
~/.qwen/oauth_creds.json
|
|
202
181
|
```
|
|
203
182
|
|
|
183
|
+
This allows sharing authentication between OpenCode plugin and qwen-code CLI.
|
|
184
|
+
|
|
185
|
+
### Check logs
|
|
186
|
+
|
|
187
|
+
OpenCode logs can be viewed through the OpenCode interface or by checking the OpenCode log directory.
|
|
188
|
+
|
|
204
189
|
## How It Works
|
|
205
190
|
|
|
206
191
|
This plugin implements OAuth 2.0 Device Flow (RFC 8628) with PKCE:
|
|
@@ -216,7 +201,7 @@ This plugin implements OAuth 2.0 Device Flow (RFC 8628) with PKCE:
|
|
|
216
201
|
### Security Features
|
|
217
202
|
- ✅ Uses PKCE (RFC 7636) for enhanced security
|
|
218
203
|
- ✅ No client secret required (safer for public clients)
|
|
219
|
-
- ✅ Tokens stored in OpenCode's
|
|
204
|
+
- ✅ Tokens stored in OpenCode's auth system and `~/.qwen/oauth_creds.json` for persistence
|
|
220
205
|
- ✅ All OAuth activity logged for auditing
|
|
221
206
|
- ✅ Sensitive data sanitized in logs
|
|
222
207
|
|
|
@@ -241,7 +226,7 @@ Run `npm run diagnose` to verify endpoint availability at any time.
|
|
|
241
226
|
|
|
242
227
|
```bash
|
|
243
228
|
# Clone and install
|
|
244
|
-
git clone https://github.com/
|
|
229
|
+
git clone https://github.com/dreygur/opencode-qwen-oauth.git
|
|
245
230
|
cd opencode-qwen-oauth
|
|
246
231
|
npm install
|
|
247
232
|
|
|
@@ -251,31 +236,49 @@ npm run build
|
|
|
251
236
|
# Watch mode
|
|
252
237
|
npm run dev
|
|
253
238
|
|
|
239
|
+
# Run tests
|
|
240
|
+
npm test
|
|
241
|
+
|
|
254
242
|
# Test locally
|
|
255
243
|
npm link
|
|
256
244
|
cd /path/to/project
|
|
257
|
-
opencode-qwen-oauth install
|
|
245
|
+
npx opencode-qwen-oauth install
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Testing
|
|
249
|
+
|
|
250
|
+
All tests use Node.js native test runner with tsx:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
npm test
|
|
258
254
|
```
|
|
259
255
|
|
|
256
|
+
29 tests covering:
|
|
257
|
+
- PKCE key pair generation
|
|
258
|
+
- Input validation (URLs, tokens, codes)
|
|
259
|
+
- Data sanitization
|
|
260
|
+
|
|
260
261
|
## Plugin Architecture
|
|
261
262
|
|
|
262
|
-
This plugin implements multiple OpenCode plugin hooks:
|
|
263
|
+
This plugin implements multiple OpenCode plugin hooks using a clean, layered architecture:
|
|
263
264
|
|
|
264
265
|
### Hooks Implemented
|
|
265
266
|
|
|
266
267
|
#### `auth` Hook
|
|
267
|
-
Provides OAuth device flow authentication with automatic browser opening and token polling.
|
|
268
|
+
Provides OAuth device flow authentication with automatic browser opening and token polling. Uses `TokenService` for token management and `CredentialRepository` for persistence.
|
|
268
269
|
|
|
269
270
|
#### `config` Hook
|
|
270
271
|
Dynamically registers the Qwen provider and available models with OpenCode.
|
|
271
272
|
|
|
272
273
|
#### `event` Hook
|
|
273
|
-
Monitors session events
|
|
274
|
+
Monitors session events for debugging.
|
|
274
275
|
|
|
275
276
|
#### `chat.headers` Hook
|
|
276
277
|
Injects custom headers for Qwen API requests:
|
|
277
|
-
- `
|
|
278
|
-
- `X-
|
|
278
|
+
- `User-Agent: QwenCode/0.10.3 (platform)`
|
|
279
|
+
- `X-DashScope-CacheControl: enable`
|
|
280
|
+
- `X-DashScope-UserAgent: QwenCode/0.10.3 (platform)`
|
|
281
|
+
- `X-DashScope-AuthType: qwen-oauth`
|
|
279
282
|
|
|
280
283
|
#### `chat.params` Hook
|
|
281
284
|
Optimizes model parameters for Qwen:
|
|
@@ -287,26 +290,33 @@ Exposes environment variables to shell commands:
|
|
|
287
290
|
- `QWEN_API_BASE_URL` - Qwen API endpoint
|
|
288
291
|
- `QWEN_PROVIDER` - Provider identifier
|
|
289
292
|
|
|
290
|
-
##
|
|
293
|
+
## Architecture
|
|
294
|
+
|
|
295
|
+
This plugin uses a **layered architecture** for maintainability:
|
|
291
296
|
|
|
292
297
|
```
|
|
293
|
-
|
|
294
|
-
├──
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
│
|
|
298
|
-
|
|
299
|
-
│
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
├──
|
|
304
|
-
├──
|
|
305
|
-
|
|
306
|
-
├──
|
|
307
|
-
|
|
298
|
+
src/
|
|
299
|
+
├── index.ts # Plugin entry point (190 lines)
|
|
300
|
+
├── types.ts # Shared type definitions
|
|
301
|
+
├── strategies/
|
|
302
|
+
│ └── oauth.strategy.ts # OAuth Device Flow (RFC 8628)
|
|
303
|
+
├── services/
|
|
304
|
+
│ └── token.service.ts # Token management & caching
|
|
305
|
+
├── repositories/
|
|
306
|
+
│ └── credential.repository.ts # File-based credential storage
|
|
307
|
+
├── middleware/
|
|
308
|
+
│ ├── auth.middleware.ts # Auth fetch interceptor
|
|
309
|
+
│ ├── rate-limit.middleware.ts # Request throttling
|
|
310
|
+
│ └── retry.middleware.ts # Retry with exponential backoff
|
|
311
|
+
├── utils/
|
|
312
|
+
│ ├── logger.ts # Structured logging
|
|
313
|
+
│ ├── mutex.ts # Concurrency control
|
|
314
|
+
│ └── pkce.ts # PKCE key generation
|
|
315
|
+
└── [config, validation, etc.]
|
|
308
316
|
```
|
|
309
317
|
|
|
318
|
+
**Total:** ~1,670 lines (refactored from 2,810 lines, -41%)
|
|
319
|
+
|
|
310
320
|
**Note:** `.opencode/` directory is for local testing only and is not included in the npm package.
|
|
311
321
|
|
|
312
322
|
## License
|
package/bin/install.js
CHANGED
|
@@ -148,7 +148,7 @@ function install() {
|
|
|
148
148
|
|
|
149
149
|
opencodePackage.dependencies = opencodePackage.dependencies || {};
|
|
150
150
|
if (!opencodePackage.dependencies["opencode-qwen-oauth"]) {
|
|
151
|
-
opencodePackage.dependencies["opencode-qwen-oauth"] = "^2.3.
|
|
151
|
+
opencodePackage.dependencies["opencode-qwen-oauth"] = "^2.3.1";
|
|
152
152
|
log("Added 'opencode-qwen-oauth' to .opencode/package.json dependencies");
|
|
153
153
|
}
|
|
154
154
|
|
package/dist/api-key-exchange.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* API Key Exchange for Qwen
|
|
3
3
|
* Attempts to exchange OAuth token for API key
|
|
4
4
|
*/
|
|
5
|
-
import { debugLog, warnLog, infoLog } from "./logger.js";
|
|
5
|
+
import { debugLog, warnLog, infoLog } from "./utils/logger.js";
|
|
6
6
|
import { QWEN_OAUTH_BASE_URL } from "./constants.js";
|
|
7
7
|
/**
|
|
8
8
|
* Potential endpoints for API key retrieval
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key-exchange.js","sourceRoot":"","sources":["../src/api-key-exchange.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api-key-exchange.js","sourceRoot":"","sources":["../src/api-key-exchange.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQrD;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,wBAAwB;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,UAAkB;IACnD,QAAQ,CAAC,gDAAgD,CAAC,CAAC;IAE3D,KAAK,MAAM,QAAQ,IAAI,iBAAiB,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,GAAG,mBAAmB,GAAG,QAAQ,EAAE,CAAC;QAEhD,IAAI,CAAC;YACH,QAAQ,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAC;YAEpC,MAAM,QAAQ,GAAG,M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AoC,CAAC,CAAC;QAE/C,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,UAAU,SAAS,EAAE;YACnD,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,KAAK,EAAE;aACnC;SACF,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;YAChB,OAAO,CAAC,iCAAiC,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;QACd,CAAC;QAED,QAAQ,CAAC,yBAAyB,EAAE;YAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;SAChC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Browser utilities for opening URLs
|
|
3
3
|
*/
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
|
-
import { Debouncer } from "./mutex.js";
|
|
5
|
+
import { Debouncer } from "./utils/mutex.js";
|
|
6
6
|
// Debouncer to prevent multiple rapid browser opens
|
|
7
7
|
const browserDebouncer = new Debouncer();
|
|
8
8
|
/**
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAE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gBAC7C,MAAM,QAAQ,GAAG;oBACf,eAAe;oBACf,SAAS;oBACT,UAAU;oBACV,eAAe;oBACf,gBAAgB;iBACjB,CAAC;gBAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;oBAC/B,IAAI,CAAC;wBACH,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE;4BACzC,KAAK,EAAE,QAAQ;4BACf,QAAQ,EAAE,IAAI;yBACf,CAAC,CAAC;wBACH,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC;wBACvB,OAAO,CAAC,gBAAgB;oBAC1B,CAAC;oBAAC,MAAM,CAAC;wBACP,mBAAmB;wBACnB,SAAS;oBACX,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iDAAiD;IACnD,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Qwen OAuth Plugin for OpenCode
|
|
3
|
-
*
|
|
4
|
-
* With proactive token refresh via custom fetch loader
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
3
|
+
* Clean architecture with separated concerns
|
|
7
4
|
*/
|
|
8
5
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
9
6
|
export declare const QwenOAuthPlugin: Plugin;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAa/D,eAAO,MAAM,eAAe,EAAE,MAyK7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|