@data-client/endpoint
Advanced tools
Comparing version 0.11.3 to 0.11.4
@@ -11,2 +11,2 @@ Object.hasOwn = Object.hasOwn || /* istanbul ignore next */function hasOwn(it, key) { | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJPYmplY3QiLCJoYXNPd24iLCJpdCIsImtleSIsInByb3RvdHlwZSIsImhhc093blByb3BlcnR5IiwiY2FsbCIsIl9zY2hlbWEiLCJzY2hlbWEiLCJkZWZhdWx0IiwiRW50aXR5IiwidmFsaWRhdGVSZXF1aXJlZCIsIklOVkFMSUQiLCJFbmRwb2ludCIsIkV4dGVuZGFibGVFbmRwb2ludCJdLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJPYmplY3QuaGFzT3duID1cbiAgT2JqZWN0Lmhhc093biB8fFxuICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqLyBmdW5jdGlvbiBoYXNPd24oaXQsIGtleSkge1xuICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoaXQsIGtleSk7XG4gIH07XG5cbmV4cG9ydCB0eXBlIHtcbiAgRW5kcG9pbnRPcHRpb25zLFxuICBFbmRwb2ludEluc3RhbmNlLFxuICBFbmRwb2ludEluc3RhbmNlSW50ZXJmYWNlLFxuICBFbmRwb2ludEV4dGVuZE9wdGlvbnMsXG59IGZyb20gJy4vZW5kcG9pbnQuanMnO1xuZXhwb3J0ICogYXMgc2NoZW1hIGZyb20gJy4vc2NoZW1hLmpzJztcbi8vIFdpdGhvdXQgdGhpcyB3ZSBnZXQgJ2Nhbm5vdCBiZSBuYW1lZCB3aXRob3V0IGEgcmVmZXJlbmNlIHRvJyBmb3IgY3JlYXRlUmVzb3VyY2UoKS4uLi53aHkgaXMgdGhpcz9cbi8vIENsdWUgMSkgSX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Jy4vZW5kcG9pbnQuanMnO1xuIl0sIm1hcHBpbmdzIjoiQUFBQUEsTUFBTSxDQUFDQyxNQUFNLEdBQ1hELE1BQU0sQ0FBQ0MsTUFBTSxJQUNiLDBCQUEyQixTQUFTQSxNQUFNQSxDQUFDQyxFQUFFLEVBQUVDLEdBQUcsRUFBRTtFQUNsRCxPQUFPSCxNQUFNLENBQUNJLFNBQVMsQ0FBQ0MsY0FBYyxDQUFDQyxJQUFJLENBQUNKLEVBQUUsRUFBRUMsR0FBRyxDQUFDO0FBQ3RELENBQUM7QUFBQyxZQUFBSSxPQUFBLE1BUW9CLGFBQWE7QUFBQSxTQUFBQSxPQUFBLElBQXpCQyxNQUFNLElBQ2xCO0FBQ0E7QUFFQSxTQUFTQyxPQUFPLElBQUlDLE1BQU0sUUFBUSxxQkFBcUI7QUFDdkQsU0FBU0QsT0FBTyxJQUFJRSxnQkFBZ0IsUUFBUSx1QkFBdUI7QUFDbkUsU0FBU0MsT0FBTyxRQUFRLGNBQWM7QUFpQ3RDLFNBQVNILE9BQU8sSUFBSUksUUFBUSxFQUFFQyxrQkFBa0IsUUFBUSxlQUFlIiwiaWdub3JlTGlzdCI6W119 |
@@ -10,4 +10,5 @@ export type { EndpointOptions, EndpointInstance, EndpointInstanceInterface, EndpointExtendOptions, } from './endpoint.js'; | ||
export type { EndpointExtraOptions, FetchFunction, ResolveType, EndpointParam, NetworkError, UnknownError, ErrorTypes, EndpointToFunction, } from './types.js'; | ||
export type { NI } from './NoInfer.js'; | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
export type { KeyofEndpointInstance } from './endpoint.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -11,2 +11,2 @@ Object.hasOwn = Object.hasOwn || /* istanbul ignore next */function hasOwn(it, key) { | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJPYmpl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NJLFNBQVMsQ0FBQ0MsY0FBYyxDQUFDQyxJQUFJLENBQUNKLEVBQUUsRUFBRUMsR0FBRyxDQUFDO0FBQ3RELENBQUM7QUFBQyxZQUFBSSxPQUFBLE1BUW9CLGFBQWE7QUFBQSxTQUFBQSxPQUFBLElBQXpCQyxNQUFNLElBQ2xCO0FBQ0E7QUFFQSxTQUFTQyxPQUFPLElBQUlDLE1BQU0sUUFBUSxxQkFBcUI7QUFDdkQsU0FBU0QsT0FBTyxJQUFJRSxnQkFBZ0IsUUFBUSx1QkFBdUI7QUFDbkUsU0FBU0MsT0FBTyxRQUFRLGNBQWM7QUFpQ3RDLFNBQVNILE9BQU8sSUFBSUksUUFBUSxFQUFFQyxrQkFBa0IsUUFBUSxlQUFlIiwiaWdub3JlTGlzdCI6W119 |
{ | ||
"name": "@data-client/endpoint", | ||
"version": "0.11.3", | ||
"version": "0.11.4", | ||
"description": "Declarative Network Interface Definitions", | ||
@@ -37,3 +37,3 @@ "homepage": "https://dataclient.io/docs/guides/custom-protocol", | ||
"typesVersions": { | ||
">=4.8": { | ||
">=5.4": { | ||
"": [ | ||
@@ -46,2 +46,10 @@ "lib/index.d.ts" | ||
}, | ||
">=4.8": { | ||
"": [ | ||
"ts4.8/index.d.ts" | ||
], | ||
"*": [ | ||
"ts4.8/index.d.ts" | ||
] | ||
}, | ||
">=4.2": { | ||
@@ -89,2 +97,3 @@ "": [ | ||
"lib", | ||
"ts4.8", | ||
"ts4.2", | ||
@@ -104,5 +113,5 @@ "ts4.0", | ||
"build:bundle": "yarn g:runs build:js:\\*", | ||
"build:clean": "yarn g:clean ts3.4 ts4.0 ts4.2", | ||
"build:clean": "yarn g:clean ts3.4 ts4.0 ts4.2 ts4.8", | ||
"build": "run build:lib && run build:legacy:lib && run build:bundle", | ||
"build:legacy-types": "yarn g:downtypes lib ts3.4 && yarn g:downtypes lib ts4.0 --to=4.0 && yarn g:downtypes lib ts4.2 --to=4.2 && yarn g:copy --up 1 ./src-4.2-types/**/*.d.ts ./ts4.0/ && yarn g:copy --up 1 ./src-4.2-types/**/*.d.ts ./ts4.2 && yarn g:copy --up 1 ./src-4.0-types/**/*.d.ts ./ts3.4/ && yarn g:copy --up 1 ./src-4.0-types/**/*.d.ts ./ts4.0 && yarn g:copy --up 1 ./src-legacy-types/**/*.d.ts ./ts3.4/", | ||
"build:legacy-types": "yarn g:legacy-types 4.8 4.2 4.0 3.4", | ||
"dev": "run build:lib -w", | ||
@@ -109,0 +118,0 @@ "prepare": "run build:lib", |
@@ -50,4 +50,5 @@ Object.hasOwn = | ||
} from './types.js'; | ||
export type { NI } from './NoInfer.js'; | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
export type { KeyofEndpointInstance } from './endpoint.js'; |
@@ -11,4 +11,5 @@ export { EndpointOptions, EndpointInstance, EndpointInstanceInterface, EndpointExtendOptions, } from './endpoint.js'; | ||
export { EndpointExtraOptions, FetchFunction, ResolveType, EndpointParam, NetworkError, UnknownError, ErrorTypes, EndpointToFunction, } from './types.js'; | ||
export { NI } from './NoInfer.js'; | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
export { KeyofEndpointInstance } from './endpoint.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,19 +0,7 @@ | ||
// we just removed instances of 'abstract new' | ||
import { AbstractInstanceType } from '../normal.js'; | ||
declare const Entity_base: import('./EntitySchema.js').IEntityClass< | ||
new (...args: any[]) => { | ||
pk( | ||
parent?: any, | ||
key?: string | undefined, | ||
args?: readonly any[] | undefined, | ||
): string | number | undefined; | ||
} | ||
> & | ||
(new (...args: any[]) => { | ||
pk( | ||
parent?: any, | ||
key?: string | undefined, | ||
args?: readonly any[] | undefined, | ||
): string | number | undefined; | ||
}); | ||
declare const Entity_base: import("./EntitySchema.js").IEntityClass<abstract new (...args: any[]) => { | ||
pk(parent?: any, key?: string | undefined, args?: readonly any[] | undefined): string | number | undefined; | ||
}> & (abstract new (...args: any[]) => { | ||
pk(parent?: any, key?: string | undefined, args?: readonly any[] | undefined): string | number | undefined; | ||
}); | ||
/** | ||
@@ -24,73 +12,43 @@ * Represents data that should be deduped by specifying a primary key. | ||
export default abstract class Entity extends Entity_base { | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
* @see https://dataclient.io/rest/api/Entity#pk | ||
*/ | ||
abstract pk( | ||
parent?: any, | ||
key?: string, | ||
args?: readonly any[], | ||
): string | number | undefined; | ||
/** Control how automatic schema validation is handled | ||
* | ||
* `undefined`: Defaults - throw error in worst offense | ||
* 'warn': only ever warn | ||
* 'silent': Don't bother with processing at all | ||
* | ||
* Note: this only applies to non-nested members. | ||
*/ | ||
protected static automaticValidation?: 'warn' | 'silent'; | ||
/** Factory method to convert from Plain JS Objects. | ||
* | ||
* @param [props] Plain Object of properties to assign. | ||
* @see https://dataclient.io/rest/api/Entity#fromJS | ||
*/ | ||
static fromJS: <T extends typeof Entity>( | ||
this: T, | ||
props?: Partial<AbstractInstanceType<T>>, | ||
) => AbstractInstanceType<T>; | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @param [value] POJO of the entity or subset used | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
*/ | ||
static pk: <T extends typeof Entity>( | ||
this: T, | ||
value: Partial<AbstractInstanceType<T>>, | ||
parent?: any, | ||
key?: string, | ||
args?: any[], | ||
) => string | number | undefined; | ||
/** Do any transformations when first receiving input | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#process | ||
*/ | ||
static process( | ||
input: any, | ||
parent: any, | ||
key: string | undefined, | ||
args: any[], | ||
): any; | ||
/** Returning a string indicates an error (the string is the message) | ||
* @see https://dataclient.io/rest/api/Entity#validate | ||
*/ | ||
static validate(processedEntity: any): string | undefined; | ||
static denormalize: <T extends typeof Entity>( | ||
this: T, | ||
input: any, | ||
args: readonly any[], | ||
unvisit: (input: any, schema: any) => any, | ||
) => AbstractInstanceType<T>; | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
* @see https://dataclient.io/rest/api/Entity#pk | ||
*/ | ||
abstract pk(parent?: any, key?: string, args?: readonly any[]): string | number | undefined; | ||
/** Control how automatic schema validation is handled | ||
* | ||
* `undefined`: Defaults - throw error in worst offense | ||
* 'warn': only ever warn | ||
* 'silent': Don't bother with processing at all | ||
* | ||
* Note: this only applies to non-nested members. | ||
*/ | ||
protected static automaticValidation?: 'warn' | 'silent'; | ||
/** Factory method to convert from Plain JS Objects. | ||
* | ||
* @param [props] Plain Object of properties to assign. | ||
* @see https://dataclient.io/rest/api/Entity#fromJS | ||
*/ | ||
static fromJS: <T extends typeof Entity>(this: T, props?: Partial<AbstractInstanceType<T>>) => AbstractInstanceType<T>; | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @param [value] POJO of the entity or subset used | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
*/ | ||
static pk: <T extends typeof Entity>(this: T, value: Partial<AbstractInstanceType<T>>, parent?: any, key?: string, args?: any[]) => string | number | undefined; | ||
/** Do any transformations when first receiving input | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#process | ||
*/ | ||
static process(input: any, parent: any, key: string | undefined, args: any[]): any; | ||
static denormalize: <T extends typeof Entity>(this: T, input: any, args: readonly any[], unvisit: (input: any, schema: any) => any) => AbstractInstanceType<T>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=Entity.d.ts.map |
/** Attempts to infer reasonable input type to construct an Entity */ | ||
export type EntityFields<U> = { | ||
readonly [K in keyof U]?: U[K] extends number ? U[K] | string | ||
: U[K] extends string ? U[K] | number | ||
: U[K]; | ||
readonly [K in keyof U as U[K] extends (...args: any) => any ? never : K]?: U[K] extends number ? U[K] | string : U[K] extends string ? U[K] | number : U[K]; | ||
}; | ||
//# sourceMappingURL=EntityFields.d.ts.map |
@@ -1,256 +0,157 @@ | ||
// we just removed instances of 'abstract new' | ||
import type { Schema, GetIndex, GetEntity } from '../interface.js'; | ||
import { Schema, GetIndex, GetEntity } from '../interface.js'; | ||
import { AbstractInstanceType } from '../normal.js'; | ||
export type Constructor = new (...args: any[]) => {}; | ||
export type IDClass = new (...args: any[]) => { | ||
id: string | number | undefined; | ||
export type Constructor = abstract new (...args: any[]) => {}; | ||
export type IDClass = abstract new (...args: any[]) => { | ||
id: string | number | undefined; | ||
}; | ||
export type PKClass = new (...args: any[]) => { | ||
pk( | ||
parent?: any, | ||
key?: string, | ||
args?: readonly any[], | ||
): string | number | undefined; | ||
export type PKClass = abstract new (...args: any[]) => { | ||
pk(parent?: any, key?: string, args?: readonly any[]): string | number | undefined; | ||
}; | ||
type ValidSchemas<TInstance> = { | ||
[k in keyof TInstance]?: Schema; | ||
[k in keyof TInstance]?: Schema; | ||
}; | ||
export type EntityOptions<TInstance extends {}> = { | ||
readonly schema?: ValidSchemas<TInstance>; | ||
readonly pk?: | ||
| (( | ||
value: TInstance, | ||
parent?: any, | ||
key?: string, | ||
) => string | number | undefined) | ||
| keyof TInstance; | ||
readonly key?: string; | ||
readonly schema?: ValidSchemas<TInstance>; | ||
readonly pk?: ((value: TInstance, parent?: any, key?: string) => string | number | undefined) | keyof TInstance; | ||
readonly key?: string; | ||
} & { | ||
readonly [K in Extract< | ||
keyof IEntityClass, | ||
| 'process' | ||
| 'merge' | ||
| 'expiresAt' | ||
| 'createIfValid' | ||
| 'mergeWithStore' | ||
| 'validate' | ||
| 'shouldReorder' | ||
| 'shouldUpdate' | ||
>]?: IEntityClass<new (...args: any[]) => TInstance>[K]; | ||
readonly [K in Extract<keyof IEntityClass, 'process' | 'merge' | 'expiresAt' | 'createIfValid' | 'mergeWithStore' | 'validate' | 'shouldReorder' | 'shouldUpdate'>]?: IEntityClass<abstract new (...args: any[]) => TInstance>[K]; | ||
}; | ||
export interface RequiredPKOptions<TInstance extends {}> | ||
extends EntityOptions<TInstance> { | ||
readonly pk: | ||
| (( | ||
value: TInstance, | ||
parent?: any, | ||
key?: string, | ||
) => string | number | undefined) | ||
| keyof TInstance; | ||
export interface RequiredPKOptions<TInstance extends {}> extends EntityOptions<TInstance> { | ||
readonly pk: ((value: TInstance, parent?: any, key?: string) => string | number | undefined) | keyof TInstance; | ||
} | ||
export default function EntitySchema<TBase extends Constructor>( | ||
Base: TBase, | ||
options?: EntityOptions<InstanceType<TBase>>, | ||
): any; | ||
export default function EntitySchema<TBase extends Constructor>(Base: TBase, options?: EntityOptions<InstanceType<TBase>>): any; | ||
export interface IEntityClass<TBase extends Constructor = any> { | ||
toJSON(): { | ||
name: string; | ||
toJSON(): { | ||
name: string; | ||
schema: { | ||
[k: string]: Schema; | ||
}; | ||
key: string; | ||
}; | ||
/** Defines nested entities | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#schema | ||
*/ | ||
schema: { | ||
[k: string]: Schema; | ||
[k: string]: Schema; | ||
}; | ||
/** Returns the globally unique identifier for the static Entity | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#key | ||
*/ | ||
key: string; | ||
}; | ||
/** Defines nested entities | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#schema | ||
*/ | ||
schema: { | ||
[k: string]: Schema; | ||
}; | ||
/** Returns the globally unique identifier for the static Entity | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#key | ||
*/ | ||
key: string; | ||
/** Defines indexes to enable lookup by | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#indexes | ||
*/ | ||
indexes?: readonly string[] | undefined; | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#pk | ||
* @param [value] POJO of the entity or subset used | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
*/ | ||
pk< | ||
T extends (new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & | ||
IEntityClass & | ||
TBase, | ||
>( | ||
this: T, | ||
value: Partial<AbstractInstanceType<T>>, | ||
parent?: any, | ||
key?: string, | ||
args?: any[], | ||
): string | number | undefined; | ||
/** Return true to merge incoming data; false keeps existing entity | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#shouldUpdate | ||
*/ | ||
shouldUpdate( | ||
existingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
existing: any, | ||
incoming: any, | ||
): boolean; | ||
/** Determines the order of incoming entity vs entity already in store\ | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#shouldReorder | ||
* @returns true if incoming entity should be first argument of merge() | ||
*/ | ||
shouldReorder( | ||
existingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
existing: any, | ||
incoming: any, | ||
): boolean; | ||
/** Creates new instance copying over defined values of arguments | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#merge | ||
*/ | ||
merge(existing: any, incoming: any): any; | ||
/** Run when an existing entity is found in the store | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#mergeWithStore | ||
*/ | ||
mergeWithStore( | ||
existingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
existing: any, | ||
incoming: any, | ||
): any; | ||
/** Run when an existing entity is found in the store | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#mergeMetaWithStore | ||
*/ | ||
mergeMetaWithStore( | ||
existingMeta: { | ||
expiresAt: number; | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
incomingMeta: { | ||
expiresAt: number; | ||
date: number; | ||
fetchedAt: number; | ||
}, | ||
existing: any, | ||
incoming: any, | ||
): { | ||
expiresAt: number; | ||
date: number; | ||
fetchedAt: number; | ||
}; | ||
/** Factory method to convert from Plain JS Objects. | ||
* | ||
* @param [props] Plain Object of properties to assign. | ||
*/ | ||
fromJS< | ||
T extends (new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & | ||
IEntityClass & | ||
TBase, | ||
>( | ||
this: T, | ||
props?: Partial<AbstractInstanceType<T>>, | ||
): AbstractInstanceType<T>; | ||
/** Called when denormalizing an entity to create an instance when 'valid' | ||
* | ||
* @param [props] Plain Object of properties to assign. | ||
* @see https://dataclient.io/rest/api/Entity#createIfValid | ||
*/ | ||
createIfValid< | ||
T extends (new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & | ||
IEntityClass & | ||
TBase, | ||
>( | ||
this: T, | ||
props: Partial<AbstractInstanceType<T>>, | ||
): AbstractInstanceType<T> | undefined; | ||
/** Do any transformations when first receiving input | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#process | ||
*/ | ||
process(input: any, parent: any, key: string | undefined, args: any[]): any; | ||
normalize( | ||
input: any, | ||
parent: any, | ||
key: string | undefined, | ||
visit: (...args: any) => any, | ||
addEntity: (...args: any) => any, | ||
visitedEntities: Record<string, any>, | ||
): any; | ||
/** Do any transformations when first receiving input | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#validate | ||
*/ | ||
validate(processedEntity: any): string | undefined; | ||
/** Builds a key access the entity without endpoint results | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#queryKey | ||
*/ | ||
queryKey( | ||
args: readonly any[], | ||
queryKey: any, | ||
getEntity: GetEntity, | ||
getIndex: GetIndex, | ||
): any; | ||
denormalize< | ||
T extends (new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & | ||
IEntityClass & | ||
TBase, | ||
>( | ||
this: T, | ||
input: any, | ||
args: readonly any[], | ||
unvisit: (input: any, schema: any) => any, | ||
): AbstractInstanceType<T>; | ||
/** All instance defaults set */ | ||
readonly defaults: any; | ||
/** Defines indexes to enable lookup by | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#indexes | ||
*/ | ||
indexes?: readonly string[] | undefined; | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#pk | ||
* @param [value] POJO of the entity or subset used | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
*/ | ||
pk<T extends (abstract new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & IEntityClass & TBase>(this: T, value: Partial<AbstractInstanceType<T>>, parent?: any, key?: string, args?: any[]): string | number | undefined; | ||
/** Return true to merge incoming data; false keeps existing entity | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#shouldUpdate | ||
*/ | ||
shouldUpdate(existingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): boolean; | ||
/** Determines the order of incoming entity vs entity already in store\ | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#shouldReorder | ||
* @returns true if incoming entity should be first argument of merge() | ||
*/ | ||
shouldReorder(existingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): boolean; | ||
/** Creates new instance copying over defined values of arguments | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#merge | ||
*/ | ||
merge(existing: any, incoming: any): any; | ||
/** Run when an existing entity is found in the store | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#mergeWithStore | ||
*/ | ||
mergeWithStore(existingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): any; | ||
/** Run when an existing entity is found in the store | ||
* | ||
* @see https://dataclient.io/docs/api/schema.Entity#mergeMetaWithStore | ||
*/ | ||
mergeMetaWithStore(existingMeta: { | ||
expiresAt: number; | ||
date: number; | ||
fetchedAt: number; | ||
}, incomingMeta: { | ||
expiresAt: number; | ||
date: number; | ||
fetchedAt: number; | ||
}, existing: any, incoming: any): { | ||
expiresAt: number; | ||
date: number; | ||
fetchedAt: number; | ||
}; | ||
/** Factory method to convert from Plain JS Objects. | ||
* | ||
* @param [props] Plain Object of properties to assign. | ||
*/ | ||
fromJS<T extends (abstract new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & IEntityClass & TBase>(this: T, props?: Partial<AbstractInstanceType<T>>): AbstractInstanceType<T>; | ||
/** Called when denormalizing an entity to create an instance when 'valid' | ||
* | ||
* @param [props] Plain Object of properties to assign. | ||
* @see https://dataclient.io/rest/api/Entity#createIfValid | ||
*/ | ||
createIfValid<T extends (abstract new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & IEntityClass & TBase>(this: T, props: Partial<AbstractInstanceType<T>>): AbstractInstanceType<T> | undefined; | ||
/** Do any transformations when first receiving input | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#process | ||
*/ | ||
process(input: any, parent: any, key: string | undefined, args: any[]): any; | ||
normalize(input: any, parent: any, key: string | undefined, visit: (...args: any) => any, addEntity: (...args: any) => any, visitedEntities: Record<string, any>): any; | ||
/** Do any transformations when first receiving input | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#validate | ||
*/ | ||
validate(processedEntity: any): string | undefined; | ||
/** Builds a key access the entity without endpoint results | ||
* | ||
* @see https://dataclient.io/rest/api/Entity#queryKey | ||
*/ | ||
queryKey(args: readonly any[], queryKey: any, getEntity: GetEntity, getIndex: GetIndex): any; | ||
denormalize<T extends (abstract new (...args: any[]) => IEntityInstance & InstanceType<TBase>) & IEntityClass & TBase>(this: T, input: any, args: readonly any[], unvisit: (input: any, schema: any) => any): AbstractInstanceType<T>; | ||
/** All instance defaults set */ | ||
readonly defaults: any; | ||
} | ||
export interface IEntityInstance { | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
*/ | ||
pk( | ||
parent?: any, | ||
key?: string, | ||
args?: readonly any[], | ||
): string | number | undefined; | ||
/** | ||
* A unique identifier for each Entity | ||
* | ||
* @param [parent] When normalizing, the object which included the entity | ||
* @param [key] When normalizing, the key where this entity was found | ||
* @param [args] ...args sent to Endpoint | ||
*/ | ||
pk(parent?: any, key?: string, args?: readonly any[]): string | number | undefined; | ||
} | ||
export {}; | ||
//# sourceMappingURL=EntitySchema.d.ts.map |
@@ -1,45 +0,15 @@ | ||
// relaxed constraints on call,apply,bind *this* | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
import type { EndpointInterface, Schema } from './interface.js'; | ||
import type { | ||
EndpointExtraOptions, | ||
FetchFunction, | ||
PartialParameters, | ||
} from './types.js'; | ||
export interface EndpointOptions< | ||
F extends FetchFunction = FetchFunction, | ||
S extends Schema | undefined = undefined, | ||
M extends boolean | undefined = undefined, | ||
> extends EndpointExtraOptions<F> { | ||
key?: (...args: Parameters<F>) => string; | ||
sideEffect?: M; | ||
schema?: S; | ||
[k: string]: any; | ||
import type { EndpointExtraOptions, FetchFunction, PartialParameters } from './types.js'; | ||
export interface EndpointOptions<F extends FetchFunction = FetchFunction, S extends Schema | undefined = undefined, M extends boolean | undefined = false> extends EndpointExtraOptions<F> { | ||
key?: (...args: Parameters<F>) => string; | ||
sideEffect?: M; | ||
schema?: S; | ||
[k: string]: any; | ||
} | ||
export interface EndpointExtendOptions< | ||
F extends FetchFunction = FetchFunction, | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends boolean | undefined = boolean | undefined, | ||
> extends EndpointOptions<F, S, M> { | ||
fetch?: FetchFunction; | ||
export interface EndpointExtendOptions<F extends FetchFunction = FetchFunction, S extends Schema | undefined = Schema | undefined, M extends boolean | undefined = boolean | undefined> extends EndpointOptions<F, S, M> { | ||
fetch?: FetchFunction; | ||
} | ||
export type ParamFromFetch<F> = | ||
F extends (params: infer P, body?: any) => Promise<any> ? P : never; | ||
export type ParamFromFetch<F> = F extends (params: infer P, body?: any) => Promise<any> ? P : never; | ||
export type KeyofEndpointInstance = keyof EndpointInstance<FetchFunction>; | ||
export type ExtendedEndpoint< | ||
O extends EndpointExtendOptions<F>, | ||
E extends EndpointInstance< | ||
FetchFunction, | ||
Schema | undefined, | ||
boolean | undefined | ||
>, | ||
F extends FetchFunction, | ||
> = EndpointInstance< | ||
'fetch' extends keyof O ? Exclude<O['fetch'], undefined> : E['fetch'], | ||
'schema' extends keyof O ? O['schema'] : E['schema'], | ||
'sideEffect' extends keyof O ? O['sideEffect'] : E['sideEffect'] | ||
> & | ||
Omit<O, KeyofEndpointInstance> & | ||
Omit<E, KeyofEndpointInstance>; | ||
export type ExtendedEndpoint<O extends EndpointExtendOptions<F>, E extends EndpointInstance<FetchFunction, Schema | undefined, boolean | undefined>, F extends FetchFunction> = EndpointInstance<'fetch' extends keyof O ? Exclude<O['fetch'], undefined> : E['fetch'], 'schema' extends keyof O ? O['schema'] : E['schema'], 'sideEffect' extends keyof O ? O['sideEffect'] : E['sideEffect']> & Omit<O, KeyofEndpointInstance> & Omit<E, KeyofEndpointInstance>; | ||
/** | ||
@@ -49,20 +19,4 @@ * Defines an async data source. | ||
*/ | ||
export interface EndpointInstance< | ||
F extends (...args: any) => Promise<any> = FetchFunction, | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends boolean | undefined = boolean | undefined, | ||
> extends EndpointInstanceInterface<F, S, M> { | ||
extend< | ||
E extends EndpointInstance< | ||
(...args: any) => Promise<any>, | ||
Schema | undefined, | ||
boolean | undefined | ||
>, | ||
O extends EndpointExtendOptions<F> & | ||
Partial<Omit<E, keyof EndpointInstance<FetchFunction>>> & | ||
Record<string, unknown>, | ||
>( | ||
this: E, | ||
options: Readonly<O>, | ||
): ExtendedEndpoint<typeof options, E, F>; | ||
export interface EndpointInstance<F extends (...args: any) => Promise<any> = FetchFunction, S extends Schema | undefined = Schema | undefined, M extends boolean | undefined = boolean | undefined> extends EndpointInstanceInterface<F, S, M> { | ||
extend<E extends EndpointInstance<(...args: any) => Promise<any>, Schema | undefined, boolean | undefined>, O extends EndpointExtendOptions<F> & Partial<Omit<E, keyof EndpointInstance<FetchFunction>>> & Record<string, unknown>>(this: E, options: Readonly<O>): ExtendedEndpoint<typeof options, E, F>; | ||
} | ||
@@ -73,96 +27,56 @@ /** | ||
*/ | ||
export interface EndpointInstanceInterface< | ||
F extends FetchFunction = FetchFunction, | ||
S extends Schema | undefined = Schema | undefined, | ||
M extends boolean | undefined = boolean | undefined, | ||
> extends EndpointInterface<F, S, M> { | ||
constructor: EndpointConstructor; | ||
/** | ||
* Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. | ||
* @param thisArg The object to be used as the this object. | ||
* @param argArray A set of arguments to be passed to the function. | ||
*/ | ||
apply<E extends FetchFunction>( | ||
this: E, | ||
thisArg: any, | ||
argArray?: Parameters<E>, | ||
): ReturnType<E>; | ||
/** | ||
* Calls a method of an object, substituting another object for the current object. | ||
* @param thisArg The object to be used as the current object. | ||
* @param argArray A list of arguments to be passed to the method. | ||
*/ | ||
call<E extends FetchFunction>( | ||
this: E, | ||
thisArg: any, | ||
...argArray: Parameters<E> | ||
): ReturnType<E>; | ||
/** | ||
* For a given function, creates a bound function that has the same body as the original function. | ||
* The this object of the bound function is associated with the specified object, and has the specified initial parameters. | ||
* @param thisArg An object to which the this keyword can refer inside the new function. | ||
* @param argArray A list of arguments to be passed to the new function. | ||
*/ | ||
bind<E extends FetchFunction, P extends PartialParameters<E>>( | ||
this: E, | ||
thisArg: any, | ||
...args: readonly [...P] | ||
): EndpointInstance< | ||
(...args: readonly [...RemoveArray<Parameters<E>, P>]) => ReturnType<E>, | ||
S, | ||
M | ||
> & | ||
Omit<E, keyof EndpointInstance<FetchFunction>>; | ||
/** Returns a string representation of a function. */ | ||
toString(): string; | ||
prototype: any; | ||
readonly length: number; | ||
arguments: any; | ||
caller: F; | ||
key(...args: Parameters<F>): string; | ||
readonly sideEffect: M; | ||
readonly schema: S; | ||
fetch: F; | ||
/** @see https://dataclient.io/rest/api/Endpoint#testKey */ | ||
testKey(key: string): boolean; | ||
export interface EndpointInstanceInterface<F extends FetchFunction = FetchFunction, S extends Schema | undefined = Schema | undefined, M extends boolean | undefined = boolean | undefined> extends EndpointInterface<F, S, M> { | ||
constructor: EndpointConstructor; | ||
/** | ||
* Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. | ||
* @param thisArg The object to be used as the this object. | ||
* @param argArray A set of arguments to be passed to the function. | ||
*/ | ||
apply<E extends FetchFunction>(this: E, thisArg: ThisParameterType<E>, argArray?: Parameters<E>): ReturnType<E>; | ||
/** | ||
* Calls a method of an object, substituting another object for the current object. | ||
* @param thisArg The object to be used as the current object. | ||
* @param argArray A list of arguments to be passed to the method. | ||
*/ | ||
call<E extends FetchFunction>(this: E, thisArg: ThisParameterType<E>, ...argArray: Parameters<E>): ReturnType<E>; | ||
/** | ||
* For a given function, creates a bound function that has the same body as the original function. | ||
* The this object of the bound function is associated with the specified object, and has the specified initial parameters. | ||
* @param thisArg An object to which the this keyword can refer inside the new function. | ||
* @param argArray A list of arguments to be passed to the new function. | ||
*/ | ||
bind<E extends FetchFunction, P extends PartialParameters<E>>(this: E, thisArg: ThisParameterType<E>, ...args: readonly [ | ||
...P | ||
]): EndpointInstance<(...args: readonly [ | ||
...RemoveArray<Parameters<E>, P> | ||
]) => ReturnType<E>, S, M> & Omit<E, keyof EndpointInstance<FetchFunction>>; | ||
/** Returns a string representation of a function. */ | ||
toString(): string; | ||
prototype: any; | ||
readonly length: number; | ||
arguments: any; | ||
caller: F; | ||
key(...args: Parameters<F>): string; | ||
readonly sideEffect: M; | ||
readonly schema: S; | ||
fetch: F; | ||
/** @see https://dataclient.io/rest/api/Endpoint#testKey */ | ||
testKey(key: string): boolean; | ||
} | ||
export interface EndpointConstructor { | ||
new < | ||
F extends ( | ||
this: EndpointInstance<FetchFunction> & E, | ||
params?: any, | ||
body?: any, | ||
) => Promise<any>, | ||
S extends Schema | undefined = undefined, | ||
M extends boolean | undefined = false, | ||
E extends Record<string, any> = {}, | ||
>( | ||
fetchFunction: F, | ||
options?: EndpointOptions<F, S, M> & E, | ||
): EndpointInstance<F, S, M> & E; | ||
readonly prototype: Function; | ||
new <F extends (this: EndpointInstance<FetchFunction> & E, params?: any, body?: any) => Promise<any>, S extends Schema | undefined = undefined, M extends boolean | undefined = false, E extends Record<string, any> = {}>(fetchFunction: F, options?: EndpointOptions<F, S, M> & E): EndpointInstance<F, S, M> & E; | ||
readonly prototype: Function; | ||
} | ||
export interface ExtendableEndpointConstructor { | ||
new < | ||
F extends ( | ||
this: EndpointInstanceInterface<FetchFunction> & E, | ||
params?: any, | ||
body?: any, | ||
) => Promise<any>, | ||
S extends Schema | undefined = undefined, | ||
M extends boolean | undefined = false, | ||
E extends Record<string, any> = {}, | ||
>( | ||
RestFetch: F, | ||
options?: Readonly<EndpointOptions<F, S, M>> & E, | ||
): EndpointInstanceInterface<F, S, M> & E; | ||
readonly prototype: Function; | ||
new <F extends (this: EndpointInstanceInterface<FetchFunction> & E, params?: any, body?: any) => Promise<any>, S extends Schema | undefined = undefined, M extends boolean | undefined = false, E extends Record<string, any> = {}>(RestFetch: F, options?: Readonly<EndpointOptions<F, S, M>> & E): EndpointInstanceInterface<F, S, M> & E; | ||
readonly prototype: Function; | ||
} | ||
type RemoveArray<Orig extends any[], Rem extends any[]> = | ||
Rem extends [any, ...infer RestRem] ? | ||
Orig extends [any, ...infer RestOrig] ? | ||
RemoveArray<RestOrig, RestRem> | ||
: never | ||
: Orig; | ||
type RemoveArray<Orig extends any[], Rem extends any[]> = Rem extends [ | ||
any, | ||
...infer RestRem | ||
] ? Orig extends [ | ||
any, | ||
...infer RestOrig | ||
] ? RemoveArray<RestOrig, RestRem> : never : Orig; | ||
export {}; | ||
//# sourceMappingURL=endpointTypes.d.ts.map |
@@ -10,4 +10,5 @@ export type { EndpointOptions, EndpointInstance, EndpointInstanceInterface, EndpointExtendOptions, } from './endpoint.js'; | ||
export type { EndpointExtraOptions, FetchFunction, ResolveType, EndpointParam, NetworkError, UnknownError, ErrorTypes, EndpointToFunction, } from './types.js'; | ||
export type { NI } from './NoInfer.js'; | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
export type { KeyofEndpointInstance } from './endpoint.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,4 +10,5 @@ export type { EndpointOptions, EndpointInstance, EndpointInstanceInterface, EndpointExtendOptions, } from './endpoint.js'; | ||
export type { EndpointExtraOptions, FetchFunction, ResolveType, EndpointParam, NetworkError, UnknownError, ErrorTypes, EndpointToFunction, } from './types.js'; | ||
export type { NI } from './NoInfer.js'; | ||
export { default as Endpoint, ExtendableEndpoint } from './endpoint.js'; | ||
export type { KeyofEndpointInstance } from './endpoint.js'; | ||
//# sourceMappingURL=index.d.ts.map |
Sorry, the diff of this file is not supported yet
1218803
316
18337