@aeriajs/types 0.0.72 → 0.0.73
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/collection.d.ts +1 -1
- package/dist/description.d.ts +3 -11
- package/package.json +1 -1
package/dist/collection.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import type { Description } from './description.js';
|
|
|
6
6
|
export type Collection<TCollection extends Collection = any> = {
|
|
7
7
|
description: Description;
|
|
8
8
|
item?: any;
|
|
9
|
-
security?: CollectionSecurityPolicy<TCollection>;
|
|
10
9
|
functions?: Record<string, (payload: any, context: Context<any>, ...args: any[]) => any>;
|
|
11
10
|
contracts?: Record<string, Contract>;
|
|
12
11
|
exposedFunctions?: Record<string, AccessCondition>;
|
|
12
|
+
security?: CollectionSecurityPolicy<TCollection>;
|
|
13
13
|
};
|
|
14
14
|
export type CollectionItem<TCollectionName extends keyof Collections> = Omit<Collections[TCollectionName]['item'], '_id'>;
|
|
15
15
|
export type CollectionItemWithId<TCollectionName extends keyof Collections> = Collections[TCollectionName]['item'];
|
package/dist/description.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PhosphorIcon } from '@phosphor-icons/core';
|
|
|
3
3
|
import type { Condition } from './condition.js';
|
|
4
4
|
import type { JsonSchema, PropertiesWithId } from './property.js';
|
|
5
5
|
import type { OwnershipMode } from './security.js';
|
|
6
|
-
export type
|
|
6
|
+
export type DescriptionPreset = 'crud' | 'duplicate' | 'remove' | 'removeAll' | 'owned' | 'timestamped' | 'view';
|
|
7
7
|
export type Icon = PhosphorIcon['name'];
|
|
8
8
|
export type CollectionActionRoute = {
|
|
9
9
|
route: {
|
|
@@ -61,12 +61,6 @@ export type FiltersPreset<TDescription extends Description> = {
|
|
|
61
61
|
badgeFunction?: string;
|
|
62
62
|
default?: boolean;
|
|
63
63
|
};
|
|
64
|
-
export type CollectionOptions<TDescription extends Description> = {
|
|
65
|
-
queryPreset?: {
|
|
66
|
-
filters?: Partial<Record<PropertiesWithId<TDescription> | `$${string}`, any>>;
|
|
67
|
-
sort?: Partial<Record<PropertiesWithId<TDescription>, any>>;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
64
|
export type LayoutName = 'tabular' | 'grid' | 'list';
|
|
71
65
|
export type LayoutOptions<TDescription extends Description = any> = {
|
|
72
66
|
picture?: PropertiesWithId<TDescription>;
|
|
@@ -88,11 +82,9 @@ export type RuntimeDescription<TDescription extends Description = any> = Pick<TD
|
|
|
88
82
|
export type Description<TDescription extends Description = any> = JsonSchema<TDescription> & {
|
|
89
83
|
title?: string;
|
|
90
84
|
categories?: readonly string[];
|
|
91
|
-
|
|
92
|
-
inline?: boolean;
|
|
85
|
+
hidden?: boolean;
|
|
93
86
|
preferred?: Record<string, RuntimeDescription<TDescription>>;
|
|
94
87
|
icon?: Icon;
|
|
95
|
-
options?: CollectionOptions<TDescription>;
|
|
96
88
|
indexes?: readonly PropertiesWithId<TDescription>[];
|
|
97
89
|
defaults?: Record<string, any>;
|
|
98
90
|
owned?: OwnershipMode;
|
|
@@ -103,7 +95,7 @@ export type Description<TDescription extends Description = any> = JsonSchema<TDe
|
|
|
103
95
|
timestamps?: false;
|
|
104
96
|
immutable?: boolean | readonly (keyof TDescription['properties'])[] | ((doc: WithId<any>) => boolean | Promise<boolean>);
|
|
105
97
|
route?: readonly string[];
|
|
106
|
-
presets?: readonly
|
|
98
|
+
presets?: readonly DescriptionPreset[];
|
|
107
99
|
table?: readonly PropertiesWithId<TDescription>[];
|
|
108
100
|
tableMeta?: readonly PropertiesWithId<TDescription>[];
|
|
109
101
|
filtersPresets?: Record<string, FiltersPreset<TDescription>>;
|