fusion-framework 1.2.4 → 1.2.5

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.
Binary file
Binary file
Binary file
Binary file
package/index.js CHANGED
@@ -134,7 +134,7 @@ header.fingerprint = () =>
134
134
  : {
135
135
  'X-Powered-By': 'Fusion Framework',
136
136
  'X-Framework': 'Fusion',
137
- ['X-Fusion-Version']: '1.2.4',
137
+ ['X-Fusion-Version']: '1.2.5',
138
138
  }
139
139
 
140
140
  function isThenable(value) {
@@ -259,10 +259,13 @@ function resolveHandlerRoute(classBasePath, template, className, methodName) {
259
259
  }
260
260
 
261
261
  function httpRoute(method, route, options = {}) {
262
+ // tags unset → inherit class route tags; tags: [] clears; tags: [...] overrides.
263
+ const tagsSet = Object.prototype.hasOwnProperty.call(options, 'tags')
262
264
  const meta = {
263
265
  method: String(method).toLowerCase(),
264
266
  template: route,
265
- tags: Array.isArray(options.tags) ? options.tags : [],
267
+ tagsSet,
268
+ tags: tagsSet ? (Array.isArray(options.tags) ? options.tags : []) : null,
266
269
  desc: options.desc ?? null,
267
270
  title: options.title ?? null,
268
271
  deprecated: !!options.deprecated,
@@ -274,6 +277,15 @@ function httpRoute(method, route, options = {}) {
274
277
  return wrap
275
278
  }
276
279
 
280
+ function mergeSwagger(methodSwagger, classSwagger) {
281
+ return {
282
+ tags: methodSwagger.tagsSet ? methodSwagger.tags : classSwagger.tags,
283
+ description: methodSwagger.desc ?? classSwagger.description,
284
+ title: methodSwagger.title ?? classSwagger.title,
285
+ deprecated: !!(methodSwagger.deprecated || classSwagger.deprecated),
286
+ }
287
+ }
288
+
277
289
  function httpGet(route, options = {}) {
278
290
  return httpRoute('get', route, options)
279
291
  }
@@ -311,12 +323,7 @@ function collectRouteSlots(ApiClass, classBasePath, classSwagger) {
311
323
  path: resolveHandlerRoute(classBasePath, meta.template, className, key),
312
324
  httpMethod: meta.method,
313
325
  handlerMethod: key,
314
- swagger: {
315
- tags: meta.tags,
316
- description: meta.desc,
317
- title: meta.title,
318
- deprecated: meta.deprecated,
319
- },
326
+ swagger: mergeSwagger(meta, classSwagger),
320
327
  })
321
328
  }
322
329
 
@@ -810,7 +817,12 @@ function swaggerUiHtml(swagger, openapiUrl, primaryName = null) {
810
817
  const showUrlInput = swagger.navbar?.showUrlInput !== false
811
818
  const hideUrlCss =
812
819
  navbarEnabled && !showUrlInput
813
- ? `<style>.topbar form { display: none !important; }</style>`
820
+ ? `<style>
821
+ .swagger-ui .topbar .download-url-wrapper input[type=text],
822
+ .swagger-ui .topbar .download-url-wrapper .download-url-button {
823
+ display: none !important;
824
+ }
825
+ </style>`
814
826
  : ''
815
827
  const standaloneScript = navbarEnabled
816
828
  ? `<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"></script>`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fusion-framework",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Class-based HTTP framework for Node.js, powered by a shared Rust core via N-API",
5
5
  "keywords": [
6
6
  "http",