@scalar/nestjs-api-reference 0.3.190 → 0.4.1

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/README.md CHANGED
@@ -40,9 +40,7 @@ const OpenApiSpecification =
40
40
  app.use(
41
41
  '/reference',
42
42
  apiReference({
43
- spec: {
44
- content: document,
45
- },
43
+ content: document,
46
44
  }),
47
45
  )
48
46
  ```
@@ -55,9 +53,7 @@ import { apiReference } from '@scalar/nestjs-api-reference'
55
53
  app.use(
56
54
  '/reference',
57
55
  apiReference({
58
- spec: {
59
- url: '/openapi.json',
60
- },
56
+ url: '/openapi.json',
61
57
  }),
62
58
  )
63
59
  ```
@@ -75,9 +71,7 @@ app.use(
75
71
  '/reference',
76
72
  apiReference({
77
73
  theme: 'purple',
78
- spec: {
79
- url: '/openapi.json',
80
- },
74
+ url: '/openapi.json',
81
75
  }),
82
76
  )
83
77
  ```
@@ -97,9 +91,7 @@ app.use(
97
91
  '/reference',
98
92
  apiReference({
99
93
  cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@latest',
100
- spec: {
101
- content: OpenApiSpecification,
102
- },
94
+ content: OpenApiSpecification,
103
95
  }),
104
96
  )
105
97
  ```
package/dist/index.cjs CHANGED
@@ -104,7 +104,7 @@ var ApiReference = (options) => {
104
104
  <script
105
105
  id="api-reference"
106
106
  type="application/json"
107
- data-configuration="${JSON.stringify(configuration).split('"').join("&quot;")}">${configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""}</script>
107
+ data-configuration="${JSON.stringify(configuration).split('"').join("&quot;")}">${configuration.content ? typeof configuration.content === "function" ? JSON.stringify(configuration.content()) : JSON.stringify(configuration.content) : ""}</script>
108
108
  <script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
109
109
  `;
110
110
  };
package/dist/index.d.cts CHANGED
@@ -1,13 +1,13 @@
1
- import { ReferenceConfiguration } from '@scalar/types/legacy';
1
+ import { ServerResponse } from 'node:http';
2
+ import { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
3
  import { Request, Response } from 'express';
3
4
  import { FastifyRequest } from 'fastify';
4
- import { ServerResponse } from 'node:http';
5
5
 
6
- type NestJSReferenceConfiguration = ReferenceConfiguration & {
6
+ type NestJSReferenceConfiguration = ApiReferenceConfiguration & {
7
7
  withFastify?: boolean;
8
8
  cdn?: string;
9
9
  };
10
- type ApiReferenceOptions = ReferenceConfiguration & {
10
+ type ApiReferenceOptions = ApiReferenceConfiguration & {
11
11
  cdn?: string;
12
12
  };
13
13
  /**
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { ReferenceConfiguration } from '@scalar/types/legacy';
1
+ import { ServerResponse } from 'node:http';
2
+ import { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
3
  import { Request, Response } from 'express';
3
4
  import { FastifyRequest } from 'fastify';
4
- import { ServerResponse } from 'node:http';
5
5
 
6
- type NestJSReferenceConfiguration = ReferenceConfiguration & {
6
+ type NestJSReferenceConfiguration = ApiReferenceConfiguration & {
7
7
  withFastify?: boolean;
8
8
  cdn?: string;
9
9
  };
10
- type ApiReferenceOptions = ReferenceConfiguration & {
10
+ type ApiReferenceOptions = ApiReferenceConfiguration & {
11
11
  cdn?: string;
12
12
  };
13
13
  /**
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ var ApiReference = (options) => {
76
76
  <script
77
77
  id="api-reference"
78
78
  type="application/json"
79
- data-configuration="${JSON.stringify(configuration).split('"').join("&quot;")}">${configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""}</script>
79
+ data-configuration="${JSON.stringify(configuration).split('"').join("&quot;")}">${configuration.content ? typeof configuration.content === "function" ? JSON.stringify(configuration.content()) : JSON.stringify(configuration.content) : ""}</script>
80
80
  <script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
81
81
  `;
82
82
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "integrations/nestjs"
12
12
  },
13
- "version": "0.3.190",
13
+ "version": "0.4.1",
14
14
  "engines": {
15
15
  "node": ">=18"
16
16
  },
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "module": "dist/index.js",
36
36
  "dependencies": {
37
- "@scalar/types": "0.0.40"
37
+ "@scalar/types": "0.1.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/express": "^4.17.21",
@@ -43,7 +43,7 @@
43
43
  "tsup": "^7.2.0",
44
44
  "vite": "^5.4.10",
45
45
  "vitest": "^1.6.0",
46
- "@scalar/api-reference": "1.26.1"
46
+ "@scalar/api-reference": "1.28.3"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsup ./src/index.ts --format esm,cjs --dts",