Comparing version 1.0.10 to 1.0.11
@@ -83,2 +83,5 @@ type RecursivePartial<T> = { | ||
}; | ||
type RecursiveNullish<T> = T extends object ? { | ||
[P in keyof T]?: RecursiveNullish<T[P]> | null; | ||
} : T | null | undefined; | ||
@@ -119,10 +122,12 @@ type Fetcher = typeof fetch; | ||
* performance numbers and a unique identifier which can be used to trace | ||
* the request internally. | ||
* the request in Sentry. | ||
*/ | ||
interface Metrics { | ||
id: string; | ||
duration: { | ||
total: number; | ||
internal: number; | ||
}; | ||
/** | ||
* The Trace ID provided by Sentry. This is only available when the required | ||
* Sentry environment variables are present. | ||
*/ | ||
id: string | null; | ||
/** The total duration it took the worker to process the request. */ | ||
duration: number; | ||
} | ||
@@ -162,11 +167,11 @@ | ||
interface AllSubFilters<T> { | ||
contains: string | T; | ||
endsWith: string | T; | ||
is: T; | ||
is: T | null; | ||
isNot: T | null; | ||
contains: string | Exclude<T, null>; | ||
endsWith: string | Exclude<T, null>; | ||
startsWith: string | Exclude<T, null>; | ||
isGreaterThan: number | Date; | ||
isLessThan: number | Date; | ||
isNot: T; | ||
startsWith: string | T; | ||
} | ||
type SubFilter<T> = T extends number ? Prettify<Pick<Partial<AllSubFilters<T>>, 'isGreaterThan' | 'isLessThan' | 'is'>> : T extends string ? Prettify<Pick<Partial<AllSubFilters<T>>, 'contains' | 'endsWith' | 'is' | 'isNot' | 'startsWith'>> : T extends boolean ? Prettify<Pick<Partial<AllSubFilters<T>>, 'is'>> : T extends Date ? Prettify<Pick<Partial<AllSubFilters<T>>, 'isGreaterThan' | 'isLessThan' | 'is'>> : never; | ||
type SubFilter<T> = Prettify<T extends number ? Pick<Partial<AllSubFilters<T>>, 'isGreaterThan' | 'isLessThan' | 'is'> : T extends string ? Pick<Partial<AllSubFilters<T>>, 'contains' | 'endsWith' | 'is' | 'isNot' | 'startsWith'> : T extends boolean ? Pick<Partial<AllSubFilters<T>>, 'is'> : T extends Date ? Pick<Partial<AllSubFilters<T>>, 'isGreaterThan' | 'isLessThan' | 'is'> : never>; | ||
type Where<TSchema extends Record<string, any>> = { | ||
@@ -190,5 +195,5 @@ [TKey in keyof TSchema]: SubFilter<TSchema[TKey]>; | ||
/** Perform specific matching actions (such as "is", "contains", or "startsWith") on the fields of a record. */ | ||
where: Partial<Where<TSchema>>; | ||
where: Partial<Where<RecursiveNullish<TSchema>>>; | ||
/** Perform "is" matching actions on the fields of a record. */ | ||
with: Partial<With<TSchema>>; | ||
with: Partial<With<RecursiveNullish<TSchema>>>; | ||
/** Order the resulting records using a specific field. */ | ||
@@ -217,3 +222,3 @@ orderedBy: Partial<OrderedBy<TSchema>>; | ||
/** Perform mutations on the fields of a record or add new fields to it. */ | ||
to: Partial<To<TSchema>>; | ||
to: To<RecursiveNullish<TSchema>>; | ||
} | ||
@@ -220,0 +225,0 @@ export interface Includes extends Record<SchemaSlugKey, Array<string>> { |
{ | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"name": "ronin", | ||
@@ -10,3 +10,3 @@ "scripts": { | ||
"test:coverage": "vitest run --coverage", | ||
"test:typecheck": "vitest typecheck", | ||
"test:typecheck": "vitest typecheck --run", | ||
"deploy": "npm run build && npm publish" | ||
@@ -13,0 +13,0 @@ }, |
28204
758