@scalar/import 0.0.1 → 0.0.3
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/CHANGELOG.md +13 -0
- package/README.md +5 -3
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scalar/import
|
|
2
2
|
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [7323370]
|
|
8
|
+
- @scalar/openapi-parser@0.8.8
|
|
9
|
+
|
|
10
|
+
## 0.0.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 05f20e4: fix: sandbox links with uppercase letters can not be resolved
|
|
15
|
+
|
|
3
16
|
## 0.0.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -20,10 +20,12 @@ Find any OpenAPI/Swagger document URL in any content:
|
|
|
20
20
|
```ts
|
|
21
21
|
import { resolve } from '@scalar/import'
|
|
22
22
|
|
|
23
|
-
// Get the
|
|
24
|
-
const result = await resolve(
|
|
23
|
+
// Get the raw file URL from a GitHub link
|
|
24
|
+
const result = await resolve(
|
|
25
|
+
'https://github.com/outline/openapi/blob/main/spec3.yml',
|
|
26
|
+
)
|
|
25
27
|
|
|
26
|
-
// https://
|
|
28
|
+
// https://raw.githubusercontent.com/outline/openapi/refs/heads/main/spec3.yml
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
## Features
|
package/dist/resolve.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Find an OpenAPI document URL in the HTML of @scalar/api-reference and other places.
|
|
3
3
|
* This is useful to open the OpenAPI document from basically any source.
|
|
4
4
|
*/
|
|
5
|
-
export declare function resolve(value?: string): Promise<string | Record<string, any> | undefined>;
|
|
5
|
+
export declare function resolve(value?: string | null): Promise<string | Record<string, any> | undefined>;
|
|
6
6
|
//# sourceMappingURL=resolve.d.ts.map
|
package/dist/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,KAAK,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,CA0DnD"}
|
package/dist/resolve.js
CHANGED
|
@@ -20,7 +20,7 @@ async function resolve(value) {
|
|
|
20
20
|
return value;
|
|
21
21
|
}
|
|
22
22
|
// https://sandbox.scalar.com
|
|
23
|
-
const sandboxUrl = value.match(/https:\/\/sandbox\.scalar\.com\/(p|e)\/([a-
|
|
23
|
+
const sandboxUrl = value.match(/https:\/\/sandbox\.scalar\.com\/(p|e)\/([a-zA-Z0-9]+)/);
|
|
24
24
|
if (sandboxUrl?.[2]) {
|
|
25
25
|
return `https://sandbox.scalar.com/files/${sandboxUrl[2]}/openapi.yaml`;
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"postman",
|
|
17
17
|
"scalar"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.0.
|
|
19
|
+
"version": "0.0.3",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
],
|
|
36
36
|
"module": "dist/index.js",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@scalar/openapi-parser": "0.8.
|
|
38
|
+
"@scalar/openapi-parser": "0.8.8"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"vite": "^5.
|
|
41
|
+
"vite": "^5.4.9",
|
|
42
42
|
"@scalar/build-tooling": "0.1.11"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|