@scalar/nestjs-api-reference 0.1.73 → 0.2.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
@@ -81,3 +81,21 @@ app.use(
81
81
  }),
82
82
  )
83
83
  ```
84
+
85
+ ### Custom CDN
86
+
87
+ You can use a custom CDN ,default is `https://cdn.jsdelivr.net/npm/@scalar/api-reference`.
88
+
89
+ ```ts
90
+ import { apiReference } from '@scalar/nestjs-api-reference'
91
+
92
+ app.use(
93
+ '/reference',
94
+ apiReference({
95
+ cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference',
96
+ spec: {
97
+ content: OpenApiSpecification,
98
+ },
99
+ }),
100
+ )
101
+ ```
package/dist/index.cjs CHANGED
@@ -104,7 +104,7 @@ var ApiReference = (options) => {
104
104
  id="api-reference"
105
105
  type="application/json"
106
106
  data-configuration="${JSON.stringify(options).split('"').join("&quot;")}">${options.spec?.content ? typeof options.spec?.content === "function" ? JSON.stringify(options.spec?.content()) : JSON.stringify(options.spec?.content) : ""}</script>
107
- <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
107
+ <script src="${options.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
108
108
  `;
109
109
  };
110
110
  function apiReference(options) {
package/dist/index.d.cts CHANGED
@@ -5,8 +5,11 @@ import { ServerResponse } from 'http';
5
5
 
6
6
  type NestJSReferenceConfiguration = ReferenceConfiguration & {
7
7
  withFastify?: boolean;
8
+ cdn?: string;
9
+ };
10
+ type ApiReferenceOptions = ReferenceConfiguration & {
11
+ cdn?: string;
8
12
  };
9
- type ApiReferenceOptions = ReferenceConfiguration;
10
13
  /**
11
14
  * The custom theme CSS for the API Reference.
12
15
  */
package/dist/index.d.ts CHANGED
@@ -5,8 +5,11 @@ import { ServerResponse } from 'http';
5
5
 
6
6
  type NestJSReferenceConfiguration = ReferenceConfiguration & {
7
7
  withFastify?: boolean;
8
+ cdn?: string;
9
+ };
10
+ type ApiReferenceOptions = ReferenceConfiguration & {
11
+ cdn?: string;
8
12
  };
9
- type ApiReferenceOptions = ReferenceConfiguration;
10
13
  /**
11
14
  * The custom theme CSS for the API Reference.
12
15
  */
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ var ApiReference = (options) => {
76
76
  id="api-reference"
77
77
  type="application/json"
78
78
  data-configuration="${JSON.stringify(options).split('"').join("&quot;")}">${options.spec?.content ? typeof options.spec?.content === "function" ? JSON.stringify(options.spec?.content()) : JSON.stringify(options.spec?.content) : ""}</script>
79
- <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
79
+ <script src="${options.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
80
80
  `;
81
81
  };
82
82
  function apiReference(options) {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Scalar (https://github.com/scalar)",
6
6
  "homepage": "https://github.com/scalar/scalar",
7
7
  "bugs": "https://github.com/scalar/scalar/issues/new/choose",
8
- "version": "0.1.73",
8
+ "version": "0.2.1",
9
9
  "engines": {
10
10
  "node": ">=18"
11
11
  },
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "express": "^4.18.2",
38
- "@scalar/api-reference": "1.18.6"
38
+ "@scalar/api-reference": "1.19.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/express": "^4.17.21",