@scalar/mock-server 0.2.121 → 0.2.123

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,22 @@
1
1
  # @scalar/mock-server
2
2
 
3
+ ## 0.2.123
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ab98841]
8
+ - Updated dependencies [db9ebbc]
9
+ - @scalar/oas-utils@0.2.116
10
+
11
+ ## 0.2.122
12
+
13
+ ### Patch Changes
14
+
15
+ - 9d552b0: feat: use stricter Node tsconfig
16
+ - Updated dependencies [0d8a24f]
17
+ - @scalar/openapi-parser@0.10.10
18
+ - @scalar/oas-utils@0.2.115
19
+
3
20
  ## 0.2.121
4
21
 
5
22
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import type { MockServerOptions } from './types.js';
2
+ import type { MockServerOptions } from './types.ts';
3
3
  /**
4
4
  * Create a mock server instance
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"createMockServer.d.ts","sourceRoot":"","sources":["../src/createMockServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAgB,MAAM,MAAM,CAAA;AAGzC,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAW5D;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,uFA+ChE"}
1
+ {"version":3,"file":"createMockServer.d.ts","sourceRoot":"","sources":["../src/createMockServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAA;AAGzC,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAW/D;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,uFA+ChE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createMockServer.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMockServer.test.d.ts","sourceRoot":"","sources":["../src/createMockServer.test.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './createMockServer.js';
1
+ export { createMockServer } from './createMockServer.ts';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { OpenAPI } from '@scalar/openapi-types';
2
2
  import type { Context } from 'hono';
3
- import type { MockServerOptions } from '../types.js';
3
+ import type { MockServerOptions } from '../types.ts';
4
4
  /**
5
5
  * Mock any response
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mockAnyResponse.d.ts","sourceRoot":"","sources":["../../src/routes/mockAnyResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAMnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGhD;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,iBAAiB,YAuEnG"}
1
+ {"version":3,"file":"mockAnyResponse.d.ts","sourceRoot":"","sources":["../../src/routes/mockAnyResponse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAMnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,iBAAiB,YAyEnG"}
@@ -35,7 +35,9 @@ function mockAnyResponse(c, operation, options) {
35
35
  const acceptedContentType = accepts(c, {
36
36
  header: 'Accept',
37
37
  supports: supportedContentTypes,
38
- default: supportedContentTypes.includes('application/json') ? 'application/json' : supportedContentTypes[0],
38
+ default: supportedContentTypes.includes('application/json')
39
+ ? 'application/json'
40
+ : (supportedContentTypes[0] ?? 'text/plain;charset=UTF-8'),
39
41
  });
40
42
  c.header('Content-Type', acceptedContentType);
41
43
  const acceptedResponse = preferredResponse?.content?.[acceptedContentType];
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=findPreferredResponseKey.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findPreferredResponseKey.test.d.ts","sourceRoot":"","sources":["../../src/utils/findPreferredResponseKey.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getOpenAuthTokenUrls.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOpenAuthTokenUrls.test.d.ts","sourceRoot":"","sources":["../../src/utils/getOpenAuthTokenUrls.test.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
- import { type HttpMethod } from '../types.js';
2
+ import { type HttpMethod } from '../types.ts';
3
3
  /**
4
4
  * Takes a dereferenced OpenAPI document and returns all operations.
5
5
  * Ignores other attributes, like summary, parameters, etc.
@@ -1 +1 @@
1
- {"version":3,"file":"getOperations.d.ts","sourceRoot":"","sources":["../../src/utils/getOperations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAEtD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,cAAc,GAAG,WAAW,CAAC,cAAc,GACtF,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAUvC"}
1
+ {"version":3,"file":"getOperations.d.ts","sourceRoot":"","sources":["../../src/utils/getOperations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,YAAY,CAAA;AAEzD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,cAAc,GAAG,WAAW,CAAC,cAAc,GACtF,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAUvC"}
@@ -3,8 +3,5 @@ import type { Context } from 'hono';
3
3
  /**
4
4
  * Handles authentication for incoming requests based on the OpenAPI specification.
5
5
  */
6
- export declare function handleAuthentication(schema?: OpenAPI.Document, operation?: OpenAPI.Operation): (c: Context, next: () => Promise<void>) => Promise<(Response & import("hono").TypedResponse<{
7
- error: string;
8
- message: string;
9
- }, 401, "json">) | undefined>;
6
+ export declare function handleAuthentication(schema?: OpenAPI.Document, operation?: OpenAPI.Operation): (c: Context, next: () => Promise<void>) => Promise<Response | void>;
10
7
  //# sourceMappingURL=handleAuthentication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleAuthentication.d.ts","sourceRoot":"","sources":["../../src/utils/handleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,OAC1E,OAAO,QAAQ,MAAM,OAAO,CAAC,IAAI,CAAC;;;8BAmHpD"}
1
+ {"version":3,"file":"handleAuthentication.d.ts","sourceRoot":"","sources":["../../src/utils/handleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,OAC1E,OAAO,QAAQ,MAAM,OAAO,CAAC,IAAI,CAAC,KAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAmH/E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=honoRouteFromPath.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honoRouteFromPath.test.d.ts","sourceRoot":"","sources":["../../src/utils/honoRouteFromPath.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isAuthenticationRequired.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isAuthenticationRequired.test.d.ts","sourceRoot":"","sources":["../../src/utils/isAuthenticationRequired.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "swagger",
17
17
  "cli"
18
18
  ],
19
- "version": "0.2.121",
19
+ "version": "0.2.123",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -38,16 +38,16 @@
38
38
  "dependencies": {
39
39
  "hono": "^4.6.5",
40
40
  "object-to-xml": "^2.0.0",
41
- "@scalar/oas-utils": "0.2.114",
42
- "@scalar/openapi-parser": "0.10.9",
41
+ "@scalar/oas-utils": "0.2.116",
42
+ "@scalar/openapi-parser": "0.10.10",
43
43
  "@scalar/openapi-types": "0.1.9"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@hono/node-server": "^1.11.0",
47
47
  "@types/node": "^20.17.10",
48
48
  "vite": "^5.4.10",
49
- "@scalar/hono-api-reference": "0.5.183",
50
- "@scalar/build-tooling": "0.1.17"
49
+ "@scalar/build-tooling": "0.1.17",
50
+ "@scalar/hono-api-reference": "0.5.184"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "scalar-build-rollup",