Comparing version 2.0.59 to 2.0.60
@@ -1,2 +0,2 @@ | ||
import { KeysWithValNotEmptyObject, MidsReturnsIntersection, MidsParams } from '../utilities'; | ||
import { KeysWithValNotEmptyObject, MidsReturnsIntersection, MidsParams, ExcludeNeverKeysObj, Pretify } from '../utilities'; | ||
import { DataParser, BridgeHandler, InferDataParser, FilesConfig } from './handlers'; | ||
@@ -12,3 +12,14 @@ import { FormidableFile } from '../utilities'; | ||
} | ||
export type CreateHandler = <Resolve extends (p: { | ||
export type CreateHandler = <Resolve extends (p: Pretify<ExcludeNeverKeysObj<{ | ||
middlewares: MidsReturnsIntersection<Middelwares> extends never ? {} : MidsReturnsIntersection<Middelwares>; | ||
body: (InferDataParser<Body> extends never ? {} : InferDataParser<Body>) & (MidsParams<Middelwares>['body'] extends never ? {} : MidsParams<Middelwares>['body']); | ||
query: (InferDataParser<Query> extends never ? {} : InferDataParser<Query>) & (MidsParams<Middelwares>['query'] extends never ? {} : MidsParams<Middelwares>['query']); | ||
headers: (InferDataParser<Headers> extends never ? {} : InferDataParser<Headers>) & (MidsParams<Middelwares>['headers'] extends never ? {} : MidsParams<Middelwares>['headers']); | ||
files: Files extends ['BridgeFilesDoNotExists'] ? {} : Files extends 'any' ? { | ||
[key: string]: FormidableFile; | ||
} : { | ||
[key in Files[number]]: FormidableFile; | ||
}; | ||
}>>) => Res, Res, Body extends DataParser<Record<any, any>> = never, Query extends DataParser<Record<string, any>> = never, Headers extends DataParser<Record<string, any>> = never, Files extends FilesConfig = ['BridgeFilesDoNotExists'], Middelwares extends ReadonlyArray<BridgeHandler> = never>(p: BridgeParams<Resolve, Middelwares, Body, Query, Headers, Files>) => BridgeHandler<Resolve, Middelwares>; | ||
export type CreateHandlerOld = <Resolve extends (p: { | ||
[key in KeysWithValNotEmptyObject<{ | ||
@@ -15,0 +26,0 @@ middlewares: MidsReturnsIntersection<Middelwares> extends never ? {} : MidsReturnsIntersection<Middelwares>; |
import { BridgeHandler } from '../core/handlers'; | ||
export type Pretify<T> = { | ||
[K in keyof T]: T[K]; | ||
} & {}; | ||
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; | ||
@@ -9,2 +12,5 @@ export type KeysWithValNotNever<T> = keyof { | ||
}; | ||
export type ExcludeNeverKeysObj<T> = { | ||
[key in KeysWithValNotEmptyObject<T> & keyof T]: T[key]; | ||
}; | ||
export type KeysWithValNotEmptyObject<T> = keyof { | ||
@@ -11,0 +17,0 @@ [P in keyof T as keyof T[P] extends never ? never : P]: P; |
{ | ||
"name": "bridge", | ||
"version": "2.0.59", | ||
"version": "2.0.60", | ||
"description": "Bridge is a Typescript Node.js framework that provides an easy and scalable way to create REST APIs while generating the client code.", | ||
@@ -41,4 +41,5 @@ "author": "Bridge Team <support@bridge.codes>", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.1.3" | ||
"typescript": "^5.1.3", | ||
"zod": "^3.21.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122528
142
1350
7
+ Addedzod@^3.21.4
+ Addedzod@3.24.1(transitive)