@aeriajs/types 0.0.77 → 0.0.79

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.
package/dist/config.d.ts CHANGED
@@ -31,5 +31,5 @@ export type ApiConfig = {
31
31
  exposeFunctionsByDefault?: boolean | 'unauthenticated';
32
32
  };
33
33
  tokenUserProperties?: string[];
34
- errorHandler?: <TError extends Error>(context: RouteContext, error: TError) => any | Promise<any>;
34
+ errorHandler?: <TError extends Error>(context: RouteContext, error: TError) => unknown | Promise<unknown>;
35
35
  };
@@ -47,11 +47,12 @@ export type FormLayoutField<TDescription extends Description> = {
47
47
  props?: Record<string, any>;
48
48
  };
49
49
  };
50
+ export type TableLayoutAction<TDescription extends Description> = {
51
+ button?: boolean | Condition<TDescription>;
52
+ if?: Condition<TDescription>;
53
+ };
50
54
  export type TableLayout<TDescription extends Description> = {
51
- actions: Partial<Record<keyof TDescription['individualActions'], {
52
- button?: boolean | Condition<TDescription>;
53
- if?: Condition<TDescription>;
54
- }>>;
55
+ actions?: Partial<Record<keyof TDescription['individualActions'], TableLayoutAction<TDescription>>>;
55
56
  };
56
57
  export type FiltersPreset<TDescription extends Description> = {
57
58
  label?: string;
@@ -75,8 +76,9 @@ export type Layout<TDescription extends Description = any> = {
75
76
  options?: LayoutOptions<TDescription>;
76
77
  };
77
78
  export type SearchOptions<TDescription extends Description> = {
78
- placeholder?: string;
79
79
  indexes: readonly (keyof TDescription['properties'])[];
80
+ placeholder?: string;
81
+ exactMatches?: boolean;
80
82
  };
81
83
  export type RuntimeDescription<TDescription extends Description = any> = Pick<TDescription, 'actions' | 'individualActions' | 'filters' | 'filtersPresets' | 'layout' | 'table' | 'tableMeta' | 'form' | 'tableLayout' | 'formLayout'>;
82
84
  export type Description<TDescription extends Description = any> = JsonSchema<TDescription> & {
@@ -1,4 +1,4 @@
1
- import type { FilterOperators, StrictFilter as Filter, StrictUpdateFilter, WithId, OptionalId, ObjectId } from 'mongodb';
1
+ import type { FilterOperators, StrictFilter as Filter, WithId, OptionalId, ObjectId } from 'mongodb';
2
2
  import type { Result } from './result.js';
3
3
  import type { EndpointError, StrictEndpointError } from './endpointError.js';
4
4
  import type { PackReferences } from './schema.js';
@@ -7,7 +7,7 @@ import type { ValidationErrorCode, TraverseError } from './validation.js';
7
7
  import type { HTTPStatus, WithACErrors } from './http.js';
8
8
  export type UploadAuxProps = {
9
9
  parentId: string;
10
- propertyName: string;
10
+ propName: string;
11
11
  };
12
12
  export type Pagination = {
13
13
  recordsCount: number;
@@ -31,7 +31,7 @@ export type Filters<TDocument> = StrictFilter<TDocument> & Partial<{
31
31
  }>;
32
32
  export type What<TDocument> = ({
33
33
  _id: ObjectId | string;
34
- } & Partial<Omit<PackReferences<TDocument>, '_id'>> & RemoveAny<StrictUpdateFilter<PackReferences<TDocument>>> | {
34
+ } & Partial<Omit<PackReferences<TDocument>, '_id'>> | {
35
35
  _id?: null;
36
36
  } & Omit<PackReferences<TDocument>, '_id'>) extends infer Document ? {
37
37
  [P in keyof Document]: Document[P] | null;
@@ -94,6 +94,7 @@ export type ArrayOfRefs = Omit<ArrayProperty, 'items'> & {
94
94
  };
95
95
  export type GetterProperty = {
96
96
  getter: (document: any) => any;
97
+ requires?: string[];
97
98
  };
98
99
  export type ConstProperty = {
99
100
  const: string | number | boolean | undefined | null;
@@ -31,7 +31,7 @@ export type CollectionSecurityPolicy<TCollection extends {
31
31
  functions?: Partial<Record<keyof TCollection['functions'], SecurityPolicy>>;
32
32
  };
33
33
  export type CollectionHookProps<TPayload = any> = {
34
- propertyName?: string;
34
+ propName?: string;
35
35
  parentId?: string;
36
36
  childId?: string;
37
37
  payload: TPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.77",
3
+ "version": "0.0.79",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",