@yimingliao/cms 0.0.7 → 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/index.d.ts CHANGED
@@ -1,905 +1,11 @@
1
- import jwt from 'jsonwebtoken';
2
- import { BinaryLike } from 'node:crypto';
3
- import { cookies } from 'next/headers';
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';
4
3
 
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
- }
424
-
425
- interface CreateParams$4 {
426
- email: string;
427
- role: AdminRole;
428
- passwordHash: string;
429
- socialLinks: string[];
430
- avatarImage: SingleItem;
431
- translations: (BaseTranslation & {
432
- name: string | null;
433
- authorName: string | null;
434
- description: string | null;
435
- jobTitle: string | null;
436
- url: string | null;
437
- worksFor: string | null;
438
- knowsAbout: string[];
439
- homeLocation: string | null;
440
- nationality: string | null;
441
- })[];
442
- }
443
- interface UpdateParams$3 {
444
- id: string;
445
- email?: string;
446
- role: AdminRole;
447
- socialLinks: string[];
448
- avatarImage: SingleItem;
449
- emailVerifiedAt: Date | null;
450
- translations: (BaseTranslation & {
451
- name: string | null;
452
- authorName: string | null;
453
- description: string | null;
454
- jobTitle: string | null;
455
- url: string | null;
456
- worksFor: string | null;
457
- knowsAbout: string[];
458
- homeLocation: string | null;
459
- nationality: string | null;
460
- })[];
461
- }
462
-
463
- declare function createAdminCommandRepository(prisma: any): {
464
- create: ({ avatarImage, translations, ...params }: CreateParams$4) => Promise<Admin>;
465
- update: ({ id, avatarImage, translations, ...params }: UpdateParams$3) => Promise<Admin>;
466
- delete: ({ id }: {
467
- id: string;
468
- }) => Promise<Admin>;
469
- };
470
-
471
- interface FindListCardsParams$3 {
472
- locale: string;
473
- searchString?: string;
474
- role?: AdminRole;
475
- adminIds?: string[];
476
- page?: number;
477
- pageSize?: number;
478
- }
479
- interface FindParams$2 {
480
- id?: string;
481
- email?: string;
482
- }
483
-
484
- declare function createAdminQueryRepository(prisma: any): {
485
- findListCards: ({ locale, searchString, role, adminIds, page, pageSize, }: FindListCardsParams$3) => Promise<{
486
- items: AdminFull[];
487
- total: number;
488
- }>;
489
- find: (params: FindParams$2) => Promise<AdminSafe | null>;
490
- findFull: (params: FindParams$2) => Promise<AdminFull | null>;
491
- findWithPasswordHash: (params: FindParams$2) => Promise<Admin | null>;
492
- };
493
-
494
- interface CreateParams$3 {
495
- tokenHash: string;
496
- email: string;
497
- ip: string;
498
- deviceInfo?: DeviceInfo;
499
- adminId: string;
500
- expiresAt: Date;
501
- }
502
- interface DeleteParams {
503
- id?: string;
504
- tokenHash?: string;
505
- }
506
-
507
- declare function createAdminRefreshTokenCommandRepository(prisma: any): {
508
- create: ({ adminId, ...params }: CreateParams$3) => Promise<AdminRefreshToken>;
509
- delete: ({ id, tokenHash }: DeleteParams) => Promise<void>;
510
- deleteManyByExpired: () => Promise<number>;
511
- };
512
-
513
- declare function createAdminRefreshTokenQueryRepository(prisma: any): {
514
- findManyByAdminId: ({ adminId, }: {
515
- adminId: string;
516
- }) => Promise<AdminRefreshToken[]>;
517
- findByToken: ({ tokenHash, }: {
518
- tokenHash: string;
519
- }) => Promise<AdminRefreshToken | null>;
520
- };
521
-
522
- interface CreateParams$2 {
523
- key: string;
524
- checksum: string;
525
- fileMeta: {
526
- type?: string;
527
- size?: number;
528
- name?: string;
529
- };
530
- width?: number | null;
531
- height?: number | null;
532
- duration?: number | null;
533
- folder?: SingleItem;
534
- translations: (BaseTranslation & {
535
- name: string | null;
536
- alt: string | null;
537
- })[];
538
- }
539
- interface UpdateParams$2 {
540
- id: string;
541
- file: File$1;
542
- key: string;
543
- checksum: string;
544
- fileMeta: {
545
- type?: string;
546
- size?: number;
547
- name?: string;
548
- };
549
- width?: number | null;
550
- height?: number | null;
551
- duration?: number | null;
552
- folder?: SingleItem;
553
- translations: (BaseTranslation & {
554
- name: string | null;
555
- alt: string | null;
556
- })[];
557
- }
558
-
559
- declare function createFileCommandRepository(prisma: any): {
560
- create: ({ fileMeta, folder, translations, ...params }: CreateParams$2) => Promise<FileFull>;
561
- update: ({ file, id, fileMeta, folder, translations, ...params }: UpdateParams$2) => Promise<File$1>;
562
- softDelete: ({ id }: {
563
- id: string;
564
- }) => Promise<File$1>;
565
- softDeleteMany: ({ ids }: {
566
- ids: string[];
567
- }) => Promise<number>;
568
- restoreMany: ({ ids }: {
569
- ids: string[];
570
- }) => Promise<number>;
571
- delete: ({ id }: {
572
- id: string;
573
- }) => Promise<File$1>;
574
- };
575
-
576
- interface FindListCardsParams$2 {
577
- locale: string;
578
- searchString?: string;
579
- type?: FileType | null;
580
- isDeleted?: boolean;
581
- isLocked?: boolean | null;
582
- folderId?: string;
583
- fileIds?: string[];
584
- page?: number;
585
- pageSize?: number;
586
- }
587
-
588
- declare function createFileQueryRepository(prisma: any): {
589
- findListCards: ({ locale, page, pageSize, searchString, type, folderId, isLocked, isDeleted, fileIds, }: FindListCardsParams$2) => Promise<{
590
- items: FileFull[];
591
- total: number;
592
- }>;
593
- findManyByIds: ({ ids, }: {
594
- ids: string[];
595
- }) => Promise<FileFull[]>;
596
- findFull: ({ id }: {
597
- id: string;
598
- }) => Promise<FileFull | null>;
599
- };
600
-
601
- interface CreateParams$1 {
602
- key: string;
603
- name: string;
604
- parentFolder: Folder | null;
605
- }
606
- interface UpdateParams$1 {
607
- id: string;
608
- key: string;
609
- name: string;
610
- parentFolder: Folder | null;
611
- }
612
-
613
- declare function createFolderCommandRepository(prisma: any): {
614
- create: ({ parentFolder, ...params }: CreateParams$1) => Promise<Folder>;
615
- update: ({ id, parentFolder, ...params }: UpdateParams$1) => Promise<Folder>;
616
- delete: ({ id }: {
617
- id: string;
618
- }) => Promise<Folder>;
619
- };
620
-
621
- interface FindListCardsParams$1 {
622
- searchString?: string;
623
- parentFolderId?: string;
624
- folderIds?: string[];
625
- page?: number;
626
- pageSize?: number;
627
- }
628
- interface FindParams$1 {
629
- id?: string;
630
- key?: string;
631
- }
632
-
633
- declare function createFolderQueryRepository(prisma: any): {
634
- findListCards: ({ searchString, parentFolderId, folderIds, page, pageSize, }: FindListCardsParams$1) => Promise<{
635
- items: FolderFull[];
636
- total: number;
637
- }>;
638
- findFull: (params: FindParams$1) => Promise<FolderFull | null>;
639
- };
640
-
641
- interface CreateParams {
642
- type: PostType;
643
- isLocked: boolean;
644
- isActive: boolean;
645
- isIndexActive: boolean;
646
- index: number | null;
647
- isSlugActive: boolean;
648
- slug: string | null;
649
- isFeatured: boolean;
650
- isShownOnHome: boolean;
651
- author: SingleItem;
652
- topicId: string | null;
653
- parents: MultiItems;
654
- tags: MultiItems;
655
- relatedPosts: MultiItems;
656
- coverImage: SingleItem;
657
- contentImageIds: string[];
658
- state1: boolean;
659
- state2: boolean;
660
- state3: boolean;
661
- state4: boolean;
662
- state5: boolean;
663
- state6: boolean;
664
- state7: boolean;
665
- state8: boolean;
666
- state9: boolean;
667
- state10: boolean;
668
- images1: MultiItems;
669
- images2: MultiItems;
670
- image1: SingleItem;
671
- image2: SingleItem;
672
- image3: SingleItem;
673
- image4: SingleItem;
674
- text1: string | null;
675
- text2: string | null;
676
- text3: string | null;
677
- text4: string | null;
678
- text5: string | null;
679
- text6: string | null;
680
- text7: string | null;
681
- text8: string | null;
682
- text9: string | null;
683
- text10: string | null;
684
- data1: any[];
685
- data2: any[];
686
- data3: any[];
687
- data4: any[];
688
- translations: (BaseTranslation & {
689
- title: string | null;
690
- subtitle: string | null;
691
- summary: string | null;
692
- description: string | null;
693
- content: string | null;
694
- externalLinks: ExternalLink[];
695
- faq: Faq[];
696
- toc: TocItem[];
697
- readTime: number | null;
698
- wordCount: number;
699
- text1: string | null;
700
- text2: string | null;
701
- text3: string | null;
702
- text4: string | null;
703
- text5: string | null;
704
- text6: string | null;
705
- text7: string | null;
706
- text8: string | null;
707
- text9: string | null;
708
- text10: string | null;
709
- data1: any[];
710
- data2: any[];
711
- data3: any[];
712
- data4: any[];
713
- })[];
714
- }
715
- interface UpdateParams {
716
- id: string;
717
- type: PostType;
718
- isLocked: boolean;
719
- isActive: boolean;
720
- isIndexActive: boolean;
721
- index: number | null;
722
- isSlugActive: boolean;
723
- slug: string | null;
724
- isFeatured: boolean;
725
- isShownOnHome: boolean;
726
- author: SingleItem;
727
- topicId: string | null;
728
- parents: MultiItems;
729
- tags: MultiItems;
730
- relatedPosts: MultiItems;
731
- coverImage: SingleItem;
732
- contentImageIds: string[];
733
- state1: boolean;
734
- state2: boolean;
735
- state3: boolean;
736
- state4: boolean;
737
- state5: boolean;
738
- state6: boolean;
739
- state7: boolean;
740
- state8: boolean;
741
- state9: boolean;
742
- state10: boolean;
743
- images1: MultiItems;
744
- images2: MultiItems;
745
- image1: SingleItem;
746
- image2: SingleItem;
747
- image3: SingleItem;
748
- image4: SingleItem;
749
- text1: string | null;
750
- text2: string | null;
751
- text3: string | null;
752
- text4: string | null;
753
- text5: string | null;
754
- text6: string | null;
755
- text7: string | null;
756
- text8: string | null;
757
- text9: string | null;
758
- text10: string | null;
759
- data1: any[];
760
- data2: any[];
761
- data3: any[];
762
- data4: any[];
763
- translations: (BaseTranslation & {
764
- title: string | null;
765
- subtitle: string | null;
766
- summary: string | null;
767
- description: string | null;
768
- content: string | null;
769
- externalLinks: ExternalLink[];
770
- faq: Faq[];
771
- toc: TocItem[];
772
- readTime: number | null;
773
- wordCount: number;
774
- text1: string | null;
775
- text2: string | null;
776
- text3: string | null;
777
- text4: string | null;
778
- text5: string | null;
779
- text6: string | null;
780
- text7: string | null;
781
- text8: string | null;
782
- text9: string | null;
783
- text10: string | null;
784
- data1: any[];
785
- data2: any[];
786
- data3: any[];
787
- data4: any[];
788
- })[];
789
- }
790
-
791
- declare function createPostCommandRepository(prisma: any): {
792
- create: ({ slug, author, topicId, parents, tags, relatedPosts, coverImage, contentImageIds, images1, images2, image1, image2, image3, image4, translations, ...params }: CreateParams) => Promise<Post>;
793
- update: ({ id, slug, author, topicId, parents, tags, relatedPosts, coverImage, contentImageIds, images1, images2, image1, image2, image3, image4, translations, ...params }: UpdateParams) => Promise<Post>;
794
- delete: ({ id }: {
795
- id: string;
796
- }) => Promise<Post>;
797
- };
798
-
799
- interface FindListCardsParams {
800
- locale: string;
801
- type: PostType | null;
802
- page?: number;
803
- pageSize?: number;
804
- searchString?: string;
805
- topicId?: string;
806
- postIds?: string[];
807
- isActive?: boolean;
808
- isIndexActive?: boolean;
809
- isSlugActive?: boolean;
810
- isFeatured?: boolean;
811
- isShownOnHome?: boolean;
812
- }
813
- interface FindParams {
814
- id?: string;
815
- type?: PostType;
816
- slug?: string;
817
- }
818
- interface FindManyParams {
819
- type: PostType;
820
- topicId?: string;
821
- }
822
-
823
- declare function createPostQueryRepository(prisma: any): {
824
- findListCards: ({ locale, searchString, type, topicId, postIds, isActive, isIndexActive, isSlugActive, isFeatured, isShownOnHome, page, pageSize, }: FindListCardsParams) => Promise<{
825
- items: PostListCard[];
826
- total: number;
827
- }>;
828
- findMany: ({ type, topicId, }: FindManyParams) => Promise<(Post & {
829
- translations: PostTranslation[];
830
- })[]>;
831
- find: (params: FindParams) => Promise<(Post & {
832
- translations: PostTranslation[];
833
- }) | null>;
834
- findFull: (params: FindParams) => Promise<PostFull | null>;
835
- findWithSeoMetadata: (params: FindParams) => Promise<(Post & {
836
- translations: PostTranslation[];
837
- seoMetadatas: SeoMetadata[];
838
- }) | null>;
839
- };
840
-
841
- interface UpsertParams {
842
- postId: string;
843
- translations: (BaseTranslation & {
844
- title: string | null;
845
- description: string | null;
846
- author: string | null;
847
- canonical: string | null;
848
- alternate: Alternate[];
849
- robots: string | null;
850
- ogTitle: string | null;
851
- ogDescription: string | null;
852
- ogUrl: string | null;
853
- ogType: string | null;
854
- ogSiteName: string | null;
855
- ogImage: string | null;
856
- ogImageAlt: string | null;
857
- ogImageType: string | null;
858
- ogImageWidth: number | null;
859
- ogImageHeight: number | null;
860
- ogLocale: string | null;
861
- ogLocaleAlternate: string[];
862
- ogArticlePublishedTime: string | null;
863
- ogArticleModifiedTime: string | null;
864
- ogArticleAuthor: string | null;
865
- ogArticleSection: string | null;
866
- ogArticleTag: string[];
867
- twitterCard: string | null;
868
- twitterSite: string | null;
869
- twitterCreator: string | null;
870
- jsonLd: object[];
871
- })[];
872
- }
873
-
874
- declare function createSeoMetadataCommandRepository(prisma: any): {
875
- upsert: ({ postId, translations, }: UpsertParams) => Promise<void>;
876
- };
877
-
878
- declare const ORDER_BY: readonly [{
879
- readonly updatedAt: "desc";
880
- }, {
881
- readonly createdAt: "desc";
882
- }, {
883
- readonly id: "asc";
884
- }];
885
- declare const ADMIN_ORDER_BY: ({
886
- readonly updatedAt: "desc";
887
- } | {
888
- readonly createdAt: "desc";
889
- } | {
890
- readonly id: "asc";
891
- } | {
892
- role: "asc";
893
- })[];
894
- declare const POST_ORDER_BY: ({
895
- readonly updatedAt: "desc";
896
- } | {
897
- readonly createdAt: "desc";
898
- } | {
899
- readonly id: "asc";
900
- } | {
901
- index: "asc";
902
- })[];
4
+ declare const ROOT_FOLDER_ID = "01ARZ3NDEKTSV4RRFFQ69G5FAV";
5
+ declare const ROOT_FOLDER_NAME = "ROOT";
6
+ declare const ROOT_FOLDER: FolderFull;
7
+ declare const SIMPLE_UPLOAD_FOLDER_NAME = "simple-upload";
8
+ declare const SIMPLE_UPLOAD_FOLDER_KEY = "simple-upload";
903
9
 
904
10
  declare const mimeToExtension: (mimeType?: string) => string;
905
11
 
@@ -921,4 +27,4 @@ interface BlobFile extends File {
921
27
  duration: number | null;
922
28
  }
923
29
 
924
- export { ADMIN_ORDER_BY, ADMIN_ROLES, type Admin, type AdminCard, type AdminFull, type AdminRefreshToken, type AdminRole, type AdminSafe, type AdminTranslation, type Alternate, type BaseTranslation, type BlobFile, type DeviceInfo, type ExternalLink, FILE_TYPES, type Faq, type File$1 as File, type FileCard, type FileFull, type FileTranslation, type FileType, type Folder, type FolderFull, type MultiItems, ORDER_BY, POST_ORDER_BY, POST_TYPES, type Post, type PostFull, type PostListCard, type PostTranslation, type PostType, type SeoMetadata, type SingleItem, type TocItem, type Translation, classifyFileType, createAdminCommandRepository, createAdminQueryRepository, createAdminRefreshTokenCommandRepository, createAdminRefreshTokenQueryRepository, createArgon2Service, createCookieService, createCryptoService, createFileCommandRepository, createFileQueryRepository, createFolderCommandRepository, createFolderQueryRepository, createJwtService, createPostCommandRepository, createPostQueryRepository, createSeoMetadataCommandRepository, formatFileSize, getMediaInfo, mimeToExtension };
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 };