@yimingliao/cms 0.0.3 → 0.0.4
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 +38 -1
- package/dist/index.js +32 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -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$1 as 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 };
|