@scalar/express-api-reference 0.4.163 → 0.4.164

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
@@ -87,3 +87,11 @@ app.use(
87
87
  }),
88
88
  )
89
89
  ```
90
+
91
+ ## Community
92
+
93
+ We are API nerds. You too? Let’s chat on Discord: <https://discord.gg/scalar>
94
+
95
+ ## License
96
+
97
+ The source code in this repository is licensed under [MIT](https://github.com/scalar/scalar/blob/main/LICENSE).
package/dist/index.cjs CHANGED
@@ -122,13 +122,19 @@ var customThemeCSS = `
122
122
  --scalar-radius-xl: 3px;
123
123
  }
124
124
  `;
125
- var ApiReference = (options) => {
125
+ var ApiReference = (configuration) => {
126
+ const defaultConfiguration = {
127
+ _integration: "express"
128
+ };
126
129
  return `
127
130
  <script
128
131
  id="api-reference"
129
132
  type="application/json"
130
- 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>
131
- <script src="${options.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
133
+ data-configuration="${JSON.stringify({
134
+ ...defaultConfiguration,
135
+ ...configuration
136
+ }).split('"').join("&quot;")}">${configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""}</script>
137
+ <script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
132
138
  `;
133
139
  };
134
140
  function apiReference(options) {
package/dist/index.d.cts CHANGED
@@ -11,7 +11,7 @@ declare const customThemeCSS = "\n/* basic theme */\n.light-mode {\n --scalar-c
11
11
  /**
12
12
  * The HTML to load the @scalar/api-reference package.
13
13
  */
14
- declare const ApiReference: (options: ApiReferenceOptions) => string;
14
+ declare const ApiReference: (configuration: ApiReferenceOptions) => string;
15
15
  /**
16
16
  * The HTML template to render the API Reference.
17
17
  */
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ declare const customThemeCSS = "\n/* basic theme */\n.light-mode {\n --scalar-c
11
11
  /**
12
12
  * The HTML to load the @scalar/api-reference package.
13
13
  */
14
- declare const ApiReference: (options: ApiReferenceOptions) => string;
14
+ declare const ApiReference: (configuration: ApiReferenceOptions) => string;
15
15
  /**
16
16
  * The HTML template to render the API Reference.
17
17
  */
package/dist/index.js CHANGED
@@ -94,13 +94,19 @@ var customThemeCSS = `
94
94
  --scalar-radius-xl: 3px;
95
95
  }
96
96
  `;
97
- var ApiReference = (options) => {
97
+ var ApiReference = (configuration) => {
98
+ const defaultConfiguration = {
99
+ _integration: "express"
100
+ };
98
101
  return `
99
102
  <script
100
103
  id="api-reference"
101
104
  type="application/json"
102
- 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>
103
- <script src="${options.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
105
+ data-configuration="${JSON.stringify({
106
+ ...defaultConfiguration,
107
+ ...configuration
108
+ }).split('"').join("&quot;")}">${configuration.spec?.content ? typeof configuration.spec?.content === "function" ? JSON.stringify(configuration.spec?.content()) : JSON.stringify(configuration.spec?.content) : ""}</script>
109
+ <script src="${configuration.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference"}"></script>
104
110
  `;
105
111
  };
106
112
  function apiReference(options) {
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/scalar/scalar.git",
11
11
  "directory": "packages/express-api-reference"
12
12
  },
13
- "version": "0.4.163",
13
+ "version": "0.4.164",
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.15"
37
+ "@scalar/types": "0.0.16"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/express": "^4.17.21",
@@ -42,7 +42,7 @@
42
42
  "tsup": "^7.2.0",
43
43
  "vite": "^5.2.10",
44
44
  "vitest": "^1.6.0",
45
- "@scalar/api-reference": "1.25.37"
45
+ "@scalar/api-reference": "1.25.38"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "tsup ./src/index.ts --format esm,cjs --dts",