@rakun-kit/core 1.5.8 → 1.5.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/README.md +184 -185
- package/dist/cjs/api/operations/web-contract.js +37 -30
- package/dist/cjs/api/operations/web-contract.js.map +1 -1
- package/dist/cjs/api/operations/web.js +13 -11
- package/dist/cjs/api/operations/web.js.map +1 -1
- package/dist/cjs/api/routes/web/page.js +41 -57
- package/dist/cjs/api/routes/web/page.js.map +1 -1
- package/dist/cjs/api/routes/web/staticPaths.js +41 -0
- package/dist/cjs/api/routes/web/staticPaths.js.map +1 -0
- package/dist/cjs/auth/passwordResetMailTemplate.js +59 -59
- package/dist/cjs/contracts.js +1 -0
- package/dist/cjs/contracts.js.map +1 -1
- package/dist/cjs/schemas/web/page.js +6 -5
- package/dist/cjs/schemas/web/page.js.map +1 -1
- package/dist/cjs/schemas/web/staticPaths.js +15 -0
- package/dist/cjs/schemas/web/staticPaths.js.map +1 -0
- package/dist/docs/index.md +10 -0
- package/dist/esm/api/context.d.ts +1 -1
- package/dist/esm/api/context.js +3 -3
- package/dist/esm/api/hooks/context.d.ts +1 -1
- package/dist/esm/api/hooks/runContentHooks.d.ts +4 -4
- package/dist/esm/api/hooks/runContentHooks.js +1 -1
- package/dist/esm/api/operations/apiEventLog.d.ts +3 -3
- package/dist/esm/api/operations/apiEventLog.js +3 -3
- package/dist/esm/api/operations/catalog.d.ts +2 -2
- package/dist/esm/api/operations/catalog.js +1 -1
- package/dist/esm/api/operations/custom.d.ts +1 -1
- package/dist/esm/api/operations/custom.js +1 -1
- package/dist/esm/api/operations/index.d.ts +203 -197
- package/dist/esm/api/operations/index.d.ts.map +1 -1
- package/dist/esm/api/operations/index.js +9 -9
- package/dist/esm/api/operations/manager-contract.d.ts +164 -164
- package/dist/esm/api/operations/manager-contract.js +7 -7
- package/dist/esm/api/operations/manager.d.ts +165 -165
- package/dist/esm/api/operations/manager.js +72 -72
- package/dist/esm/api/operations/tracing.d.ts +1 -1
- package/dist/esm/api/operations/tracing.js +2 -2
- package/dist/esm/api/operations/types.d.ts +1 -1
- package/dist/esm/api/operations/web-contract.d.ts +31 -25
- package/dist/esm/api/operations/web-contract.d.ts.map +1 -1
- package/dist/esm/api/operations/web-contract.js +41 -34
- package/dist/esm/api/operations/web-contract.js.map +1 -1
- package/dist/esm/api/operations/web.d.ts +31 -25
- package/dist/esm/api/operations/web.d.ts.map +1 -1
- package/dist/esm/api/operations/web.js +22 -20
- package/dist/esm/api/operations/web.js.map +1 -1
- package/dist/esm/api/routes/manager/apiOperations.d.ts +3 -3
- package/dist/esm/api/routes/manager/apiOperations.js +5 -5
- package/dist/esm/api/routes/manager/auth/accountInfo.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/accountInfo.js +3 -3
- package/dist/esm/api/routes/manager/auth/deleteSession.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/deleteSession.js +3 -3
- package/dist/esm/api/routes/manager/auth/externalLogin.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/externalLogin.js +7 -7
- package/dist/esm/api/routes/manager/auth/getSession.d.ts +7 -7
- package/dist/esm/api/routes/manager/auth/login.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/login.js +9 -9
- package/dist/esm/api/routes/manager/auth/logout.d.ts +1 -1
- package/dist/esm/api/routes/manager/auth/logout.js +3 -3
- package/dist/esm/api/routes/manager/auth/markTourSeen.d.ts +8 -8
- package/dist/esm/api/routes/manager/auth/markTourSeen.js +3 -3
- package/dist/esm/api/routes/manager/auth/mfa/regenerateRecoveryCodes.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/mfa/regenerateRecoveryCodes.js +6 -6
- package/dist/esm/api/routes/manager/auth/mfa/verifyRecoveryCode.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/mfa/verifyRecoveryCode.js +7 -7
- package/dist/esm/api/routes/manager/auth/passwordIpBlocks.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/passwordIpBlocks.js +8 -8
- package/dist/esm/api/routes/manager/auth/passwordRecovery.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/passwordRecovery.js +10 -10
- package/dist/esm/api/routes/manager/auth/totp/confirmTotp.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/totp/confirmTotp.js +4 -4
- package/dist/esm/api/routes/manager/auth/totp/enrollTotp.d.ts +1 -1
- package/dist/esm/api/routes/manager/auth/totp/enrollTotp.js +3 -3
- package/dist/esm/api/routes/manager/auth/totp/verifyTotp.d.ts +1 -1
- package/dist/esm/api/routes/manager/auth/totp/verifyTotp.js +5 -5
- package/dist/esm/api/routes/manager/auth/updateAccount.d.ts +8 -8
- package/dist/esm/api/routes/manager/auth/updateAccount.js +3 -3
- package/dist/esm/api/routes/manager/auth/updatePassword.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/updatePassword.js +5 -5
- package/dist/esm/api/routes/manager/auth/updateTutorialPreferences.d.ts +8 -8
- package/dist/esm/api/routes/manager/auth/updateTutorialPreferences.js +3 -3
- package/dist/esm/api/routes/manager/auth/webauthn/webauthnAuthOptions.js +4 -4
- package/dist/esm/api/routes/manager/auth/webauthn/webauthnAuthVerify.js +6 -6
- package/dist/esm/api/routes/manager/auth/webauthn/webauthnRegisterOptions.d.ts +2 -2
- package/dist/esm/api/routes/manager/auth/webauthn/webauthnRegisterOptions.js +3 -3
- package/dist/esm/api/routes/manager/auth/webauthn/webauthnRegisterVerify.d.ts +1 -1
- package/dist/esm/api/routes/manager/auth/webauthn/webauthnRegisterVerify.js +6 -6
- package/dist/esm/api/routes/manager/backups/create.d.ts +2 -2
- package/dist/esm/api/routes/manager/backups/create.js +2 -2
- package/dist/esm/api/routes/manager/backups/list.d.ts +2 -2
- package/dist/esm/api/routes/manager/backups/list.js +2 -2
- package/dist/esm/api/routes/manager/backups/restore.d.ts +2 -2
- package/dist/esm/api/routes/manager/backups/restore.js +4 -4
- package/dist/esm/api/routes/manager/comments.d.ts +2 -2
- package/dist/esm/api/routes/manager/comments.js +8 -8
- package/dist/esm/api/routes/manager/contentType.d.ts +16 -16
- package/dist/esm/api/routes/manager/contentType.js +3 -3
- package/dist/esm/api/routes/manager/contentTypes.d.ts +14 -14
- package/dist/esm/api/routes/manager/contentTypes.js +1 -1
- package/dist/esm/api/routes/manager/contentVersions.d.ts +2 -2
- package/dist/esm/api/routes/manager/contentVersions.js +13 -13
- package/dist/esm/api/routes/manager/create.d.ts +5 -5
- package/dist/esm/api/routes/manager/create.js +11 -11
- package/dist/esm/api/routes/manager/delete.d.ts +2 -2
- package/dist/esm/api/routes/manager/delete.js +12 -12
- package/dist/esm/api/routes/manager/duplicate.d.ts +5 -5
- package/dist/esm/api/routes/manager/duplicate.js +6 -6
- package/dist/esm/api/routes/manager/favorites.d.ts +2 -2
- package/dist/esm/api/routes/manager/favorites.js +5 -5
- package/dist/esm/api/routes/manager/get.d.ts +2 -2
- package/dist/esm/api/routes/manager/get.js +10 -10
- package/dist/esm/api/routes/manager/languages.d.ts +4 -4
- package/dist/esm/api/routes/manager/languages.js +1 -1
- package/dist/esm/api/routes/manager/list.d.ts +2 -2
- package/dist/esm/api/routes/manager/list.js +15 -15
- package/dist/esm/api/routes/manager/literals/list.d.ts +2 -2
- package/dist/esm/api/routes/manager/literals/list.js +5 -5
- package/dist/esm/api/routes/manager/literals/upsert.d.ts +2 -2
- package/dist/esm/api/routes/manager/literals/upsert.js +6 -6
- package/dist/esm/api/routes/manager/localeVariants.d.ts +49 -49
- package/dist/esm/api/routes/manager/localeVariants.js +19 -19
- package/dist/esm/api/routes/manager/logs/cleanup.d.ts +2 -2
- package/dist/esm/api/routes/manager/logs/cleanup.js +3 -3
- package/dist/esm/api/routes/manager/logs/list.d.ts +2 -2
- package/dist/esm/api/routes/manager/logs/list.js +2 -2
- package/dist/esm/api/routes/manager/media/createFolder.d.ts +2 -2
- package/dist/esm/api/routes/manager/media/createFolder.js +7 -7
- package/dist/esm/api/routes/manager/media/deleteFolder.d.ts +2 -2
- package/dist/esm/api/routes/manager/media/deleteFolder.js +7 -7
- package/dist/esm/api/routes/manager/media/deleteMediaStorage.js +2 -2
- package/dist/esm/api/routes/manager/media/finalizeUpload.d.ts +2 -2
- package/dist/esm/api/routes/manager/media/finalizeUpload.js +12 -12
- package/dist/esm/api/routes/manager/media/getMediaUrl.d.ts +2 -2
- package/dist/esm/api/routes/manager/media/getMediaUrl.js +6 -6
- package/dist/esm/api/routes/manager/media/listFolders.d.ts +2 -2
- package/dist/esm/api/routes/manager/media/listFolders.js +4 -4
- package/dist/esm/api/routes/manager/media/prepareUpload.d.ts +3 -3
- package/dist/esm/api/routes/manager/media/prepareUpload.js +5 -5
- package/dist/esm/api/routes/manager/media/reimportMedia.d.ts +5 -5
- package/dist/esm/api/routes/manager/media/reimportMedia.js +10 -10
- package/dist/esm/api/routes/manager/media/resolveMediaRecordUrls.js +1 -1
- package/dist/esm/api/routes/manager/media/uploadBinary.d.ts +1 -1
- package/dist/esm/api/routes/manager/media/uploadBinary.js +8 -8
- package/dist/esm/api/routes/manager/migrations/list.d.ts +2 -2
- package/dist/esm/api/routes/manager/migrations/list.js +2 -2
- package/dist/esm/api/routes/manager/notifications.d.ts +2 -2
- package/dist/esm/api/routes/manager/notifications.js +6 -6
- package/dist/esm/api/routes/manager/permissions.d.ts +1 -1
- package/dist/esm/api/routes/manager/permissions.js +2 -2
- package/dist/esm/api/routes/manager/preview/create.d.ts +2 -2
- package/dist/esm/api/routes/manager/preview/create.js +15 -15
- package/dist/esm/api/routes/manager/previewSlugRedirects.d.ts +2 -2
- package/dist/esm/api/routes/manager/previewSlugRedirects.js +3 -3
- package/dist/esm/api/routes/manager/regenerateRoutes.d.ts +1 -1
- package/dist/esm/api/routes/manager/regenerateRoutes.js +2 -2
- package/dist/esm/api/routes/manager/reviewPolicies.d.ts +2 -2
- package/dist/esm/api/routes/manager/reviewPolicies.js +7 -7
- package/dist/esm/api/routes/manager/reviews.d.ts +2 -2
- package/dist/esm/api/routes/manager/reviews.js +8 -8
- package/dist/esm/api/routes/manager/routeLayout.d.ts +2 -2
- package/dist/esm/api/routes/manager/routeLayout.js +6 -6
- package/dist/esm/api/routes/manager/setDefaultLanguage.d.ts +2 -2
- package/dist/esm/api/routes/manager/setDefaultLanguage.js +5 -5
- package/dist/esm/api/routes/manager/template.d.ts +3 -3
- package/dist/esm/api/routes/manager/template.js +10 -10
- package/dist/esm/api/routes/manager/translateDocument.d.ts +2 -2
- package/dist/esm/api/routes/manager/translateDocument.js +11 -11
- package/dist/esm/api/routes/manager/trash.d.ts +3 -3
- package/dist/esm/api/routes/manager/trash.js +9 -9
- package/dist/esm/api/routes/manager/uiLocales.d.ts +1 -1
- package/dist/esm/api/routes/manager/uiLocales.js +1 -1
- package/dist/esm/api/routes/manager/update.d.ts +5 -5
- package/dist/esm/api/routes/manager/update.js +14 -14
- package/dist/esm/api/routes/manager/users.d.ts +2 -2
- package/dist/esm/api/routes/manager/users.js +2 -2
- package/dist/esm/api/routes/manager/versions/get.d.ts +2 -2
- package/dist/esm/api/routes/manager/versions/get.js +2 -2
- package/dist/esm/api/routes/manager/versions/list.d.ts +2 -2
- package/dist/esm/api/routes/manager/versions/list.js +2 -2
- package/dist/esm/api/routes/manager/versions/restore.d.ts +2 -2
- package/dist/esm/api/routes/manager/versions/restore.js +8 -8
- package/dist/esm/api/routes/web/page.d.ts +5 -5
- package/dist/esm/api/routes/web/page.d.ts.map +1 -1
- package/dist/esm/api/routes/web/page.js +60 -76
- package/dist/esm/api/routes/web/page.js.map +1 -1
- package/dist/esm/api/routes/web/previewPage.d.ts +8 -8
- package/dist/esm/api/routes/web/previewPage.js +9 -9
- package/dist/esm/api/routes/web/robots.d.ts +1 -1
- package/dist/esm/api/routes/web/robots.js +2 -2
- package/dist/esm/api/routes/web/seo.d.ts +1 -1
- package/dist/esm/api/routes/web/sitemap.d.ts +1 -1
- package/dist/esm/api/routes/web/sitemap.js +3 -3
- package/dist/esm/api/routes/web/staticPaths.d.ts +6 -0
- package/dist/esm/api/routes/web/staticPaths.d.ts.map +1 -0
- package/dist/esm/api/routes/web/staticPaths.js +36 -0
- package/dist/esm/api/routes/web/staticPaths.js.map +1 -0
- package/dist/esm/api/sessionCookie.d.ts +1 -1
- package/dist/esm/api/utils/authEvents.d.ts +2 -2
- package/dist/esm/api/utils/authEvents.js +2 -2
- package/dist/esm/api/utils/authRateLimit.d.ts +1 -1
- package/dist/esm/api/utils/authRateLimit.js +1 -1
- package/dist/esm/api/utils/breadcrums.d.ts +5 -5
- package/dist/esm/api/utils/breadcrums.js +3 -3
- package/dist/esm/api/utils/checkFailureCase.d.ts +1 -1
- package/dist/esm/api/utils/checkFailureCase.js +1 -1
- package/dist/esm/api/utils/checkOwnership.d.ts +2 -2
- package/dist/esm/api/utils/checkOwnership.js +5 -5
- package/dist/esm/api/utils/checkPermissions.d.ts +2 -2
- package/dist/esm/api/utils/checkPermissions.js +3 -3
- package/dist/esm/api/utils/contentTemplate.d.ts +2 -2
- package/dist/esm/api/utils/contentTemplate.js +7 -7
- package/dist/esm/api/utils/dynamicData.d.ts +5 -5
- package/dist/esm/api/utils/dynamicData.js +11 -11
- package/dist/esm/api/utils/getLanguages.d.ts +2 -2
- package/dist/esm/api/utils/getLanguages.js +2 -2
- package/dist/esm/api/utils/getLink.d.ts +2 -2
- package/dist/esm/api/utils/getLink.js +5 -5
- package/dist/esm/api/utils/getUser.d.ts +7 -7
- package/dist/esm/api/utils/getUser.js +4 -4
- package/dist/esm/api/utils/index.d.ts +25 -25
- package/dist/esm/api/utils/index.js +25 -25
- package/dist/esm/api/utils/iteratorVisibility.d.ts +1 -1
- package/dist/esm/api/utils/localeVariants.d.ts +1 -1
- package/dist/esm/api/utils/localeVariants.js +8 -8
- package/dist/esm/api/utils/managerNotifications.d.ts +5 -5
- package/dist/esm/api/utils/managerNotifications.js +3 -3
- package/dist/esm/api/utils/mediaUploadToken.d.ts +1 -1
- package/dist/esm/api/utils/parseId.d.ts +1 -1
- package/dist/esm/api/utils/parseId.js +1 -1
- package/dist/esm/api/utils/passwords.js +1 -1
- package/dist/esm/api/utils/populates/populateLinks.d.ts +2 -2
- package/dist/esm/api/utils/populates/populateLinks.js +5 -5
- package/dist/esm/api/utils/populates/populateRelations.d.ts +2 -2
- package/dist/esm/api/utils/populates/populateRelations.js +7 -7
- package/dist/esm/api/utils/redirects/createSlugChangeRedirects.d.ts +2 -2
- package/dist/esm/api/utils/redirects/createSlugChangeRedirects.js +6 -6
- package/dist/esm/api/utils/redirects/resolveRedirect.js +2 -2
- package/dist/esm/api/utils/redirects/slugPathChanges.d.ts +1 -1
- package/dist/esm/api/utils/redirects/slugPathChanges.js +4 -4
- package/dist/esm/api/utils/requireContentType.d.ts +1 -1
- package/dist/esm/api/utils/requireContentType.js +2 -2
- package/dist/esm/api/utils/reviews.d.ts +12 -12
- package/dist/esm/api/utils/reviews.js +4 -4
- package/dist/esm/api/utils/routes/revalidatePath.js +5 -5
- package/dist/esm/api/utils/routes/routeDefinitions.d.ts +1 -1
- package/dist/esm/api/utils/routes/routeMapHelpers.d.ts +6 -6
- package/dist/esm/api/utils/routes/routeMapHelpers.js +8 -8
- package/dist/esm/api/utils/routes/syncConfiguredRoutes.d.ts +2 -2
- package/dist/esm/api/utils/routes/syncConfiguredRoutes.js +5 -5
- package/dist/esm/api/utils/routes/updateRoutesMap.d.ts +2 -2
- package/dist/esm/api/utils/routes/updateRoutesMap.js +5 -5
- package/dist/esm/api/utils/safeManagerQuery.d.ts +2 -2
- package/dist/esm/api/utils/safeManagerQuery.js +1 -1
- package/dist/esm/api/utils/sanitizeManagerOutput.d.ts +1 -1
- package/dist/esm/api/utils/sanitizeManagerOutput.js +1 -1
- package/dist/esm/api/utils/transformObjectIdsToStrings.js +1 -1
- package/dist/esm/api/utils/transformStringToObjectIds.js +1 -1
- package/dist/esm/api/utils/translate.d.ts +1 -1
- package/dist/esm/api/utils/translate.js +3 -3
- package/dist/esm/api/utils/validateModule.d.ts +1 -1
- package/dist/esm/api/utils/validateModule.js +2 -2
- package/dist/esm/auth/accountRecovery.d.ts +1 -1
- package/dist/esm/auth/completePrimaryAuthentication.d.ts +1 -1
- package/dist/esm/auth/completePrimaryAuthentication.js +3 -3
- package/dist/esm/auth/loginAdapters.d.ts +1 -1
- package/dist/esm/auth/passwordFail2ban.d.ts +2 -2
- package/dist/esm/auth/passwordFail2ban.js +4 -4
- package/dist/esm/auth/passwordResetMailTemplate.d.ts +2 -2
- package/dist/esm/auth/passwordResetMailTemplate.js +60 -60
- package/dist/esm/bootstrapState.d.ts +14 -14
- package/dist/esm/client.d.ts +60 -60
- package/dist/esm/client.js +32 -32
- package/dist/esm/contracts.d.ts +58 -57
- package/dist/esm/contracts.d.ts.map +1 -1
- package/dist/esm/contracts.js +58 -57
- package/dist/esm/contracts.js.map +1 -1
- package/dist/esm/eventLog/index.d.ts +6 -6
- package/dist/esm/eventLog/index.js +4 -4
- package/dist/esm/eventLog/mongo.d.ts +1 -1
- package/dist/esm/eventLog/mongo.js +2 -2
- package/dist/esm/eventLog/service.d.ts +1 -1
- package/dist/esm/index.d.ts +47 -47
- package/dist/esm/index.js +48 -48
- package/dist/esm/internal-content-types/ApiOperation.d.ts +114 -114
- package/dist/esm/internal-content-types/ApiOperation.js +2 -2
- package/dist/esm/internal-content-types/Backup.d.ts +57 -57
- package/dist/esm/internal-content-types/Backup.d.ts.map +1 -1
- package/dist/esm/internal-content-types/Backup.js +2 -2
- package/dist/esm/internal-content-types/BackupDocument.d.ts +114 -114
- package/dist/esm/internal-content-types/BackupDocument.js +2 -2
- package/dist/esm/internal-content-types/ContentComment.d.ts +788 -788
- package/dist/esm/internal-content-types/ContentComment.js +3 -3
- package/dist/esm/internal-content-types/ContentCommentReadState.d.ts +575 -575
- package/dist/esm/internal-content-types/ContentCommentReadState.js +3 -3
- package/dist/esm/internal-content-types/ContentReview.d.ts +1688 -1688
- package/dist/esm/internal-content-types/ContentReview.d.ts.map +1 -1
- package/dist/esm/internal-content-types/ContentReview.js +4 -4
- package/dist/esm/internal-content-types/ContentReviewDecision.d.ts +534 -534
- package/dist/esm/internal-content-types/ContentReviewDecision.js +3 -3
- package/dist/esm/internal-content-types/ContentReviewPolicy.d.ts +210 -210
- package/dist/esm/internal-content-types/ContentReviewPolicy.d.ts.map +1 -1
- package/dist/esm/internal-content-types/ContentReviewPolicy.js +3 -3
- package/dist/esm/internal-content-types/ContentTemplate.d.ts +79 -79
- package/dist/esm/internal-content-types/ContentTemplate.d.ts.map +1 -1
- package/dist/esm/internal-content-types/ContentTemplate.js +2 -2
- package/dist/esm/internal-content-types/ContentVersion.d.ts +139 -139
- package/dist/esm/internal-content-types/ContentVersion.d.ts.map +1 -1
- package/dist/esm/internal-content-types/ContentVersion.js +2 -2
- package/dist/esm/internal-content-types/HelloWorld.d.ts +30 -30
- package/dist/esm/internal-content-types/HelloWorld.js +2 -2
- package/dist/esm/internal-content-types/Language.d.ts +39 -39
- package/dist/esm/internal-content-types/Language.js +2 -2
- package/dist/esm/internal-content-types/LiteralTranslation.d.ts +59 -59
- package/dist/esm/internal-content-types/LiteralTranslation.js +2 -2
- package/dist/esm/internal-content-types/LoginIpBlock.d.ts +66 -66
- package/dist/esm/internal-content-types/LoginIpBlock.d.ts.map +1 -1
- package/dist/esm/internal-content-types/LoginIpBlock.js +2 -2
- package/dist/esm/internal-content-types/ManagerFavorite.d.ts +547 -547
- package/dist/esm/internal-content-types/ManagerFavorite.js +3 -3
- package/dist/esm/internal-content-types/ManagerNotification.d.ts +1101 -1101
- package/dist/esm/internal-content-types/ManagerNotification.js +3 -3
- package/dist/esm/internal-content-types/ManagerRole.d.ts +33 -33
- package/dist/esm/internal-content-types/ManagerRole.js +2 -2
- package/dist/esm/internal-content-types/ManagerRoleHooks.d.ts +2 -2
- package/dist/esm/internal-content-types/ManagerRoleHooks.js +3 -3
- package/dist/esm/internal-content-types/ManagerUser.d.ts +212 -212
- package/dist/esm/internal-content-types/ManagerUser.js +3 -3
- package/dist/esm/internal-content-types/ManagerUserHooks.d.ts +2 -2
- package/dist/esm/internal-content-types/ManagerUserHooks.js +3 -3
- package/dist/esm/internal-content-types/Media.d.ts +261 -261
- package/dist/esm/internal-content-types/Media.js +3 -3
- package/dist/esm/internal-content-types/MediaFolder.d.ts +88 -88
- package/dist/esm/internal-content-types/MediaFolder.js +2 -2
- package/dist/esm/internal-content-types/MfaChallenge.d.ts +570 -570
- package/dist/esm/internal-content-types/MfaChallenge.d.ts.map +1 -1
- package/dist/esm/internal-content-types/MfaChallenge.js +3 -3
- package/dist/esm/internal-content-types/Migration.d.ts +133 -133
- package/dist/esm/internal-content-types/Migration.d.ts.map +1 -1
- package/dist/esm/internal-content-types/Migration.js +2 -2
- package/dist/esm/internal-content-types/MigrationLock.d.ts +16 -16
- package/dist/esm/internal-content-types/MigrationLock.js +2 -2
- package/dist/esm/internal-content-types/Page.d.ts +85 -85
- package/dist/esm/internal-content-types/Page.js +3 -3
- package/dist/esm/internal-content-types/PasswordResetToken.d.ts +534 -534
- package/dist/esm/internal-content-types/PasswordResetToken.js +4 -4
- package/dist/esm/internal-content-types/PreviewSnapshot.d.ts +214 -214
- package/dist/esm/internal-content-types/PreviewSnapshot.js +2 -2
- package/dist/esm/internal-content-types/Redirect.d.ts +146 -146
- package/dist/esm/internal-content-types/Redirect.js +2 -2
- package/dist/esm/internal-content-types/RobotsRule.d.ts +103 -103
- package/dist/esm/internal-content-types/RobotsRule.d.ts.map +1 -1
- package/dist/esm/internal-content-types/RobotsRule.js +2 -2
- package/dist/esm/internal-content-types/Route.d.ts +123 -123
- package/dist/esm/internal-content-types/Route.d.ts.map +1 -1
- package/dist/esm/internal-content-types/Route.js +2 -2
- package/dist/esm/internal-content-types/RouteLayoutModule.d.ts +164 -164
- package/dist/esm/internal-content-types/RouteLayoutModule.d.ts.map +1 -1
- package/dist/esm/internal-content-types/RouteLayoutModule.js +2 -2
- package/dist/esm/internal-content-types/RouteLayoutModuleOverride.d.ts +143 -143
- package/dist/esm/internal-content-types/RouteLayoutModuleOverride.js +2 -2
- package/dist/esm/internal-content-types/RouteLocaleVariant.d.ts +170 -170
- package/dist/esm/internal-content-types/RouteLocaleVariant.js +2 -2
- package/dist/esm/internal-content-types/RouteMap.d.ts +144 -144
- package/dist/esm/internal-content-types/RouteMap.js +2 -2
- package/dist/esm/internal-content-types/RouteSettings.d.ts +116 -116
- package/dist/esm/internal-content-types/RouteSettings.js +3 -3
- package/dist/esm/internal-content-types/SchemaState.d.ts +65 -65
- package/dist/esm/internal-content-types/SchemaState.d.ts.map +1 -1
- package/dist/esm/internal-content-types/SchemaState.js +2 -2
- package/dist/esm/internal-content-types/Seo.d.ts +430 -430
- package/dist/esm/internal-content-types/Seo.js +2 -2
- package/dist/esm/internal-content-types/SeoSettings.d.ts +518 -518
- package/dist/esm/internal-content-types/SeoSettings.js +3 -3
- package/dist/esm/internal-content-types/Session.d.ts +533 -533
- package/dist/esm/internal-content-types/Session.js +3 -3
- package/dist/esm/internal-content-types/TemplateContent.d.ts +1 -1
- package/dist/esm/internal-content-types/TemplateContent.js +1 -1
- package/dist/esm/internal-content-types/UserMfa.d.ts +504 -504
- package/dist/esm/internal-content-types/UserMfa.js +4 -4
- package/dist/esm/internal-content-types/WebAuthnCredential.d.ts +624 -624
- package/dist/esm/internal-content-types/WebAuthnCredential.d.ts.map +1 -1
- package/dist/esm/internal-content-types/WebAuthnCredential.js +3 -3
- package/dist/esm/internal-content-types/WebAuthnRegChallenge.d.ts +562 -562
- package/dist/esm/internal-content-types/WebAuthnRegChallenge.js +3 -3
- package/dist/esm/internal-content-types/index.d.ts +42 -42
- package/dist/esm/internal-content-types/index.js +42 -42
- package/dist/esm/internal-content-types/syncAdminRole.d.ts +4 -4
- package/dist/esm/internal-content-types/syncAdminRole.js +4 -4
- package/dist/esm/lib/ContentType.d.ts +7 -7
- package/dist/esm/lib/ContentType.js +5 -5
- package/dist/esm/lib/Permissions.d.ts +2 -2
- package/dist/esm/lib/Permissions.js +4 -4
- package/dist/esm/lib/Registry.d.ts +6 -6
- package/dist/esm/lib/Registry.js +4 -4
- package/dist/esm/lib/errors/AppError.d.ts +1 -1
- package/dist/esm/lib/errors/AppError.js +1 -1
- package/dist/esm/lib/errors/index.d.ts +4 -4
- package/dist/esm/lib/errors/index.js +3 -3
- package/dist/esm/lib/errors/throwAppError.d.ts +1 -1
- package/dist/esm/lib/errors/throwAppError.js +3 -3
- package/dist/esm/lib/fields/Boolean.d.ts +1 -1
- package/dist/esm/lib/fields/Boolean.js +1 -1
- package/dist/esm/lib/fields/Breadcrums.d.ts +1 -1
- package/dist/esm/lib/fields/Breadcrums.js +1 -1
- package/dist/esm/lib/fields/ContentReference.d.ts +2 -2
- package/dist/esm/lib/fields/ContentReference.js +2 -2
- package/dist/esm/lib/fields/Date.d.ts +1 -1
- package/dist/esm/lib/fields/Date.js +1 -1
- package/dist/esm/lib/fields/Field.d.ts +13 -13
- package/dist/esm/lib/fields/Fields.d.ts +14 -14
- package/dist/esm/lib/fields/Fields.js +14 -14
- package/dist/esm/lib/fields/File.d.ts +1 -1
- package/dist/esm/lib/fields/File.js +2 -2
- package/dist/esm/lib/fields/Iterator.d.ts +2 -2
- package/dist/esm/lib/fields/Iterator.js +3 -3
- package/dist/esm/lib/fields/Link.d.ts +1 -1
- package/dist/esm/lib/fields/Link.js +2 -2
- package/dist/esm/lib/fields/List.d.ts +1 -1
- package/dist/esm/lib/fields/List.js +2 -2
- package/dist/esm/lib/fields/Number.d.ts +1 -1
- package/dist/esm/lib/fields/Number.js +1 -1
- package/dist/esm/lib/fields/Relation.d.ts +3 -3
- package/dist/esm/lib/fields/Relation.js +3 -3
- package/dist/esm/lib/fields/Select.d.ts +1 -1
- package/dist/esm/lib/fields/Select.js +1 -1
- package/dist/esm/lib/fields/SelfRelation.d.ts +1 -1
- package/dist/esm/lib/fields/SelfRelation.js +2 -2
- package/dist/esm/lib/fields/SimpleList.d.ts +1 -1
- package/dist/esm/lib/fields/SimpleList.js +1 -1
- package/dist/esm/lib/fields/String.d.ts +1 -1
- package/dist/esm/lib/fields/String.js +3 -3
- package/dist/esm/lib/fields/index.d.ts +16 -16
- package/dist/esm/lib/fields/index.js +16 -16
- package/dist/esm/lib/hooks.d.ts +4 -4
- package/dist/esm/lib/routeableContent.js +1 -1
- package/dist/esm/lib/types/index.d.ts +2 -2
- package/dist/esm/lib/utils/getListField.d.ts +1 -1
- package/dist/esm/lib/utils/getSchemas.d.ts +1 -1
- package/dist/esm/lib/utils/getTranslation.d.ts +2 -2
- package/dist/esm/lib/utils/getTranslation.js +1 -1
- package/dist/esm/lib/utils/isTranslatableObject.d.ts +1 -1
- package/dist/esm/lib/utils/translateObject.d.ts +2 -2
- package/dist/esm/lib/utils/translateObject.js +3 -3
- package/dist/esm/literals/definitions.d.ts +1 -1
- package/dist/esm/literals/definitions.js +1 -1
- package/dist/esm/literals/index.d.ts +2 -2
- package/dist/esm/literals/index.js +2 -2
- package/dist/esm/mail/index.d.ts +6 -6
- package/dist/esm/mail/index.js +5 -5
- package/dist/esm/mail/mailService.d.ts +2 -2
- package/dist/esm/mail/mailService.js +1 -1
- package/dist/esm/mail/templates.d.ts +1 -1
- package/dist/esm/mail/templates.js +2 -2
- package/dist/esm/manager.d.ts +3 -3
- package/dist/esm/manager.js +1 -1
- package/dist/esm/media/imageOptimization.d.ts +1 -1
- package/dist/esm/media/imageOptimization.js +2 -2
- package/dist/esm/media/index.d.ts +4 -4
- package/dist/esm/media/index.js +3 -3
- package/dist/esm/media/mediaService.d.ts +1 -1
- package/dist/esm/orm/backups.js +5 -5
- package/dist/esm/orm/createIndexes.js +4 -4
- package/dist/esm/orm/database.js +3 -3
- package/dist/esm/orm/dbService.d.ts +6 -6
- package/dist/esm/orm/index.d.ts +2 -2
- package/dist/esm/orm/index.js +16 -16
- package/dist/esm/orm/migrations.d.ts +1 -1
- package/dist/esm/orm/migrations.js +4 -4
- package/dist/esm/orm/mongodbPeer.js +1 -1
- package/dist/esm/orm/operations/clear.d.ts +2 -2
- package/dist/esm/orm/operations/clear.js +1 -1
- package/dist/esm/orm/operations/create.d.ts +4 -4
- package/dist/esm/orm/operations/create.js +7 -7
- package/dist/esm/orm/operations/delete.d.ts +3 -3
- package/dist/esm/orm/operations/delete.js +5 -5
- package/dist/esm/orm/operations/find.d.ts +2 -2
- package/dist/esm/orm/operations/find.js +3 -3
- package/dist/esm/orm/operations/findDependencies.d.ts +2 -2
- package/dist/esm/orm/operations/findDependencies.js +4 -4
- package/dist/esm/orm/operations/get.d.ts +3 -3
- package/dist/esm/orm/operations/get.js +3 -3
- package/dist/esm/orm/operations/getAll.d.ts +2 -2
- package/dist/esm/orm/operations/getAll.js +2 -2
- package/dist/esm/orm/operations/list.d.ts +2 -2
- package/dist/esm/orm/operations/list.js +3 -3
- package/dist/esm/orm/operations/update.d.ts +5 -5
- package/dist/esm/orm/operations/update.js +8 -8
- package/dist/esm/orm/operations/updateMany.d.ts +4 -4
- package/dist/esm/orm/operations/updateMany.js +4 -4
- package/dist/esm/orm/operations/upsert.d.ts +3 -3
- package/dist/esm/orm/operations/upsert.js +4 -4
- package/dist/esm/orm/utils/deepDeleteNulls.js +1 -1
- package/dist/esm/orm/utils/parseId.d.ts +1 -1
- package/dist/esm/orm/utils/parseId.js +1 -1
- package/dist/esm/orm/utils/transformObjectIdsToStrings.js +1 -1
- package/dist/esm/orm/utils/transformStringToObjectIds.js +1 -1
- package/dist/esm/orm/versions.d.ts +1 -1
- package/dist/esm/orm/versions.js +7 -7
- package/dist/esm/plugins.d.ts +11 -11
- package/dist/esm/schemas/manager/auth/externalLogin.js +1 -1
- package/dist/esm/schemas/manager/comments.js +1 -1
- package/dist/esm/schemas/manager/contentVersions.d.ts +64 -64
- package/dist/esm/schemas/manager/contentVersions.js +3 -3
- package/dist/esm/schemas/manager/literals/upsert.js +1 -1
- package/dist/esm/schemas/manager/localeVariants.d.ts +96 -96
- package/dist/esm/schemas/manager/localeVariants.js +1 -1
- package/dist/esm/schemas/manager/media/finalizeUpload.js +1 -1
- package/dist/esm/schemas/manager/media/getMediaUrl.js +1 -1
- package/dist/esm/schemas/manager/media/listFolders.js +1 -1
- package/dist/esm/schemas/manager/media/reimportMedia.js +2 -2
- package/dist/esm/schemas/manager/notifications.js +1 -1
- package/dist/esm/schemas/manager/reviews.js +1 -1
- package/dist/esm/schemas/manager/uiLocales.js +1 -1
- package/dist/esm/schemas/web/page.d.ts +42 -41
- package/dist/esm/schemas/web/page.d.ts.map +1 -1
- package/dist/esm/schemas/web/page.js +7 -6
- package/dist/esm/schemas/web/page.js.map +1 -1
- package/dist/esm/schemas/web/previewPage.d.ts +28 -28
- package/dist/esm/schemas/web/previewPage.js +1 -1
- package/dist/esm/schemas/web/staticPaths.d.ts +14 -0
- package/dist/esm/schemas/web/staticPaths.d.ts.map +1 -0
- package/dist/esm/schemas/web/staticPaths.js +9 -0
- package/dist/esm/schemas/web/staticPaths.js.map +1 -0
- package/dist/esm/translation/document.d.ts +3 -3
- package/dist/esm/translation/index.d.ts +4 -4
- package/dist/esm/translation/index.js +3 -3
- package/dist/esm/translation/translationService.d.ts +1 -1
- package/dist/esm/web/client.d.ts +1 -1
- package/dist/esm/web/client.js +1 -1
- package/dist/esm/web/index.d.ts +2 -2
- package/dist/esm/web/index.js +2 -2
- package/dist/esm/web/page.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +138 -138
package/README.md
CHANGED
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
Typical imports:
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
|
-
import {
|
|
11
|
-
ContentType,
|
|
12
|
-
f,
|
|
13
|
-
rakunBootstrap,
|
|
14
|
-
ensureRakunInitialized,
|
|
15
|
-
} from "@rakun-kit/core";
|
|
10
|
+
import { ContentType, f, rakunBootstrap, ensureRakunInitialized } from '@rakun-kit/core'
|
|
16
11
|
```
|
|
17
12
|
|
|
18
13
|
The main entrypoint exports:
|
|
@@ -46,15 +41,15 @@ rakunBootstrap({
|
|
|
46
41
|
apiOperations,
|
|
47
42
|
mongo: {
|
|
48
43
|
MONGO_URI: process.env.MONGO_URI!,
|
|
49
|
-
ENVIRONMENT: process.env.NODE_ENV ===
|
|
44
|
+
ENVIRONMENT: process.env.NODE_ENV === 'test' ? 'test' : 'production',
|
|
50
45
|
},
|
|
51
46
|
media,
|
|
52
47
|
logger: {
|
|
53
|
-
level:
|
|
48
|
+
level: 'info',
|
|
54
49
|
prettify: true,
|
|
55
50
|
},
|
|
56
51
|
syncRoutes: true,
|
|
57
|
-
})
|
|
52
|
+
})
|
|
58
53
|
```
|
|
59
54
|
|
|
60
55
|
Options:
|
|
@@ -84,9 +79,9 @@ import {
|
|
|
84
79
|
createGoogleLoginAdapter,
|
|
85
80
|
createMicrosoftLoginAdapter,
|
|
86
81
|
rakunBootstrap,
|
|
87
|
-
} from
|
|
82
|
+
} from '@rakun-kit/core'
|
|
88
83
|
|
|
89
|
-
const callbackUrl =
|
|
84
|
+
const callbackUrl = 'https://cms.example.com/backend/login/callback'
|
|
90
85
|
|
|
91
86
|
rakunBootstrap({
|
|
92
87
|
// ...
|
|
@@ -107,11 +102,11 @@ rakunBootstrap({
|
|
|
107
102
|
clientId: process.env.MICROSOFT_CLIENT_ID!,
|
|
108
103
|
clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
|
|
109
104
|
redirectUri: callbackUrl,
|
|
110
|
-
tenant:
|
|
105
|
+
tenant: 'common',
|
|
111
106
|
}),
|
|
112
107
|
],
|
|
113
108
|
},
|
|
114
|
-
})
|
|
109
|
+
})
|
|
115
110
|
```
|
|
116
111
|
|
|
117
112
|
Register the exact callback URL in each provider console. External identities
|
|
@@ -155,8 +150,8 @@ configured. The reset URL must point to the manager's public
|
|
|
155
150
|
`/reset-password` screen and preserve the token as the `token` query parameter:
|
|
156
151
|
|
|
157
152
|
```ts
|
|
158
|
-
import { rakunBootstrap } from
|
|
159
|
-
import { createResendMailServiceConfig } from
|
|
153
|
+
import { rakunBootstrap } from '@rakun-kit/core'
|
|
154
|
+
import { createResendMailServiceConfig } from '@rakun-kit/resend'
|
|
160
155
|
|
|
161
156
|
rakunBootstrap({
|
|
162
157
|
// ...
|
|
@@ -171,7 +166,7 @@ rakunBootstrap({
|
|
|
171
166
|
`https://cms.example.com/backend/reset-password?token=${encodeURIComponent(token)}`,
|
|
172
167
|
},
|
|
173
168
|
},
|
|
174
|
-
})
|
|
169
|
+
})
|
|
175
170
|
```
|
|
176
171
|
|
|
177
172
|
Core uses its branded HTML and plain-text password-reset template by default.
|
|
@@ -202,20 +197,20 @@ rakunBootstrap({
|
|
|
202
197
|
// ...
|
|
203
198
|
routes: [
|
|
204
199
|
{
|
|
205
|
-
key:
|
|
206
|
-
contentType:
|
|
207
|
-
field:
|
|
200
|
+
key: 'pages',
|
|
201
|
+
contentType: 'Page',
|
|
202
|
+
field: 'slug',
|
|
208
203
|
hasPage: true,
|
|
209
204
|
dynamic: false,
|
|
210
|
-
defaultBasePath:
|
|
205
|
+
defaultBasePath: '',
|
|
211
206
|
layout: [
|
|
212
|
-
{ key:
|
|
213
|
-
{ type:
|
|
214
|
-
{ key:
|
|
207
|
+
{ key: 'header', contentType: 'Header' },
|
|
208
|
+
{ type: 'content' },
|
|
209
|
+
{ key: 'footer', contentType: 'Footer' },
|
|
215
210
|
],
|
|
216
211
|
},
|
|
217
212
|
],
|
|
218
|
-
})
|
|
213
|
+
})
|
|
219
214
|
```
|
|
220
215
|
|
|
221
216
|
The web page response includes an ordered `layout` array containing module slots
|
|
@@ -229,19 +224,19 @@ manager browser; relative URLs are also supported:
|
|
|
229
224
|
|
|
230
225
|
```ts
|
|
231
226
|
const Hero = new ContentType({
|
|
232
|
-
name:
|
|
227
|
+
name: 'Hero',
|
|
233
228
|
modulePicker: {
|
|
234
|
-
title:
|
|
235
|
-
description:
|
|
236
|
-
category:
|
|
237
|
-
icon:
|
|
238
|
-
preview:
|
|
239
|
-
keywords: [
|
|
229
|
+
title: 'Hero section',
|
|
230
|
+
description: 'Large introduction with heading, copy, and CTA.',
|
|
231
|
+
category: 'Marketing',
|
|
232
|
+
icon: 'PanelTop',
|
|
233
|
+
preview: '/images/modules/hero.webp',
|
|
234
|
+
keywords: ['banner', 'cover'],
|
|
240
235
|
},
|
|
241
236
|
fields: {
|
|
242
237
|
title: f.string().required(),
|
|
243
238
|
},
|
|
244
|
-
})
|
|
239
|
+
})
|
|
245
240
|
```
|
|
246
241
|
|
|
247
242
|
When `preview` is omitted or cannot be loaded, the picker displays a neutral
|
|
@@ -264,12 +259,12 @@ the public `manager.uiLocales` operation returns configured packs to the
|
|
|
264
259
|
manager client:
|
|
265
260
|
|
|
266
261
|
```ts
|
|
267
|
-
import { esManagerLocalePack } from
|
|
262
|
+
import { esManagerLocalePack } from '@rakun-kit/manager-locales/es'
|
|
268
263
|
|
|
269
264
|
rakunBootstrap({
|
|
270
265
|
// ...
|
|
271
266
|
managerLanguages: [esManagerLocalePack],
|
|
272
|
-
})
|
|
267
|
+
})
|
|
273
268
|
```
|
|
274
269
|
|
|
275
270
|
`managerLanguages` may also extend locales with arbitrary project keys. This is
|
|
@@ -277,28 +272,28 @@ useful for translatable content-type titles and categories without adding host
|
|
|
277
272
|
keys to the manager's static `ManagerMessageKey` union:
|
|
278
273
|
|
|
279
274
|
```ts
|
|
280
|
-
import { extendManagerLanguagePack } from
|
|
281
|
-
import { esManagerLocalePack } from
|
|
275
|
+
import { extendManagerLanguagePack } from '@rakun-kit/core/contracts'
|
|
276
|
+
import { esManagerLocalePack } from '@rakun-kit/manager-locales/es'
|
|
282
277
|
|
|
283
278
|
rakunBootstrap({
|
|
284
279
|
// ...
|
|
285
280
|
managerLanguages: [
|
|
286
281
|
{
|
|
287
|
-
code:
|
|
288
|
-
name:
|
|
282
|
+
code: 'en',
|
|
283
|
+
name: 'English',
|
|
289
284
|
messages: {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
285
|
+
'field.title': 'Title',
|
|
286
|
+
'layoutModule.header': 'Header',
|
|
287
|
+
'project.contentTypes.article.menu': 'Articles',
|
|
293
288
|
},
|
|
294
289
|
},
|
|
295
290
|
extendManagerLanguagePack(esManagerLocalePack, {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
291
|
+
'field.title': 'Título',
|
|
292
|
+
'layoutModule.header': 'Cabecera',
|
|
293
|
+
'project.contentTypes.article.menu': 'Artículos',
|
|
299
294
|
}),
|
|
300
295
|
],
|
|
301
|
-
})
|
|
296
|
+
})
|
|
302
297
|
```
|
|
303
298
|
|
|
304
299
|
Content-type field labels automatically use `field.<fieldName>` from these
|
|
@@ -314,26 +309,26 @@ Trusted server plugins contribute to the same bootstrap registry without couplin
|
|
|
314
309
|
core to React:
|
|
315
310
|
|
|
316
311
|
```ts
|
|
317
|
-
import { defineRakunPlugin, rakunBootstrap } from
|
|
312
|
+
import { defineRakunPlugin, rakunBootstrap } from '@rakun-kit/core'
|
|
318
313
|
|
|
319
314
|
export const analyticsPlugin = defineRakunPlugin({
|
|
320
|
-
id:
|
|
315
|
+
id: '@acme/rakun-analytics',
|
|
321
316
|
contentTypes: [AnalyticsEvent],
|
|
322
317
|
routes: analyticsRoutes,
|
|
323
318
|
apiOperations: analyticsOperations,
|
|
324
|
-
permissions: [
|
|
319
|
+
permissions: ['plugin.analytics.view'],
|
|
325
320
|
literals: {},
|
|
326
321
|
initialize: async ({ db }) => {
|
|
327
322
|
// Services and migrations are ready here. Keep initialization idempotent.
|
|
328
323
|
},
|
|
329
|
-
})
|
|
324
|
+
})
|
|
330
325
|
|
|
331
326
|
rakunBootstrap({
|
|
332
327
|
plugins: [analyticsPlugin],
|
|
333
328
|
contentTypes: [],
|
|
334
329
|
literals: {},
|
|
335
330
|
mongo,
|
|
336
|
-
})
|
|
331
|
+
})
|
|
337
332
|
```
|
|
338
333
|
|
|
339
334
|
Plugin ids and contributed content types, routes, operations, literals, and
|
|
@@ -351,21 +346,21 @@ A `ContentType` defines a logical collection:
|
|
|
351
346
|
|
|
352
347
|
```ts
|
|
353
348
|
const Post = new ContentType({
|
|
354
|
-
name:
|
|
349
|
+
name: 'Post',
|
|
355
350
|
menu: {
|
|
356
|
-
title:
|
|
357
|
-
icon:
|
|
358
|
-
category:
|
|
351
|
+
title: 'Posts',
|
|
352
|
+
icon: 'newspaper',
|
|
353
|
+
category: 'Content',
|
|
359
354
|
},
|
|
360
355
|
fields: {
|
|
361
356
|
title: f.string().required(),
|
|
362
|
-
slug: f.string().type(
|
|
363
|
-
body: f.string().type(
|
|
357
|
+
slug: f.string().type('Slug').required(),
|
|
358
|
+
body: f.string().type('RichText'),
|
|
364
359
|
published: f.boolean(),
|
|
365
360
|
},
|
|
366
|
-
uniques: [[
|
|
367
|
-
listFields: [
|
|
368
|
-
})
|
|
361
|
+
uniques: [['slug']],
|
|
362
|
+
listFields: ['title', 'slug', 'published'],
|
|
363
|
+
})
|
|
369
364
|
```
|
|
370
365
|
|
|
371
366
|
Page-like content types can define ordered page modules with `iterator` outside
|
|
@@ -373,18 +368,18 @@ Page-like content types can define ordered page modules with `iterator` outside
|
|
|
373
368
|
|
|
374
369
|
```ts
|
|
375
370
|
const Page = new ContentType({
|
|
376
|
-
name:
|
|
371
|
+
name: 'Page',
|
|
377
372
|
fields: {
|
|
378
373
|
title: f.string().required(),
|
|
379
|
-
slug: f.string().type(
|
|
374
|
+
slug: f.string().type('Slug').required(),
|
|
380
375
|
},
|
|
381
376
|
iterator: [
|
|
382
|
-
{ contentType: PageSection, type:
|
|
383
|
-
{ contentType: Hero, type:
|
|
384
|
-
{ contentType: LayoutWithInfo, type:
|
|
385
|
-
{ contentType: Newsletter, type:
|
|
377
|
+
{ contentType: PageSection, type: 'new' },
|
|
378
|
+
{ contentType: Hero, type: 'new' },
|
|
379
|
+
{ contentType: LayoutWithInfo, type: 'new' },
|
|
380
|
+
{ contentType: Newsletter, type: 'new' },
|
|
386
381
|
],
|
|
387
|
-
})
|
|
382
|
+
})
|
|
388
383
|
```
|
|
389
384
|
|
|
390
385
|
`iterator` always belongs to the individual document and is edited in the
|
|
@@ -441,10 +436,10 @@ Hooks run around DB mutations and public output resolution:
|
|
|
441
436
|
|
|
442
437
|
```ts
|
|
443
438
|
const User = new ContentType({
|
|
444
|
-
name:
|
|
439
|
+
name: 'User',
|
|
445
440
|
fields: {
|
|
446
|
-
email: f.string().type(
|
|
447
|
-
password: f.string().type(
|
|
441
|
+
email: f.string().type('Email').required(),
|
|
442
|
+
password: f.string().type('Password').required().managerOnly(),
|
|
448
443
|
},
|
|
449
444
|
}).withHooks({
|
|
450
445
|
beforeInsert: ({ data }) => ({
|
|
@@ -453,9 +448,9 @@ const User = new ContentType({
|
|
|
453
448
|
}),
|
|
454
449
|
onGet: ({ data }) => ({
|
|
455
450
|
...data,
|
|
456
|
-
displayName: String(data.email).split(
|
|
451
|
+
displayName: String(data.email).split('@')[0],
|
|
457
452
|
}),
|
|
458
|
-
})
|
|
453
|
+
})
|
|
459
454
|
```
|
|
460
455
|
|
|
461
456
|
Dynamic data turns a content type into a reusable layout. The manager can bind
|
|
@@ -476,27 +471,27 @@ configured route with `hasPage: true`.
|
|
|
476
471
|
|
|
477
472
|
```ts
|
|
478
473
|
const Project = new ContentType({
|
|
479
|
-
name:
|
|
474
|
+
name: 'Project',
|
|
480
475
|
dynamicDataSource: true,
|
|
481
476
|
fields: {
|
|
482
477
|
title: f.string().required(),
|
|
483
|
-
slug: f.string().type(
|
|
478
|
+
slug: f.string().type('Slug').required(),
|
|
484
479
|
},
|
|
485
|
-
})
|
|
480
|
+
})
|
|
486
481
|
|
|
487
482
|
const Carousel = new ContentType({
|
|
488
|
-
name:
|
|
483
|
+
name: 'Carousel',
|
|
489
484
|
fields: {
|
|
490
485
|
title: f.string().required(),
|
|
491
486
|
internalNote: f.string().noDynamic(),
|
|
492
487
|
items: f.blocks([
|
|
493
488
|
{
|
|
494
|
-
name:
|
|
495
|
-
field: f.relation(CarouselItem,
|
|
489
|
+
name: 'CarouselItem',
|
|
490
|
+
field: f.relation(CarouselItem, 'new'),
|
|
496
491
|
},
|
|
497
492
|
]),
|
|
498
493
|
},
|
|
499
|
-
})
|
|
494
|
+
})
|
|
500
495
|
```
|
|
501
496
|
|
|
502
497
|
List bindings append dynamic items to manually stored items instead of replacing
|
|
@@ -516,19 +511,19 @@ const headerBindings = {
|
|
|
516
511
|
categories: {
|
|
517
512
|
contentType: LinkItem.name,
|
|
518
513
|
source: {
|
|
519
|
-
kind:
|
|
514
|
+
kind: 'currentDocument',
|
|
520
515
|
contentType: Project.name,
|
|
521
|
-
path:
|
|
522
|
-
itemName:
|
|
516
|
+
path: 'categories',
|
|
517
|
+
itemName: 'Category',
|
|
523
518
|
},
|
|
524
|
-
itemName:
|
|
519
|
+
itemName: 'Category',
|
|
525
520
|
map: {
|
|
526
|
-
title: { contentType: LinkItem.name, path:
|
|
527
|
-
href: { contentType: LinkItem.name, path:
|
|
521
|
+
title: { contentType: LinkItem.name, path: 'title' },
|
|
522
|
+
href: { contentType: LinkItem.name, path: 'href' },
|
|
528
523
|
},
|
|
529
524
|
},
|
|
530
525
|
},
|
|
531
|
-
}
|
|
526
|
+
}
|
|
532
527
|
```
|
|
533
528
|
|
|
534
529
|
List query conditions can compare a source field with a value from the current
|
|
@@ -589,40 +584,40 @@ can create one item per `Category` and collect the images of its related
|
|
|
589
584
|
|
|
590
585
|
```ts
|
|
591
586
|
const Category = new ContentType({
|
|
592
|
-
name:
|
|
587
|
+
name: 'Category',
|
|
593
588
|
dynamicDataSource: true,
|
|
594
589
|
fields: {
|
|
595
590
|
title: f.string().required(),
|
|
596
591
|
},
|
|
597
|
-
})
|
|
592
|
+
})
|
|
598
593
|
|
|
599
594
|
const Project = new ContentType({
|
|
600
|
-
name:
|
|
595
|
+
name: 'Project',
|
|
601
596
|
dynamicDataSource: true,
|
|
602
597
|
fields: {
|
|
603
|
-
category: f.relation(Category,
|
|
604
|
-
images: f.file().type(
|
|
598
|
+
category: f.relation(Category, 'existing').required(),
|
|
599
|
+
images: f.file().type('Image').multiple().required(),
|
|
605
600
|
},
|
|
606
|
-
})
|
|
601
|
+
})
|
|
607
602
|
|
|
608
603
|
const galleryBindings = {
|
|
609
604
|
lists: {
|
|
610
605
|
items: {
|
|
611
606
|
contentType: Category.name,
|
|
612
|
-
itemName:
|
|
607
|
+
itemName: 'CategoriesGalleryItem',
|
|
613
608
|
map: {
|
|
614
|
-
title: { contentType: Category.name, path:
|
|
609
|
+
title: { contentType: Category.name, path: 'title' },
|
|
615
610
|
images: {
|
|
616
|
-
kind:
|
|
611
|
+
kind: 'relatedCollection',
|
|
617
612
|
contentType: Project.name,
|
|
618
|
-
relation:
|
|
619
|
-
path:
|
|
613
|
+
relation: 'category',
|
|
614
|
+
path: 'images',
|
|
620
615
|
limit: 10,
|
|
621
616
|
},
|
|
622
617
|
},
|
|
623
618
|
},
|
|
624
619
|
},
|
|
625
|
-
}
|
|
620
|
+
}
|
|
626
621
|
```
|
|
627
622
|
|
|
628
623
|
The related collection query matches `Project.category._id` against the current
|
|
@@ -653,19 +648,19 @@ a backward-compatible alias and references the same object.
|
|
|
653
648
|
Main factories:
|
|
654
649
|
|
|
655
650
|
```ts
|
|
656
|
-
f.string()
|
|
657
|
-
f.number()
|
|
658
|
-
f.boolean()
|
|
659
|
-
f.date()
|
|
660
|
-
f.select([
|
|
661
|
-
f.relation(Post)
|
|
662
|
-
f.contentReference(
|
|
663
|
-
f.selfRelation()
|
|
664
|
-
f.blocks([{ name:
|
|
665
|
-
f.array(f.string())
|
|
666
|
-
f.link()
|
|
667
|
-
f.file()
|
|
668
|
-
f.breadcrums()
|
|
651
|
+
f.string()
|
|
652
|
+
f.number()
|
|
653
|
+
f.boolean()
|
|
654
|
+
f.date()
|
|
655
|
+
f.select(['draft', 'published'])
|
|
656
|
+
f.relation(Post)
|
|
657
|
+
f.contentReference('Post')
|
|
658
|
+
f.selfRelation()
|
|
659
|
+
f.blocks([{ name: 'title', field: f.string() }])
|
|
660
|
+
f.array(f.string())
|
|
661
|
+
f.link()
|
|
662
|
+
f.file()
|
|
663
|
+
f.breadcrums()
|
|
669
664
|
```
|
|
670
665
|
|
|
671
666
|
Common modifiers:
|
|
@@ -717,13 +712,13 @@ Notable fields:
|
|
|
717
712
|
`core/src/orm` implements `DBService` on top of MongoDB:
|
|
718
713
|
|
|
719
714
|
```ts
|
|
720
|
-
const db = await getMongoService()
|
|
715
|
+
const db = await getMongoService()
|
|
721
716
|
|
|
722
717
|
const post = await db.create(Post, {
|
|
723
|
-
_type:
|
|
724
|
-
title:
|
|
725
|
-
slug:
|
|
726
|
-
})
|
|
718
|
+
_type: 'Post',
|
|
719
|
+
title: 'Hello',
|
|
720
|
+
slug: 'hello',
|
|
721
|
+
})
|
|
727
722
|
```
|
|
728
723
|
|
|
729
724
|
Operations:
|
|
@@ -751,9 +746,9 @@ Connection:
|
|
|
751
746
|
|
|
752
747
|
```ts
|
|
753
748
|
type MongoConfig = {
|
|
754
|
-
MONGO_URI: string
|
|
755
|
-
ENVIRONMENT?:
|
|
756
|
-
}
|
|
749
|
+
MONGO_URI: string
|
|
750
|
+
ENVIRONMENT?: 'local' | 'development' | 'test' | 'production'
|
|
751
|
+
}
|
|
757
752
|
```
|
|
758
753
|
|
|
759
754
|
In environments other than `test`, the connection creates indexes defined by `createIndexes`.
|
|
@@ -768,7 +763,11 @@ In environments other than `test`, the connection creates indexes defined by `cr
|
|
|
768
763
|
`manager.comments.markRead`, `manager.comments.unreadCount`,
|
|
769
764
|
`manager.users.mentions`,
|
|
770
765
|
`manager.notifications.list`, and `manager.notifications.markRead`.
|
|
771
|
-
- Web: page resolution.
|
|
766
|
+
- Web: page resolution, static paths, sitemap, robots, and preview.
|
|
767
|
+
|
|
768
|
+
`web.staticPaths` returns `{ path, ttl }` only for route-map entries backed by
|
|
769
|
+
page routes configured with `dynamic: false`. Adapters can use this operation
|
|
770
|
+
for static generation without querying Rakun's database directly.
|
|
772
771
|
|
|
773
772
|
Main helpers:
|
|
774
773
|
|
|
@@ -791,7 +790,7 @@ import {
|
|
|
791
790
|
getManagerOperationMeta,
|
|
792
791
|
type ManagerOperationInput,
|
|
793
792
|
type ManagerOperationOutput,
|
|
794
|
-
} from
|
|
793
|
+
} from '@rakun-kit/core/manager'
|
|
795
794
|
```
|
|
796
795
|
|
|
797
796
|
### Custom Operations
|
|
@@ -801,23 +800,23 @@ bootstrap, and reuse its type on the frontend:
|
|
|
801
800
|
|
|
802
801
|
```ts
|
|
803
802
|
// server/api-operations.ts
|
|
804
|
-
import { defineOperation } from
|
|
805
|
-
import { z } from
|
|
803
|
+
import { defineOperation } from '@rakun-kit/core'
|
|
804
|
+
import { z } from 'zod'
|
|
806
805
|
|
|
807
806
|
export const apiOperations = {
|
|
808
|
-
|
|
807
|
+
'demo.helloWorld': defineOperation<
|
|
809
808
|
{ text: string },
|
|
810
809
|
{ message: string },
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
810
|
+
'query',
|
|
811
|
+
'get',
|
|
812
|
+
'public'
|
|
814
813
|
>({
|
|
815
|
-
access:
|
|
816
|
-
kind:
|
|
817
|
-
method:
|
|
818
|
-
description:
|
|
814
|
+
access: 'public',
|
|
815
|
+
kind: 'query',
|
|
816
|
+
method: 'get',
|
|
817
|
+
description: 'Return a hello world message with the provided text',
|
|
819
818
|
input: z.object({
|
|
820
|
-
text: z.string().default(
|
|
819
|
+
text: z.string().default('world'),
|
|
821
820
|
}),
|
|
822
821
|
output: z.object({
|
|
823
822
|
message: z.string(),
|
|
@@ -826,17 +825,17 @@ export const apiOperations = {
|
|
|
826
825
|
message: `Hello ${input.text}`,
|
|
827
826
|
}),
|
|
828
827
|
}),
|
|
829
|
-
}
|
|
828
|
+
}
|
|
830
829
|
```
|
|
831
830
|
|
|
832
831
|
```ts
|
|
833
832
|
// bootstrap
|
|
834
|
-
import { apiOperations } from
|
|
833
|
+
import { apiOperations } from './server/api-operations'
|
|
835
834
|
|
|
836
835
|
rakunBootstrap({
|
|
837
836
|
// ...
|
|
838
837
|
apiOperations,
|
|
839
|
-
})
|
|
838
|
+
})
|
|
840
839
|
```
|
|
841
840
|
|
|
842
841
|
Operation names define their HTTP path: `demo.helloWorld` becomes
|
|
@@ -860,20 +859,20 @@ converted to JSON Schema for display.
|
|
|
860
859
|
`@rakun-kit/core/web` exposes a small typed HTTP client for operation maps:
|
|
861
860
|
|
|
862
861
|
```ts
|
|
863
|
-
import { createRakunApiClient, type GetClient } from
|
|
864
|
-
import type { apiOperations } from
|
|
862
|
+
import { createRakunApiClient, type GetClient } from '@rakun-kit/core/web'
|
|
863
|
+
import type { apiOperations } from './server/api-operations'
|
|
865
864
|
|
|
866
|
-
type ApiClient = GetClient<typeof apiOperations
|
|
865
|
+
type ApiClient = GetClient<typeof apiOperations>
|
|
867
866
|
|
|
868
867
|
const client: ApiClient = createRakunApiClient<typeof apiOperations>({
|
|
869
|
-
baseUrl:
|
|
870
|
-
})
|
|
868
|
+
baseUrl: '/api',
|
|
869
|
+
})
|
|
871
870
|
|
|
872
|
-
const result = await client.query(
|
|
873
|
-
text:
|
|
874
|
-
})
|
|
871
|
+
const result = await client.query('demo.helloWorld', {
|
|
872
|
+
text: 'Rakun',
|
|
873
|
+
})
|
|
875
874
|
|
|
876
|
-
result.message
|
|
875
|
+
result.message
|
|
877
876
|
```
|
|
878
877
|
|
|
879
878
|
The client exposes:
|
|
@@ -896,7 +895,7 @@ const ctx = await createRequestContext({
|
|
|
896
895
|
setHeader: res.setHeader.bind(res),
|
|
897
896
|
cookie: res.cookie.bind(res),
|
|
898
897
|
},
|
|
899
|
-
})
|
|
898
|
+
})
|
|
900
899
|
```
|
|
901
900
|
|
|
902
901
|
The resulting context includes:
|
|
@@ -915,10 +914,10 @@ Media uses a storage adapter:
|
|
|
915
914
|
```ts
|
|
916
915
|
createMediaService({
|
|
917
916
|
adapter,
|
|
918
|
-
defaultAccess:
|
|
917
|
+
defaultAccess: 'private',
|
|
919
918
|
defaultGetExpiresInSeconds: 300,
|
|
920
|
-
uploadUrl:
|
|
921
|
-
})
|
|
919
|
+
uploadUrl: '/api/rakun/manager/media/upload',
|
|
920
|
+
})
|
|
922
921
|
```
|
|
923
922
|
|
|
924
923
|
APIs:
|
|
@@ -939,28 +938,28 @@ The event log keeps events immutable and defaults to a MongoDB collection
|
|
|
939
938
|
with indexes for time, type, category, outcome, severity, correlation and tags:
|
|
940
939
|
|
|
941
940
|
```ts
|
|
942
|
-
import { recordEvent, queryEvents } from
|
|
941
|
+
import { recordEvent, queryEvents } from '@rakun-kit/core'
|
|
943
942
|
|
|
944
943
|
await recordEvent({
|
|
945
|
-
type:
|
|
946
|
-
category:
|
|
947
|
-
outcome:
|
|
948
|
-
actor: { type:
|
|
949
|
-
resource: { type:
|
|
944
|
+
type: 'content.article.published',
|
|
945
|
+
category: 'content',
|
|
946
|
+
outcome: 'success',
|
|
947
|
+
actor: { type: 'manager-user', id: userId },
|
|
948
|
+
resource: { type: 'Article', id: articleId },
|
|
950
949
|
correlationId: requestId,
|
|
951
|
-
tags: [
|
|
950
|
+
tags: ['editorial'],
|
|
952
951
|
data: {
|
|
953
|
-
locale:
|
|
952
|
+
locale: 'es',
|
|
954
953
|
changedFields: 3,
|
|
955
954
|
},
|
|
956
|
-
})
|
|
955
|
+
})
|
|
957
956
|
|
|
958
957
|
const page = await queryEvents({
|
|
959
|
-
categories: [
|
|
960
|
-
outcomes: [
|
|
961
|
-
from: new Date(
|
|
958
|
+
categories: ['content'],
|
|
959
|
+
outcomes: ['success'],
|
|
960
|
+
from: new Date('2026-01-01T00:00:00.000Z'),
|
|
962
961
|
limit: 50,
|
|
963
|
-
})
|
|
962
|
+
})
|
|
964
963
|
```
|
|
965
964
|
|
|
966
965
|
`data` accepts nested JSON values. Event queries use cursor pagination and can
|
|
@@ -969,24 +968,24 @@ required tags and a date range. A custom persistence implementation can be
|
|
|
969
968
|
plugged in globally:
|
|
970
969
|
|
|
971
970
|
```ts
|
|
972
|
-
import type { EventLogAdapter } from
|
|
971
|
+
import type { EventLogAdapter } from '@rakun-kit/core'
|
|
973
972
|
|
|
974
973
|
const adapter: EventLogAdapter = {
|
|
975
974
|
async append(event) {
|
|
976
|
-
return customStore.append(event)
|
|
975
|
+
return customStore.append(event)
|
|
977
976
|
},
|
|
978
977
|
async query(filters) {
|
|
979
|
-
return customStore.query(filters)
|
|
978
|
+
return customStore.query(filters)
|
|
980
979
|
},
|
|
981
980
|
async deleteBefore(before) {
|
|
982
|
-
return customStore.deleteBefore(before)
|
|
981
|
+
return customStore.deleteBefore(before)
|
|
983
982
|
},
|
|
984
|
-
}
|
|
983
|
+
}
|
|
985
984
|
|
|
986
985
|
rakunBootstrap({
|
|
987
986
|
// ...
|
|
988
987
|
eventLog: { adapter },
|
|
989
|
-
})
|
|
988
|
+
})
|
|
990
989
|
```
|
|
991
990
|
|
|
992
991
|
Plugins receive the resolved `eventLog` service in their initialization
|
|
@@ -1020,42 +1019,42 @@ Mail providers receive normalized, already-rendered messages through
|
|
|
1020
1019
|
engine:
|
|
1021
1020
|
|
|
1022
1021
|
```ts
|
|
1023
|
-
import type { MailAdapter } from
|
|
1022
|
+
import type { MailAdapter } from '@rakun-kit/core'
|
|
1024
1023
|
|
|
1025
1024
|
const adapter: MailAdapter = {
|
|
1026
1025
|
async send(message) {
|
|
1027
|
-
const result = await provider.send(message)
|
|
1028
|
-
return { id: result.id }
|
|
1026
|
+
const result = await provider.send(message)
|
|
1027
|
+
return { id: result.id }
|
|
1029
1028
|
},
|
|
1030
|
-
}
|
|
1029
|
+
}
|
|
1031
1030
|
|
|
1032
1031
|
rakunBootstrap({
|
|
1033
1032
|
// ...
|
|
1034
1033
|
mail: {
|
|
1035
1034
|
adapter,
|
|
1036
|
-
defaultFrom:
|
|
1037
|
-
defaultReplyTo:
|
|
1035
|
+
defaultFrom: 'hello@example.com',
|
|
1036
|
+
defaultReplyTo: 'support@example.com',
|
|
1038
1037
|
},
|
|
1039
|
-
})
|
|
1038
|
+
})
|
|
1040
1039
|
```
|
|
1041
1040
|
|
|
1042
1041
|
Send rendered content directly:
|
|
1043
1042
|
|
|
1044
1043
|
```ts
|
|
1045
|
-
import { sendMail } from
|
|
1044
|
+
import { sendMail } from '@rakun-kit/core'
|
|
1046
1045
|
|
|
1047
1046
|
await sendMail({
|
|
1048
|
-
to:
|
|
1049
|
-
subject:
|
|
1050
|
-
html:
|
|
1051
|
-
text:
|
|
1052
|
-
})
|
|
1047
|
+
to: 'ada@example.com',
|
|
1048
|
+
subject: 'Welcome',
|
|
1049
|
+
html: '<p>Hello Ada</p>',
|
|
1050
|
+
text: 'Hello Ada',
|
|
1051
|
+
})
|
|
1053
1052
|
```
|
|
1054
1053
|
|
|
1055
1054
|
Or create a typed application template registry:
|
|
1056
1055
|
|
|
1057
1056
|
```ts
|
|
1058
|
-
import { createMailSender, defineMailTemplate } from
|
|
1057
|
+
import { createMailSender, defineMailTemplate } from '@rakun-kit/core'
|
|
1059
1058
|
|
|
1060
1059
|
const mail = createMailSender({
|
|
1061
1060
|
templates: {
|
|
@@ -1067,13 +1066,13 @@ const mail = createMailSender({
|
|
|
1067
1066
|
}),
|
|
1068
1067
|
}),
|
|
1069
1068
|
},
|
|
1070
|
-
})
|
|
1069
|
+
})
|
|
1071
1070
|
|
|
1072
1071
|
await mail.send({
|
|
1073
|
-
template:
|
|
1074
|
-
props: { name:
|
|
1075
|
-
to:
|
|
1076
|
-
})
|
|
1072
|
+
template: 'welcome',
|
|
1073
|
+
props: { name: 'Ada' },
|
|
1074
|
+
to: 'ada@example.com',
|
|
1075
|
+
})
|
|
1077
1076
|
```
|
|
1078
1077
|
|
|
1079
1078
|
The common contract supports To/CC/BCC/Reply-To, custom headers and in-memory
|