@scalar/mock-server 0.2.83 → 0.2.84

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,12 @@
1
1
  # @scalar/mock-server
2
2
 
3
+ ## 0.2.84
4
+
5
+ ### Patch Changes
6
+
7
+ - 7465487: refactor: use path aliases
8
+ - @scalar/oas-utils@0.2.80
9
+
3
10
  ## 0.2.83
4
11
 
5
12
  ### Patch Changes
@@ -1,5 +1,5 @@
1
- import { Hono } from 'hono';
2
1
  import type { MockServerOptions } from './types.js';
2
+ import { Hono } from 'hono';
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,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAA;AAKzC,OAAO,KAAK,EAAc,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAQ5D;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,uFAoDhE"}
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"}
@@ -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,6 +1,6 @@
1
+ import type { MockServerOptions } from '../types.js';
1
2
  import type { OpenAPI } from '@scalar/openapi-types';
2
3
  import type { Context } from 'hono';
3
- import type { MockServerOptions } from '../types.js';
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,UAAU,CAAA;AAGjD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,OAAO,EACV,SAAS,EAAE,OAAO,CAAC,SAAS,EAC5B,OAAO,EAAE,iBAAiB,YAiF3B"}
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,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,UAAU,CAAA;AAEvD;;;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
+ {"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":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA0B,MAAM,uBAAuB,CAAA;AAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAMhC;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,IAAI,EACT,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,QAuG1B"}
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.83",
19
+ "version": "0.2.84",
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.79",
42
- "@scalar/openapi-parser": "0.8.10",
43
- "@scalar/openapi-types": "0.1.5"
41
+ "@scalar/oas-utils": "0.2.80",
42
+ "@scalar/openapi-types": "0.1.5",
43
+ "@scalar/openapi-parser": "0.8.10"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@hono/node-server": "^1.11.0",
47
47
  "@types/node": "^20.14.10",
48
- "@scalar/hono-api-reference": "0.5.160",
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"}
@@ -1,6 +0,0 @@
1
- export * from './findPreferredResponseKey.js';
2
- export * from './getOpenAuthTokenUrls.js';
3
- export * from './getOperations.js';
4
- export * from './honoRouteFromPath.js';
5
- export * from './isAuthenticationRequired.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -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"}