@aeriajs/types 0.0.64 → 0.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,8 +15,9 @@ export type Pagination = {
15
15
  offset: number;
16
16
  limit: number;
17
17
  };
18
+ type FilterProperty<T> = T extends ObjectId ? T | string : T;
18
19
  type DocumentFilter<TDocument> = PackReferences<TDocument> extends infer Document ? {
19
- [P in keyof Document]: null | (Document[P] extends ObjectId ? Document[P] | string : Document[P]);
20
+ [P in keyof Document]: null | (Document[P] extends (infer E)[] ? FilterProperty<E>[] : FilterProperty<Document[P]>);
20
21
  } : never;
21
22
  type RemoveAny<T> = {
22
23
  [P in keyof T as 0 extends (T[P] & 1) ? never : P]: T[P];
@@ -24,9 +25,9 @@ type RemoveAny<T> = {
24
25
  export type StrictFilter<TDocument> = RemoveAny<Filter<DocumentFilter<TDocument>>>;
25
26
  export type StrictFilterOperators<TDocument> = RemoveAny<FilterOperators<DocumentFilter<TDocument>>>;
26
27
  export type Filters<TDocument> = StrictFilter<TDocument> & Partial<{
27
- [P in keyof TDocument]: null | (TDocument[P] extends infer Field ? Field extends ObjectId ? Field | string : Field extends {
28
+ [P in keyof TDocument | `${Extract<keyof TDocument, string>}.${string}`]: (P extends keyof TDocument ? TDocument[P] extends infer Field ? Field extends ObjectId ? Field | string : Field extends {
28
29
  _id: infer Id;
29
- } ? Id | string : Field : never) extends infer Field ? Field | StrictFilterOperators<Field> | null : never;
30
+ } ? Id | string : Field : never : any) extends infer Field ? Field | StrictFilterOperators<Field> | null : never;
30
31
  }>;
31
32
  export type What<TDocument> = ({
32
33
  _id: ObjectId | string;
package/dist/http.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ServerResponse, IncomingMessage } from 'http';
3
2
  import type { MapSchemaUnion } from './schema.js';
4
3
  import type { ExtractError, ExtractResult, Result } from './result.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",