@paroicms/server 0.151.0 → 0.151.2
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/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -0
- package/dist/common/child-ordering-query.d.ts +13 -0
- package/dist/common/child-ordering-query.js +107 -0
- package/dist/common/child-ordering-query.js.map +1 -0
- package/dist/common/data-format.d.ts +19 -0
- package/dist/common/data-format.js +86 -0
- package/dist/common/data-format.js.map +1 -0
- package/dist/common/mail/html-helpers.d.ts +7 -0
- package/dist/common/mail/html-helpers.js +46 -0
- package/dist/common/mail/html-helpers.js.map +1 -0
- package/dist/common/mail/sendMail.helpers.d.ts +14 -0
- package/dist/common/mail/sendMail.helpers.js +51 -0
- package/dist/common/mail/sendMail.helpers.js.map +1 -0
- package/dist/common/media-handles.helpers.d.ts +19 -0
- package/dist/common/media-handles.helpers.js +52 -0
- package/dist/common/media-handles.helpers.js.map +1 -0
- package/dist/common/serve-html-or.d.ts +16 -0
- package/dist/common/serve-html-or.js +72 -0
- package/dist/common/serve-html-or.js.map +1 -0
- package/dist/common/text-cache.d.ts +57 -0
- package/dist/common/text-cache.js +87 -0
- package/dist/common/text-cache.js.map +1 -0
- package/dist/common/tracker-report.d.ts +2 -0
- package/dist/common/tracker-report.js +27 -0
- package/dist/common/tracker-report.js.map +1 -0
- package/dist/context.d.ts +29 -0
- package/dist/context.js +60 -0
- package/dist/context.js.map +1 -0
- package/dist/express/http-helpers.d.ts +16 -0
- package/dist/express/http-helpers.js +44 -0
- package/dist/express/http-helpers.js.map +1 -0
- package/dist/express/static-middlewares.d.ts +3 -0
- package/dist/express/static-middlewares.js +114 -0
- package/dist/express/static-middlewares.js.map +1 -0
- package/dist/helpers/configuration.helpers.d.ts +2 -0
- package/dist/helpers/configuration.helpers.js +8 -0
- package/dist/helpers/configuration.helpers.js.map +1 -0
- package/dist/helpers/excerpt.helpers.d.ts +2 -0
- package/dist/helpers/excerpt.helpers.js +31 -0
- package/dist/helpers/excerpt.helpers.js.map +1 -0
- package/dist/helpers/jwt-secret.helpers.d.ts +2 -0
- package/dist/helpers/jwt-secret.helpers.js +30 -0
- package/dist/helpers/jwt-secret.helpers.js.map +1 -0
- package/dist/helpers/label-translator.helper.d.ts +9 -0
- package/dist/helpers/label-translator.helper.js +14 -0
- package/dist/helpers/label-translator.helper.js.map +1 -0
- package/dist/helpers/passwordEncrypt-helper.d.ts +2 -0
- package/dist/helpers/passwordEncrypt-helper.js +37 -0
- package/dist/helpers/passwordEncrypt-helper.js.map +1 -0
- package/dist/helpers/relative-id-helper.d.ts +10 -0
- package/dist/helpers/relative-id-helper.js +37 -0
- package/dist/helpers/relative-id-helper.js.map +1 -0
- package/dist/helpers/simple-i18n.d.ts +14 -0
- package/dist/helpers/simple-i18n.js +82 -0
- package/dist/helpers/simple-i18n.js.map +1 -0
- package/dist/helpers/special-account.helpers.d.ts +9 -0
- package/dist/helpers/special-account.helpers.js +43 -0
- package/dist/helpers/special-account.helpers.js.map +1 -0
- package/dist/helpers/url.helpers.d.ts +2 -0
- package/dist/helpers/url.helpers.js +12 -0
- package/dist/helpers/url.helpers.js.map +1 -0
- package/dist/helpers/utils-helper.d.ts +4 -0
- package/dist/helpers/utils-helper.js +32 -0
- package/dist/helpers/utils-helper.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-drop.d.ts +31 -0
- package/dist/liquidjs-tools/liquidjs-drop.js +45 -0
- package/dist/liquidjs-tools/liquidjs-drop.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-filter.d.ts +10 -0
- package/dist/liquidjs-tools/liquidjs-filter.js +23 -0
- package/dist/liquidjs-tools/liquidjs-filter.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.d.ts +6 -0
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.js +40 -0
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.d.ts +25 -0
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.js +35 -0
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-utils.d.ts +5 -0
- package/dist/liquidjs-tools/liquidjs-utils.js +22 -0
- package/dist/liquidjs-tools/liquidjs-utils.js.map +1 -0
- package/dist/liquidjs-tools/render-clone/collection.d.ts +1 -0
- package/dist/liquidjs-tools/render-clone/collection.js +18 -0
- package/dist/liquidjs-tools/render-clone/collection.js.map +1 -0
- package/dist/liquidjs-tools/render-clone/forloop-drop.d.ts +15 -0
- package/dist/liquidjs-tools/render-clone/forloop-drop.js +40 -0
- package/dist/liquidjs-tools/render-clone/forloop-drop.js.map +1 -0
- package/dist/liquidjs-tools/render-clone/render.d.ts +13 -0
- package/dist/liquidjs-tools/render-clone/render.js +108 -0
- package/dist/liquidjs-tools/render-clone/render.js.map +1 -0
- package/dist/maintenance/maintenance-task.d.ts +4 -0
- package/dist/maintenance/maintenance-task.js +27 -0
- package/dist/maintenance/maintenance-task.js.map +1 -0
- package/dist/maintenance/shutdown.d.ts +7 -0
- package/dist/maintenance/shutdown.js +51 -0
- package/dist/maintenance/shutdown.js.map +1 -0
- package/dist/modules/app.controller.d.ts +5 -0
- package/dist/modules/app.controller.js +89 -0
- package/dist/modules/app.controller.js.map +1 -0
- package/dist/modules/app.module.d.ts +2 -0
- package/dist/modules/app.module.js +48 -0
- package/dist/modules/app.module.js.map +1 -0
- package/dist/modules/core/account/account.model.d.ts +18 -0
- package/dist/modules/core/account/account.model.js +59 -0
- package/dist/modules/core/account/account.model.js.map +1 -0
- package/dist/modules/core/account/account.module.d.ts +2 -0
- package/dist/modules/core/account/account.module.js +20 -0
- package/dist/modules/core/account/account.module.js.map +1 -0
- package/dist/modules/core/account/account.queries.d.ts +18 -0
- package/dist/modules/core/account/account.queries.js +150 -0
- package/dist/modules/core/account/account.queries.js.map +1 -0
- package/dist/modules/core/account/account.resolver.d.ts +11 -0
- package/dist/modules/core/account/account.resolver.js +107 -0
- package/dist/modules/core/account/account.resolver.js.map +1 -0
- package/dist/modules/core/account/account.schema.d.ts +24 -0
- package/dist/modules/core/account/account.schema.js +114 -0
- package/dist/modules/core/account/account.schema.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.module.d.ts +2 -0
- package/dist/modules/core/account-auth/account-auth.module.js +24 -0
- package/dist/modules/core/account-auth/account-auth.module.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.service.d.ts +5 -0
- package/dist/modules/core/account-auth/account-auth.service.js +41 -0
- package/dist/modules/core/account-auth/account-auth.service.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.strategy.d.ts +10 -0
- package/dist/modules/core/account-auth/account-auth.strategy.js +48 -0
- package/dist/modules/core/account-auth/account-auth.strategy.js.map +1 -0
- package/dist/modules/core/auth/auth.module.d.ts +2 -0
- package/dist/modules/core/auth/auth.module.js +35 -0
- package/dist/modules/core/auth/auth.module.js.map +1 -0
- package/dist/modules/core/auth/auth.service.d.ts +11 -0
- package/dist/modules/core/auth/auth.service.js +163 -0
- package/dist/modules/core/auth/auth.service.js.map +1 -0
- package/dist/modules/core/auth/auth.types.d.ts +27 -0
- package/dist/modules/core/auth/auth.types.js +3 -0
- package/dist/modules/core/auth/auth.types.js.map +1 -0
- package/dist/modules/core/auth/jwt.auth.guard.d.ts +6 -0
- package/dist/modules/core/auth/jwt.auth.guard.js +23 -0
- package/dist/modules/core/auth/jwt.auth.guard.js.map +1 -0
- package/dist/modules/core/auth/jwt.strategy.d.ts +10 -0
- package/dist/modules/core/auth/jwt.strategy.js +35 -0
- package/dist/modules/core/auth/jwt.strategy.js.map +1 -0
- package/dist/modules/core/backup/backup.controller.d.ts +7 -0
- package/dist/modules/core/backup/backup.controller.js +60 -0
- package/dist/modules/core/backup/backup.controller.js.map +1 -0
- package/dist/modules/core/backup/backup.module.d.ts +2 -0
- package/dist/modules/core/backup/backup.module.js +22 -0
- package/dist/modules/core/backup/backup.module.js.map +1 -0
- package/dist/modules/core/backup/backup.resolver.d.ts +8 -0
- package/dist/modules/core/backup/backup.resolver.js +53 -0
- package/dist/modules/core/backup/backup.resolver.js.map +1 -0
- package/dist/modules/core/backup/backup.shema.d.ts +4 -0
- package/dist/modules/core/backup/backup.shema.js +30 -0
- package/dist/modules/core/backup/backup.shema.js.map +1 -0
- package/dist/modules/core/core.module.d.ts +2 -0
- package/dist/modules/core/core.module.js +50 -0
- package/dist/modules/core/core.module.js.map +1 -0
- package/dist/modules/core/document/document.helper.d.ts +2 -0
- package/dist/modules/core/document/document.helper.js +10 -0
- package/dist/modules/core/document/document.helper.js.map +1 -0
- package/dist/modules/core/document/document.model.d.ts +9 -0
- package/dist/modules/core/document/document.model.js +59 -0
- package/dist/modules/core/document/document.model.js.map +1 -0
- package/dist/modules/core/document/document.module.d.ts +2 -0
- package/dist/modules/core/document/document.module.js +25 -0
- package/dist/modules/core/document/document.module.js.map +1 -0
- package/dist/modules/core/document/document.resolver.d.ts +12 -0
- package/dist/modules/core/document/document.resolver.extend.d.ts +10 -0
- package/dist/modules/core/document/document.resolver.extend.js +69 -0
- package/dist/modules/core/document/document.resolver.extend.js.map +1 -0
- package/dist/modules/core/document/document.resolver.js +154 -0
- package/dist/modules/core/document/document.resolver.js.map +1 -0
- package/dist/modules/core/document/document.schema.d.ts +39 -0
- package/dist/modules/core/document/document.schema.js +181 -0
- package/dist/modules/core/document/document.schema.js.map +1 -0
- package/dist/modules/core/document/load-documents.queries.d.ts +17 -0
- package/dist/modules/core/document/load-documents.queries.js +119 -0
- package/dist/modules/core/document/load-documents.queries.js.map +1 -0
- package/dist/modules/core/document/save-documents.queries.d.ts +18 -0
- package/dist/modules/core/document/save-documents.queries.js +199 -0
- package/dist/modules/core/document/save-documents.queries.js.map +1 -0
- package/dist/modules/core/fields/_fields.helpers.d.ts +2 -0
- package/dist/modules/core/fields/_fields.helpers.js +12 -0
- package/dist/modules/core/fields/_fields.helpers.js.map +1 -0
- package/dist/modules/core/fields/fields.model.d.ts +17 -0
- package/dist/modules/core/fields/fields.model.js +99 -0
- package/dist/modules/core/fields/fields.model.js.map +1 -0
- package/dist/modules/core/fields/fields.module.d.ts +2 -0
- package/dist/modules/core/fields/fields.module.js +20 -0
- package/dist/modules/core/fields/fields.module.js.map +1 -0
- package/dist/modules/core/fields/fields.resolver.d.ts +14 -0
- package/dist/modules/core/fields/fields.resolver.js +165 -0
- package/dist/modules/core/fields/fields.resolver.js.map +1 -0
- package/dist/modules/core/fields/load-fields.queries.d.ts +20 -0
- package/dist/modules/core/fields/load-fields.queries.js +233 -0
- package/dist/modules/core/fields/load-fields.queries.js.map +1 -0
- package/dist/modules/core/fields/quill-delta.d.ts +1 -0
- package/dist/modules/core/fields/quill-delta.js +40 -0
- package/dist/modules/core/fields/quill-delta.js.map +1 -0
- package/dist/modules/core/fields/save-fields.queries.d.ts +9 -0
- package/dist/modules/core/fields/save-fields.queries.js +135 -0
- package/dist/modules/core/fields/save-fields.queries.js.map +1 -0
- package/dist/modules/core/leaf/leaf.model.d.ts +9 -0
- package/dist/modules/core/leaf/leaf.model.js +61 -0
- package/dist/modules/core/leaf/leaf.model.js.map +1 -0
- package/dist/modules/core/leaf/leaf.module.d.ts +2 -0
- package/dist/modules/core/leaf/leaf.module.js +21 -0
- package/dist/modules/core/leaf/leaf.module.js.map +1 -0
- package/dist/modules/core/leaf/leaf.queries.d.ts +21 -0
- package/dist/modules/core/leaf/leaf.queries.js +159 -0
- package/dist/modules/core/leaf/leaf.queries.js.map +1 -0
- package/dist/modules/core/leaf/leaf.resolver.d.ts +9 -0
- package/dist/modules/core/leaf/leaf.resolver.extend.d.ts +6 -0
- package/dist/modules/core/leaf/leaf.resolver.extend.js +42 -0
- package/dist/modules/core/leaf/leaf.resolver.extend.js.map +1 -0
- package/dist/modules/core/leaf/leaf.resolver.js +84 -0
- package/dist/modules/core/leaf/leaf.resolver.js.map +1 -0
- package/dist/modules/core/leaf/leaf.schema.d.ts +7 -0
- package/dist/modules/core/leaf/leaf.schema.js +45 -0
- package/dist/modules/core/leaf/leaf.schema.js.map +1 -0
- package/dist/modules/core/leaf-item/leaf-item.model.d.ts +6 -0
- package/dist/modules/core/leaf-item/leaf-item.model.js +44 -0
- package/dist/modules/core/leaf-item/leaf-item.model.js.map +1 -0
- package/dist/modules/core/leaf-item/leaf-item.queries.d.ts +9 -0
- package/dist/modules/core/leaf-item/leaf-item.queries.js +120 -0
- package/dist/modules/core/leaf-item/leaf-item.queries.js.map +1 -0
- package/dist/modules/core/login/login.controller.d.ts +8 -0
- package/dist/modules/core/login/login.controller.js +53 -0
- package/dist/modules/core/login/login.controller.js.map +1 -0
- package/dist/modules/core/login/login.module.d.ts +2 -0
- package/dist/modules/core/login/login.module.js +22 -0
- package/dist/modules/core/login/login.module.js.map +1 -0
- package/dist/modules/core/media/media-upload.controller.d.ts +21 -0
- package/dist/modules/core/media/media-upload.controller.js +160 -0
- package/dist/modules/core/media/media-upload.controller.js.map +1 -0
- package/dist/modules/core/media/media.d.ts +22 -0
- package/dist/modules/core/media/media.js +53 -0
- package/dist/modules/core/media/media.js.map +1 -0
- package/dist/modules/core/media/media.module.d.ts +2 -0
- package/dist/modules/core/media/media.module.js +22 -0
- package/dist/modules/core/media/media.module.js.map +1 -0
- package/dist/modules/core/media/media.resolver.d.ts +14 -0
- package/dist/modules/core/media/media.resolver.js +199 -0
- package/dist/modules/core/media/media.resolver.js.map +1 -0
- package/dist/modules/core/media/media.schema.d.ts +30 -0
- package/dist/modules/core/media/media.schema.js +144 -0
- package/dist/modules/core/media/media.schema.js.map +1 -0
- package/dist/modules/core/part/part.module.d.ts +2 -0
- package/dist/modules/core/part/part.module.js +21 -0
- package/dist/modules/core/part/part.module.js.map +1 -0
- package/dist/modules/core/part/part.queries.d.ts +22 -0
- package/dist/modules/core/part/part.queries.js +167 -0
- package/dist/modules/core/part/part.queries.js.map +1 -0
- package/dist/modules/core/part/part.resolver.d.ts +14 -0
- package/dist/modules/core/part/part.resolver.extend.d.ts +5 -0
- package/dist/modules/core/part/part.resolver.extend.js +49 -0
- package/dist/modules/core/part/part.resolver.extend.js.map +1 -0
- package/dist/modules/core/part/part.resolver.js +135 -0
- package/dist/modules/core/part/part.resolver.js.map +1 -0
- package/dist/modules/core/part/part.schema.d.ts +12 -0
- package/dist/modules/core/part/part.schema.js +66 -0
- package/dist/modules/core/part/part.schema.js.map +1 -0
- package/dist/modules/core/section/section-wrap.resolver.d.ts +11 -0
- package/dist/modules/core/section/section-wrap.resolver.js +168 -0
- package/dist/modules/core/section/section-wrap.resolver.js.map +1 -0
- package/dist/modules/core/section/section.model.d.ts +6 -0
- package/dist/modules/core/section/section.model.js +44 -0
- package/dist/modules/core/section/section.model.js.map +1 -0
- package/dist/modules/core/section/section.module.d.ts +2 -0
- package/dist/modules/core/section/section.module.js +21 -0
- package/dist/modules/core/section/section.module.js.map +1 -0
- package/dist/modules/core/section/section.queries.d.ts +51 -0
- package/dist/modules/core/section/section.queries.js +228 -0
- package/dist/modules/core/section/section.queries.js.map +1 -0
- package/dist/modules/core/section/section.resolver.d.ts +7 -0
- package/dist/modules/core/section/section.resolver.js +78 -0
- package/dist/modules/core/section/section.resolver.js.map +1 -0
- package/dist/modules/core/section/section.schema.d.ts +27 -0
- package/dist/modules/core/section/section.schema.js +129 -0
- package/dist/modules/core/section/section.schema.js.map +1 -0
- package/dist/modules/core/site-info/site-info.module.d.ts +2 -0
- package/dist/modules/core/site-info/site-info.module.js +20 -0
- package/dist/modules/core/site-info/site-info.module.js.map +1 -0
- package/dist/modules/core/site-info/site-info.resolver.d.ts +5 -0
- package/dist/modules/core/site-info/site-info.resolver.js +44 -0
- package/dist/modules/core/site-info/site-info.resolver.js.map +1 -0
- package/dist/modules/core/site-info/site-info.schema.d.ts +6 -0
- package/dist/modules/core/site-info/site-info.schema.js +36 -0
- package/dist/modules/core/site-info/site-info.schema.js.map +1 -0
- package/dist/modules/core/site-schema/site-schema.module.d.ts +2 -0
- package/dist/modules/core/site-schema/site-schema.module.js +20 -0
- package/dist/modules/core/site-schema/site-schema.module.js.map +1 -0
- package/dist/modules/core/site-schema/site-schema.resolver.d.ts +4 -0
- package/dist/modules/core/site-schema/site-schema.resolver.js +35 -0
- package/dist/modules/core/site-schema/site-schema.resolver.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.model.d.ts +6 -0
- package/dist/modules/core/term-flag/term-flag.model.js +45 -0
- package/dist/modules/core/term-flag/term-flag.model.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.module.d.ts +2 -0
- package/dist/modules/core/term-flag/term-flag.module.js +20 -0
- package/dist/modules/core/term-flag/term-flag.module.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.queries.d.ts +7 -0
- package/dist/modules/core/term-flag/term-flag.queries.js +44 -0
- package/dist/modules/core/term-flag/term-flag.queries.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.resolver.d.ts +5 -0
- package/dist/modules/core/term-flag/term-flag.resolver.js +47 -0
- package/dist/modules/core/term-flag/term-flag.resolver.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.schema.d.ts +9 -0
- package/dist/modules/core/term-flag/term-flag.schema.js +51 -0
- package/dist/modules/core/term-flag/term-flag.schema.js.map +1 -0
- package/dist/modules/core/unprotected/unprotected.module.d.ts +2 -0
- package/dist/modules/core/unprotected/unprotected.module.js +20 -0
- package/dist/modules/core/unprotected/unprotected.module.js.map +1 -0
- package/dist/modules/core/unprotected/unprotected.resolver.d.ts +8 -0
- package/dist/modules/core/unprotected/unprotected.resolver.js +106 -0
- package/dist/modules/core/unprotected/unprotected.resolver.js.map +1 -0
- package/dist/modules/core/unprotected/unprotected.schema.d.ts +19 -0
- package/dist/modules/core/unprotected/unprotected.schema.js +93 -0
- package/dist/modules/core/unprotected/unprotected.schema.js.map +1 -0
- package/dist/modules/graphql.types.d.ts +6 -0
- package/dist/modules/graphql.types.js +3 -0
- package/dist/modules/graphql.types.js.map +1 -0
- package/dist/modules/private-api.module.d.ts +2 -0
- package/dist/modules/private-api.module.js +50 -0
- package/dist/modules/private-api.module.js.map +1 -0
- package/dist/modules/public-api/class-validator-options.d.ts +7 -0
- package/dist/modules/public-api/class-validator-options.js +11 -0
- package/dist/modules/public-api/class-validator-options.js.map +1 -0
- package/dist/modules/public-api/mail/contact-form-mail.d.ts +8 -0
- package/dist/modules/public-api/mail/contact-form-mail.js +96 -0
- package/dist/modules/public-api/mail/contact-form-mail.js.map +1 -0
- package/dist/modules/public-api/mail/mail.dto.d.ts +8 -0
- package/dist/modules/public-api/mail/mail.dto.js +56 -0
- package/dist/modules/public-api/mail/mail.dto.js.map +1 -0
- package/dist/modules/public-api/partials/partials-params.dto.d.ts +6 -0
- package/dist/modules/public-api/partials/partials-params.dto.js +45 -0
- package/dist/modules/public-api/partials/partials-params.dto.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.controller.d.ts +11 -0
- package/dist/modules/public-api/password-reset/password-reset.controller.js +57 -0
- package/dist/modules/public-api/password-reset/password-reset.controller.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.dto.d.ts +9 -0
- package/dist/modules/public-api/password-reset/password-reset.dto.js +55 -0
- package/dist/modules/public-api/password-reset/password-reset.dto.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.module.d.ts +2 -0
- package/dist/modules/public-api/password-reset/password-reset.module.js +22 -0
- package/dist/modules/public-api/password-reset/password-reset.module.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.service.d.ts +14 -0
- package/dist/modules/public-api/password-reset/password-reset.service.js +56 -0
- package/dist/modules/public-api/password-reset/password-reset.service.js.map +1 -0
- package/dist/modules/public-api/public-api-controller.d.ts +32 -0
- package/dist/modules/public-api/public-api-controller.js +195 -0
- package/dist/modules/public-api/public-api-controller.js.map +1 -0
- package/dist/modules/public-api/public-api.module.d.ts +2 -0
- package/dist/modules/public-api/public-api.module.js +22 -0
- package/dist/modules/public-api/public-api.module.js.map +1 -0
- package/dist/modules/public-api/search-text/search-text.dto.d.ts +7 -0
- package/dist/modules/public-api/search-text/search-text.dto.js +50 -0
- package/dist/modules/public-api/search-text/search-text.dto.js.map +1 -0
- package/dist/modules/public-api/search-text/search-text.queries.d.ts +14 -0
- package/dist/modules/public-api/search-text/search-text.queries.js +58 -0
- package/dist/modules/public-api/search-text/search-text.queries.js.map +1 -0
- package/dist/modules/public-site/app-exception-filter.d.ts +4 -0
- package/dist/modules/public-site/app-exception-filter.js +41 -0
- package/dist/modules/public-site/app-exception-filter.js.map +1 -0
- package/dist/modules/public-site/helpers/format-date.helper.d.ts +4 -0
- package/dist/modules/public-site/helpers/format-date.helper.js +35 -0
- package/dist/modules/public-site/helpers/format-date.helper.js.map +1 -0
- package/dist/modules/public-site/helpers/medias.helpers.d.ts +3 -0
- package/dist/modules/public-site/helpers/medias.helpers.js +16 -0
- package/dist/modules/public-site/helpers/medias.helpers.js.map +1 -0
- package/dist/modules/public-site/helpers/obfuscate.helper.d.ts +2 -0
- package/dist/modules/public-site/helpers/obfuscate.helper.js +27 -0
- package/dist/modules/public-site/helpers/obfuscate.helper.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.d.ts +7 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.js +15 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.d.ts +6 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.js +17 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/info-filter.d.ts +1 -0
- package/dist/modules/public-site/liquidjs-filters/info-filter.js +144 -0
- package/dist/modules/public-site/liquidjs-filters/info-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.d.ts +1 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js +40 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.d.ts +6 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js +25 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.js +10 -0
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js +18 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.d.ts +6 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js +41 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.d.ts +7 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js +23 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.js +69 -0
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js +95 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.js +54 -0
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.js.map +1 -0
- package/dist/modules/public-site/media-serve/_media-serve-helpers.d.ts +11 -0
- package/dist/modules/public-site/media-serve/_media-serve-helpers.js +26 -0
- package/dist/modules/public-site/media-serve/_media-serve-helpers.js.map +1 -0
- package/dist/modules/public-site/media-serve/media-serve.controller.d.ts +4 -0
- package/dist/modules/public-site/media-serve/media-serve.controller.js +140 -0
- package/dist/modules/public-site/media-serve/media-serve.controller.js.map +1 -0
- package/dist/modules/public-site/media-serve/media-serve.module.d.ts +2 -0
- package/dist/modules/public-site/media-serve/media-serve.module.js +20 -0
- package/dist/modules/public-site/media-serve/media-serve.module.js.map +1 -0
- package/dist/modules/public-site/oauth2-client.controller.d.ts +10 -0
- package/dist/modules/public-site/oauth2-client.controller.js +143 -0
- package/dist/modules/public-site/oauth2-client.controller.js.map +1 -0
- package/dist/modules/public-site/public-route/make-url.d.ts +11 -0
- package/dist/modules/public-site/public-route/make-url.js +150 -0
- package/dist/modules/public-site/public-route/make-url.js.map +1 -0
- package/dist/modules/public-site/public-route/public-route-parser.d.ts +16 -0
- package/dist/modules/public-site/public-route/public-route-parser.js +154 -0
- package/dist/modules/public-site/public-route/public-route-parser.js.map +1 -0
- package/dist/modules/public-site/public-route/raw-document-payload.d.ts +8 -0
- package/dist/modules/public-site/public-route/raw-document-payload.js +86 -0
- package/dist/modules/public-site/public-route/raw-document-payload.js.map +1 -0
- package/dist/modules/public-site/public-site.controller.d.ts +7 -0
- package/dist/modules/public-site/public-site.controller.js +58 -0
- package/dist/modules/public-site/public-site.controller.js.map +1 -0
- package/dist/modules/public-site/public-site.middleware.d.ts +5 -0
- package/dist/modules/public-site/public-site.middleware.js +67 -0
- package/dist/modules/public-site/public-site.middleware.js.map +1 -0
- package/dist/modules/public-site/public-site.module.d.ts +4 -0
- package/dist/modules/public-site/public-site.module.js +27 -0
- package/dist/modules/public-site/public-site.module.js.map +1 -0
- package/dist/modules/public-site/serve-document/serve-document.d.ts +20 -0
- package/dist/modules/public-site/serve-document/serve-document.js +60 -0
- package/dist/modules/public-site/serve-document/serve-document.js.map +1 -0
- package/dist/modules/security/app-throttler-guard.d.ts +8 -0
- package/dist/modules/security/app-throttler-guard.js +18 -0
- package/dist/modules/security/app-throttler-guard.js.map +1 -0
- package/dist/modules/security/complexity-plugin.d.ts +8 -0
- package/dist/modules/security/complexity-plugin.js +45 -0
- package/dist/modules/security/complexity-plugin.js.map +1 -0
- package/dist/nest-custom-logger.d.ts +8 -0
- package/dist/nest-custom-logger.js +23 -0
- package/dist/nest-custom-logger.js.map +1 -0
- package/dist/public-payload/breadcrumb.queries.d.ts +5 -0
- package/dist/public-payload/breadcrumb.queries.js +26 -0
- package/dist/public-payload/breadcrumb.queries.js.map +1 -0
- package/dist/public-payload/create-page-drop.d.ts +11 -0
- package/dist/public-payload/create-page-drop.js +160 -0
- package/dist/public-payload/create-page-drop.js.map +1 -0
- package/dist/public-payload/create-page-part-drop.d.ts +7 -0
- package/dist/public-payload/create-page-part-drop.js +39 -0
- package/dist/public-payload/create-page-part-drop.js.map +1 -0
- package/dist/public-payload/excerpt.queries.d.ts +10 -0
- package/dist/public-payload/excerpt.queries.js +38 -0
- package/dist/public-payload/excerpt.queries.js.map +1 -0
- package/dist/public-payload/field-values.d.ts +9 -0
- package/dist/public-payload/field-values.js +99 -0
- package/dist/public-payload/field-values.js.map +1 -0
- package/dist/public-payload/get-siblings.queries.d.ts +5 -0
- package/dist/public-payload/get-siblings.queries.js +117 -0
- package/dist/public-payload/get-siblings.queries.js.map +1 -0
- package/dist/public-payload/load-default-image.d.ts +8 -0
- package/dist/public-payload/load-default-image.js +52 -0
- package/dist/public-payload/load-default-image.js.map +1 -0
- package/dist/public-payload/make-basic-payload.d.ts +6 -0
- package/dist/public-payload/make-basic-payload.js +19 -0
- package/dist/public-payload/make-basic-payload.js.map +1 -0
- package/dist/public-payload/make-image-available.d.ts +26 -0
- package/dist/public-payload/make-image-available.js +38 -0
- package/dist/public-payload/make-image-available.js.map +1 -0
- package/dist/public-payload/page-values.queries.d.ts +27 -0
- package/dist/public-payload/page-values.queries.js +110 -0
- package/dist/public-payload/page-values.queries.js.map +1 -0
- package/dist/public-payload/parts.queries.d.ts +6 -0
- package/dist/public-payload/parts.queries.js +123 -0
- package/dist/public-payload/parts.queries.js.map +1 -0
- package/dist/public-payload/public-payload.types.d.ts +130 -0
- package/dist/public-payload/public-payload.types.js +3 -0
- package/dist/public-payload/public-payload.types.js.map +1 -0
- package/dist/public-payload/site-payload.d.ts +4 -0
- package/dist/public-payload/site-payload.js +43 -0
- package/dist/public-payload/site-payload.js.map +1 -0
- package/dist/public-payload/taxonomies.queries.d.ts +13 -0
- package/dist/public-payload/taxonomies.queries.js +45 -0
- package/dist/public-payload/taxonomies.queries.js.map +1 -0
- package/dist/public-payload/translations.queries.d.ts +7 -0
- package/dist/public-payload/translations.queries.js +62 -0
- package/dist/public-payload/translations.queries.js.map +1 -0
- package/dist/public.types.d.ts +5 -0
- package/dist/public.types.js +3 -0
- package/dist/public.types.js.map +1 -0
- package/dist/share/pino-app-log.d.ts +26 -0
- package/dist/share/pino-app-log.js +138 -0
- package/dist/share/pino-app-log.js.map +1 -0
- package/dist/share/read-configuration.d.ts +7 -0
- package/dist/share/read-configuration.js +31 -0
- package/dist/share/read-configuration.js.map +1 -0
- package/dist/site-backup/archiver.helper.d.ts +12 -0
- package/dist/site-backup/archiver.helper.js +43 -0
- package/dist/site-backup/archiver.helper.js.map +1 -0
- package/dist/site-backup/backup-tasks.d.ts +10 -0
- package/dist/site-backup/backup-tasks.js +50 -0
- package/dist/site-backup/backup-tasks.js.map +1 -0
- package/dist/site-backup/backup.d.ts +11 -0
- package/dist/site-backup/backup.helper.d.ts +3 -0
- package/dist/site-backup/backup.helper.js +13 -0
- package/dist/site-backup/backup.helper.js.map +1 -0
- package/dist/site-backup/backup.js +35 -0
- package/dist/site-backup/backup.js.map +1 -0
- package/dist/site-context/create-site-context.d.ts +3 -0
- package/dist/site-context/create-site-context.js +183 -0
- package/dist/site-context/create-site-context.js.map +1 -0
- package/dist/site-context/db-init/db-init.d.ts +11 -0
- package/dist/site-context/db-init/db-init.js +38 -0
- package/dist/site-context/db-init/db-init.js.map +1 -0
- package/dist/site-context/db-init/ddl-migration.d.ts +13 -0
- package/dist/site-context/db-init/ddl-migration.js +26 -0
- package/dist/site-context/db-init/ddl-migration.js.map +1 -0
- package/dist/site-context/db-init/init-routing-points.d.ts +5 -0
- package/dist/site-context/db-init/init-routing-points.js +149 -0
- package/dist/site-context/db-init/init-routing-points.js.map +1 -0
- package/dist/site-context/site-conf.d.ts +17 -0
- package/dist/site-context/site-conf.js +103 -0
- package/dist/site-context/site-conf.js.map +1 -0
- package/dist/site-context/site-context.d.ts +12 -0
- package/dist/site-context/site-context.js +87 -0
- package/dist/site-context/site-context.js.map +1 -0
- package/dist/site-context/site-context.types.d.ts +46 -0
- package/dist/site-context/site-context.types.js +3 -0
- package/dist/site-context/site-context.types.js.map +1 -0
- package/dist/site-context/theme-conf-reader.d.ts +4 -0
- package/dist/site-context/theme-conf-reader.js +33 -0
- package/dist/site-context/theme-conf-reader.js.map +1 -0
- package/dist/site-context/theme-conf-types.d.ts +4 -0
- package/dist/site-context/theme-conf-types.js +3 -0
- package/dist/site-context/theme-conf-types.js.map +1 -0
- package/dist/site-schema/common-schema-reader.d.ts +6 -0
- package/dist/site-schema/common-schema-reader.js +29 -0
- package/dist/site-schema/common-schema-reader.js.map +1 -0
- package/dist/site-schema/merged-schema-lib.d.ts +30 -0
- package/dist/site-schema/merged-schema-lib.js +118 -0
- package/dist/site-schema/merged-schema-lib.js.map +1 -0
- package/dist/site-schema/read-locales.d.ts +24 -0
- package/dist/site-schema/read-locales.js +171 -0
- package/dist/site-schema/read-locales.js.map +1 -0
- package/dist/site-schema/site-schema-factory.d.ts +2 -0
- package/dist/site-schema/site-schema-factory.js +385 -0
- package/dist/site-schema/site-schema-factory.js.map +1 -0
- package/dist/site-schema/site-schema-helpers.d.ts +5 -0
- package/dist/site-schema/site-schema-helpers.js +27 -0
- package/dist/site-schema/site-schema-helpers.js.map +1 -0
- package/dist/site-schema/site-schema-lib-reader.d.ts +14 -0
- package/dist/site-schema/site-schema-lib-reader.js +48 -0
- package/dist/site-schema/site-schema-lib-reader.js.map +1 -0
- package/dist/start.d.ts +1 -0
- package/dist/start.js +5 -0
- package/dist/start.js.map +1 -0
- package/dist/types.to.json +1 -0
- package/package.json +9 -8
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,mBAAiB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ChildOrdering, type DocumentSchema } from "@paroicms/anywhere-lib";
|
|
2
|
+
import type { SelectQueryBuilder } from "typeorm";
|
|
3
|
+
import type { SiteContext } from "../site-context/site-context.types";
|
|
4
|
+
export declare function applyChildOrderingOnQuery(siteContext: Pick<SiteContext, "mainCn" | "siteSchema">, options: {
|
|
5
|
+
query: SelectQueryBuilder<any>;
|
|
6
|
+
parentDocumentType: DocumentSchema;
|
|
7
|
+
childOrdering?: ChildOrdering;
|
|
8
|
+
leftJoinDocument?: boolean;
|
|
9
|
+
orderByAsString?: boolean;
|
|
10
|
+
}): {
|
|
11
|
+
ordered: boolean;
|
|
12
|
+
orderBy?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyChildOrderingOnQuery = void 0;
|
|
4
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
function applyChildOrderingOnQuery(siteContext, options) {
|
|
7
|
+
const { query, parentDocumentType, leftJoinDocument, orderByAsString } = options;
|
|
8
|
+
const childOrdering = options.childOrdering ?? parentDocumentType.childOrdering;
|
|
9
|
+
if (!childOrdering)
|
|
10
|
+
return { ordered: false };
|
|
11
|
+
const orderPropertiesMap = makeMapOfOrderProperties(siteContext, parentDocumentType.children);
|
|
12
|
+
const orderByQb = orderByAsString ? makeOrderByAsStringQB() : query;
|
|
13
|
+
if (childOrdering === "manual") {
|
|
14
|
+
query.leftJoin("PaLeafItem", "i", "i.leafId = l.id and i.listName = :listName", {
|
|
15
|
+
listName: "documents",
|
|
16
|
+
});
|
|
17
|
+
orderByQb.orderBy("i.itemNum", "ASC").addOrderBy("l.id", "ASC");
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
let index = 0;
|
|
21
|
+
for (const [fieldName, direction] of childOrdering) {
|
|
22
|
+
if (fieldName === "title") {
|
|
23
|
+
if (leftJoinDocument) {
|
|
24
|
+
query.leftJoin("PaDocument", "d", "d.leafId = s.leafId and d.lang = s.lang");
|
|
25
|
+
}
|
|
26
|
+
orderByQb.addOrderBy("d.title", formatTypeOrmOrder(direction));
|
|
27
|
+
}
|
|
28
|
+
else if (fieldName === "publishDate") {
|
|
29
|
+
orderByQb.addOrderBy("l.publishDate", formatTypeOrmOrder(direction));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const orderProperties = orderPropertiesMap.get(fieldName);
|
|
33
|
+
if (!orderProperties)
|
|
34
|
+
throw new Error(`unknown field '${fieldName}'`);
|
|
35
|
+
const { dataType, storedOn } = orderProperties;
|
|
36
|
+
let orderByField;
|
|
37
|
+
if (dataType === "string" || dataType === "boolean") {
|
|
38
|
+
orderByField = `f${index}.val`;
|
|
39
|
+
}
|
|
40
|
+
else if (dataType === "number" || dataType === "currency") {
|
|
41
|
+
orderByField = `cast(f${index}.val as float)`;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw new Error(`invalid data type '${dataType}'`);
|
|
45
|
+
}
|
|
46
|
+
const langJoinCrit = storedOn === "section" ? `f${index}.lang = s.lang` : `f${index}.lang = :dbAnyLang`;
|
|
47
|
+
const critParams = storedOn === "section" ? { fieldName } : { fieldName, dbAnyLang: context_1.dbAnyLang };
|
|
48
|
+
query.leftJoin("PaFieldVarchar", `f${index}`, `f${index}.field = :fieldName and f${index}.leafId = s.leafId and ${langJoinCrit}`, critParams);
|
|
49
|
+
orderByQb.addOrderBy(orderByField, formatTypeOrmOrder(direction));
|
|
50
|
+
}
|
|
51
|
+
++index;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
ordered: true,
|
|
56
|
+
orderBy: orderByAsString ? orderByQb.getAsString() : undefined,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
exports.applyChildOrderingOnQuery = applyChildOrderingOnQuery;
|
|
60
|
+
function makeMapOfOrderProperties(siteContext, children) {
|
|
61
|
+
const orderProperties = new Map();
|
|
62
|
+
for (const child of children ?? []) {
|
|
63
|
+
const documentSchema = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteContext.siteSchema, child);
|
|
64
|
+
for (const field of documentSchema.fields ?? []) {
|
|
65
|
+
if (field.storedAs !== "varchar")
|
|
66
|
+
continue;
|
|
67
|
+
const prev = orderProperties.get(field.name);
|
|
68
|
+
if (prev) {
|
|
69
|
+
if (prev.dataType !== field.dataType) {
|
|
70
|
+
throw new Error(`Cannot order on '${field.name}': inconsistent data types '${prev.dataType}' and '${field.dataType}'`);
|
|
71
|
+
}
|
|
72
|
+
if (prev.storedOn !== field.storedOn) {
|
|
73
|
+
throw new Error(`Cannot order on '${field.name}': inconsistent storedOn`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
orderProperties.set(field.name, { dataType: field.dataType, storedOn: field.storedOn });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return orderProperties;
|
|
82
|
+
}
|
|
83
|
+
function makeOrderByAsStringQB() {
|
|
84
|
+
let arr = [];
|
|
85
|
+
const qb = {
|
|
86
|
+
orderBy(column, direction) {
|
|
87
|
+
arr = [`${column} ${direction}`];
|
|
88
|
+
return qb;
|
|
89
|
+
},
|
|
90
|
+
addOrderBy(column, direction) {
|
|
91
|
+
arr.push(`${column} ${direction}`);
|
|
92
|
+
return qb;
|
|
93
|
+
},
|
|
94
|
+
getAsString() {
|
|
95
|
+
return arr.join(", ");
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
return qb;
|
|
99
|
+
}
|
|
100
|
+
function formatTypeOrmOrder(direction) {
|
|
101
|
+
if (direction === "asc")
|
|
102
|
+
return "ASC";
|
|
103
|
+
if (direction === "desc")
|
|
104
|
+
return "DESC";
|
|
105
|
+
throw new Error(`Invalid direction ${direction}`);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=child-ordering-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-ordering-query.js","sourceRoot":"","sources":["../../src/common/child-ordering-query.ts"],"names":[],"mappings":";;;AAAA,yDAKgC;AAEhC,wCAAuC;AAGvC,SAAgB,yBAAyB,CACvC,WAAuD,EACvD,OAMC;IAED,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IACjF,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,kBAAkB,CAAC,aAAa,CAAC;IAChF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC9C,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,WAAW,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAE9F,MAAM,SAAS,GAAG,eAAe,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpE,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC/B,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE,4CAA4C,EAAE;YAC9E,QAAQ,EAAE,WAAW;SACtB,CAAC,CAAC;QACH,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,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
1
|
+
import type { AccountEntity, AccountModel } from "../modules/core/account/account.model";
|
|
2
|
+
import type { AccountObjectType, AccountPreferencesObjectType } from "../modules/core/account/account.schema";
|
|
3
|
+
import type { DocumentEntity } from "../modules/core/document/document.model";
|
|
4
|
+
import type { DocumentObjectType } from "../modules/core/document/document.schema";
|
|
5
|
+
import type { LeafEntity } from "../modules/core/leaf/leaf.model";
|
|
6
|
+
import type { LeafObjectType } from "../modules/core/leaf/leaf.schema";
|
|
7
|
+
import type { SectionEntity } from "../modules/core/section/section.model";
|
|
8
|
+
import type { SectionObjectType, SectionWrapObjectType } from "../modules/core/section/section.schema";
|
|
9
|
+
import type { TermFlagObjectType } from "../modules/core/term-flag/term-flag.schema";
|
|
10
|
+
import type { SiteContext } from "../site-context/site-context.types";
|
|
11
|
+
export declare function leafEntityToObjectType(leaf: LeafEntity): LeafObjectType;
|
|
12
|
+
export declare function sectionEntityToObjectType(section: SectionEntity): SectionObjectType;
|
|
13
|
+
export declare function documentToObjectType(document: DocumentEntity): DocumentObjectType;
|
|
14
|
+
export declare function sectionWrapToObjectType({ lang, leafId }: SectionEntity): SectionWrapObjectType;
|
|
15
|
+
export declare function formatTermFlagObjectType(data: any): TermFlagObjectType;
|
|
16
|
+
export declare function formatAccountPreferences(data: string): AccountPreferencesObjectType;
|
|
17
|
+
export declare function formatToAccountObjectType(data: AccountEntity | AccountModel): AccountObjectType;
|
|
18
|
+
export declare function getAssetsBaseUrl(siteContext: Pick<SiteContext, "version">): string;
|
|
19
|
+
export declare function getSiteAppBaseUrl(): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSiteAppBaseUrl = exports.getAssetsBaseUrl = exports.formatToAccountObjectType = exports.formatAccountPreferences = exports.formatTermFlagObjectType = exports.sectionWrapToObjectType = exports.documentToObjectType = exports.sectionEntityToObjectType = exports.leafEntityToObjectType = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
6
|
+
const site_app_1 = require("@paroicms/site-app");
|
|
7
|
+
const context_1 = require("../context");
|
|
8
|
+
const media_handles_helpers_1 = require("./media-handles.helpers");
|
|
9
|
+
function leafEntityToObjectType(leaf) {
|
|
10
|
+
return {
|
|
11
|
+
id: leaf.id,
|
|
12
|
+
parentId: leaf.parentId,
|
|
13
|
+
leafType: leaf.leafType,
|
|
14
|
+
publishDate: leaf.publishDate,
|
|
15
|
+
relativeId: leaf.relativeId,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
exports.leafEntityToObjectType = leafEntityToObjectType;
|
|
19
|
+
function sectionEntityToObjectType(section) {
|
|
20
|
+
return {
|
|
21
|
+
sectionId: (0, anywhere_lib_1.encodeSectionId)({
|
|
22
|
+
lang: section.lang,
|
|
23
|
+
leafId: section.leafId,
|
|
24
|
+
}),
|
|
25
|
+
ready: section.ready,
|
|
26
|
+
lang: section.lang,
|
|
27
|
+
leafId: section.leafId,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
exports.sectionEntityToObjectType = sectionEntityToObjectType;
|
|
31
|
+
function documentToObjectType(document) {
|
|
32
|
+
return {
|
|
33
|
+
sectionId: (0, anywhere_lib_1.encodeSectionId)({
|
|
34
|
+
lang: document.lang,
|
|
35
|
+
leafId: document.leafId,
|
|
36
|
+
}),
|
|
37
|
+
lang: document.lang,
|
|
38
|
+
leafId: document.leafId,
|
|
39
|
+
metaDescription: document.metaDescription,
|
|
40
|
+
title: document.title,
|
|
41
|
+
slug: document.slug,
|
|
42
|
+
metaKeywords: document.metaKeywords,
|
|
43
|
+
featuredImageHandle: (0, media_handles_helpers_1.getHandleOfFeaturedImage)(document.leafId),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.documentToObjectType = documentToObjectType;
|
|
47
|
+
function sectionWrapToObjectType({ lang, leafId }) {
|
|
48
|
+
return {
|
|
49
|
+
lang,
|
|
50
|
+
leafId,
|
|
51
|
+
sectionId: (0, anywhere_lib_1.encodeSectionId)({ lang, leafId }),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.sectionWrapToObjectType = sectionWrapToObjectType;
|
|
55
|
+
function formatTermFlagObjectType(data) {
|
|
56
|
+
return {
|
|
57
|
+
isLead: (0, data_formatters_lib_1.boolVal)(data.lead),
|
|
58
|
+
taxonomyLeafType: (0, data_formatters_lib_1.strVal)(data.parentLeafType),
|
|
59
|
+
termId: (0, data_formatters_lib_1.strVal)(data.termId),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
exports.formatTermFlagObjectType = formatTermFlagObjectType;
|
|
63
|
+
function formatAccountPreferences(data) {
|
|
64
|
+
const parsedData = JSON.parse(data);
|
|
65
|
+
return {
|
|
66
|
+
lang: (0, data_formatters_lib_1.strValOrUndef)(parsedData.lang),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
exports.formatAccountPreferences = formatAccountPreferences;
|
|
70
|
+
function formatToAccountObjectType(data) {
|
|
71
|
+
return {
|
|
72
|
+
...data,
|
|
73
|
+
preferences: data.preferences ? formatAccountPreferences(data.preferences) : undefined,
|
|
74
|
+
hasPasswordResetToken: data.passwordResetToken ? true : false,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
exports.formatToAccountObjectType = formatToAccountObjectType;
|
|
78
|
+
function getAssetsBaseUrl(siteContext) {
|
|
79
|
+
return `/assets/${siteContext.version ?? context_1.appVersion}`;
|
|
80
|
+
}
|
|
81
|
+
exports.getAssetsBaseUrl = getAssetsBaseUrl;
|
|
82
|
+
function getSiteAppBaseUrl() {
|
|
83
|
+
return `/assets/site-app/${site_app_1.version}`;
|
|
84
|
+
}
|
|
85
|
+
exports.getSiteAppBaseUrl = getSiteAppBaseUrl;
|
|
86
|
+
//# sourceMappingURL=data-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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escapeHtml(text: string, options?: {
|
|
2
|
+
newLinesToBr?: boolean;
|
|
3
|
+
}): string;
|
|
4
|
+
export declare function newLinesToBr(text: string): string;
|
|
5
|
+
export declare function htmlToText(html: string): string;
|
|
6
|
+
export declare function stripHtmlTags(html: string): string;
|
|
7
|
+
export declare function replaceLinks(html: string): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceLinks = exports.stripHtmlTags = exports.htmlToText = exports.newLinesToBr = exports.escapeHtml = void 0;
|
|
4
|
+
const htmlEntities = {
|
|
5
|
+
"&": "&",
|
|
6
|
+
"<": "<",
|
|
7
|
+
">": ">",
|
|
8
|
+
'"': """,
|
|
9
|
+
"'": "'",
|
|
10
|
+
};
|
|
11
|
+
function escapeHtml(text, options = {}) {
|
|
12
|
+
let val = text;
|
|
13
|
+
val = val.replace(/[&<>"']/g, (m) => htmlEntities[m]);
|
|
14
|
+
if (options.newLinesToBr) {
|
|
15
|
+
val = newLinesToBr(val);
|
|
16
|
+
}
|
|
17
|
+
return val;
|
|
18
|
+
}
|
|
19
|
+
exports.escapeHtml = escapeHtml;
|
|
20
|
+
function newLinesToBr(text) {
|
|
21
|
+
return text.replace(/(?:\r\n|\r|\n)/g, "<br>\n");
|
|
22
|
+
}
|
|
23
|
+
exports.newLinesToBr = newLinesToBr;
|
|
24
|
+
function htmlToText(html) {
|
|
25
|
+
return stripHtmlTags(replaceLinks(html));
|
|
26
|
+
}
|
|
27
|
+
exports.htmlToText = htmlToText;
|
|
28
|
+
const tagBody = "(?:[^\"'>]|\"[^\"]*\"|'[^']*')*";
|
|
29
|
+
const tagOrComment = new RegExp(`<(?:!--(?:(?:-*[^->])*--+|-?)|script\\b${tagBody}>[\\s\\S]*?</script\\s*|style\\b${tagBody}>[\\s\\S]*?</style\\s*|/?[a-z]${tagBody})>`, "gi");
|
|
30
|
+
function stripHtmlTags(html) {
|
|
31
|
+
let val = html;
|
|
32
|
+
let oldHtml;
|
|
33
|
+
do {
|
|
34
|
+
oldHtml = val;
|
|
35
|
+
val = val.replace(tagOrComment, "");
|
|
36
|
+
} while (val !== oldHtml);
|
|
37
|
+
return val.replace(/</g, "<");
|
|
38
|
+
}
|
|
39
|
+
exports.stripHtmlTags = stripHtmlTags;
|
|
40
|
+
function replaceLinks(html) {
|
|
41
|
+
return html.replace(/<a\s+[^>]*href="([^"]*)"[^>]*>([\s\S]*)<\/a>/gi, (_, url, label) => {
|
|
42
|
+
return `${label.trim()} ( ${url} )`;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
exports.replaceLinks = replaceLinks;
|
|
46
|
+
//# sourceMappingURL=html-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-helpers.js","sourceRoot":"","sources":["../../../src/common/mail/html-helpers.ts"],"names":[],"mappings":";;;AAMA,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAY,EAAE,UAAsC,EAAE;IAC/E,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAA8B,CAAC,CAAC,CAAC;IACnF,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACzB,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAPD,gCAOC;AAED,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACnD,CAAC;AAFD,oCAEC;AAED,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,gCAEC;AAKD,MAAM,OAAO,GAAG,iCAAiC,CAAC;AAClD,MAAM,YAAY,GAAG,IAAI,MAAM,CAC7B,0CAA0C,OAAO,mCAAmC,OAAO,iCAAiC,OAAO,IAAI,EACvI,IAAI,CACL,CAAC;AAEF,SAAgB,aAAa,CAAC,IAAY;IACxC,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,IAAI,OAAe,CAAC;IACpB,GAAG,CAAC;QACF,OAAO,GAAG,GAAG,CAAC;QACd,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC,QAAQ,GAAG,KAAK,OAAO,EAAE;IAC1B,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC;AARD,sCAQC;AAED,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,gDAAgD,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QACtF,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,oCAIC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AppLog } from "@paroicms/server-lib";
|
|
2
|
+
export interface MailData {
|
|
3
|
+
subject: string;
|
|
4
|
+
html: string;
|
|
5
|
+
replyTo?: ReplyTo;
|
|
6
|
+
to: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ReplyTo {
|
|
9
|
+
email: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function sendMail({ subject, html, replyTo, to }: MailData, { appLog }: {
|
|
13
|
+
appLog: AppLog;
|
|
14
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendMail = void 0;
|
|
4
|
+
const client_ses_1 = require("@aws-sdk/client-ses");
|
|
5
|
+
const context_1 = require("../../context");
|
|
6
|
+
const html_helpers_1 = require("./html-helpers");
|
|
7
|
+
const sesClient = context_1.appConf.awsSesMail.disabled
|
|
8
|
+
? undefined
|
|
9
|
+
: new client_ses_1.SESClient({
|
|
10
|
+
region: context_1.appConf.awsSesMail.region,
|
|
11
|
+
credentials: {
|
|
12
|
+
accessKeyId: context_1.appConf.awsSesMail.accessKeyId,
|
|
13
|
+
secretAccessKey: context_1.appConf.awsSesMail.secretAccessKey,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
async function sendMail({ subject, html, replyTo, to }, { appLog }) {
|
|
17
|
+
const text = (0, html_helpers_1.htmlToText)(html);
|
|
18
|
+
const replyToAddr = replyTo
|
|
19
|
+
? `"${(0, html_helpers_1.escapeHtml)(replyTo.name)}" <${(0, html_helpers_1.escapeHtml)(replyTo.email)}>`
|
|
20
|
+
: undefined;
|
|
21
|
+
const fromAddr = context_1.appConf.awsSesMail.from;
|
|
22
|
+
appLog.info("[sendMail]", JSON.stringify({ fromAddr, to, replyToAddr, subject, html, text }));
|
|
23
|
+
if (!sesClient)
|
|
24
|
+
return;
|
|
25
|
+
const command = new client_ses_1.SendEmailCommand({
|
|
26
|
+
Source: fromAddr,
|
|
27
|
+
Destination: {
|
|
28
|
+
ToAddresses: [to],
|
|
29
|
+
},
|
|
30
|
+
ReplyToAddresses: replyToAddr ? [replyToAddr] : undefined,
|
|
31
|
+
Message: {
|
|
32
|
+
Subject: {
|
|
33
|
+
Charset: "UTF-8",
|
|
34
|
+
Data: subject,
|
|
35
|
+
},
|
|
36
|
+
Body: {
|
|
37
|
+
Html: {
|
|
38
|
+
Charset: "UTF-8",
|
|
39
|
+
Data: html,
|
|
40
|
+
},
|
|
41
|
+
Text: {
|
|
42
|
+
Charset: "UTF-8",
|
|
43
|
+
Data: text,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
await sesClient.send(command);
|
|
49
|
+
}
|
|
50
|
+
exports.sendMail = sendMail;
|
|
51
|
+
//# sourceMappingURL=sendMail.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendMail.helpers.js","sourceRoot":"","sources":["../../../src/common/mail/sendMail.helpers.ts"],"names":[],"mappings":";;;AAAA,oDAAkE;AAElE,2CAAwC;AACxC,iDAAwD;AAExD,MAAM,SAAS,GAAG,iBAAO,CAAC,UAAU,CAAC,QAAQ;IAC3C,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,IAAI,sBAAS,CAAC;QACZ,MAAM,EAAE,iBAAO,CAAC,UAAU,CAAC,MAAM;QACjC,WAAW,EAAE;YACX,WAAW,EAAE,iBAAO,CAAC,UAAU,CAAC,WAAW;YAC3C,eAAe,EAAE,iBAAO,CAAC,UAAU,CAAC,eAAe;SACpD;KACF,CAAC,CAAC;AAcA,KAAK,UAAU,QAAQ,CAC5B,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAY,EACxC,EAAE,MAAM,EAAsB;IAE9B,MAAM,IAAI,GAAG,IAAA,yBAAU,EAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,OAAO;QACzB,CAAC,CAAC,IAAI,IAAA,yBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAA,yBAAU,EAAC,OAAO,CAAC,KAAK,CAAC,GAAG;QAChE,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,QAAQ,GAAG,iBAAO,CAAC,UAAU,CAAC,IAAI,CAAC;IAEzC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAE9F,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,OAAO,GAAG,IAAI,6BAAgB,CAAC;QACnC,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,EAAE,CAAC;SAClB;QACD,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;QACzD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,OAAO,EAAE,OAAO;gBAChB,IAAI,EAAE,OAAO;aACd;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,OAAO,EAAE,OAAO;oBAChB,IAAI,EAAE,IAAI;iBACX;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,OAAO;oBAChB,IAAI,EAAE,IAAI;iBACX;aACF;SACF;KACF,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAvCD,4BAuCC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FieldType } from "@paroicms/anywhere-lib";
|
|
2
|
+
import type { SiteContext } from "../site-context/site-context.types";
|
|
3
|
+
export declare function getHandleOfFeaturedImage(leafId: string): string;
|
|
4
|
+
export declare function getHandleOfSiteBoFavicon(): string;
|
|
5
|
+
export declare function getHandleOfSiteFavicon(): string;
|
|
6
|
+
export declare function getHandleOfField(siteContext: Pick<SiteContext, "siteIds">, options: {
|
|
7
|
+
fieldType: FieldType;
|
|
8
|
+
leafId: string;
|
|
9
|
+
lang?: string;
|
|
10
|
+
}): string;
|
|
11
|
+
export declare function getHandleOfFieldOnLeaf(siteContext: Pick<SiteContext, "siteIds">, options: {
|
|
12
|
+
fieldType: FieldType;
|
|
13
|
+
leafId: string;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function getHandleOfSiteField(siteContext: Pick<SiteContext, "siteIds" | "siteSchema">, options: {
|
|
16
|
+
fieldName: string;
|
|
17
|
+
lang?: string;
|
|
18
|
+
}): string;
|
|
19
|
+
export declare function extractLeafIdFromHandle(handle: string): string | undefined;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractLeafIdFromHandle = exports.getHandleOfSiteField = exports.getHandleOfFieldOnLeaf = exports.getHandleOfField = exports.getHandleOfSiteFavicon = exports.getHandleOfSiteBoFavicon = exports.getHandleOfFeaturedImage = void 0;
|
|
4
|
+
function getHandleOfFeaturedImage(leafId) {
|
|
5
|
+
return `leaf:${leafId}:featuredImage`;
|
|
6
|
+
}
|
|
7
|
+
exports.getHandleOfFeaturedImage = getHandleOfFeaturedImage;
|
|
8
|
+
function getHandleOfSiteBoFavicon() {
|
|
9
|
+
return "site:boFavicon";
|
|
10
|
+
}
|
|
11
|
+
exports.getHandleOfSiteBoFavicon = getHandleOfSiteBoFavicon;
|
|
12
|
+
function getHandleOfSiteFavicon() {
|
|
13
|
+
return "site:favicon";
|
|
14
|
+
}
|
|
15
|
+
exports.getHandleOfSiteFavicon = getHandleOfSiteFavicon;
|
|
16
|
+
function getHandleOfField(siteContext, options) {
|
|
17
|
+
const { fieldType, leafId, lang } = options;
|
|
18
|
+
if (fieldType.storedOn === "section") {
|
|
19
|
+
if (lang === undefined)
|
|
20
|
+
throw new Error("Missing lang for section field");
|
|
21
|
+
if (leafId === siteContext.siteIds.siteLeafId)
|
|
22
|
+
return `site:${fieldType.name}:${lang}`;
|
|
23
|
+
return `sect:${leafId}:${fieldType.name}:${lang}`;
|
|
24
|
+
}
|
|
25
|
+
return getHandleOfFieldOnLeaf(siteContext, { fieldType, leafId });
|
|
26
|
+
}
|
|
27
|
+
exports.getHandleOfField = getHandleOfField;
|
|
28
|
+
function getHandleOfFieldOnLeaf(siteContext, options) {
|
|
29
|
+
const { fieldType, leafId } = options;
|
|
30
|
+
if (leafId === siteContext.siteIds.siteLeafId)
|
|
31
|
+
return `site:${fieldType.name}`;
|
|
32
|
+
return `leaf:${leafId}:${fieldType.name}`;
|
|
33
|
+
}
|
|
34
|
+
exports.getHandleOfFieldOnLeaf = getHandleOfFieldOnLeaf;
|
|
35
|
+
function getHandleOfSiteField(siteContext, options) {
|
|
36
|
+
const { fieldName, lang } = options;
|
|
37
|
+
const fieldType = siteContext.siteSchema.site.fields.find((f) => f.name === fieldName);
|
|
38
|
+
if (!fieldType)
|
|
39
|
+
throw new Error(`Unknown site field '${fieldName}'`);
|
|
40
|
+
return getHandleOfField(siteContext, {
|
|
41
|
+
fieldType,
|
|
42
|
+
leafId: siteContext.siteIds.siteLeafId,
|
|
43
|
+
lang,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exports.getHandleOfSiteField = getHandleOfSiteField;
|
|
47
|
+
function extractLeafIdFromHandle(handle) {
|
|
48
|
+
const match = handle.match(/^leaf:(.+?):/);
|
|
49
|
+
return match?.[1];
|
|
50
|
+
}
|
|
51
|
+
exports.extractLeafIdFromHandle = extractLeafIdFromHandle;
|
|
52
|
+
//# sourceMappingURL=media-handles.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-handles.helpers.js","sourceRoot":"","sources":["../../src/common/media-handles.helpers.ts"],"names":[],"mappings":";;;AAMA,SAAgB,wBAAwB,CAAC,MAAc;IACrD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACxC,CAAC;AAFD,4DAEC;AAED,SAAgB,wBAAwB;IACtC,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAFD,4DAEC;AAED,SAAgB,sBAAsB;IACpC,OAAO,cAAc,CAAC;AACxB,CAAC;AAFD,wDAEC;AAED,SAAgB,gBAAgB,CAC9B,WAAyC,EACzC,OAIC;IAED,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC5C,IAAI,SAAS,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC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AAG,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAHD,0DAGC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Tracker } from "@paroicms/server-lib";
|
|
2
|
+
import type { Request, Response } from "express";
|
|
3
|
+
import type { SiteContext } from "../site-context/site-context.types";
|
|
4
|
+
export interface ServeHtmlOr {
|
|
5
|
+
serveFromCache: () => Promise<boolean>;
|
|
6
|
+
putInCacheAndServe: (html: string, dependencyKeys: string[]) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function serveHtmlFromCacheOr(siteContext: SiteContext, tracker: Tracker, options: {
|
|
9
|
+
cacheKey: string;
|
|
10
|
+
req: Request;
|
|
11
|
+
res: Response;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
}): ServeHtmlOr;
|
|
14
|
+
export declare function render404Html(siteContext: SiteContext, res: Response, options?: {
|
|
15
|
+
lang?: string;
|
|
16
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.render404Html = exports.serveHtmlFromCacheOr = void 0;
|
|
4
|
+
const server_lib_1 = require("@paroicms/server-lib");
|
|
5
|
+
const http_helpers_1 = require("../express/http-helpers");
|
|
6
|
+
const render_liquidjs_1 = require("../liquidjs-tools/liquidjs-rendering/render-liquidjs");
|
|
7
|
+
const rendering_context_1 = require("../liquidjs-tools/liquidjs-rendering/rendering-context");
|
|
8
|
+
const make_basic_payload_1 = require("../public-payload/make-basic-payload");
|
|
9
|
+
const text_cache_1 = require("./text-cache");
|
|
10
|
+
const tracker_report_1 = require("./tracker-report");
|
|
11
|
+
function serveHtmlFromCacheOr(siteContext, tracker, options) {
|
|
12
|
+
const { cacheKey, req, res, contentType } = options;
|
|
13
|
+
return {
|
|
14
|
+
async serveFromCache() {
|
|
15
|
+
const cacheHtml = await siteContext.textCache.getCacheValue(cacheKey, tracker);
|
|
16
|
+
if (!cacheHtml)
|
|
17
|
+
return false;
|
|
18
|
+
(0, http_helpers_1.serveContent)({
|
|
19
|
+
res,
|
|
20
|
+
contentType,
|
|
21
|
+
html: cacheHtml.value,
|
|
22
|
+
or304: {
|
|
23
|
+
req,
|
|
24
|
+
lastModified: cacheHtml.lastModified,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
async putInCacheAndServe(html, dependencyKeys) {
|
|
30
|
+
const cacheHtml = await siteContext.textCache.setCacheValue({
|
|
31
|
+
cacheKey,
|
|
32
|
+
dependencyKeys,
|
|
33
|
+
value: html,
|
|
34
|
+
}, tracker);
|
|
35
|
+
(0, http_helpers_1.serveContent)({
|
|
36
|
+
res,
|
|
37
|
+
contentType,
|
|
38
|
+
html: cacheHtml.value,
|
|
39
|
+
or304: {
|
|
40
|
+
req,
|
|
41
|
+
lastModified: cacheHtml.lastModified,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.serveHtmlFromCacheOr = serveHtmlFromCacheOr;
|
|
48
|
+
async function render404Html(siteContext, res, options) {
|
|
49
|
+
const tracker = (0, server_lib_1.createTracker)();
|
|
50
|
+
const cacheKey = (0, text_cache_1.makeCacheKey)({ kind: "html", url: "404" });
|
|
51
|
+
let cacheHtml = await siteContext.textCache.getCacheValue(cacheKey, tracker);
|
|
52
|
+
if (!cacheHtml) {
|
|
53
|
+
const renderingContext = await (0, rendering_context_1.createRenderingContext)(siteContext, { cacheKey, tracker });
|
|
54
|
+
const html = await (0, render_liquidjs_1.renderLiquidTemplate)(siteContext, renderingContext, {
|
|
55
|
+
templateNames: ["404"],
|
|
56
|
+
payload: (0, make_basic_payload_1.makePublicBasicPayload)(siteContext, renderingContext, options),
|
|
57
|
+
});
|
|
58
|
+
cacheHtml = await siteContext.textCache.setCacheValue({
|
|
59
|
+
cacheKey,
|
|
60
|
+
dependencyKeys: renderingContext.getDependencyKeys(),
|
|
61
|
+
value: html,
|
|
62
|
+
}, tracker);
|
|
63
|
+
}
|
|
64
|
+
(0, http_helpers_1.serveContent)({
|
|
65
|
+
status: 404,
|
|
66
|
+
res,
|
|
67
|
+
html: cacheHtml.value,
|
|
68
|
+
});
|
|
69
|
+
siteContext.siteLog.stats((0, tracker_report_1.trackerReportToMessage)(tracker.toReport(), `serve ${404}`));
|
|
70
|
+
}
|
|
71
|
+
exports.render404Html = render404Html;
|
|
72
|
+
//# sourceMappingURL=serve-html-or.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-html-or.js","sourceRoot":"","sources":["../../src/common/serve-html-or.ts"],"names":[],"mappings":";;;AAAA,qDAAmE;AAEnE,0DAAuD;AACvD,0FAA4F;AAC5F,8FAAgG;AAChG,6EAA8E;AAE9E,6CAA4C;AAC5C,qDAA0D;AAO1D,SAAgB,oBAAoB,CAClC,WAAwB,EACxB,OAAgB,EAChB,OAQC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IACpD,OAAO;QACL,KAAK,CAAC,cAAc;YAClB,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC/E,IAAI,CAAC,SAAS;gBAAE,OAAO,KAAK,CAAC;YAE7B,IAAA,2BAAY,EAAC;gBACX,GAAG;gBACH,WAAW;gBACX,IAAI,EAAE,SAAS,CAAC,KAAK;gBACrB,KAAK,EAAE;oBACL,GAAG;oBACH,YAAY,EAAE,SAAS,CAAC,YAAY;iBACrC;aACF,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;QAED,KAAK,CAAC,kBAAkB,CAAC,IAAI,EAAE,cAAc;YAC3C,MAAM,SAAS,GA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,MAAM,EAAE,GAAG;QACX,GAAG;QACH,IAAI,EAAE,SAAS,CAAC,KAAK;KACtB,CAAC,CAAC;IACH,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,uCAAsB,EAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC;AACxF,CAAC;AAhCD,sCAgCC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ParsedSectionId } from "@paroicms/anywhere-lib";
|
|
2
|
+
import type { SiteContext } from "../site-context/site-context.types";
|
|
3
|
+
export declare function makeCacheDependencyKey(options: {
|
|
4
|
+
documentId: ParsedSectionId;
|
|
5
|
+
perimeter?: "slug";
|
|
6
|
+
} | {
|
|
7
|
+
documentId: ParsedSectionId;
|
|
8
|
+
relation: "children";
|
|
9
|
+
} | {
|
|
10
|
+
leafId: string;
|
|
11
|
+
relation: "flagged";
|
|
12
|
+
taxonomyLeafType: string;
|
|
13
|
+
} | {
|
|
14
|
+
leafId: string;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function makeCacheKey(options: {
|
|
17
|
+
kind: "redirect";
|
|
18
|
+
urlKey: string;
|
|
19
|
+
}): string;
|
|
20
|
+
export declare function makeCacheKey(options: {
|
|
21
|
+
kind: "url";
|
|
22
|
+
documentId: ParsedSectionId;
|
|
23
|
+
}): string;
|
|
24
|
+
export declare function makeCacheKey(options: {
|
|
25
|
+
kind: "html";
|
|
26
|
+
url: string;
|
|
27
|
+
}): string;
|
|
28
|
+
export declare function makeCacheKey(options: {
|
|
29
|
+
kind: "api";
|
|
30
|
+
url: string;
|
|
31
|
+
}): string;
|
|
32
|
+
export declare function invalidateDocumentInCache(siteContext: Pick<SiteContext, "mainCn" | "textCache" | "siteSchema">, options: {
|
|
33
|
+
parentOf: ParsedSectionId;
|
|
34
|
+
} | {
|
|
35
|
+
documentId: ParsedSectionId;
|
|
36
|
+
perimeter?: "slug";
|
|
37
|
+
} | {
|
|
38
|
+
documentId: ParsedSectionId;
|
|
39
|
+
fully: true;
|
|
40
|
+
parentId: ParsedSectionId | undefined;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
export declare function invalidateDocumentRelationCache(siteContext: Pick<SiteContext, "textCache">, options: {
|
|
43
|
+
documentId: ParsedSectionId;
|
|
44
|
+
relation: "children";
|
|
45
|
+
} | {
|
|
46
|
+
leafId: string;
|
|
47
|
+
relation: "flagged";
|
|
48
|
+
taxonomyLeafType: string;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
export declare function invalidateMultipleDocumentsInCache(siteContext: Pick<SiteContext, "mainCn" | "textCache" | "siteSchema">, options: {
|
|
51
|
+
leafId: string;
|
|
52
|
+
parentIds?: ParsedSectionId[];
|
|
53
|
+
fully?: boolean;
|
|
54
|
+
} | {
|
|
55
|
+
parentOfLeafId: string;
|
|
56
|
+
fully?: boolean;
|
|
57
|
+
}): Promise<void>;
|