rajt 0.0.78 → 0.0.80

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rajt",
3
3
  "description": "A serverless bundler layer, fully typed for AWS Lambda (Node.js and LLRT) and Cloudflare Workers.",
4
- "version": "0.0.78",
4
+ "version": "0.0.80",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
7
7
  "bin": {
package/src/create-app.ts CHANGED
@@ -111,7 +111,7 @@ export const createApp = <E extends Env>(options?: ServerOptions<E>) => {
111
111
  const routes = options?.routes || []
112
112
  for (const route of routes) {
113
113
  if (Array.isArray(route)) { // @ts-ignore
114
- app[route[0]](route[1], describeRoute(route[4]), ...mw(route[2], route[3]), ...resolve(getHandler(route[3]), route[3]))
114
+ app[route[0]](route[1], ...mw(route[2], route[3]), ...resolve(getHandler(route[3]), route[3]))
115
115
  } else { // @ts-ignore
116
116
  app[route.method](route.path, describeRoute(route.desc), ...mw(route.middlewares, route.name), ...resolve(route.handle, route.name))
117
117
  }
package/src/prod.ts CHANGED
@@ -4,7 +4,7 @@ import { Ability } from './auth'
4
4
  import createApp from './create-app'
5
5
 
6
6
  // @ts-ignore
7
- import '../../../.rajt/import-routes.mjs'
7
+ import '../../../.rajt/imports.mjs'
8
8
  // @ts-ignore
9
9
  import routes from '../../../.rajt/routes.json'
10
10
 
package/src/routes.ts CHANGED
@@ -63,7 +63,7 @@ function isZodSchema(obj: any): obj is z.ZodType {
63
63
  function ResolveDescribeSchema(obj: any, deep: boolean = false) {
64
64
  if (!obj || typeof obj !== 'object') return obj
65
65
  if (isZodSchema(obj))
66
- return { content: {'*/*': { schema: resolver(obj as unknown as StandardSchemaV1) }} }
66
+ return { content: {'application/json': { schema: resolver(obj as unknown as StandardSchemaV1) }} }
67
67
 
68
68
  if (obj.content && typeof obj.content == 'object') {
69
69
  for (const mediaType in obj.content) {
@@ -322,7 +322,7 @@ export async function cacheRoutes() {
322
322
  // @ts-ignore
323
323
  const openApi = await OAS.generateSpecs(createApp({ routes }), configs?.rajt || {})
324
324
 
325
- const iPath = join(__root, '.rajt/import-routes.mjs')
325
+ const iPath = join(__root, '.rajt/imports.mjs')
326
326
  ensureDir(iPath)
327
327
  writeFileSync(iPath, `// AUTO-GENERATED FILE - DO NOT EDIT
328
328
  ${env?.length ? `import { Envir } from '../node_modules/t0n/dist/index'\nEnvir.add({${env.map(([key, val]) => key +':'+ stringifyToJS(val)).join(',')}})` : ''}
@@ -361,7 +361,6 @@ try {
361
361
  route.path,
362
362
  route.middlewares,
363
363
  route.name,
364
- route.desc,
365
364
  ])))
366
365
  }
367
366