@scalar/fastify-api-reference 1.26.2 → 1.28.2

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,36 @@
1
1
  # @scalar/fastify-api-reference
2
2
 
3
+ ## 1.28.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [01f2610]
8
+ - @scalar/core@0.2.0
9
+
10
+ ## 1.28.1
11
+
12
+ ## 1.28.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 5f9a8a2: feat!: remove the spec prefix, make content and url top-level attributes
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [5f9a8a2]
21
+ - @scalar/types@0.1.0
22
+ - @scalar/core@0.1.3
23
+ - @scalar/openapi-parser@0.10.10
24
+
25
+ ## 1.27.0
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [fc6a45e]
30
+ - @scalar/types@0.0.41
31
+ - @scalar/core@0.1.2
32
+ - @scalar/openapi-parser@0.10.10
33
+
3
34
  ## 1.26.2
4
35
 
5
36
  ## 1.26.1
package/README.md CHANGED
@@ -33,9 +33,7 @@ fastify.register(import('@scalar/fastify-api-reference'), {
33
33
  routePrefix: '/reference',
34
34
  configuration: {
35
35
  title: 'Our API Reference',
36
- spec: {
37
- url: '/openapi.json',
38
- },
36
+ url: '/openapi.json',
39
37
  },
40
38
  })
41
39
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAAmC,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAwC7F;;GAEG;AACH,eAAO,MAAM,WAAW,s4EAwEvB,CAAA;AASD,QAAA,MAAM,mBAAmB,sIAoMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"fastifyApiReference.d.ts","sourceRoot":"","sources":["../src/fastifyApiReference.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,KAAK,EAAmC,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAwC7F;;GAEG;AACH,eAAO,MAAM,WAAW,s4EAwEvB,CAAA;AASD,QAAA,MAAM,mBAAmB,sIAkMxB,CAAA;AAED,eAAe,mBAAmB,CAAA"}
@@ -3,7 +3,7 @@ import { fetchUrls } from '@scalar/openapi-parser/plugins/fetch-urls';
3
3
  import fp from 'fastify-plugin';
4
4
  import { slug } from 'github-slugger';
5
5
  import { getJavaScriptFile } from './utils/getJavaScriptFile.js';
6
- import { getHtmlDocument } from './packages/core/dist/libs/html-rendering/index.js';
6
+ import { getHtmlDocument } from './packages/core/dist/libs/html-rendering/html-rendering.js';
7
7
 
8
8
  /**
9
9
  * Path to the bundled Scalar JavaScript file
@@ -120,7 +120,7 @@ const fastifyApiReference = fp(async (fastify, options) => {
120
120
  ...givenConfiguration,
121
121
  };
122
122
  const specSource = (() => {
123
- const { content, url } = configuration?.spec ?? {};
123
+ const { content, url } = configuration ?? {};
124
124
  if (content)
125
125
  return {
126
126
  type: 'content',
@@ -247,10 +247,8 @@ const fastifyApiReference = fp(async (fastify, options) => {
247
247
  if (specSource.type !== 'url') {
248
248
  configuration = {
249
249
  ...configuration,
250
- spec: {
251
- // Use a relative URL in case we're proxied
252
- url: `.${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).json}`,
253
- },
250
+ // Use a relative URL in case we're proxied
251
+ url: `.${getOpenApiDocumentEndpoints(options.openApiDocumentEndpoints).json}`,
254
252
  };
255
253
  }
256
254
  // Respond with the HTML document