@yimingliao/cms 0.0.3 → 0.0.5
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 +46 -9
- package/dist/index.js +32 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -163,7 +163,7 @@ declare const FILE_TYPES: {
|
|
|
163
163
|
};
|
|
164
164
|
type FileType = (typeof FILE_TYPES)[keyof typeof FILE_TYPES];
|
|
165
165
|
|
|
166
|
-
interface File
|
|
166
|
+
interface File {
|
|
167
167
|
id: string;
|
|
168
168
|
key: string;
|
|
169
169
|
checksum: string;
|
|
@@ -205,10 +205,10 @@ interface Folder {
|
|
|
205
205
|
type FolderFull = Folder & {
|
|
206
206
|
parentFolder: (Folder & {
|
|
207
207
|
subFolders: Folder[];
|
|
208
|
-
files: File
|
|
208
|
+
files: File[];
|
|
209
209
|
}) | null;
|
|
210
210
|
subFolders: Folder[];
|
|
211
|
-
files: File
|
|
211
|
+
files: File[];
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
declare const POST_TYPES: {
|
|
@@ -320,7 +320,7 @@ type PostListCard = Post & {
|
|
|
320
320
|
postsInTopic: Post[];
|
|
321
321
|
children: Post[];
|
|
322
322
|
taggedPosts: Post[];
|
|
323
|
-
coverImage: File
|
|
323
|
+
coverImage: File | null;
|
|
324
324
|
translations: PostTranslation[];
|
|
325
325
|
};
|
|
326
326
|
|
|
@@ -344,7 +344,7 @@ type PostFull = Post & {
|
|
|
344
344
|
translations: PostTranslation[];
|
|
345
345
|
};
|
|
346
346
|
|
|
347
|
-
type FileFull = File
|
|
347
|
+
type FileFull = File & {
|
|
348
348
|
folder: Folder | null;
|
|
349
349
|
adminAsAvatarImage: Admin[];
|
|
350
350
|
postsAsCoverImage: Post[];
|
|
@@ -358,13 +358,13 @@ type FileFull = File$1 & {
|
|
|
358
358
|
translations: FileTranslation[];
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
-
type FileCard = File
|
|
361
|
+
type FileCard = File & {
|
|
362
362
|
translations: FileTranslation[];
|
|
363
363
|
};
|
|
364
364
|
|
|
365
365
|
type AdminFull = AdminSafe & {
|
|
366
366
|
adminRefreshTokens: AdminRefreshToken[];
|
|
367
|
-
avatarImage: (File
|
|
367
|
+
avatarImage: (File & {
|
|
368
368
|
translations: FileTranslation[];
|
|
369
369
|
}) | null;
|
|
370
370
|
posts: Post[];
|
|
@@ -498,7 +498,7 @@ interface CreateParams$2 {
|
|
|
498
498
|
}
|
|
499
499
|
interface UpdateParams$2 {
|
|
500
500
|
id: string;
|
|
501
|
-
file: File
|
|
501
|
+
file: File;
|
|
502
502
|
key: string;
|
|
503
503
|
checksum: string;
|
|
504
504
|
fileMeta: {
|
|
@@ -838,4 +838,41 @@ declare function createPostQueryRepository(prisma: any): {
|
|
|
838
838
|
}) | null>;
|
|
839
839
|
};
|
|
840
840
|
|
|
841
|
-
|
|
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
|
+
export { ADMIN_ROLES, type Admin, type AdminCard, type AdminFull, type AdminRefreshToken, type AdminRole, type AdminSafe, type AdminTranslation, type Alternate, type BaseTranslation, type DeviceInfo, type ExternalLink, FILE_TYPES, type Faq, type File, type FileCard, type FileFull, type FileTranslation, type FileType, type Folder, type FolderFull, type MultiItems, POST_TYPES, type Post, type PostFull, type PostListCard, type PostTranslation, type PostType, type SeoMetadata, type SingleItem, type TocItem, type Translation, createAdminCommandRepository, createAdminQueryRepository, createAdminRefreshTokenCommandRepository, createAdminRefreshTokenQueryRepository, createArgon2Service, createCookieService, createCryptoService, createFileCommandRepository, createFileQueryRepository, createFolderCommandRepository, createFolderQueryRepository, createJwtService, createPostCommandRepository, createPostQueryRepository, createSeoMetadataCommandRepository };
|
package/dist/index.js
CHANGED
|
@@ -1264,6 +1264,37 @@ function createPostQueryRepository(prisma) {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
1266
1266
|
|
|
1267
|
+
// src/database/seo-metadata/command/create-seo-metadata-command-repository.ts
|
|
1268
|
+
function createSeoMetadataCommandRepository(prisma) {
|
|
1269
|
+
async function upsert({
|
|
1270
|
+
// ------------------------------------
|
|
1271
|
+
// relations
|
|
1272
|
+
// ------------------------------------
|
|
1273
|
+
// Post
|
|
1274
|
+
postId,
|
|
1275
|
+
// ------------------------------------
|
|
1276
|
+
// translation
|
|
1277
|
+
// ------------------------------------
|
|
1278
|
+
translations
|
|
1279
|
+
}) {
|
|
1280
|
+
await prisma.post.update({
|
|
1281
|
+
where: { id: postId },
|
|
1282
|
+
data: {
|
|
1283
|
+
seoMetadatas: {
|
|
1284
|
+
upsert: translations.map((t) => ({
|
|
1285
|
+
where: { postId_locale: { postId, locale: t.locale } },
|
|
1286
|
+
update: t,
|
|
1287
|
+
create: t
|
|
1288
|
+
}))
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
return {
|
|
1294
|
+
upsert
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1267
1298
|
// src/domain/post/props.ts
|
|
1268
1299
|
var POST_TYPES = {
|
|
1269
1300
|
TOPIC: "TOPIC",
|
|
@@ -1273,4 +1304,4 @@ var POST_TYPES = {
|
|
|
1273
1304
|
PAGE: "PAGE"
|
|
1274
1305
|
};
|
|
1275
1306
|
|
|
1276
|
-
export { ADMIN_ROLES, FILE_TYPES, POST_TYPES, createAdminCommandRepository, createAdminQueryRepository, createAdminRefreshTokenCommandRepository, createAdminRefreshTokenQueryRepository, createArgon2Service, createCookieService, createCryptoService, createFileCommandRepository, createFileQueryRepository, createFolderCommandRepository, createFolderQueryRepository, createJwtService, createPostCommandRepository, createPostQueryRepository };
|
|
1307
|
+
export { ADMIN_ROLES, FILE_TYPES, POST_TYPES, createAdminCommandRepository, createAdminQueryRepository, createAdminRefreshTokenCommandRepository, createAdminRefreshTokenQueryRepository, createArgon2Service, createCookieService, createCryptoService, createFileCommandRepository, createFileQueryRepository, createFolderCommandRepository, createFolderQueryRepository, createJwtService, createPostCommandRepository, createPostQueryRepository, createSeoMetadataCommandRepository };
|