@yimingliao/cms 0.0.8 → 0.0.9
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/base-DbGnfZr6.d.ts +340 -0
- package/dist/chunk-KEQXXUK2.js +207 -0
- package/dist/index.d.ts +3 -903
- package/dist/index.js +1 -1447
- package/dist/server/index.d.ts +566 -0
- package/dist/server/index.js +1242 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,426 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { cookies } from 'next/headers';
|
|
4
|
-
|
|
5
|
-
interface JwtServiceConfig {
|
|
6
|
-
defaultSecret: string;
|
|
7
|
-
issuer?: string;
|
|
8
|
-
audience?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* JWT service
|
|
12
|
-
*
|
|
13
|
-
* Sign, Verify
|
|
14
|
-
*/
|
|
15
|
-
declare function createJwtService(config: JwtServiceConfig): {
|
|
16
|
-
sign: ({ payload, secret, expiresIn, }: {
|
|
17
|
-
payload: object;
|
|
18
|
-
secret: string;
|
|
19
|
-
expiresIn: number;
|
|
20
|
-
}) => string;
|
|
21
|
-
verify: ({ token, secret, }: {
|
|
22
|
-
token: string;
|
|
23
|
-
secret: string;
|
|
24
|
-
}) => jwt.JwtPayload;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
declare function createArgon2Service(): {
|
|
28
|
-
hash: (password: string) => Promise<string>;
|
|
29
|
-
verify: (hash: string, plain: string) => Promise<boolean>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
interface CryptoServiceConfig {
|
|
33
|
-
defaultSecret: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Crypto service
|
|
37
|
-
*
|
|
38
|
-
* Encrypt & Decrypt, Calculate checksum, Sign
|
|
39
|
-
*/
|
|
40
|
-
declare function createCryptoService(config: CryptoServiceConfig): {
|
|
41
|
-
generateToken: () => string;
|
|
42
|
-
hash: (value: BinaryLike) => string;
|
|
43
|
-
hashBuffer: (value: BinaryLike) => Buffer;
|
|
44
|
-
encrypt: (data: string) => string;
|
|
45
|
-
decrypt: (data: string) => string;
|
|
46
|
-
sign: ({ value, expireSeconds, createdAt, }: {
|
|
47
|
-
value: string;
|
|
48
|
-
expireSeconds: number;
|
|
49
|
-
createdAt?: number;
|
|
50
|
-
}) => {
|
|
51
|
-
signed: string;
|
|
52
|
-
signature: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Cookie Service
|
|
58
|
-
*
|
|
59
|
-
* Set, Get, Verify, Delete
|
|
60
|
-
*/
|
|
61
|
-
declare function createCookieService(nextCookies: () => Promise<Awaited<ReturnType<typeof cookies>>>, cryptoService: ReturnType<typeof createCryptoService>): {
|
|
62
|
-
set: ({ name, value, expireSeconds, }: {
|
|
63
|
-
name: string;
|
|
64
|
-
value: string;
|
|
65
|
-
expireSeconds: number;
|
|
66
|
-
}) => Promise<void>;
|
|
67
|
-
setSignedCookie: ({ name, value, expireSeconds, }: {
|
|
68
|
-
name: string;
|
|
69
|
-
value: string;
|
|
70
|
-
expireSeconds: number;
|
|
71
|
-
}) => Promise<void>;
|
|
72
|
-
get: ({ name }: {
|
|
73
|
-
name: string;
|
|
74
|
-
}) => Promise<string | undefined>;
|
|
75
|
-
getSignedCookie: ({ name }: {
|
|
76
|
-
name: string;
|
|
77
|
-
}) => Promise<string>;
|
|
78
|
-
verifySignedCookie: ({ signed }: {
|
|
79
|
-
signed: string | undefined;
|
|
80
|
-
}) => string;
|
|
81
|
-
delete: ({ name }: {
|
|
82
|
-
name: string;
|
|
83
|
-
}) => Promise<void>;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
type SingleItem = {
|
|
87
|
-
id: string;
|
|
88
|
-
} | null;
|
|
89
|
-
type MultiItems = {
|
|
90
|
-
id: string;
|
|
91
|
-
}[];
|
|
92
|
-
|
|
93
|
-
type BaseTranslation<T extends string = string> = {
|
|
94
|
-
locale: T;
|
|
95
|
-
};
|
|
96
|
-
type Translation<T extends string = string> = BaseTranslation<T> & {
|
|
97
|
-
[k: string]: unknown;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
declare const ADMIN_ROLES: {
|
|
101
|
-
SUPER_ADMIN: "SUPER_ADMIN";
|
|
102
|
-
ADMIN: "ADMIN";
|
|
103
|
-
EDITOR: "EDITOR";
|
|
104
|
-
};
|
|
105
|
-
type AdminRole = (typeof ADMIN_ROLES)[keyof typeof ADMIN_ROLES];
|
|
106
|
-
|
|
107
|
-
interface Admin {
|
|
108
|
-
id: string;
|
|
109
|
-
email: string;
|
|
110
|
-
role: AdminRole;
|
|
111
|
-
passwordHash: string;
|
|
112
|
-
socialLinks: string[];
|
|
113
|
-
avatarImageId: string | null;
|
|
114
|
-
createdAt: Date;
|
|
115
|
-
updatedAt: Date;
|
|
116
|
-
emailVerifiedAt: Date | null;
|
|
117
|
-
}
|
|
118
|
-
type AdminSafe = Omit<Admin, "passwordHash">;
|
|
119
|
-
|
|
120
|
-
interface AdminTranslation extends Translation {
|
|
121
|
-
id: string;
|
|
122
|
-
locale: string;
|
|
123
|
-
adminId: string;
|
|
124
|
-
name: string | null;
|
|
125
|
-
authorName: string | null;
|
|
126
|
-
description: string | null;
|
|
127
|
-
jobTitle: string | null;
|
|
128
|
-
url: string | null;
|
|
129
|
-
worksFor: string | null;
|
|
130
|
-
knowsAbout: string[];
|
|
131
|
-
homeLocation: string | null;
|
|
132
|
-
nationality: string | null;
|
|
133
|
-
createdAt: Date;
|
|
134
|
-
updatedAt: Date;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
interface DeviceInfo {
|
|
138
|
-
deviceType: "mobile" | "tablet" | "console" | "smarttv" | "wearable" | "xr" | "embedded";
|
|
139
|
-
platform: string;
|
|
140
|
-
timezone?: string;
|
|
141
|
-
language?: string;
|
|
142
|
-
screenResolution?: {
|
|
143
|
-
width: number;
|
|
144
|
-
height: number;
|
|
145
|
-
};
|
|
146
|
-
browser?: string;
|
|
147
|
-
browserVersion?: string;
|
|
148
|
-
userAgent?: string;
|
|
149
|
-
[key: string]: unknown;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
interface AdminRefreshToken {
|
|
153
|
-
id: string;
|
|
154
|
-
tokenHash: string;
|
|
155
|
-
email: string;
|
|
156
|
-
ip: string;
|
|
157
|
-
deviceInfo: DeviceInfo | null;
|
|
158
|
-
adminId: string;
|
|
159
|
-
createdAt: Date;
|
|
160
|
-
expiresAt: Date;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
declare const FILE_TYPES: {
|
|
164
|
-
IMAGE: "IMAGE";
|
|
165
|
-
AUDIO: "AUDIO";
|
|
166
|
-
VIDEO: "VIDEO";
|
|
167
|
-
DOCUMENT: "DOCUMENT";
|
|
168
|
-
ARCHIVE: "ARCHIVE";
|
|
169
|
-
OTHER: "OTHER";
|
|
170
|
-
};
|
|
171
|
-
type FileType = (typeof FILE_TYPES)[keyof typeof FILE_TYPES];
|
|
172
|
-
|
|
173
|
-
interface File$1 {
|
|
174
|
-
id: string;
|
|
175
|
-
key: string;
|
|
176
|
-
checksum: string;
|
|
177
|
-
width: number | null;
|
|
178
|
-
height: number | null;
|
|
179
|
-
duration: number | null;
|
|
180
|
-
originalName: string;
|
|
181
|
-
size: number;
|
|
182
|
-
extension: string;
|
|
183
|
-
mimeType: string;
|
|
184
|
-
type: FileType;
|
|
185
|
-
isLocked: boolean;
|
|
186
|
-
folderId: string | null;
|
|
187
|
-
createdAt: Date;
|
|
188
|
-
updatedAt: Date;
|
|
189
|
-
deletedAt: Date | null;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
interface FileTranslation extends Translation {
|
|
193
|
-
id: string;
|
|
194
|
-
locale: string;
|
|
195
|
-
name: string | null;
|
|
196
|
-
alt: string | null;
|
|
197
|
-
fileId: string;
|
|
198
|
-
createdAt: Date;
|
|
199
|
-
updatedAt: Date;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
interface Folder {
|
|
203
|
-
id: string;
|
|
204
|
-
name: string;
|
|
205
|
-
key: string;
|
|
206
|
-
isLocked: boolean;
|
|
207
|
-
parentFolderId: string | null;
|
|
208
|
-
createdAt: Date;
|
|
209
|
-
updatedAt: Date;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
type FolderFull = Folder & {
|
|
213
|
-
parentFolder: (Folder & {
|
|
214
|
-
subFolders: Folder[];
|
|
215
|
-
files: File$1[];
|
|
216
|
-
}) | null;
|
|
217
|
-
subFolders: Folder[];
|
|
218
|
-
files: File$1[];
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
declare const POST_TYPES: {
|
|
222
|
-
TOPIC: "TOPIC";
|
|
223
|
-
CATEGORY: "CATEGORY";
|
|
224
|
-
POST: "POST";
|
|
225
|
-
TAG: "TAG";
|
|
226
|
-
PAGE: "PAGE";
|
|
227
|
-
};
|
|
228
|
-
type PostType = (typeof POST_TYPES)[keyof typeof POST_TYPES];
|
|
229
|
-
interface ExternalLink {
|
|
230
|
-
name: string;
|
|
231
|
-
href: string;
|
|
232
|
-
}
|
|
233
|
-
interface Faq {
|
|
234
|
-
question: string;
|
|
235
|
-
answer: string;
|
|
236
|
-
}
|
|
237
|
-
interface TocItem {
|
|
238
|
-
text: string;
|
|
239
|
-
id: string;
|
|
240
|
-
level: 2 | 3 | 4 | 5 | 6;
|
|
241
|
-
children?: TocItem[];
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
interface Post {
|
|
245
|
-
id: string;
|
|
246
|
-
type: PostType;
|
|
247
|
-
isLocked: boolean;
|
|
248
|
-
isActive: boolean;
|
|
249
|
-
isIndexActive: boolean;
|
|
250
|
-
index: number | null;
|
|
251
|
-
isSlugActive: boolean;
|
|
252
|
-
slug: string;
|
|
253
|
-
isFeatured: boolean;
|
|
254
|
-
isShownOnHome: boolean;
|
|
255
|
-
authorId: string | null;
|
|
256
|
-
topicId: string | null;
|
|
257
|
-
coverImageId: string | null;
|
|
258
|
-
createdAt: Date;
|
|
259
|
-
updatedAt: Date;
|
|
260
|
-
deletedAt: Date | null;
|
|
261
|
-
state1: boolean;
|
|
262
|
-
state2: boolean;
|
|
263
|
-
state3: boolean;
|
|
264
|
-
state4: boolean;
|
|
265
|
-
state5: boolean;
|
|
266
|
-
state6: boolean;
|
|
267
|
-
state7: boolean;
|
|
268
|
-
state8: boolean;
|
|
269
|
-
state9: boolean;
|
|
270
|
-
state10: boolean;
|
|
271
|
-
image1Id: string | null;
|
|
272
|
-
image2Id: string | null;
|
|
273
|
-
image3Id: string | null;
|
|
274
|
-
image4Id: string | null;
|
|
275
|
-
text1: string | null;
|
|
276
|
-
text2: string | null;
|
|
277
|
-
text3: string | null;
|
|
278
|
-
text4: string | null;
|
|
279
|
-
text5: string | null;
|
|
280
|
-
text6: string | null;
|
|
281
|
-
text7: string | null;
|
|
282
|
-
text8: string | null;
|
|
283
|
-
text9: string | null;
|
|
284
|
-
text10: string | null;
|
|
285
|
-
data1: any[];
|
|
286
|
-
data2: any[];
|
|
287
|
-
data3: any[];
|
|
288
|
-
data4: any[];
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
interface PostTranslation extends Translation {
|
|
292
|
-
id: string;
|
|
293
|
-
locale: string;
|
|
294
|
-
title: string | null;
|
|
295
|
-
subtitle: string | null;
|
|
296
|
-
summary: string | null;
|
|
297
|
-
description: string | null;
|
|
298
|
-
content: string | null;
|
|
299
|
-
externalLinks: ExternalLink[];
|
|
300
|
-
faq: Faq[];
|
|
301
|
-
toc: TocItem[];
|
|
302
|
-
readTime: number | null;
|
|
303
|
-
wordCount: number;
|
|
304
|
-
postId: string;
|
|
305
|
-
createdAt: Date;
|
|
306
|
-
updatedAt: Date;
|
|
307
|
-
text1: string | null;
|
|
308
|
-
text2: string | null;
|
|
309
|
-
text3: string | null;
|
|
310
|
-
text4: string | null;
|
|
311
|
-
text5: string | null;
|
|
312
|
-
text6: string | null;
|
|
313
|
-
text7: string | null;
|
|
314
|
-
text8: string | null;
|
|
315
|
-
text9: string | null;
|
|
316
|
-
text10: string | null;
|
|
317
|
-
data1: any[];
|
|
318
|
-
data2: any[];
|
|
319
|
-
data3: any[];
|
|
320
|
-
data4: any[];
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
type PostListCard = Post & {
|
|
324
|
-
topic: (Post & {
|
|
325
|
-
translations: PostTranslation[];
|
|
326
|
-
}) | null;
|
|
327
|
-
postsInTopic: Post[];
|
|
328
|
-
children: Post[];
|
|
329
|
-
taggedPosts: Post[];
|
|
330
|
-
coverImage: File$1 | null;
|
|
331
|
-
translations: PostTranslation[];
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
type PostFull = Post & {
|
|
335
|
-
author: AdminCard | null;
|
|
336
|
-
topic: PostListCard | null;
|
|
337
|
-
postsInTopic: PostListCard[];
|
|
338
|
-
parents: PostListCard[];
|
|
339
|
-
children: PostListCard[];
|
|
340
|
-
tags: PostListCard[];
|
|
341
|
-
taggedPosts: PostListCard[];
|
|
342
|
-
relatedPosts: PostListCard[];
|
|
343
|
-
referencingPosts: PostListCard[];
|
|
344
|
-
coverImage: FileCard | null;
|
|
345
|
-
images1: FileCard[];
|
|
346
|
-
images2: FileCard[];
|
|
347
|
-
image1: FileCard | null;
|
|
348
|
-
image2: FileCard | null;
|
|
349
|
-
image3: FileCard | null;
|
|
350
|
-
image4: FileCard | null;
|
|
351
|
-
translations: PostTranslation[];
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
type FileFull = File$1 & {
|
|
355
|
-
folder: Folder | null;
|
|
356
|
-
adminAsAvatarImage: Admin[];
|
|
357
|
-
postsAsCoverImage: Post[];
|
|
358
|
-
postsAsContentImage: Post[];
|
|
359
|
-
postsAsImages1: Post[];
|
|
360
|
-
postsAsImages2: Post[];
|
|
361
|
-
postsAsImage1: Post[];
|
|
362
|
-
postsAsImage2: Post[];
|
|
363
|
-
postsAsImage3: Post[];
|
|
364
|
-
postsAsImage4: Post[];
|
|
365
|
-
translations: FileTranslation[];
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
type FileCard = File$1 & {
|
|
369
|
-
translations: FileTranslation[];
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
type AdminFull = AdminSafe & {
|
|
373
|
-
adminRefreshTokens: AdminRefreshToken[];
|
|
374
|
-
avatarImage: (File$1 & {
|
|
375
|
-
translations: FileTranslation[];
|
|
376
|
-
}) | null;
|
|
377
|
-
posts: Post[];
|
|
378
|
-
translations: AdminTranslation[];
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
type AdminCard = AdminSafe & {
|
|
382
|
-
translations: AdminTranslation[];
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
interface Alternate {
|
|
386
|
-
hreflang: string;
|
|
387
|
-
href: string | null;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
interface SeoMetadata {
|
|
391
|
-
id: string;
|
|
392
|
-
locale: string;
|
|
393
|
-
title: string | null;
|
|
394
|
-
description: string | null;
|
|
395
|
-
author: string | null;
|
|
396
|
-
canonical: string | null;
|
|
397
|
-
alternate: Alternate[];
|
|
398
|
-
robots: string | null;
|
|
399
|
-
ogTitle: string | null;
|
|
400
|
-
ogDescription: string | null;
|
|
401
|
-
ogUrl: string | null;
|
|
402
|
-
ogType: string | null;
|
|
403
|
-
ogSiteName: string | null;
|
|
404
|
-
ogImage: string | null;
|
|
405
|
-
ogImageAlt: string | null;
|
|
406
|
-
ogImageType: string | null;
|
|
407
|
-
ogImageWidth: number | null;
|
|
408
|
-
ogImageHeight: number | null;
|
|
409
|
-
ogLocale: string | null;
|
|
410
|
-
ogLocaleAlternate: string[];
|
|
411
|
-
ogArticlePublishedTime: Date | null;
|
|
412
|
-
ogArticleModifiedTime: Date | null;
|
|
413
|
-
ogArticleAuthor: string | null;
|
|
414
|
-
ogArticleSection: string | null;
|
|
415
|
-
ogArticleTag: string[];
|
|
416
|
-
twitterCard: string | null;
|
|
417
|
-
twitterSite: string | null;
|
|
418
|
-
twitterCreator: string | null;
|
|
419
|
-
jsonLd: object[];
|
|
420
|
-
postId: string;
|
|
421
|
-
createdAt: Date;
|
|
422
|
-
updatedAt: Date;
|
|
423
|
-
}
|
|
1
|
+
import { F as FolderFull } from './base-DbGnfZr6.js';
|
|
2
|
+
export { A as ADMIN_ROLES, a as Admin, b as AdminCard, c as AdminFull, d as AdminRefreshToken, e as AdminRole, f as AdminSafe, g as AdminTranslation, h as Alternate, B as BaseTranslation, D as DeviceInfo, E as ExternalLink, i as FILE_TYPES, j as Faq, k as File, l as FileCard, m as FileFull, n as FileTranslation, o as FileType, p as Folder, M as MultiItems, P as POST_TYPES, q as Post, r as PostFull, s as PostListCard, t as PostTranslation, u as PostType, S as SeoMetadata, v as SingleItem, T as TocItem, w as Translation } from './base-DbGnfZr6.js';
|
|
424
3
|
|
|
425
4
|
declare const ROOT_FOLDER_ID = "01ARZ3NDEKTSV4RRFFQ69G5FAV";
|
|
426
5
|
declare const ROOT_FOLDER_NAME = "ROOT";
|
|
@@ -428,485 +7,6 @@ declare const ROOT_FOLDER: FolderFull;
|
|
|
428
7
|
declare const SIMPLE_UPLOAD_FOLDER_NAME = "simple-upload";
|
|
429
8
|
declare const SIMPLE_UPLOAD_FOLDER_KEY = "simple-upload";
|
|
430
9
|
|
|
431
|
-
interface CreateParams$4 {
|
|
432
|
-
email: string;
|
|
433
|
-
role: AdminRole;
|
|
434
|
-
passwordHash: string;
|
|
435
|
-
socialLinks: string[];
|
|
436
|
-
avatarImage: SingleItem;
|
|
437
|
-
translations: (BaseTranslation & {
|
|
438
|
-
name: string | null;
|
|
439
|
-
authorName: string | null;
|
|
440
|
-
description: string | null;
|
|
441
|
-
jobTitle: string | null;
|
|
442
|
-
url: string | null;
|
|
443
|
-
worksFor: string | null;
|
|
444
|
-
knowsAbout: string[];
|
|
445
|
-
homeLocation: string | null;
|
|
446
|
-
nationality: string | null;
|
|
447
|
-
})[];
|
|
448
|
-
}
|
|
449
|
-
interface UpdateParams$3 {
|
|
450
|
-
id: string;
|
|
451
|
-
email?: string;
|
|
452
|
-
role: AdminRole;
|
|
453
|
-
socialLinks: string[];
|
|
454
|
-
avatarImage: SingleItem;
|
|
455
|
-
emailVerifiedAt: Date | null;
|
|
456
|
-
translations: (BaseTranslation & {
|
|
457
|
-
name: string | null;
|
|
458
|
-
authorName: string | null;
|
|
459
|
-
description: string | null;
|
|
460
|
-
jobTitle: string | null;
|
|
461
|
-
url: string | null;
|
|
462
|
-
worksFor: string | null;
|
|
463
|
-
knowsAbout: string[];
|
|
464
|
-
homeLocation: string | null;
|
|
465
|
-
nationality: string | null;
|
|
466
|
-
})[];
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
declare function createAdminCommandRepository(prisma: any): {
|
|
470
|
-
create: ({ avatarImage, translations, ...params }: CreateParams$4) => Promise<Admin>;
|
|
471
|
-
update: ({ id, avatarImage, translations, ...params }: UpdateParams$3) => Promise<Admin>;
|
|
472
|
-
delete: ({ id }: {
|
|
473
|
-
id: string;
|
|
474
|
-
}) => Promise<Admin>;
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
interface FindListCardsParams$3 {
|
|
478
|
-
locale: string;
|
|
479
|
-
searchString?: string;
|
|
480
|
-
role?: AdminRole;
|
|
481
|
-
adminIds?: string[];
|
|
482
|
-
page?: number;
|
|
483
|
-
pageSize?: number;
|
|
484
|
-
}
|
|
485
|
-
interface FindParams$2 {
|
|
486
|
-
id?: string;
|
|
487
|
-
email?: string;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
declare function createAdminQueryRepository(prisma: any): {
|
|
491
|
-
findListCards: ({ locale, searchString, role, adminIds, page, pageSize, }: FindListCardsParams$3) => Promise<{
|
|
492
|
-
items: AdminFull[];
|
|
493
|
-
total: number;
|
|
494
|
-
}>;
|
|
495
|
-
find: (params: FindParams$2) => Promise<AdminSafe | null>;
|
|
496
|
-
findFull: (params: FindParams$2) => Promise<AdminFull | null>;
|
|
497
|
-
findWithPasswordHash: (params: FindParams$2) => Promise<Admin | null>;
|
|
498
|
-
};
|
|
499
|
-
|
|
500
|
-
interface CreateParams$3 {
|
|
501
|
-
tokenHash: string;
|
|
502
|
-
email: string;
|
|
503
|
-
ip: string;
|
|
504
|
-
deviceInfo?: DeviceInfo;
|
|
505
|
-
adminId: string;
|
|
506
|
-
expiresAt: Date;
|
|
507
|
-
}
|
|
508
|
-
interface DeleteParams {
|
|
509
|
-
id?: string;
|
|
510
|
-
tokenHash?: string;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
declare function createAdminRefreshTokenCommandRepository(prisma: any): {
|
|
514
|
-
create: ({ adminId, ...params }: CreateParams$3) => Promise<AdminRefreshToken>;
|
|
515
|
-
delete: ({ id, tokenHash }: DeleteParams) => Promise<void>;
|
|
516
|
-
deleteManyByExpired: () => Promise<number>;
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
declare function createAdminRefreshTokenQueryRepository(prisma: any): {
|
|
520
|
-
findManyByAdminId: ({ adminId, }: {
|
|
521
|
-
adminId: string;
|
|
522
|
-
}) => Promise<AdminRefreshToken[]>;
|
|
523
|
-
findByToken: ({ tokenHash, }: {
|
|
524
|
-
tokenHash: string;
|
|
525
|
-
}) => Promise<AdminRefreshToken | null>;
|
|
526
|
-
};
|
|
527
|
-
|
|
528
|
-
interface CreateParams$2 {
|
|
529
|
-
key: string;
|
|
530
|
-
checksum: string;
|
|
531
|
-
fileMeta: {
|
|
532
|
-
type?: string;
|
|
533
|
-
size?: number;
|
|
534
|
-
name?: string;
|
|
535
|
-
};
|
|
536
|
-
width?: number | null;
|
|
537
|
-
height?: number | null;
|
|
538
|
-
duration?: number | null;
|
|
539
|
-
folder?: SingleItem;
|
|
540
|
-
translations: (BaseTranslation & {
|
|
541
|
-
name: string | null;
|
|
542
|
-
alt: string | null;
|
|
543
|
-
})[];
|
|
544
|
-
}
|
|
545
|
-
interface UpdateParams$2 {
|
|
546
|
-
id: string;
|
|
547
|
-
file: File$1;
|
|
548
|
-
key: string;
|
|
549
|
-
checksum: string;
|
|
550
|
-
fileMeta: {
|
|
551
|
-
type?: string;
|
|
552
|
-
size?: number;
|
|
553
|
-
name?: string;
|
|
554
|
-
};
|
|
555
|
-
width?: number | null;
|
|
556
|
-
height?: number | null;
|
|
557
|
-
duration?: number | null;
|
|
558
|
-
folder?: SingleItem;
|
|
559
|
-
translations: (BaseTranslation & {
|
|
560
|
-
name: string | null;
|
|
561
|
-
alt: string | null;
|
|
562
|
-
})[];
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
declare function createFileCommandRepository(prisma: any): {
|
|
566
|
-
create: ({ fileMeta, folder, translations, ...params }: CreateParams$2) => Promise<FileFull>;
|
|
567
|
-
update: ({ file, id, fileMeta, folder, translations, ...params }: UpdateParams$2) => Promise<File$1>;
|
|
568
|
-
softDelete: ({ id }: {
|
|
569
|
-
id: string;
|
|
570
|
-
}) => Promise<File$1>;
|
|
571
|
-
softDeleteMany: ({ ids }: {
|
|
572
|
-
ids: string[];
|
|
573
|
-
}) => Promise<number>;
|
|
574
|
-
restoreMany: ({ ids }: {
|
|
575
|
-
ids: string[];
|
|
576
|
-
}) => Promise<number>;
|
|
577
|
-
delete: ({ id }: {
|
|
578
|
-
id: string;
|
|
579
|
-
}) => Promise<File$1>;
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
interface FindListCardsParams$2 {
|
|
583
|
-
locale: string;
|
|
584
|
-
searchString?: string;
|
|
585
|
-
type?: FileType | null;
|
|
586
|
-
isDeleted?: boolean;
|
|
587
|
-
isLocked?: boolean | null;
|
|
588
|
-
folderId?: string;
|
|
589
|
-
fileIds?: string[];
|
|
590
|
-
page?: number;
|
|
591
|
-
pageSize?: number;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
declare function createFileQueryRepository(prisma: any): {
|
|
595
|
-
findListCards: ({ locale, page, pageSize, searchString, type, folderId, isLocked, isDeleted, fileIds, }: FindListCardsParams$2) => Promise<{
|
|
596
|
-
items: FileFull[];
|
|
597
|
-
total: number;
|
|
598
|
-
}>;
|
|
599
|
-
findManyByIds: ({ ids, }: {
|
|
600
|
-
ids: string[];
|
|
601
|
-
}) => Promise<FileFull[]>;
|
|
602
|
-
findFull: ({ id }: {
|
|
603
|
-
id: string;
|
|
604
|
-
}) => Promise<FileFull | null>;
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
interface CreateParams$1 {
|
|
608
|
-
key: string;
|
|
609
|
-
name: string;
|
|
610
|
-
parentFolder: Folder | null;
|
|
611
|
-
}
|
|
612
|
-
interface UpdateParams$1 {
|
|
613
|
-
id: string;
|
|
614
|
-
key: string;
|
|
615
|
-
name: string;
|
|
616
|
-
parentFolder: Folder | null;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
declare function createFolderCommandRepository(prisma: any): {
|
|
620
|
-
create: ({ parentFolder, ...params }: CreateParams$1) => Promise<Folder>;
|
|
621
|
-
update: ({ id, parentFolder, ...params }: UpdateParams$1) => Promise<Folder>;
|
|
622
|
-
delete: ({ id }: {
|
|
623
|
-
id: string;
|
|
624
|
-
}) => Promise<Folder>;
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
interface FindListCardsParams$1 {
|
|
628
|
-
searchString?: string;
|
|
629
|
-
parentFolderId?: string;
|
|
630
|
-
folderIds?: string[];
|
|
631
|
-
page?: number;
|
|
632
|
-
pageSize?: number;
|
|
633
|
-
}
|
|
634
|
-
interface FindParams$1 {
|
|
635
|
-
id?: string;
|
|
636
|
-
key?: string;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
declare function createFolderQueryRepository(prisma: any): {
|
|
640
|
-
findListCards: ({ searchString, parentFolderId, folderIds, page, pageSize, }: FindListCardsParams$1) => Promise<{
|
|
641
|
-
items: FolderFull[];
|
|
642
|
-
total: number;
|
|
643
|
-
}>;
|
|
644
|
-
findFull: (params: FindParams$1) => Promise<FolderFull | null>;
|
|
645
|
-
};
|
|
646
|
-
|
|
647
|
-
interface CreateParams {
|
|
648
|
-
type: PostType;
|
|
649
|
-
isLocked: boolean;
|
|
650
|
-
isActive: boolean;
|
|
651
|
-
isIndexActive: boolean;
|
|
652
|
-
index: number | null;
|
|
653
|
-
isSlugActive: boolean;
|
|
654
|
-
slug: string | null;
|
|
655
|
-
isFeatured: boolean;
|
|
656
|
-
isShownOnHome: boolean;
|
|
657
|
-
author: SingleItem;
|
|
658
|
-
topicId: string | null;
|
|
659
|
-
parents: MultiItems;
|
|
660
|
-
tags: MultiItems;
|
|
661
|
-
relatedPosts: MultiItems;
|
|
662
|
-
coverImage: SingleItem;
|
|
663
|
-
contentImageIds: string[];
|
|
664
|
-
state1: boolean;
|
|
665
|
-
state2: boolean;
|
|
666
|
-
state3: boolean;
|
|
667
|
-
state4: boolean;
|
|
668
|
-
state5: boolean;
|
|
669
|
-
state6: boolean;
|
|
670
|
-
state7: boolean;
|
|
671
|
-
state8: boolean;
|
|
672
|
-
state9: boolean;
|
|
673
|
-
state10: boolean;
|
|
674
|
-
images1: MultiItems;
|
|
675
|
-
images2: MultiItems;
|
|
676
|
-
image1: SingleItem;
|
|
677
|
-
image2: SingleItem;
|
|
678
|
-
image3: SingleItem;
|
|
679
|
-
image4: SingleItem;
|
|
680
|
-
text1: string | null;
|
|
681
|
-
text2: string | null;
|
|
682
|
-
text3: string | null;
|
|
683
|
-
text4: string | null;
|
|
684
|
-
text5: string | null;
|
|
685
|
-
text6: string | null;
|
|
686
|
-
text7: string | null;
|
|
687
|
-
text8: string | null;
|
|
688
|
-
text9: string | null;
|
|
689
|
-
text10: string | null;
|
|
690
|
-
data1: any[];
|
|
691
|
-
data2: any[];
|
|
692
|
-
data3: any[];
|
|
693
|
-
data4: any[];
|
|
694
|
-
translations: (BaseTranslation & {
|
|
695
|
-
title: string | null;
|
|
696
|
-
subtitle: string | null;
|
|
697
|
-
summary: string | null;
|
|
698
|
-
description: string | null;
|
|
699
|
-
content: string | null;
|
|
700
|
-
externalLinks: ExternalLink[];
|
|
701
|
-
faq: Faq[];
|
|
702
|
-
toc: TocItem[];
|
|
703
|
-
readTime: number | null;
|
|
704
|
-
wordCount: number;
|
|
705
|
-
text1: string | null;
|
|
706
|
-
text2: string | null;
|
|
707
|
-
text3: string | null;
|
|
708
|
-
text4: string | null;
|
|
709
|
-
text5: string | null;
|
|
710
|
-
text6: string | null;
|
|
711
|
-
text7: string | null;
|
|
712
|
-
text8: string | null;
|
|
713
|
-
text9: string | null;
|
|
714
|
-
text10: string | null;
|
|
715
|
-
data1: any[];
|
|
716
|
-
data2: any[];
|
|
717
|
-
data3: any[];
|
|
718
|
-
data4: any[];
|
|
719
|
-
})[];
|
|
720
|
-
}
|
|
721
|
-
interface UpdateParams {
|
|
722
|
-
id: string;
|
|
723
|
-
type: PostType;
|
|
724
|
-
isLocked: boolean;
|
|
725
|
-
isActive: boolean;
|
|
726
|
-
isIndexActive: boolean;
|
|
727
|
-
index: number | null;
|
|
728
|
-
isSlugActive: boolean;
|
|
729
|
-
slug: string | null;
|
|
730
|
-
isFeatured: boolean;
|
|
731
|
-
isShownOnHome: boolean;
|
|
732
|
-
author: SingleItem;
|
|
733
|
-
topicId: string | null;
|
|
734
|
-
parents: MultiItems;
|
|
735
|
-
tags: MultiItems;
|
|
736
|
-
relatedPosts: MultiItems;
|
|
737
|
-
coverImage: SingleItem;
|
|
738
|
-
contentImageIds: string[];
|
|
739
|
-
state1: boolean;
|
|
740
|
-
state2: boolean;
|
|
741
|
-
state3: boolean;
|
|
742
|
-
state4: boolean;
|
|
743
|
-
state5: boolean;
|
|
744
|
-
state6: boolean;
|
|
745
|
-
state7: boolean;
|
|
746
|
-
state8: boolean;
|
|
747
|
-
state9: boolean;
|
|
748
|
-
state10: boolean;
|
|
749
|
-
images1: MultiItems;
|
|
750
|
-
images2: MultiItems;
|
|
751
|
-
image1: SingleItem;
|
|
752
|
-
image2: SingleItem;
|
|
753
|
-
image3: SingleItem;
|
|
754
|
-
image4: SingleItem;
|
|
755
|
-
text1: string | null;
|
|
756
|
-
text2: string | null;
|
|
757
|
-
text3: string | null;
|
|
758
|
-
text4: string | null;
|
|
759
|
-
text5: string | null;
|
|
760
|
-
text6: string | null;
|
|
761
|
-
text7: string | null;
|
|
762
|
-
text8: string | null;
|
|
763
|
-
text9: string | null;
|
|
764
|
-
text10: string | null;
|
|
765
|
-
data1: any[];
|
|
766
|
-
data2: any[];
|
|
767
|
-
data3: any[];
|
|
768
|
-
data4: any[];
|
|
769
|
-
translations: (BaseTranslation & {
|
|
770
|
-
title: string | null;
|
|
771
|
-
subtitle: string | null;
|
|
772
|
-
summary: string | null;
|
|
773
|
-
description: string | null;
|
|
774
|
-
content: string | null;
|
|
775
|
-
externalLinks: ExternalLink[];
|
|
776
|
-
faq: Faq[];
|
|
777
|
-
toc: TocItem[];
|
|
778
|
-
readTime: number | null;
|
|
779
|
-
wordCount: number;
|
|
780
|
-
text1: string | null;
|
|
781
|
-
text2: string | null;
|
|
782
|
-
text3: string | null;
|
|
783
|
-
text4: string | null;
|
|
784
|
-
text5: string | null;
|
|
785
|
-
text6: string | null;
|
|
786
|
-
text7: string | null;
|
|
787
|
-
text8: string | null;
|
|
788
|
-
text9: string | null;
|
|
789
|
-
text10: string | null;
|
|
790
|
-
data1: any[];
|
|
791
|
-
data2: any[];
|
|
792
|
-
data3: any[];
|
|
793
|
-
data4: any[];
|
|
794
|
-
})[];
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
declare function createPostCommandRepository(prisma: any): {
|
|
798
|
-
create: ({ slug, author, topicId, parents, tags, relatedPosts, coverImage, contentImageIds, images1, images2, image1, image2, image3, image4, translations, ...params }: CreateParams) => Promise<Post>;
|
|
799
|
-
update: ({ id, slug, author, topicId, parents, tags, relatedPosts, coverImage, contentImageIds, images1, images2, image1, image2, image3, image4, translations, ...params }: UpdateParams) => Promise<Post>;
|
|
800
|
-
delete: ({ id }: {
|
|
801
|
-
id: string;
|
|
802
|
-
}) => Promise<Post>;
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
interface FindListCardsParams {
|
|
806
|
-
locale: string;
|
|
807
|
-
type: PostType | null;
|
|
808
|
-
page?: number;
|
|
809
|
-
pageSize?: number;
|
|
810
|
-
searchString?: string;
|
|
811
|
-
topicId?: string;
|
|
812
|
-
postIds?: string[];
|
|
813
|
-
isActive?: boolean;
|
|
814
|
-
isIndexActive?: boolean;
|
|
815
|
-
isSlugActive?: boolean;
|
|
816
|
-
isFeatured?: boolean;
|
|
817
|
-
isShownOnHome?: boolean;
|
|
818
|
-
}
|
|
819
|
-
interface FindParams {
|
|
820
|
-
id?: string;
|
|
821
|
-
type?: PostType;
|
|
822
|
-
slug?: string;
|
|
823
|
-
}
|
|
824
|
-
interface FindManyParams {
|
|
825
|
-
type: PostType;
|
|
826
|
-
topicId?: string;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
declare function createPostQueryRepository(prisma: any): {
|
|
830
|
-
findListCards: ({ locale, searchString, type, topicId, postIds, isActive, isIndexActive, isSlugActive, isFeatured, isShownOnHome, page, pageSize, }: FindListCardsParams) => Promise<{
|
|
831
|
-
items: PostListCard[];
|
|
832
|
-
total: number;
|
|
833
|
-
}>;
|
|
834
|
-
findMany: ({ type, topicId, }: FindManyParams) => Promise<(Post & {
|
|
835
|
-
translations: PostTranslation[];
|
|
836
|
-
})[]>;
|
|
837
|
-
find: (params: FindParams) => Promise<(Post & {
|
|
838
|
-
translations: PostTranslation[];
|
|
839
|
-
}) | null>;
|
|
840
|
-
findFull: (params: FindParams) => Promise<PostFull | null>;
|
|
841
|
-
findWithSeoMetadata: (params: FindParams) => Promise<(Post & {
|
|
842
|
-
translations: PostTranslation[];
|
|
843
|
-
seoMetadatas: SeoMetadata[];
|
|
844
|
-
}) | null>;
|
|
845
|
-
};
|
|
846
|
-
|
|
847
|
-
interface UpsertParams {
|
|
848
|
-
postId: string;
|
|
849
|
-
translations: (BaseTranslation & {
|
|
850
|
-
title: string | null;
|
|
851
|
-
description: string | null;
|
|
852
|
-
author: string | null;
|
|
853
|
-
canonical: string | null;
|
|
854
|
-
alternate: Alternate[];
|
|
855
|
-
robots: string | null;
|
|
856
|
-
ogTitle: string | null;
|
|
857
|
-
ogDescription: string | null;
|
|
858
|
-
ogUrl: string | null;
|
|
859
|
-
ogType: string | null;
|
|
860
|
-
ogSiteName: string | null;
|
|
861
|
-
ogImage: string | null;
|
|
862
|
-
ogImageAlt: string | null;
|
|
863
|
-
ogImageType: string | null;
|
|
864
|
-
ogImageWidth: number | null;
|
|
865
|
-
ogImageHeight: number | null;
|
|
866
|
-
ogLocale: string | null;
|
|
867
|
-
ogLocaleAlternate: string[];
|
|
868
|
-
ogArticlePublishedTime: string | null;
|
|
869
|
-
ogArticleModifiedTime: string | null;
|
|
870
|
-
ogArticleAuthor: string | null;
|
|
871
|
-
ogArticleSection: string | null;
|
|
872
|
-
ogArticleTag: string[];
|
|
873
|
-
twitterCard: string | null;
|
|
874
|
-
twitterSite: string | null;
|
|
875
|
-
twitterCreator: string | null;
|
|
876
|
-
jsonLd: object[];
|
|
877
|
-
})[];
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
declare function createSeoMetadataCommandRepository(prisma: any): {
|
|
881
|
-
upsert: ({ postId, translations, }: UpsertParams) => Promise<void>;
|
|
882
|
-
};
|
|
883
|
-
|
|
884
|
-
declare const ORDER_BY: readonly [{
|
|
885
|
-
readonly updatedAt: "desc";
|
|
886
|
-
}, {
|
|
887
|
-
readonly createdAt: "desc";
|
|
888
|
-
}, {
|
|
889
|
-
readonly id: "asc";
|
|
890
|
-
}];
|
|
891
|
-
declare const ADMIN_ORDER_BY: ({
|
|
892
|
-
readonly updatedAt: "desc";
|
|
893
|
-
} | {
|
|
894
|
-
readonly createdAt: "desc";
|
|
895
|
-
} | {
|
|
896
|
-
readonly id: "asc";
|
|
897
|
-
} | {
|
|
898
|
-
role: "asc";
|
|
899
|
-
})[];
|
|
900
|
-
declare const POST_ORDER_BY: ({
|
|
901
|
-
readonly updatedAt: "desc";
|
|
902
|
-
} | {
|
|
903
|
-
readonly createdAt: "desc";
|
|
904
|
-
} | {
|
|
905
|
-
readonly id: "asc";
|
|
906
|
-
} | {
|
|
907
|
-
index: "asc";
|
|
908
|
-
})[];
|
|
909
|
-
|
|
910
10
|
declare const mimeToExtension: (mimeType?: string) => string;
|
|
911
11
|
|
|
912
12
|
declare const classifyFileType: (mimeType?: string, extension?: string) => "IMAGE" | "AUDIO" | "VIDEO" | "DOCUMENT" | "ARCHIVE" | "OTHER";
|
|
@@ -927,4 +27,4 @@ interface BlobFile extends File {
|
|
|
927
27
|
duration: number | null;
|
|
928
28
|
}
|
|
929
29
|
|
|
930
|
-
export {
|
|
30
|
+
export { type BlobFile, FolderFull, ROOT_FOLDER, ROOT_FOLDER_ID, ROOT_FOLDER_NAME, SIMPLE_UPLOAD_FOLDER_KEY, SIMPLE_UPLOAD_FOLDER_NAME, classifyFileType, formatFileSize, getMediaInfo, mimeToExtension };
|