@dyrected/core 2.5.8 → 2.5.10
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/app-DZt5nslu.d.ts +334 -331
- package/dist/app-Dk3SzV1a.d.cts +374 -0
- package/dist/app-Dk3SzV1a.d.ts +374 -0
- package/dist/chunk-3VUH2MNW.js +1903 -0
- package/dist/chunk-45JDQDA2.js +1899 -0
- package/dist/index.cjs +80 -54
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -5
- package/dist/server.cjs +74 -50
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/app-DZt5nslu.d.ts
CHANGED
|
@@ -1,374 +1,377 @@
|
|
|
1
|
-
import * as hono_types from
|
|
2
|
-
import { Hono } from
|
|
1
|
+
import * as hono_types from "hono/types";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
3
|
|
|
4
|
-
type FieldType =
|
|
4
|
+
type FieldType =
|
|
5
|
+
| "text"
|
|
6
|
+
| "textarea"
|
|
7
|
+
| "richText"
|
|
8
|
+
| "number"
|
|
9
|
+
| "boolean"
|
|
10
|
+
| "date"
|
|
11
|
+
| "select"
|
|
12
|
+
| "multiSelect"
|
|
13
|
+
| "relationship"
|
|
14
|
+
| "array"
|
|
15
|
+
| "object"
|
|
16
|
+
| "json"
|
|
17
|
+
| "blocks"
|
|
18
|
+
| "image"
|
|
19
|
+
| "email"
|
|
20
|
+
| "url"
|
|
21
|
+
| "icon"
|
|
22
|
+
| "join"
|
|
23
|
+
| "row";
|
|
5
24
|
interface Block {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
25
|
+
slug: string;
|
|
26
|
+
labels?: {
|
|
27
|
+
singular: string;
|
|
28
|
+
plural: string;
|
|
29
|
+
};
|
|
30
|
+
fields: Field[];
|
|
12
31
|
}
|
|
13
32
|
interface Field {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
name?: string;
|
|
34
|
+
type: FieldType;
|
|
35
|
+
label?: string;
|
|
36
|
+
required?: boolean;
|
|
37
|
+
unique?: boolean;
|
|
38
|
+
defaultValue?: any;
|
|
39
|
+
options?:
|
|
40
|
+
| string[]
|
|
41
|
+
| {
|
|
21
42
|
label: string;
|
|
22
43
|
value: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
}[];
|
|
45
|
+
relationTo?: string;
|
|
46
|
+
hasMany?: boolean;
|
|
47
|
+
fields?: Field[];
|
|
48
|
+
blocks?: Block[];
|
|
49
|
+
collection?: string;
|
|
50
|
+
on?: string;
|
|
51
|
+
access?: {
|
|
52
|
+
read?: AccessFunction;
|
|
53
|
+
update?: AccessFunction;
|
|
54
|
+
};
|
|
55
|
+
hooks?: {
|
|
56
|
+
beforeChange?: FieldHook[];
|
|
57
|
+
afterRead?: FieldHook[];
|
|
58
|
+
};
|
|
59
|
+
admin?: {
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
hidden?: boolean;
|
|
63
|
+
readOnly?: boolean;
|
|
64
|
+
condition?: ((data: any, siblingData: any) => boolean) | string;
|
|
65
|
+
layout?: "radio" | "select" | string;
|
|
66
|
+
direction?: "horizontal" | "vertical";
|
|
67
|
+
tab?: string;
|
|
68
|
+
width?: string;
|
|
69
|
+
};
|
|
70
|
+
/** For database migrations: if set, data from this key will be migrated to the current field name. */
|
|
71
|
+
renameTo?: string;
|
|
72
|
+
/** For database migrations: if true, this field will be extracted to a real SQL column for performance. */
|
|
73
|
+
promoted?: boolean;
|
|
53
74
|
}
|
|
54
75
|
type AccessFunction = (args: {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
user: any;
|
|
77
|
+
doc?: any;
|
|
78
|
+
data?: any;
|
|
79
|
+
req: any;
|
|
59
80
|
}) => boolean | object | Promise<boolean | object>;
|
|
60
81
|
type HookFunction = (args: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}) => any | Promise<any>;
|
|
68
|
-
type FieldHook = (args: {
|
|
69
|
-
value: any;
|
|
70
|
-
originalDoc?: any;
|
|
71
|
-
data?: any;
|
|
72
|
-
user?: any;
|
|
82
|
+
data?: any;
|
|
83
|
+
doc?: any;
|
|
84
|
+
user?: any;
|
|
85
|
+
req?: any;
|
|
86
|
+
/** The operation that triggered this hook. */
|
|
87
|
+
operation?: "create" | "update" | "delete";
|
|
73
88
|
}) => any | Promise<any>;
|
|
89
|
+
type FieldHook<T, V> = (args: { value: V; originalDoc?: T; data?: any; user?: any }) => any | Promise<any>;
|
|
74
90
|
interface CollectionConfig {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
91
|
+
slug: string;
|
|
92
|
+
siteId?: string;
|
|
93
|
+
shared?: boolean;
|
|
94
|
+
labels?: {
|
|
95
|
+
singular: string;
|
|
96
|
+
plural: string;
|
|
97
|
+
};
|
|
98
|
+
auth?: boolean;
|
|
99
|
+
upload?: boolean | UploadConfig;
|
|
100
|
+
fields: Field[];
|
|
101
|
+
timestamps?: boolean;
|
|
102
|
+
/** Initial data to seed this collection with on first fetch if it is empty. */
|
|
103
|
+
initialData?: any[];
|
|
104
|
+
/** Enable full activity logging to the __audit collection for this collection. */
|
|
105
|
+
audit?: boolean;
|
|
106
|
+
access?: {
|
|
107
|
+
read?: AccessFunction;
|
|
108
|
+
create?: AccessFunction;
|
|
109
|
+
update?: AccessFunction;
|
|
110
|
+
delete?: AccessFunction;
|
|
111
|
+
};
|
|
112
|
+
hooks?: {
|
|
113
|
+
beforeRead?: HookFunction[];
|
|
114
|
+
afterRead?: HookFunction[];
|
|
115
|
+
beforeChange?: HookFunction[];
|
|
116
|
+
afterChange?: HookFunction[];
|
|
117
|
+
beforeDelete?: HookFunction[];
|
|
118
|
+
afterDelete?: HookFunction[];
|
|
119
|
+
};
|
|
120
|
+
admin?: {
|
|
121
|
+
useAsTitle?: string;
|
|
122
|
+
defaultColumns?: string[];
|
|
123
|
+
group?: string;
|
|
124
|
+
hidden?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* URL to open in the Live Preview pane.
|
|
127
|
+
* Accepts a static string or a function that receives the document and returns a URL.
|
|
128
|
+
*/
|
|
129
|
+
previewUrl?:
|
|
130
|
+
| string
|
|
131
|
+
| ((
|
|
132
|
+
doc: any,
|
|
133
|
+
opts: {
|
|
114
134
|
locale?: string;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
135
|
+
},
|
|
136
|
+
) => string | null);
|
|
137
|
+
/** Which mode to use for live preview. Defaults to 'postMessage'. */
|
|
138
|
+
previewMode?: "postMessage" | "token";
|
|
139
|
+
};
|
|
119
140
|
}
|
|
120
141
|
interface UploadConfig {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
allowedMimeTypes?: string[];
|
|
143
|
+
maxFileSize?: number;
|
|
144
|
+
/** Local disk path where files are stored. Only used by LocalStorage adapter. */
|
|
145
|
+
staticDir?: string;
|
|
146
|
+
/** Public URL prefix for locally stored files. Only used by LocalStorage adapter. */
|
|
147
|
+
staticURL?: string;
|
|
148
|
+
/** Which imageSizes entry to use as the thumbnail in the Admin media grid. */
|
|
149
|
+
adminThumbnail?: string;
|
|
150
|
+
imageSizes?: {
|
|
151
|
+
name: string;
|
|
152
|
+
width?: number;
|
|
153
|
+
height?: number;
|
|
154
|
+
crop?: string;
|
|
155
|
+
/** sharp fit strategy: 'cover' | 'contain' | 'fill' | 'inside' | 'outside' */
|
|
156
|
+
fit?: string;
|
|
157
|
+
/** Never upscale images smaller than the target size. Default: true. */
|
|
158
|
+
withoutEnlargement?: boolean;
|
|
159
|
+
/** Additional sharp format options. */
|
|
160
|
+
formatOptions?: Record<string, any>;
|
|
161
|
+
}[];
|
|
141
162
|
}
|
|
142
163
|
interface GlobalConfig {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
slug: string;
|
|
165
|
+
siteId?: string;
|
|
166
|
+
shared?: boolean;
|
|
167
|
+
label?: string;
|
|
168
|
+
fields: Field[];
|
|
169
|
+
access?: {
|
|
170
|
+
read?: AccessFunction;
|
|
171
|
+
update?: AccessFunction;
|
|
172
|
+
};
|
|
173
|
+
hooks?: {
|
|
174
|
+
beforeRead?: HookFunction[];
|
|
175
|
+
afterRead?: HookFunction[];
|
|
176
|
+
beforeChange?: HookFunction[];
|
|
177
|
+
afterChange?: HookFunction[];
|
|
178
|
+
};
|
|
179
|
+
admin?: {
|
|
180
|
+
group?: string;
|
|
181
|
+
hidden?: boolean;
|
|
182
|
+
};
|
|
183
|
+
/** Initial data to seed this global with on first fetch if it is empty. */
|
|
184
|
+
initialData?: any;
|
|
164
185
|
}
|
|
165
186
|
interface PaginatedResult<T = any> {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
187
|
+
docs: T[];
|
|
188
|
+
total: number;
|
|
189
|
+
limit: number;
|
|
190
|
+
page: number;
|
|
191
|
+
/** Total number of pages given the current limit. */
|
|
192
|
+
totalPages: number;
|
|
193
|
+
hasNextPage: boolean;
|
|
194
|
+
hasPrevPage: boolean;
|
|
174
195
|
}
|
|
175
196
|
interface DatabaseAdapter {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}): Promise<any>;
|
|
200
|
-
getGlobal(args: {
|
|
201
|
-
slug: string;
|
|
202
|
-
}): Promise<any>;
|
|
203
|
-
updateGlobal(args: {
|
|
204
|
-
slug: string;
|
|
205
|
-
data: any;
|
|
206
|
-
}): Promise<any>;
|
|
207
|
-
/**
|
|
208
|
-
* Sync the database schema with the provided collections and globals.
|
|
209
|
-
* Useful for creating tables on startup.
|
|
210
|
-
*/
|
|
211
|
-
sync?(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
|
|
212
|
-
/**
|
|
213
|
-
* Low-level raw query execution.
|
|
214
|
-
* Optional as not all adapters may support raw SQL/commands.
|
|
215
|
-
*/
|
|
216
|
-
execute?(query: string, params?: any[]): Promise<any>;
|
|
197
|
+
find(args: {
|
|
198
|
+
collection: string;
|
|
199
|
+
where?: any;
|
|
200
|
+
limit?: number;
|
|
201
|
+
page?: number;
|
|
202
|
+
sort?: string;
|
|
203
|
+
}): Promise<PaginatedResult>;
|
|
204
|
+
findOne(args: { collection: string; id: string }): Promise<any>;
|
|
205
|
+
create(args: { collection: string; data: any }): Promise<any>;
|
|
206
|
+
update(args: { collection: string; id: string; data: any }): Promise<any>;
|
|
207
|
+
delete(args: { collection: string; id: string }): Promise<any>;
|
|
208
|
+
getGlobal(args: { slug: string }): Promise<any>;
|
|
209
|
+
updateGlobal(args: { slug: string; data: any }): Promise<any>;
|
|
210
|
+
/**
|
|
211
|
+
* Sync the database schema with the provided collections and globals.
|
|
212
|
+
* Useful for creating tables on startup.
|
|
213
|
+
*/
|
|
214
|
+
sync?(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
|
|
215
|
+
/**
|
|
216
|
+
* Low-level raw query execution.
|
|
217
|
+
* Optional as not all adapters may support raw SQL/commands.
|
|
218
|
+
*/
|
|
219
|
+
execute?(query: string, params?: any[]): Promise<any>;
|
|
217
220
|
}
|
|
218
221
|
interface FileData {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
222
|
+
filename: string;
|
|
223
|
+
filesize?: number;
|
|
224
|
+
mimeType: string;
|
|
225
|
+
url: string;
|
|
226
|
+
width?: number;
|
|
227
|
+
height?: number;
|
|
228
|
+
focalPoint?: {
|
|
229
|
+
x: number;
|
|
230
|
+
y: number;
|
|
231
|
+
};
|
|
232
|
+
blurhash?: string;
|
|
233
|
+
type?: "upload" | "external";
|
|
234
|
+
provider?: string;
|
|
235
|
+
provider_metadata?: any;
|
|
236
|
+
[key: string]: any;
|
|
234
237
|
}
|
|
235
238
|
interface StorageAdapter {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}): Promise<void>;
|
|
245
|
-
getURL(args: {
|
|
246
|
-
filename: string;
|
|
247
|
-
}): string;
|
|
248
|
-
/** Retrieve file content for serving via API */
|
|
249
|
-
resolve?(args: {
|
|
250
|
-
filename: string;
|
|
251
|
-
}): Promise<{
|
|
252
|
-
buffer: Uint8Array;
|
|
253
|
-
mimeType: string;
|
|
254
|
-
} | null>;
|
|
239
|
+
upload(args: { filename: string; buffer: Uint8Array; mimeType: string; prefix?: string }): Promise<FileData>;
|
|
240
|
+
delete(args: { filename: string }): Promise<void>;
|
|
241
|
+
getURL(args: { filename: string }): string;
|
|
242
|
+
/** Retrieve file content for serving via API */
|
|
243
|
+
resolve?(args: { filename: string }): Promise<{
|
|
244
|
+
buffer: Uint8Array;
|
|
245
|
+
mimeType: string;
|
|
246
|
+
} | null>;
|
|
255
247
|
}
|
|
256
248
|
/** Branding and metadata configuration for the Admin UI. */
|
|
257
249
|
interface AdminConfig {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
250
|
+
branding?: {
|
|
251
|
+
/** URL or imported image for the full logo shown in the sidebar. */
|
|
252
|
+
logo?: string;
|
|
253
|
+
/** URL or imported image for the compact logo mark used in collapsed sidebar. */
|
|
254
|
+
logoMark?: string;
|
|
255
|
+
/** Primary accent colour as a CSS value (e.g. '#6366f1' or 'hsl(240 50% 60%)') */
|
|
256
|
+
primaryColor?: string;
|
|
257
|
+
/** URL for the browser tab favicon. */
|
|
258
|
+
favicon?: string;
|
|
259
|
+
/** Default font family for body and UI elements (sans-serif). */
|
|
260
|
+
fontSans?: string;
|
|
261
|
+
/** Default font family for headings and display elements (serif). */
|
|
262
|
+
fontSerif?: string;
|
|
263
|
+
};
|
|
264
|
+
meta?: {
|
|
265
|
+
/** Appended to every Admin page title. Default: '- Dyrected' */
|
|
266
|
+
titleSuffix?: string;
|
|
267
|
+
};
|
|
276
268
|
}
|
|
277
269
|
interface ImageService {
|
|
278
|
-
|
|
270
|
+
process(args: {
|
|
271
|
+
buffer: Uint8Array;
|
|
272
|
+
mimeType: string;
|
|
273
|
+
config?: CollectionConfig["upload"];
|
|
274
|
+
focalPoint?: {
|
|
275
|
+
x: number;
|
|
276
|
+
y: number;
|
|
277
|
+
};
|
|
278
|
+
}): Promise<{
|
|
279
|
+
metadata: {
|
|
280
|
+
width?: number;
|
|
281
|
+
height?: number;
|
|
282
|
+
blurhash?: string;
|
|
283
|
+
};
|
|
284
|
+
sizes?: Record<
|
|
285
|
+
string,
|
|
286
|
+
{
|
|
279
287
|
buffer: Uint8Array;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}): Promise<{
|
|
287
|
-
metadata: {
|
|
288
|
-
width?: number;
|
|
289
|
-
height?: number;
|
|
290
|
-
blurhash?: string;
|
|
291
|
-
};
|
|
292
|
-
sizes?: Record<string, {
|
|
293
|
-
buffer: Uint8Array;
|
|
294
|
-
width: number;
|
|
295
|
-
height: number;
|
|
296
|
-
filename: string;
|
|
297
|
-
}>;
|
|
298
|
-
}>;
|
|
288
|
+
width: number;
|
|
289
|
+
height: number;
|
|
290
|
+
filename: string;
|
|
291
|
+
}
|
|
292
|
+
>;
|
|
293
|
+
}>;
|
|
299
294
|
}
|
|
300
295
|
interface DyrectedConfig {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
};
|
|
329
|
-
resetPassword?: (args: {
|
|
330
|
-
token: string;
|
|
331
|
-
}) => {
|
|
332
|
-
subject?: string;
|
|
333
|
-
html: string;
|
|
334
|
-
};
|
|
335
|
-
passwordChanged?: (args: {
|
|
336
|
-
email: string;
|
|
337
|
-
}) => {
|
|
338
|
-
subject?: string;
|
|
339
|
-
html: string;
|
|
340
|
-
};
|
|
341
|
-
};
|
|
342
|
-
};
|
|
343
|
-
redis?: {
|
|
344
|
-
url: string;
|
|
345
|
-
};
|
|
346
|
-
cors?: {
|
|
347
|
-
origins: string[];
|
|
296
|
+
collections: CollectionConfig[];
|
|
297
|
+
globals: GlobalConfig[];
|
|
298
|
+
db?: DatabaseAdapter;
|
|
299
|
+
storage?: StorageAdapter;
|
|
300
|
+
image?: ImageService;
|
|
301
|
+
/** Admin UI branding and meta configuration. */
|
|
302
|
+
admin?: AdminConfig;
|
|
303
|
+
email?: {
|
|
304
|
+
from: string;
|
|
305
|
+
send: (args: { to: string; subject: string; html: string }) => Promise<void>;
|
|
306
|
+
templates?: {
|
|
307
|
+
welcome?: (args: { email: string }) => {
|
|
308
|
+
subject?: string;
|
|
309
|
+
html: string;
|
|
310
|
+
};
|
|
311
|
+
invite?: (args: { token: string; invitedByEmail?: string }) => {
|
|
312
|
+
subject?: string;
|
|
313
|
+
html: string;
|
|
314
|
+
};
|
|
315
|
+
resetPassword?: (args: { token: string }) => {
|
|
316
|
+
subject?: string;
|
|
317
|
+
html: string;
|
|
318
|
+
};
|
|
319
|
+
passwordChanged?: (args: { email: string }) => {
|
|
320
|
+
subject?: string;
|
|
321
|
+
html: string;
|
|
322
|
+
};
|
|
348
323
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
324
|
+
};
|
|
325
|
+
redis?: {
|
|
326
|
+
url: string;
|
|
327
|
+
};
|
|
328
|
+
cors?: {
|
|
329
|
+
origins: string[];
|
|
330
|
+
};
|
|
331
|
+
onSchemaFetch?: (siteId: string) => Promise<{
|
|
332
|
+
collections?: CollectionConfig[];
|
|
333
|
+
globals?: GlobalConfig[];
|
|
334
|
+
}>;
|
|
353
335
|
}
|
|
354
336
|
|
|
355
337
|
interface DyrectedContext {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
};
|
|
338
|
+
Variables: {
|
|
339
|
+
config: DyrectedConfig;
|
|
340
|
+
siteId?: string;
|
|
341
|
+
workspaceId?: string;
|
|
342
|
+
/** Decoded JWT payload set by requireAuth() or optionalAuth() middleware. */
|
|
343
|
+
user?: {
|
|
344
|
+
sub: string;
|
|
345
|
+
email: string;
|
|
346
|
+
collection: string;
|
|
347
|
+
[key: string]: any;
|
|
367
348
|
};
|
|
349
|
+
};
|
|
368
350
|
}
|
|
369
351
|
/**
|
|
370
352
|
* Create the main Dyrected Hono application.
|
|
371
353
|
*/
|
|
372
|
-
declare function createDyrectedApp(
|
|
354
|
+
declare function createDyrectedApp(
|
|
355
|
+
rawConfig: DyrectedConfig,
|
|
356
|
+
): Promise<Hono<DyrectedContext, hono_types.BlankSchema, "/">>;
|
|
373
357
|
|
|
374
|
-
export {
|
|
358
|
+
export {
|
|
359
|
+
type AccessFunction as A,
|
|
360
|
+
type Block as B,
|
|
361
|
+
type CollectionConfig as C,
|
|
362
|
+
type DyrectedConfig as D,
|
|
363
|
+
type Field as F,
|
|
364
|
+
type GlobalConfig as G,
|
|
365
|
+
type HookFunction as H,
|
|
366
|
+
type ImageService as I,
|
|
367
|
+
type PaginatedResult as P,
|
|
368
|
+
type StorageAdapter as S,
|
|
369
|
+
type UploadConfig as U,
|
|
370
|
+
type AdminConfig as a,
|
|
371
|
+
type DatabaseAdapter as b,
|
|
372
|
+
type DyrectedContext as c,
|
|
373
|
+
type FieldHook as d,
|
|
374
|
+
type FieldType as e,
|
|
375
|
+
type FileData as f,
|
|
376
|
+
createDyrectedApp as g,
|
|
377
|
+
};
|