@scalar/mock-server 0.2.83 → 0.2.85
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/dist/createMockServer.d.ts +1 -1
- package/dist/createMockServer.d.ts.map +1 -1
- package/dist/createMockServer.js +5 -5
- package/dist/routes/mockAnyResponse.d.ts +1 -1
- package/dist/routes/mockAnyResponse.d.ts.map +1 -1
- package/dist/routes/mockAnyResponse.js +1 -1
- package/dist/utils/createOpenApiDefinition.d.ts +4 -0
- package/dist/utils/createOpenApiDefinition.d.ts.map +1 -0
- package/dist/utils/getOperations.d.ts +1 -1
- package/dist/utils/getOperations.d.ts.map +1 -1
- package/dist/utils/setupAuthenticationRoutes.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/utils/createOpenAPIDocument.d.ts +0 -4
- package/dist/utils/createOpenAPIDocument.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/index.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMockServer.d.ts","sourceRoot":"","sources":["../src/createMockServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMockServer.d.ts","sourceRoot":"","sources":["../src/createMockServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAS5D,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAA;AAMzC;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,uFAoDhE"}
|
package/dist/createMockServer.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { openapi } from '@scalar/openapi-parser';
|
|
2
|
-
import { Hono } from 'hono';
|
|
3
|
-
import { cors } from 'hono/cors';
|
|
4
|
-
import { mockAnyResponse } from './routes/mockAnyResponse.js';
|
|
5
|
-
import { respondWithOpenApiDocument } from './routes/respondWithOpenApiDocument.js';
|
|
6
1
|
import { getOperations } from './utils/getOperations.js';
|
|
7
2
|
import { handleAuthentication } from './utils/handleAuthentication.js';
|
|
8
3
|
import { honoRouteFromPath } from './utils/honoRouteFromPath.js';
|
|
9
4
|
import { isAuthenticationRequired } from './utils/isAuthenticationRequired.js';
|
|
10
5
|
import { logAuthenticationInstructions } from './utils/logAuthenticationInstructions.js';
|
|
11
6
|
import { setupAuthenticationRoutes } from './utils/setupAuthenticationRoutes.js';
|
|
7
|
+
import { openapi } from '@scalar/openapi-parser';
|
|
8
|
+
import { Hono } from 'hono';
|
|
9
|
+
import { cors } from 'hono/cors';
|
|
10
|
+
import { mockAnyResponse } from './routes/mockAnyResponse.js';
|
|
11
|
+
import { respondWithOpenApiDocument } from './routes/respondWithOpenApiDocument.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Create a mock server instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockAnyResponse.d.ts","sourceRoot":"","sources":["../../src/routes/mockAnyResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockAnyResponse.d.ts","sourceRoot":"","sources":["../../src/routes/mockAnyResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAMnC;;GAEG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,OAAO,EACV,SAAS,EAAE,OAAO,CAAC,SAAS,EAC5B,OAAO,EAAE,iBAAiB,YAiF3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { findPreferredResponseKey } from '../utils/findPreferredResponseKey.js';
|
|
1
2
|
import { getExampleFromSchema } from '@scalar/oas-utils/spec-getters';
|
|
2
3
|
import { accepts } from 'hono/accepts';
|
|
3
4
|
import objectToXML from 'object-to-xml';
|
|
4
|
-
import { findPreferredResponseKey } from '../utils/findPreferredResponseKey.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Mock any response
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
/** Helper function create an OpenAPI document with security schemss */
|
|
3
|
+
export declare function createOpenApiDefinition(securitySchemes: Record<string, OpenAPIV3.SecuritySchemeObject | OpenAPIV3_1.SecuritySchemeObject>): OpenAPIV3_1.Document;
|
|
4
|
+
//# sourceMappingURL=createOpenApiDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOpenApiDefinition.d.ts","sourceRoot":"","sources":["../../src/utils/createOpenApiDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnE,uEAAuE;AACvE,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,MAAM,CACrB,MAAM,EACN,SAAS,CAAC,oBAAoB,GAAG,WAAW,CAAC,oBAAoB,CAClE,GACA,WAAW,CAAC,QAAQ,CAMtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
1
|
import { type HttpMethod } from '../types.js';
|
|
2
|
+
import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
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,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAE9B
|
|
1
|
+
{"version":3,"file":"getOperations.d.ts","sourceRoot":"","sources":["../../src/utils/getOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAE9B;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,CAAC,EACD,SAAS,CAAC,cAAc,GACxB,SAAS,CAAC,cAAc,GACxB,WAAW,CAAC,cAAc,GAC7B,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAUvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupAuthenticationRoutes.d.ts","sourceRoot":"","sources":["../../src/utils/setupAuthenticationRoutes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupAuthenticationRoutes.d.ts","sourceRoot":"","sources":["../../src/utils/setupAuthenticationRoutes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAA0B,MAAM,uBAAuB,CAAA;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAIhC;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,IAAI,EACT,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,QAuG1B"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"swagger",
|
|
17
17
|
"cli"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.2.
|
|
19
|
+
"version": "0.2.85",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -38,15 +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.
|
|
41
|
+
"@scalar/oas-utils": "0.2.81",
|
|
42
42
|
"@scalar/openapi-parser": "0.8.10",
|
|
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
|
-
"
|
|
49
|
-
"@scalar/build-tooling": "0.1.12"
|
|
48
|
+
"vite": "^5.4.10",
|
|
49
|
+
"@scalar/build-tooling": "0.1.12",
|
|
50
|
+
"@scalar/hono-api-reference": "0.5.161"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
53
|
"build": "scalar-build-rollup",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
-
/** Helper function create an OpenAPI document with security schemss */
|
|
3
|
-
export declare function createOpenAPIDocument(securitySchemes: Record<string, OpenAPIV3.SecuritySchemeObject | OpenAPIV3_1.SecuritySchemeObject>): OpenAPIV3.Document;
|
|
4
|
-
//# sourceMappingURL=createOpenAPIDocument.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createOpenAPIDocument.d.ts","sourceRoot":"","sources":["../../src/utils/createOpenAPIDocument.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnE,uEAAuE;AACvE,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,MAAM,CACrB,MAAM,EACN,SAAS,CAAC,oBAAoB,GAAG,WAAW,CAAC,oBAAoB,CAClE,GACA,SAAS,CAAC,QAAQ,CAMpB"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA"}
|