@yimingliao/cms 0.0.34 → 0.0.36
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-BUAGZ2YH.d.ts → card-Bstrkz2o.d.ts} +39 -32
- package/dist/{chunk-I2DBI3WJ.js → chunk-JADZTYRH.js} +23 -11
- package/dist/{chunk-DWFOB4P3.js → chunk-SUETTGXY.js} +1 -1
- package/dist/index.d.ts +8 -14
- package/dist/index.js +1 -1
- package/dist/server/index.d.ts +2 -11
- package/dist/server/index.js +1 -1
- package/dist/storage/r2/index.js +2 -2
- package/dist/storage/sftp/index.js +2 -2
- package/package.json +1 -1
|
@@ -266,37 +266,6 @@ type PostFull = Post & {
|
|
|
266
266
|
translations: PostTranslation[];
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
-
type FileFull = File & {
|
|
270
|
-
folder: Folder | null;
|
|
271
|
-
adminAsAvatarImage: Admin[];
|
|
272
|
-
postsAsCoverImage: Post[];
|
|
273
|
-
postsAsContentImage: Post[];
|
|
274
|
-
postsAsImages1: Post[];
|
|
275
|
-
postsAsImages2: Post[];
|
|
276
|
-
postsAsImage1: Post[];
|
|
277
|
-
postsAsImage2: Post[];
|
|
278
|
-
postsAsImage3: Post[];
|
|
279
|
-
postsAsImage4: Post[];
|
|
280
|
-
translations: FileTranslation[];
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
type FileCard = File & {
|
|
284
|
-
translations: FileTranslation[];
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
type AdminFull = AdminSafe & {
|
|
288
|
-
adminRefreshTokens: AdminRefreshToken[];
|
|
289
|
-
avatarImage: (File & {
|
|
290
|
-
translations: FileTranslation[];
|
|
291
|
-
}) | null;
|
|
292
|
-
posts: Post[];
|
|
293
|
-
translations: AdminTranslation[];
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
type AdminCard = AdminSafe & {
|
|
297
|
-
translations: AdminTranslation[];
|
|
298
|
-
};
|
|
299
|
-
|
|
300
269
|
interface Alternate {
|
|
301
270
|
hreflang: string;
|
|
302
271
|
href: string | null;
|
|
@@ -337,4 +306,42 @@ interface SeoMetadata {
|
|
|
337
306
|
updatedAt: Date;
|
|
338
307
|
}
|
|
339
308
|
|
|
340
|
-
|
|
309
|
+
type PostWithSeoMetadata = Post & {
|
|
310
|
+
author: AdminCard | null;
|
|
311
|
+
coverImage: FileCard | null;
|
|
312
|
+
seoMetadatas: SeoMetadata[];
|
|
313
|
+
translations: PostTranslation[];
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
type FileFull = File & {
|
|
317
|
+
folder: Folder | null;
|
|
318
|
+
adminAsAvatarImage: Admin[];
|
|
319
|
+
postsAsCoverImage: Post[];
|
|
320
|
+
postsAsContentImage: Post[];
|
|
321
|
+
postsAsImages1: Post[];
|
|
322
|
+
postsAsImages2: Post[];
|
|
323
|
+
postsAsImage1: Post[];
|
|
324
|
+
postsAsImage2: Post[];
|
|
325
|
+
postsAsImage3: Post[];
|
|
326
|
+
postsAsImage4: Post[];
|
|
327
|
+
translations: FileTranslation[];
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
type FileCard = File & {
|
|
331
|
+
translations: FileTranslation[];
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
type AdminFull = AdminSafe & {
|
|
335
|
+
adminRefreshTokens: AdminRefreshToken[];
|
|
336
|
+
avatarImage: (File & {
|
|
337
|
+
translations: FileTranslation[];
|
|
338
|
+
}) | null;
|
|
339
|
+
posts: Post[];
|
|
340
|
+
translations: AdminTranslation[];
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
type AdminCard = AdminSafe & {
|
|
344
|
+
translations: AdminTranslation[];
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
export { ADMIN_ROLES as A, type BaseTranslation as B, type DeviceInfo as D, type ExternalLink as E, type FolderFull as F, type MultiItems as M, POST_TYPES as P, type SeoMetadata as S, type TocItem as T, type Admin as a, type AdminCard as b, type AdminFull as c, type AdminRefreshToken as d, type AdminRole as e, type AdminSafe as f, type AdminTranslation as g, type Alternate as h, FILE_TYPES as i, type Faq as j, type File as k, type FileCard as l, type FileFull as m, type FileTranslation as n, type FileType as o, type Folder as p, type Post as q, type PostFull as r, type PostListCard as s, type PostTranslation as t, type PostType as u, type PostWithSeoMetadata as v, type SingleItem as w, type Translation as x };
|
|
@@ -185,6 +185,28 @@ var result = {
|
|
|
185
185
|
error
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
+
// src/shared/seo-metadata/standards.ts
|
|
189
|
+
var OG_TYPE_ARRAY = [
|
|
190
|
+
"article",
|
|
191
|
+
"book",
|
|
192
|
+
"music.song",
|
|
193
|
+
"music.album",
|
|
194
|
+
"music.playlist",
|
|
195
|
+
"music.radio_station",
|
|
196
|
+
"profile",
|
|
197
|
+
"website",
|
|
198
|
+
"video.tv_show",
|
|
199
|
+
"video.other",
|
|
200
|
+
"video.movie",
|
|
201
|
+
"video.episode"
|
|
202
|
+
];
|
|
203
|
+
var TWITTER_CARD_ARRAY = [
|
|
204
|
+
"summary",
|
|
205
|
+
"summary_large_image",
|
|
206
|
+
"player",
|
|
207
|
+
"app"
|
|
208
|
+
];
|
|
209
|
+
|
|
188
210
|
// src/shared/units.ts
|
|
189
211
|
var SIZE = {
|
|
190
212
|
BYTE: 1,
|
|
@@ -194,15 +216,5 @@ var SIZE = {
|
|
|
194
216
|
TB: 1024 ** 4,
|
|
195
217
|
PB: 1024 ** 5
|
|
196
218
|
};
|
|
197
|
-
var TIME = {
|
|
198
|
-
MILLISECOND: 1,
|
|
199
|
-
SECOND: 1e3,
|
|
200
|
-
MINUTE: 60 * 1e3,
|
|
201
|
-
HOUR: 60 * 60 * 1e3,
|
|
202
|
-
DAY: 24 * 60 * 60 * 1e3,
|
|
203
|
-
WEEK: 7 * 24 * 60 * 60 * 1e3,
|
|
204
|
-
MONTH: 30 * 24 * 60 * 60 * 1e3,
|
|
205
|
-
YEAR: 365 * 24 * 60 * 60 * 1e3
|
|
206
|
-
};
|
|
207
219
|
|
|
208
|
-
export { FILE_TYPES, SIZE,
|
|
220
|
+
export { FILE_TYPES, OG_TYPE_ARRAY, SIZE, TWITTER_CARD_ARRAY, classifyFileType, formatFileSize, getMediaInfo, mimeToExtension, result };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FolderFull } from './
|
|
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,
|
|
1
|
+
import { F as FolderFull } from './card-Bstrkz2o.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, v as PostWithSeoMetadata, S as SeoMetadata, w as SingleItem, T as TocItem, x as Translation } from './card-Bstrkz2o.js';
|
|
3
3
|
export { B as BlobFile } from './types-0oS1A2K5.js';
|
|
4
4
|
import { E as ErrorDetail, S as SuccessResult, a as ErrorResult } from './types-DHlRoJwv.js';
|
|
5
5
|
export { R as Result } from './types-DHlRoJwv.js';
|
|
@@ -44,6 +44,11 @@ declare const result: {
|
|
|
44
44
|
error: typeof error;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
declare const OG_TYPE_ARRAY: ("article" | "book" | "music.song" | "music.album" | "music.playlist" | "music.radio_station" | "profile" | "website" | "video.tv_show" | "video.other" | "video.movie" | "video.episode")[];
|
|
48
|
+
type OgType = (typeof OG_TYPE_ARRAY)[number];
|
|
49
|
+
declare const TWITTER_CARD_ARRAY: readonly ["summary", "summary_large_image", "player", "app"];
|
|
50
|
+
type TwitterCard = (typeof TWITTER_CARD_ARRAY)[number];
|
|
51
|
+
|
|
47
52
|
declare const SIZE: {
|
|
48
53
|
readonly BYTE: 1;
|
|
49
54
|
readonly KB: 1024;
|
|
@@ -53,16 +58,5 @@ declare const SIZE: {
|
|
|
53
58
|
readonly PB: number;
|
|
54
59
|
};
|
|
55
60
|
type SizeUnit = keyof typeof SIZE;
|
|
56
|
-
declare const TIME: {
|
|
57
|
-
readonly MILLISECOND: 1;
|
|
58
|
-
readonly SECOND: 1000;
|
|
59
|
-
readonly MINUTE: number;
|
|
60
|
-
readonly HOUR: number;
|
|
61
|
-
readonly DAY: number;
|
|
62
|
-
readonly WEEK: number;
|
|
63
|
-
readonly MONTH: number;
|
|
64
|
-
readonly YEAR: number;
|
|
65
|
-
};
|
|
66
|
-
type TimeUnit = keyof typeof TIME;
|
|
67
61
|
|
|
68
|
-
export { ErrorDetail, ErrorResult, type ErrorResultParams, FolderFull, ROOT_FOLDER, ROOT_FOLDER_ID, ROOT_FOLDER_NAME, SIMPLE_UPLOAD_FOLDER_KEY, SIMPLE_UPLOAD_FOLDER_NAME, SIZE, type SizeUnit, SuccessResult, type SuccessResultParams,
|
|
62
|
+
export { ErrorDetail, ErrorResult, type ErrorResultParams, FolderFull, OG_TYPE_ARRAY, type OgType, ROOT_FOLDER, ROOT_FOLDER_ID, ROOT_FOLDER_NAME, SIMPLE_UPLOAD_FOLDER_KEY, SIMPLE_UPLOAD_FOLDER_NAME, SIZE, type SizeUnit, SuccessResult, type SuccessResultParams, TWITTER_CARD_ARRAY, type TwitterCard, classifyFileType, formatFileSize, getMediaInfo, mimeToExtension, result };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ADMIN_ROLES, POST_TYPES, ROOT_FOLDER, ROOT_FOLDER_ID, ROOT_FOLDER_NAME, SIMPLE_UPLOAD_FOLDER_KEY, SIMPLE_UPLOAD_FOLDER_NAME } from './chunk-ZCOYQ5BG.js';
|
|
2
|
-
export { FILE_TYPES, SIZE,
|
|
2
|
+
export { FILE_TYPES, OG_TYPE_ARRAY, SIZE, TWITTER_CARD_ARRAY, classifyFileType, formatFileSize, getMediaInfo, mimeToExtension, result } from './chunk-JADZTYRH.js';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as zod from 'zod';
|
|
|
7
7
|
import zod__default, { z, ZodType } from 'zod';
|
|
8
8
|
import { B as BlobFile } from '../types-0oS1A2K5.js';
|
|
9
9
|
import * as zod_v4_core from 'zod/v4/core';
|
|
10
|
-
import { T as TocItem, e as AdminRole,
|
|
10
|
+
import { T as TocItem, e as AdminRole, w as SingleItem, B as BaseTranslation, a as Admin, c as AdminFull, f as AdminSafe, D as DeviceInfo, d as AdminRefreshToken, k as File$1, m as FileFull, o as FileType, p as Folder, F as FolderFull, u as PostType, M as MultiItems, E as ExternalLink, j as Faq, q as Post, s as PostListCard, t as PostTranslation, r as PostFull, v as PostWithSeoMetadata, h as Alternate } from '../card-Bstrkz2o.js';
|
|
11
11
|
import { BaseTranslator, LocaleMessages } from 'intor';
|
|
12
12
|
import { S as SuccessResult, R as Result } from '../types-DHlRoJwv.js';
|
|
13
13
|
import { NextResponse } from 'next/server';
|
|
@@ -614,16 +614,7 @@ declare function createPostQueryRepository(prisma: any): {
|
|
|
614
614
|
translations: PostTranslation[];
|
|
615
615
|
}) | null>;
|
|
616
616
|
findFull: ({ isActive, topicSlug, ...rest }: FindParams) => Promise<PostFull | null>;
|
|
617
|
-
findWithSeoMetadata: ({ isActive, ...rest }: FindParams) => Promise<
|
|
618
|
-
translations: PostTranslation[];
|
|
619
|
-
seoMetadatas: SeoMetadata[];
|
|
620
|
-
author: AdminSafe & {
|
|
621
|
-
translations: AdminTranslation[];
|
|
622
|
-
};
|
|
623
|
-
coverImage: File$1 & {
|
|
624
|
-
translations: FileTranslation[];
|
|
625
|
-
};
|
|
626
|
-
}) | null>;
|
|
617
|
+
findWithSeoMetadata: ({ isActive, ...rest }: FindParams) => Promise<PostWithSeoMetadata | null>;
|
|
627
618
|
};
|
|
628
619
|
|
|
629
620
|
interface UpsertParams {
|
package/dist/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ADMIN_ROLES, ROOT_FOLDER_ID } from '../chunk-ZCOYQ5BG.js';
|
|
2
|
-
import { SIZE, result, mimeToExtension, classifyFileType } from '../chunk-
|
|
2
|
+
import { SIZE, result, mimeToExtension, classifyFileType } from '../chunk-JADZTYRH.js';
|
|
3
3
|
import jwt from 'jsonwebtoken';
|
|
4
4
|
import argon2 from 'argon2';
|
|
5
5
|
import crypto, { timingSafeEqual } from 'crypto';
|
package/dist/storage/r2/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createObjectKey } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { createObjectKey } from '../../chunk-SUETTGXY.js';
|
|
2
|
+
import '../../chunk-JADZTYRH.js';
|
|
3
3
|
import { PutObjectCommand, DeleteObjectCommand, CopyObjectCommand } from '@aws-sdk/client-s3';
|
|
4
4
|
|
|
5
5
|
function createR2Service({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createObjectKey } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { createObjectKey } from '../../chunk-SUETTGXY.js';
|
|
2
|
+
import '../../chunk-JADZTYRH.js';
|
|
3
3
|
import path from 'path/posix';
|
|
4
4
|
import { createPool } from 'generic-pool';
|
|
5
5
|
import SFTPClient from 'ssh2-sftp-client';
|