@scalar/nestjs-api-reference 1.1.7 → 1.1.9
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/dist/index.cjs +9 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
29
|
// src/nestJSApiReference.ts
|
|
30
|
-
var
|
|
30
|
+
var import_client_side_rendering = require("@scalar/client-side-rendering");
|
|
31
31
|
var customThemeCSS = `
|
|
32
32
|
/* basic theme */
|
|
33
33
|
.light-mode {
|
|
@@ -104,7 +104,14 @@ function apiReference(givenConfiguration) {
|
|
|
104
104
|
...DEFAULT_CONFIGURATION,
|
|
105
105
|
...givenConfiguration
|
|
106
106
|
};
|
|
107
|
-
const content = /* @__PURE__ */ __name(() =>
|
|
107
|
+
const content = /* @__PURE__ */ __name(() => {
|
|
108
|
+
const { cdn, pageTitle, ...config } = configuration;
|
|
109
|
+
return (0, import_client_side_rendering.renderApiReference)({
|
|
110
|
+
config,
|
|
111
|
+
pageTitle,
|
|
112
|
+
cdn
|
|
113
|
+
}, customThemeCSS);
|
|
114
|
+
}, "content");
|
|
108
115
|
if (givenConfiguration.withFastify) {
|
|
109
116
|
return (_req, res) => {
|
|
110
117
|
res.writeHead(200, {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerResponse } from 'node:http';
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
3
|
import { FastifyRequest } from 'fastify';
|
|
4
|
-
import { HtmlRenderingConfiguration } from '@scalar/
|
|
4
|
+
import { HtmlRenderingConfiguration } from '@scalar/client-side-rendering';
|
|
5
5
|
|
|
6
6
|
type ApiReferenceOptions = Partial<HtmlRenderingConfiguration>;
|
|
7
7
|
type NestJSReferenceConfiguration = ApiReferenceOptions & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerResponse } from 'node:http';
|
|
2
2
|
import { Request, Response } from 'express';
|
|
3
3
|
import { FastifyRequest } from 'fastify';
|
|
4
|
-
import { HtmlRenderingConfiguration } from '@scalar/
|
|
4
|
+
import { HtmlRenderingConfiguration } from '@scalar/client-side-rendering';
|
|
5
5
|
|
|
6
6
|
type ApiReferenceOptions = Partial<HtmlRenderingConfiguration>;
|
|
7
7
|
type NestJSReferenceConfiguration = ApiReferenceOptions & {
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
4
|
// src/nestJSApiReference.ts
|
|
5
|
-
import {
|
|
5
|
+
import { renderApiReference } from "@scalar/client-side-rendering";
|
|
6
6
|
var customThemeCSS = `
|
|
7
7
|
/* basic theme */
|
|
8
8
|
.light-mode {
|
|
@@ -79,7 +79,14 @@ function apiReference(givenConfiguration) {
|
|
|
79
79
|
...DEFAULT_CONFIGURATION,
|
|
80
80
|
...givenConfiguration
|
|
81
81
|
};
|
|
82
|
-
const content = /* @__PURE__ */ __name(() =>
|
|
82
|
+
const content = /* @__PURE__ */ __name(() => {
|
|
83
|
+
const { cdn, pageTitle, ...config } = configuration;
|
|
84
|
+
return renderApiReference({
|
|
85
|
+
config,
|
|
86
|
+
pageTitle,
|
|
87
|
+
cdn
|
|
88
|
+
}, customThemeCSS);
|
|
89
|
+
}, "content");
|
|
83
90
|
if (givenConfiguration.withFastify) {
|
|
84
91
|
return (_req, res) => {
|
|
85
92
|
res.writeHead(200, {
|
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": "1.1.
|
|
13
|
+
"version": "1.1.9",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=22"
|
|
16
16
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"documentation": "https://scalar.com/products/api-references/integrations/nestjs"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@scalar/
|
|
52
|
+
"@scalar/client-side-rendering": "0.1.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@nestjs/common": "^11.1.11",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"docker:run-fastify": "docker run -p 5057:5057 nestjs-api-reference-fastify",
|
|
78
78
|
"lint:check": "eslint .",
|
|
79
79
|
"lint:fix": "eslint . --fix",
|
|
80
|
-
"test": "vitest",
|
|
80
|
+
"test": "vitest --run",
|
|
81
81
|
"types:check": "tsc --noEmit"
|
|
82
82
|
}
|
|
83
83
|
}
|