@empathyco/x-adapter
Advanced tools
Comparing version 8.0.0-alpha.22 to 8.0.0-alpha.23
@@ -41,3 +41,3 @@ import { HttpClient, RequestOptions } from '../http-clients/types'; | ||
*/ | ||
export declare type EndpointAdapterFactory = <Request, Response>(options: EndpointAdapterOptions<Request, Response>) => ExtendableEndpointAdapter<Request, Response>; | ||
export type EndpointAdapterFactory = <Request, Response>(options: EndpointAdapterOptions<Request, Response>) => ExtendableEndpointAdapter<Request, Response>; | ||
/** | ||
@@ -44,0 +44,0 @@ * Options to create an adapter with. |
@@ -10,3 +10,3 @@ import { Dictionary } from '@empathyco/x-utils'; | ||
*/ | ||
export declare type HttpClient = <Response = unknown>(endpoint: string, options?: Omit<RequestOptions, 'endpoint'>) => Promise<Readonly<Response>>; | ||
export type HttpClient = <Response = unknown>(endpoint: string, options?: Omit<RequestOptions, 'endpoint'>) => Promise<Readonly<Response>>; | ||
/** | ||
@@ -13,0 +13,0 @@ * A record of options to make the request with. |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
export declare type Mapper<From, To> = (from: Readonly<From>, context: MapperContext) => To; | ||
export type Mapper<From, To> = (from: Readonly<From>, context: MapperContext) => To; | ||
/** | ||
@@ -11,0 +11,0 @@ * The context is an object that can be used to share information between the invocation of |
@@ -37,3 +37,3 @@ import { AnyFunction, DeepPartial, ExtractPath, ExtractPathByType, ExtractType, Primitive } from '@empathyco/x-utils'; | ||
*/ | ||
export declare type Schema<Source = any, Target = any> = { | ||
export type Schema<Source = any, Target = any> = { | ||
[TargetKey in keyof Target]: SchemaTransformer<Source, Target, TargetKey>; | ||
@@ -48,3 +48,3 @@ }; | ||
*/ | ||
export declare type MutableSchema<Source, Target> = Schema<Source, Target> & { | ||
export type MutableSchema<Source, Target> = Schema<Source, Target> & { | ||
/** | ||
@@ -91,3 +91,3 @@ * Replaces all usages of the original {@link Schema | schema} with the given one. | ||
*/ | ||
export declare type SchemaTransformer<Source, Target, TargetKey extends keyof Target> = PathTransformer<Source, Target[TargetKey]> | FunctionTransformer<Source, Target[TargetKey]> | SubSchemaTransformer<Source, Target[TargetKey]> | Schema<Source, Exclude<Target[TargetKey], AnyFunction | Primitive>>; | ||
export type SchemaTransformer<Source, Target, TargetKey extends keyof Target> = PathTransformer<Source, Target[TargetKey]> | FunctionTransformer<Source, Target[TargetKey]> | SubSchemaTransformer<Source, Target[TargetKey]> | Schema<Source, Exclude<Target[TargetKey], AnyFunction | Primitive>>; | ||
/** | ||
@@ -124,3 +124,3 @@ * A function with the source object and mapper context as parameters that returns the value of a | ||
*/ | ||
export declare type PathTransformer<Source, Target> = ExtractPathByType<Source, Target>; | ||
export type PathTransformer<Source, Target> = ExtractPathByType<Source, Target>; | ||
/** | ||
@@ -153,3 +153,3 @@ * A function with the source object and mapper context as parameters that returns the value of a | ||
*/ | ||
export declare type FunctionTransformer<Source, Target> = (source: Source, context?: MapperContext) => Target; | ||
export type FunctionTransformer<Source, Target> = (source: Source, context?: MapperContext) => Target; | ||
/** | ||
@@ -190,3 +190,3 @@ * An object containing a schema narrowing its source object based on the given path. | ||
*/ | ||
export declare type SubSchemaTransformer<Source, Target> = { | ||
export type SubSchemaTransformer<Source, Target> = { | ||
[Path in ExtractPath<Source>]: { | ||
@@ -206,2 +206,2 @@ $context?: MapperContext; | ||
*/ | ||
export declare type SubSchema<Source, Target, Path extends ExtractPath<Source>> = ExtractType<Source, Path> extends (infer SourceArrayType)[] ? Target extends (infer TargetArrayType)[] ? Schema<SourceArrayType, TargetArrayType> : never : Target extends [] ? never : Schema<ExtractType<Source, Path>, Target>; | ||
export type SubSchema<Source, Target, Path extends ExtractPath<Source>> = ExtractType<Source, Path> extends (infer SourceArrayType)[] ? Target extends (infer TargetArrayType)[] ? Schema<SourceArrayType, TargetArrayType> : never : Target extends [] ? never : Schema<ExtractType<Source, Path>, Target>; |
{ | ||
"name": "@empathyco/x-adapter", | ||
"version": "8.0.0-alpha.22", | ||
"version": "8.0.0-alpha.23", | ||
"description": "A utils library to create a client for any API", | ||
@@ -38,4 +38,4 @@ "author": "Empathy Systems Corporation S.L.", | ||
"dependencies": { | ||
"@empathyco/x-deep-merge": "^1.3.0-alpha.29", | ||
"@empathyco/x-utils": "^1.0.0-alpha.14", | ||
"@empathyco/x-deep-merge": "^1.3.0-alpha.30", | ||
"@empathyco/x-utils": "^1.0.0-alpha.15", | ||
"tslib": "~2.4.1" | ||
@@ -49,3 +49,3 @@ }, | ||
"ts-jest": "~27.0.7", | ||
"typescript": "~4.6.2" | ||
"typescript": "~4.9.4" | ||
}, | ||
@@ -55,3 +55,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "bb92e0826e5b29ddd2a7d95480b88be02e5a761d" | ||
"gitHead": "6fccb9c182fa3bad626901b551006a39a7f47d98" | ||
} |
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
182273