@scalar/mock-server 0.2.75 → 0.2.77

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,23 @@
1
1
  # @scalar/mock-server
2
2
 
3
+ ## 0.2.77
4
+
5
+ ### Patch Changes
6
+
7
+ - 8eddb5b: fix: openapi endpoints don’t have a YAML content type header
8
+ - Updated dependencies [82f7c35]
9
+ - Updated dependencies [3421489]
10
+ - @scalar/oas-utils@0.2.73
11
+
12
+ ## 0.2.76
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [4bcaa75]
17
+ - Updated dependencies [9eb6650]
18
+ - Updated dependencies [c98a99c]
19
+ - @scalar/oas-utils@0.2.72
20
+
3
21
  ## 0.2.75
4
22
 
5
23
  ### 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, import("hono/utils/http-status").StatusCode, "text">) | (Response & import("hono").TypedResponse<{
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;;;;;;;;kBAwCjC"}
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.75",
19
+ "version": "0.2.77",
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.71",
42
41
  "@scalar/openapi-parser": "0.8.9",
42
+ "@scalar/oas-utils": "0.2.73",
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/build-tooling": "0.1.12",
49
- "@scalar/hono-api-reference": "0.5.159"
48
+ "@scalar/hono-api-reference": "0.5.159",
49
+ "@scalar/build-tooling": "0.1.12"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "scalar-build-rollup",