@scalar/mock-server 0.2.76 → 0.2.78
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
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @scalar/mock-server
|
|
2
2
|
|
|
3
|
+
## 0.2.78
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [ac55d0f]
|
|
8
|
+
- @scalar/oas-utils@0.2.74
|
|
9
|
+
|
|
10
|
+
## 0.2.77
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 8eddb5b: fix: openapi endpoints don’t have a YAML content type header
|
|
15
|
+
- Updated dependencies [82f7c35]
|
|
16
|
+
- Updated dependencies [3421489]
|
|
17
|
+
- @scalar/oas-utils@0.2.73
|
|
18
|
+
|
|
3
19
|
## 0.2.76
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -2,9 +2,9 @@ import type { Context } from 'hono';
|
|
|
2
2
|
/**
|
|
3
3
|
* OpenAPI endpoints
|
|
4
4
|
*/
|
|
5
|
-
export declare function respondWithOpenApiDocument(c: Context, input?: string | Record<string, any>, format?: 'json' | 'yaml'): Promise<(Response & import("hono").TypedResponse<{
|
|
5
|
+
export declare function respondWithOpenApiDocument(c: Context, input?: string | Record<string, any>, format?: 'json' | 'yaml'): Promise<(Response & import("hono").TypedResponse<"Not found", 404, "text">) | (Response & import("hono").TypedResponse<{
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
}, import("hono/utils/http-status").StatusCode, "json">) | (Response & import("hono").TypedResponse<string,
|
|
7
|
+
}, import("hono/utils/http-status").StatusCode, "json">) | (Response & import("hono").TypedResponse<string, 200, "text">) | (Response & import("hono").TypedResponse<{
|
|
8
8
|
error: string;
|
|
9
9
|
message: string;
|
|
10
10
|
}, 500, "json">) | (Response & import("hono").TypedResponse<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"respondWithOpenApiDocument.d.ts","sourceRoot":"","sources":["../../src/routes/respondWithOpenApiDocument.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,CAAC,EAAE,OAAO,EACV,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACpC,MAAM,GAAE,MAAM,GAAG,MAAe;;;;;;;;
|
|
1
|
+
{"version":3,"file":"respondWithOpenApiDocument.d.ts","sourceRoot":"","sources":["../../src/routes/respondWithOpenApiDocument.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,CAAC,EAAE,OAAO,EACV,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACpC,MAAM,GAAE,MAAM,GAAG,MAAe;;;;;;;;kBAyCjC"}
|
|
@@ -11,14 +11,15 @@ async function respondWithOpenApiDocument(c, input, format = 'json') {
|
|
|
11
11
|
const { specification } = await openapi().load(input).get();
|
|
12
12
|
// JSON
|
|
13
13
|
if (format === 'json') {
|
|
14
|
-
c.header('Content-Type', 'application/json');
|
|
15
14
|
return c.json(specification);
|
|
16
15
|
}
|
|
17
16
|
// YAML
|
|
18
17
|
try {
|
|
19
18
|
const yamlSpecification = await openapi().load(input).toYaml();
|
|
20
19
|
c.header('Content-Type', 'text/yaml');
|
|
21
|
-
return c.text(yamlSpecification
|
|
20
|
+
return c.text(yamlSpecification, 200, {
|
|
21
|
+
'Content-Type': 'application/yaml; charset=UTF-8',
|
|
22
|
+
});
|
|
22
23
|
}
|
|
23
24
|
catch (error) {
|
|
24
25
|
return c.json({
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"swagger",
|
|
17
17
|
"cli"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.78",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"hono": "^4.6.5",
|
|
40
40
|
"object-to-xml": "^2.0.0",
|
|
41
|
-
"@scalar/oas-utils": "0.2.
|
|
41
|
+
"@scalar/oas-utils": "0.2.74",
|
|
42
42
|
"@scalar/openapi-parser": "0.8.9",
|
|
43
43
|
"@scalar/openapi-types": "0.1.5"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@hono/node-server": "^1.11.0",
|
|
47
47
|
"@types/node": "^20.14.10",
|
|
48
|
-
"@scalar/
|
|
49
|
-
"@scalar/
|
|
48
|
+
"@scalar/build-tooling": "0.1.12",
|
|
49
|
+
"@scalar/hono-api-reference": "0.5.159"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "scalar-build-rollup",
|