Socket
Socket
Sign inDemoInstall

@api-ts/io-ts-http

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@api-ts/io-ts-http - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1-beta.1

2

dist/src/combinators.d.ts

@@ -5,3 +5,3 @@ import * as t from 'io-ts';

export declare const optionalized: <P extends t.Props>(props: P, name?: string) => OptionalizedC<P>;
export declare const flattened: <Props extends NestedProps>(name: string, props: Props) => t.Type<Simplify<(NestedType<Props>[keyof Props] extends infer T ? T extends NestedType<Props>[keyof Props] ? T extends any ? (x: T) => any : never : never : never) extends (x: infer R) => any ? R : never>, Simplify<NestedOutputType<Props>>, unknown>;
export declare const flattened: <Props extends NestedProps>(name: string, props: Props) => t.Type<Simplify<Flattened<NestedType<Props>>>, Simplify<NestedOutputType<Props>>, unknown>;
//# sourceMappingURL=combinators.d.ts.map

@@ -9,4 +9,4 @@ import * as t from 'io-ts';

}>;
export declare type HttpRequestCodec<T> = t.Type<T, t.OutputOf<typeof GenericHttpRequest>, unknown>;
export declare type HttpRequestCombinatorProps = {
export type HttpRequestCodec<T> = t.Type<T, t.OutputOf<typeof GenericHttpRequest>, unknown>;
export type HttpRequestCombinatorProps = {
params?: NonNullable<t.Props>;

@@ -17,9 +17,9 @@ query?: NonNullable<t.Props>;

};
declare type EmitOutputTypeErrors<P extends t.Props | undefined, O, OName extends string> = P extends undefined ? P : {
type EmitOutputTypeErrors<P extends t.Props | undefined, O, OName extends string> = P extends undefined ? P : {
[K in keyof P & string]: P[K] extends t.Type<any, O, any> ? P[K] : `Codec's output type is not assignable to \`${OName}\`. Try using one like \`NumberFromString\``;
};
declare type QueryValue = string | string[] | undefined;
declare type ParamValue = string | undefined;
declare type HeaderValue = string | undefined;
declare type EmitPropsErrors<P extends HttpRequestCombinatorProps> = {
type QueryValue = string | string[] | undefined;
type ParamValue = string | undefined;
type HeaderValue = string | undefined;
type EmitPropsErrors<P extends HttpRequestCombinatorProps> = {
params?: EmitOutputTypeErrors<P['params'], ParamValue, 'string | undefined'>;

@@ -26,0 +26,0 @@ query?: EmitOutputTypeErrors<P['query'], QueryValue, 'string | string[] | undefined'>;

import * as t from 'io-ts';
export declare type HttpResponse = {
export type HttpResponse = {
[K: number | string]: t.Mixed;

@@ -247,3 +247,3 @@ };

};
export declare type ResponseTypeForStatus<Response extends HttpResponse, S extends keyof Response> = Response[S] extends t.Mixed ? t.TypeOf<Response[S]> : never;
export type ResponseTypeForStatus<Response extends HttpResponse, S extends keyof Response> = Response[S] extends t.Mixed ? t.TypeOf<Response[S]> : never;
//# sourceMappingURL=httpResponse.d.ts.map

@@ -11,4 +11,4 @@ import * as t from 'io-ts';

}>;
export declare type Method = t.TypeOf<typeof Method>;
export declare type HttpRoute<M extends Method = Method> = {
export type Method = t.TypeOf<typeof Method>;
export type HttpRoute<M extends Method = Method> = {
readonly path: string;

@@ -19,4 +19,4 @@ readonly method: Uppercase<M>;

};
export declare type RequestType<T extends HttpRoute> = t.TypeOf<T['request']>;
export declare type ResponseType<T extends HttpRoute> = {
export type RequestType<T extends HttpRoute> = t.TypeOf<T['request']>;
export type ResponseType<T extends HttpRoute> = {
[K in keyof T['response']]: T['response'][K] extends t.Mixed ? {

@@ -27,3 +27,3 @@ type: K;

}[keyof T['response']];
export declare type ApiSpec = {
export type ApiSpec = {
[ApiAction: string]: {

@@ -33,3 +33,3 @@ [M in Method]?: HttpRoute<M>;

};
declare type UnknownKeysToError<Spec extends ApiSpec> = {
type UnknownKeysToError<Spec extends ApiSpec> = {
[ApiAction in keyof Spec]: {

@@ -36,0 +36,0 @@ [M in keyof Spec[ApiAction]]: M extends Method ? Spec[ApiAction][M] : `Unsupported HTTP Method. Use "get" | "post" | "put" | "delete" | "patch"`;

@@ -63,3 +63,3 @@ export declare const HttpToKeyStatus: {

};
export declare type HttpToKeyStatus = typeof HttpToKeyStatus;
export type HttpToKeyStatus = typeof HttpToKeyStatus;
export declare const KeyToHttpStatus: {

@@ -127,3 +127,3 @@ readonly continue: 100;

};
export declare type KeyToHttpStatus = typeof KeyToHttpStatus;
export type KeyToHttpStatus = typeof KeyToHttpStatus;
//# sourceMappingURL=statusCode.d.ts.map
import type * as t from 'io-ts';
declare type Defined<T> = T extends undefined ? never : T;
export declare type DefinedValues<T> = {
type Defined<T> = T extends undefined ? never : T;
export type DefinedValues<T> = {
[K in keyof T]: Defined<T[K]>;
};
declare type DefinedProps<Props extends t.Props> = {
type DefinedProps<Props extends t.Props> = {
[K in keyof Props]: Props[K] extends t.Type<infer A, infer O, infer I> ? t.Type<Defined<A>, O, I> : never;
};
declare type PossiblyUndefinedKeys<T> = {
type PossiblyUndefinedKeys<T> = {
[K in keyof T]: undefined extends T[K] ? K : never;
}[keyof T];
export declare type PossiblyUndefinedProps<T extends t.Props> = {
export type PossiblyUndefinedProps<T extends t.Props> = {
[K in keyof T]: undefined extends t.TypeOf<T[K]> ? K : never;
}[keyof T];
declare type Optionalized<T> = Simplify<Omit<T, PossiblyUndefinedKeys<T>> & Partial<DefinedValues<Pick<T, PossiblyUndefinedKeys<T>>>>>;
export declare type OptionalProps<Props extends t.Props> = DefinedProps<Pick<Props, PossiblyUndefinedProps<Props>>>;
export declare type RequiredProps<Props extends t.Props> = Omit<Props, PossiblyUndefinedProps<Props>>;
export declare type OptionalizedC<Props extends t.Props> = t.IntersectionC<[
type Optionalized<T> = Simplify<Omit<T, PossiblyUndefinedKeys<T>> & Partial<DefinedValues<Pick<T, PossiblyUndefinedKeys<T>>>>>;
export type OptionalProps<Props extends t.Props> = DefinedProps<Pick<Props, PossiblyUndefinedProps<Props>>>;
export type RequiredProps<Props extends t.Props> = Omit<Props, PossiblyUndefinedProps<Props>>;
export type OptionalizedC<Props extends t.Props> = t.IntersectionC<[
t.TypeC<RequiredProps<Props>>,
t.PartialC<OptionalProps<Props>>
]>;
export declare type NestedProps = {
export type NestedProps = {
[K: string]: t.Props;
};
export declare type NestedType<Props extends NestedProps> = {
export type NestedType<Props extends NestedProps> = {
[K in keyof Props]: Optionalized<t.TypeOfProps<Props[K]>>;
};
export declare type NestedOutputType<Props extends NestedProps> = {
export type NestedOutputType<Props extends NestedProps> = {
[K in keyof Props]: Optionalized<t.OutputOfProps<Props[K]>>;
};
export declare type Flattened<T> = UnionToIntersection<T[keyof T]>;
declare type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
export declare type Simplify<T> = T extends unknown ? {
export type Flattened<T> = UnionToIntersection<T[keyof T]>;
type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
export type Simplify<T> = T extends unknown ? {
[K in keyof T]: T[K];

@@ -35,0 +35,0 @@ } : never;

{
"name": "@api-ts/io-ts-http",
"version": "2.4.0",
"version": "2.4.1-beta.1",
"description": "Types for (de)serializing HTTP requests from both the client and server side",

@@ -19,6 +19,6 @@ "author": "Patrick McLaughlin <patrickmclaughlin@bitgo.com>",

"format:fix": "prettier --write .",
"test": "c8 mocha test/**/*.test.ts --require ts-node/register --exit"
"test": "c8 --all node --require @swc-node/register --test test/*.test.ts"
},
"dependencies": {
"@api-ts/response": "2.1.0",
"@api-ts/response": "2.1.1-beta.1",
"fp-ts": "^2.0.0",

@@ -29,9 +29,5 @@ "io-ts": "2.1.3",

"devDependencies": {
"@types/chai": "4.3.5",
"@types/mocha": "10.0.1",
"c8": "7.13.0",
"chai": "4.3.7",
"mocha": "10.2.0",
"ts-node": "10.9.1",
"typescript": "4.7.4"
"@swc-node/register": "1.6.8",
"c8": "8.0.1",
"typescript": "5.2.2"
},

@@ -38,0 +34,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc