@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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createUseImageLiquidJsTag = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
|
|
6
|
+
const liquidjs_1 = require("liquidjs");
|
|
7
|
+
const rendering_context_1 = require("../../../liquidjs-tools/liquidjs-rendering/rendering-context");
|
|
8
|
+
const liquidjs_utils_1 = require("../../../liquidjs-tools/liquidjs-utils");
|
|
9
|
+
const make_image_available_1 = require("../../../public-payload/make-image-available");
|
|
10
|
+
const availableParameterNames = new Set(["uid", "handle", "size", "autoCrop"]);
|
|
11
|
+
function createUseImageLiquidJsTag(siteContext) {
|
|
12
|
+
return class UseImageTag extends liquidjs_1.Tag {
|
|
13
|
+
#hash;
|
|
14
|
+
#varName;
|
|
15
|
+
constructor(tagToken, remainTokens, liquid) {
|
|
16
|
+
super(tagToken, remainTokens, liquid);
|
|
17
|
+
this.#varName = this.tokenizer.readIdentifier().content;
|
|
18
|
+
this.#hash = new liquidjs_1.Hash(tagToken.args);
|
|
19
|
+
}
|
|
20
|
+
*render(ctx) {
|
|
21
|
+
const options = validateParameters(yield this.#hash.render(ctx), this.#varName, siteContext);
|
|
22
|
+
const cacheKey = (0, rendering_context_1.makeTagCacheKeyForRendering)("useImage", { tagParameters: options });
|
|
23
|
+
const renderingContext = (0, liquidjs_utils_1.getRenderingContext)(ctx);
|
|
24
|
+
const cacheVal = renderingContext.getValueFromCache(cacheKey);
|
|
25
|
+
if (cacheVal.found) {
|
|
26
|
+
ctx.bottom()[this.#varName] = cacheVal.val;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const val = yield (0, make_image_available_1.makeImageAvailable)(siteContext, renderingContext, options);
|
|
30
|
+
renderingContext.setValueIntoCache(cacheKey, val);
|
|
31
|
+
ctx.bottom()[this.#varName] = val;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.createUseImageLiquidJsTag = createUseImageLiquidJsTag;
|
|
36
|
+
function validateParameters(values, varName, { siteLog }) {
|
|
37
|
+
for (const name of Object.keys(values)) {
|
|
38
|
+
if (!availableParameterNames.has(name) && name !== varName) {
|
|
39
|
+
siteLog.warn(`[useImage] unknown parameter "${name}"`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const size = (0, data_formatters_lib_1.strVal)(values.size);
|
|
43
|
+
if (!(0, server_image_cache_engine_1.isVariantName)(size))
|
|
44
|
+
throw new Error(`useImage param size is not valid, size:${size}`);
|
|
45
|
+
const uid = (0, data_formatters_lib_1.strValOrUndef)(values.uid);
|
|
46
|
+
const handle = (0, data_formatters_lib_1.strValOrUndef)(values.handle);
|
|
47
|
+
const autoCrop = (0, data_formatters_lib_1.boolValOrUndef)(values.autoCrop);
|
|
48
|
+
if (uid)
|
|
49
|
+
return { imageSel: { uid }, size, autoCrop };
|
|
50
|
+
if (handle)
|
|
51
|
+
return { imageSel: { handle }, size, autoCrop };
|
|
52
|
+
throw new Error("useImage: missing 'uid' parameter");
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=use-image-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-image-tag.js","sourceRoot":"","sources":["../../../../src/modules/public-site/liquidjs-tags/use-image-tag.ts"],"names":[],"mappings":";;;AAAA,oEAAmF;AACnF,mFAAoE;AACpE,uCAAmG;AACnG,oGAA2G;AAC3G,2EAA6E;AAC7E,uFAIsD;AAGtD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ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teVariantName;
|
|
5
|
+
}
|
|
6
|
+
export declare function parseMediaName(param: string): ParsedMediaName | undefined;
|
|
7
|
+
export declare function makeMediaName({ mediaUid, variantSize, mediaType, }: {
|
|
8
|
+
mediaUid: string;
|
|
9
|
+
variantSize?: `${number}x${number}`;
|
|
10
|
+
mediaType: string;
|
|
11
|
+
}): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMediaName = exports.parseMediaName = void 0;
|
|
4
|
+
function parseMediaName(param) {
|
|
5
|
+
const found = param.match(/^([0-9a-f-]{36})(?:\-([0-9]+x[0-9]+))?\.[0-9a-z]+$/);
|
|
6
|
+
if (!found)
|
|
7
|
+
return;
|
|
8
|
+
const [_, mediaUid, variantName] = found;
|
|
9
|
+
return {
|
|
10
|
+
mediaUid,
|
|
11
|
+
variantName: variantName,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.parseMediaName = parseMediaName;
|
|
15
|
+
function makeMediaName({ mediaUid, variantSize, mediaType, }) {
|
|
16
|
+
return `${mediaUid}${variantSize ? `-${variantSize}` : ""}.${mediaTypeToFileExtension(mediaType)}`;
|
|
17
|
+
}
|
|
18
|
+
exports.makeMediaName = makeMediaName;
|
|
19
|
+
function mediaTypeToFileExtension(mediaType) {
|
|
20
|
+
const regexMatchArray = mediaType.match(/\w+\/([-+.\w]+)/);
|
|
21
|
+
if (!regexMatchArray) {
|
|
22
|
+
throw new Error("media extension is incorrect.");
|
|
23
|
+
}
|
|
24
|
+
return regexMatchArray[1];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=_media-serve-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_media-serve-helpers.js","sourceRoot":"","sources":["../../../../src/modules/public-site/media-serve/_media-serve-helpers.ts"],"names":[],"mappings":";;;AAOA,SAAgB,cAAc,CAAC,KAAa;IAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAChF,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC;IACzC,OAAO;QACL,QAAQ;QACR,WAAW,EAAE,WAA8C;KAC5D,CAAC;AACJ,CAAC;AARD,wCAQC;AAED,SAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EACX,SAAS,GAKV;IACC,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,wBAAwB,CACnF,SAAS,CACV,EAAE,CAAC;AACN,CAAC;AAZD,sCAYC;AAED,SAAS,wBAAwB,CAAC,SAAiB;IACjD,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE3D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.MediaServeController = void 0;
|
|
16
|
+
const node_stream_1 = require("node:stream");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const http_helpers_1 = require("../../../express/http-helpers");
|
|
19
|
+
const utils_helper_1 = require("../../../helpers/utils-helper");
|
|
20
|
+
const site_context_1 = require("../../../site-context/site-context");
|
|
21
|
+
const _media_serve_helpers_1 = require("./_media-serve-helpers");
|
|
22
|
+
let MediaServeController = class MediaServeController {
|
|
23
|
+
async serveMedia(param, res, req) {
|
|
24
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
25
|
+
const parsedName = (0, _media_serve_helpers_1.parseMediaName)(param);
|
|
26
|
+
if (!parsedName) {
|
|
27
|
+
throw new common_1.NotFoundException("media not found");
|
|
28
|
+
}
|
|
29
|
+
const fts = parsedName.variantName
|
|
30
|
+
? await getImageToServe(siteContext, {
|
|
31
|
+
mediaUid: parsedName.mediaUid,
|
|
32
|
+
variantName: parsedName.variantName,
|
|
33
|
+
ifModifiedSince: req.headers["if-modified-since"],
|
|
34
|
+
})
|
|
35
|
+
: await getFileToServe(siteContext, {
|
|
36
|
+
mediaUid: parsedName.mediaUid,
|
|
37
|
+
ifModifiedSince: req.headers["if-modified-since"],
|
|
38
|
+
});
|
|
39
|
+
if (fts.status === 304) {
|
|
40
|
+
res.setHeader("content-type", fts.mediaType);
|
|
41
|
+
res.append("Last-Modified", fts.lastModified);
|
|
42
|
+
return (0, http_helpers_1.serve304NotModified)(res);
|
|
43
|
+
}
|
|
44
|
+
const { file, lastModified } = fts;
|
|
45
|
+
const mediaName = (0, _media_serve_helpers_1.makeMediaName)({
|
|
46
|
+
mediaType: file.mediaType,
|
|
47
|
+
mediaUid: parsedName.mediaUid,
|
|
48
|
+
variantSize: parsedName.variantName,
|
|
49
|
+
});
|
|
50
|
+
if (mediaName !== param) {
|
|
51
|
+
(0, http_helpers_1.serve301Redirect)(res, `/medias/${mediaName}`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
res.setHeader("content-type", file.mediaType);
|
|
55
|
+
res.append("Last-Modified", lastModified);
|
|
56
|
+
node_stream_1.Readable.from(file.binaryFile)
|
|
57
|
+
.on("data", (chunk) => {
|
|
58
|
+
res.write(chunk);
|
|
59
|
+
})
|
|
60
|
+
.on("error", (error) => {
|
|
61
|
+
res.end(error);
|
|
62
|
+
})
|
|
63
|
+
.on("end", () => {
|
|
64
|
+
res.end();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.MediaServeController = MediaServeController;
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, common_1.Get)(":param"),
|
|
71
|
+
__param(0, (0, common_1.Param)("param")),
|
|
72
|
+
__param(1, (0, common_1.Res)()),
|
|
73
|
+
__param(2, (0, common_1.Req)()),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], MediaServeController.prototype, "serveMedia", null);
|
|
78
|
+
exports.MediaServeController = MediaServeController = __decorate([
|
|
79
|
+
(0, common_1.Controller)("medias"),
|
|
80
|
+
(0, common_1.UseInterceptors)(common_1.ClassSerializerInterceptor)
|
|
81
|
+
], MediaServeController);
|
|
82
|
+
async function getImageToServe(siteContext, options) {
|
|
83
|
+
const { mediaUid, variantName, ifModifiedSince } = options;
|
|
84
|
+
let file = await siteContext.imageCache.getImageVariantWithBinary({
|
|
85
|
+
imageUid: mediaUid,
|
|
86
|
+
variantName,
|
|
87
|
+
});
|
|
88
|
+
if (file) {
|
|
89
|
+
if (ifModifiedSince === file.lastModified) {
|
|
90
|
+
return {
|
|
91
|
+
status: 304,
|
|
92
|
+
lastModified: file.lastModified,
|
|
93
|
+
mediaType: file.mediaType,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
file = await tryToCreateImageVariant(siteContext, { mediaUid, variantName });
|
|
99
|
+
if (!file)
|
|
100
|
+
throw new common_1.NotFoundException("image not found");
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
status: 200,
|
|
104
|
+
lastModified: file.lastModified,
|
|
105
|
+
file,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
async function getFileToServe(siteContext, options) {
|
|
109
|
+
const { mediaUid, ifModifiedSince } = options;
|
|
110
|
+
const media = await siteContext.mediaStorage.getMediaWithBinary(mediaUid);
|
|
111
|
+
if (!media)
|
|
112
|
+
throw new common_1.NotFoundException(`media '${mediaUid}' not found`);
|
|
113
|
+
const lastModified = (0, utils_helper_1.toHttpHeaderIfModifiedSince)(media.modifiedTs);
|
|
114
|
+
if (lastModified === ifModifiedSince) {
|
|
115
|
+
return { status: 304, lastModified, mediaType: media.mediaType };
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
status: 200,
|
|
119
|
+
lastModified,
|
|
120
|
+
file: media,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
async function tryToCreateImageVariant(siteContext, options) {
|
|
124
|
+
const { mediaUid, variantName } = options;
|
|
125
|
+
const media = await siteContext.mediaStorage.getMedia({ uid: mediaUid });
|
|
126
|
+
if (!media || media.kind !== "image") {
|
|
127
|
+
throw new common_1.NotFoundException(`image '${mediaUid}' not found`);
|
|
128
|
+
}
|
|
129
|
+
return await siteContext.imageCache.conditionallyCreateImageVariantWithBinary({
|
|
130
|
+
imageUid: media.uid,
|
|
131
|
+
mediaType: media.mediaType,
|
|
132
|
+
width: media.width,
|
|
133
|
+
height: media.height,
|
|
134
|
+
}, {
|
|
135
|
+
authorisedVariantNames: siteContext.themeConf.fTextImages,
|
|
136
|
+
variantName,
|
|
137
|
+
dependsOnCacheKey: "themeConf.fTextImages",
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=media-serve.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-serve.controller.js","sourceRoot":"","sources":["../../../../src/modules/public-site/media-serve/media-serve.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAuC;AACvC,2CASwB;AAMxB,gEAAsF;AACtF,gEAA4E;AAC5E,qEAAoE;AAEpE,iEAAuE;AAIhE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEzB,AAAN,KAAK,CAAC,UAAU,CAAiB,KAAa,EAAS,GAAa,EAAS,GAAY;QACvF,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,IAAA,qCAAc,EAAC,KAAK,CAAC,CAAC;QAEzC,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,0BAAiB,CAAC,iBAAiB,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,GAAG,GAAG,UAAU,CAAC,WAAW;YAChC,CAAC,CAAC,MAAM,eAAe,CAAC,WAAW,EAAE;gBACjC,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC;aAClD,CAAC;YACJ,CAAC,CAAC,MAAM,cAAc,CAAC,WAAW,EAAE;gBAChC,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC;aAClD,CAAC,CAAC;QAEP,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACvB,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,GAAG,CAAC,SAAS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AAM,YAAY,GAAG,IAAA,0CAA2B,EAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACnE,IAAI,YAAY,KAAK,eAAe,EAAE,CAAC;QACrC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACnE,CAAC;IACD,OAAO;QACL,MAAM,EAAE,GAAG;QACX,YAAY;QACZ,IAAI,EAAE,KAAK;KACZ,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,uBAAuB,CACpC,WAAwB,EACxB,OAA+D;IAE/D,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACrC,MAAM,IAAI,0BAAiB,CAAC,UAAU,QAAQ,aAAa,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,MAAM,WAAW,CAAC,UAAU,CAAC,yCAAyC,CAC3E;QACE,QAAQ,EAAE,KAAK,CAAC,GAAG;QACnB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,EACD;QACE,sBAAsB,EAAE,WAAW,CAAC,SAAS,CAAC,WAAW;QACzD,WAAW;QACX,iBAAiB,EAAE,uBAAuB;KAC3C,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.MediaServeModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const media_serve_controller_1 = require("./media-serve.controller");
|
|
12
|
+
let MediaServeModule = class MediaServeModule {
|
|
13
|
+
};
|
|
14
|
+
exports.MediaServeModule = MediaServeModule;
|
|
15
|
+
exports.MediaServeModule = MediaServeModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
controllers: [media_serve_controller_1.MediaServeController],
|
|
18
|
+
})
|
|
19
|
+
], MediaServeModule);
|
|
20
|
+
//# sourceMappingURL=media-serve.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-serve.module.js","sourceRoot":"","sources":["../../../../src/modules/public-site/media-serve/media-serve.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qEAAgE;AAKzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAH5B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,6CAAoB,CAAC;KACpC,CAAC;GACW,gBAAgB,CAAG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JwtService } from "@nestjs/jwt";
|
|
2
|
+
import type { Request, Response } from "express";
|
|
3
|
+
export declare class OAuth2ClientController {
|
|
4
|
+
private readonly jwtService;
|
|
5
|
+
constructor(jwtService: JwtService);
|
|
6
|
+
auth(req: Request, res: Response): Promise<void>;
|
|
7
|
+
googleLogin(): void;
|
|
8
|
+
googleLoginCallback(req: Request, res: Response): Promise<void>;
|
|
9
|
+
siteUrl(redirectTo: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OAuth2ClientController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const passport_1 = require("@nestjs/passport");
|
|
18
|
+
const html_helpers_1 = require("../../common/mail/html-helpers");
|
|
19
|
+
const context_1 = require("../../context");
|
|
20
|
+
const url_helpers_1 = require("../../helpers/url.helpers");
|
|
21
|
+
let OAuth2ClientController = class OAuth2ClientController {
|
|
22
|
+
jwtService;
|
|
23
|
+
constructor(jwtService) {
|
|
24
|
+
this.jwtService = jwtService;
|
|
25
|
+
}
|
|
26
|
+
async auth(req, res) {
|
|
27
|
+
if (req.hostname !== context_1.appConf.googleAuth.fqdn) {
|
|
28
|
+
throw new common_1.NotFoundException();
|
|
29
|
+
}
|
|
30
|
+
res.send(generateAuthPageHtml(context_1.platformAuthUrl));
|
|
31
|
+
}
|
|
32
|
+
googleLogin() { }
|
|
33
|
+
async googleLoginCallback(req, res) {
|
|
34
|
+
if (!req.user) {
|
|
35
|
+
throw new common_1.BadRequestException("Email not found in user payload");
|
|
36
|
+
}
|
|
37
|
+
const platformToken = await this.jwtService.signAsync(req.user, {
|
|
38
|
+
secret: context_1.platformJwtSecret,
|
|
39
|
+
expiresIn: "7d",
|
|
40
|
+
});
|
|
41
|
+
res.send(generateGoogleRedirectPageHtml({ platformToken, platformAuthUrl: context_1.platformAuthUrl }));
|
|
42
|
+
}
|
|
43
|
+
siteUrl(redirectTo) {
|
|
44
|
+
const siteConf = context_1.siteConfs.get(redirectTo);
|
|
45
|
+
if (!siteConf)
|
|
46
|
+
throw new common_1.BadRequestException("Site not found");
|
|
47
|
+
return (0, url_helpers_1.getBoUrl)(siteConf);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.OAuth2ClientController = OAuth2ClientController;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, common_1.Get)(),
|
|
53
|
+
__param(0, (0, common_1.Req)()),
|
|
54
|
+
__param(1, (0, common_1.Res)()),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
57
|
+
__metadata("design:returntype", Promise)
|
|
58
|
+
], OAuth2ClientController.prototype, "auth", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, common_1.Get)("google"),
|
|
61
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("google")),
|
|
62
|
+
__metadata("design:type", Function),
|
|
63
|
+
__metadata("design:paramtypes", []),
|
|
64
|
+
__metadata("design:returntype", void 0)
|
|
65
|
+
], OAuth2ClientController.prototype, "googleLogin", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, common_1.Get)("google/callback"),
|
|
68
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("google")),
|
|
69
|
+
__param(0, (0, common_1.Req)()),
|
|
70
|
+
__param(1, (0, common_1.Res)()),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
73
|
+
__metadata("design:returntype", Promise)
|
|
74
|
+
], OAuth2ClientController.prototype, "googleLoginCallback", null);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, common_1.Get)("site-url/:redirectTo"),
|
|
77
|
+
__param(0, (0, common_1.Param)("redirectTo")),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", [String]),
|
|
80
|
+
__metadata("design:returntype", void 0)
|
|
81
|
+
], OAuth2ClientController.prototype, "siteUrl", null);
|
|
82
|
+
exports.OAuth2ClientController = OAuth2ClientController = __decorate([
|
|
83
|
+
(0, common_1.Controller)("auth"),
|
|
84
|
+
__metadata("design:paramtypes", [Function])
|
|
85
|
+
], OAuth2ClientController);
|
|
86
|
+
function generateGoogleRedirectPageHtml({ platformToken, platformAuthUrl, }) {
|
|
87
|
+
return `<!DOCTYPE html>
|
|
88
|
+
<html lang="en">
|
|
89
|
+
<head>
|
|
90
|
+
<meta charset="UTF-8">
|
|
91
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
92
|
+
<title>Successful authentication</title>
|
|
93
|
+
</head>
|
|
94
|
+
<body>
|
|
95
|
+
<p>Authentication successful, redirect now to the website.</p>
|
|
96
|
+
|
|
97
|
+
<script>
|
|
98
|
+
async function redirectToBo () {
|
|
99
|
+
const redirectTo = sessionStorage.getItem("redirectTo");
|
|
100
|
+
const redirectUrl = await getRedirectUrl(redirectTo);
|
|
101
|
+
window.location.replace(redirectUrl + "/adm/login/?pltok=${(0, html_helpers_1.escapeHtml)(platformToken)}");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function getRedirectUrl (redirectTo) {
|
|
105
|
+
const res = await fetch("${(0, html_helpers_1.escapeHtml)(platformAuthUrl)}/site-url/" + redirectTo);
|
|
106
|
+
if (!res.ok) {
|
|
107
|
+
throw new Error(\`redirect url, \${res.status} \${res.statusText}\`)
|
|
108
|
+
}
|
|
109
|
+
return await res.text();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
redirectToBo().catch(error => {
|
|
113
|
+
const node = document.createElement("p");
|
|
114
|
+
node.textContent = \`You have been successfully authenticated, but we cannot redirect you to the website: \${error.message}\`;
|
|
115
|
+
node.style = "color: red;";
|
|
116
|
+
document.body.appendChild(node);
|
|
117
|
+
console.error(error);
|
|
118
|
+
});
|
|
119
|
+
</script>
|
|
120
|
+
</body>
|
|
121
|
+
</html>`;
|
|
122
|
+
}
|
|
123
|
+
function generateAuthPageHtml(platformAuthUrl) {
|
|
124
|
+
return `<!DOCTYPE html>
|
|
125
|
+
<html lang="en">
|
|
126
|
+
<head>
|
|
127
|
+
<meta charset="UTF-8">
|
|
128
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
129
|
+
<title>Authentication</title>
|
|
130
|
+
</head>
|
|
131
|
+
<body>
|
|
132
|
+
<p>Initiating authentification on Google…</p>
|
|
133
|
+
|
|
134
|
+
<script>
|
|
135
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
136
|
+
const redirectTo = urlParams.get("redirectTo");
|
|
137
|
+
sessionStorage.setItem("redirectTo", redirectTo);
|
|
138
|
+
window.location.replace("${(0, html_helpers_1.escapeHtml)(platformAuthUrl)}/google");
|
|
139
|
+
</script>
|
|
140
|
+
</body>
|
|
141
|
+
</html>`;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=oauth2-client.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth2-client.controller.js","sourceRoot":"","sources":["../../../src/modules/public-site/oauth2-client.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AAExB,+CAA6C;AAE7C,iEAA4D;AAC5D,2CAAuF;AACvF,2DAAqD;AAG9C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACJ;IAA7B,YAA6B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EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;;;;yDACf;AAIV;IAFL,IAAA,YAAG,EAAC,iBAAiB,CAAC;IACtB,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;IACJ,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;iEAUpD;AAGD;IADC,IAAA,YAAG,EAAC,sBAAsB,CAAC;IACnB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;qDAI3B;iCAnCU,sBAAsB;IADlC,IAAA,mBAAU,EAAC,MAAM,CAAC;;GACN,sBAAsB,CAoClC;AAED,SAAS,8BAA8B,CAAC,EACtC,aAAa,EACb,eAAe,GACoC;IACnD,OAAO;;;;;;;;;;;;;;iEAcwD,IAAA,yBAAU,EAAC,aAAa,CAAC;;;;iCAIzD,IAAA,yBAAU,EAAC,eAAe,CAAC;;;;;;;;;;;;;;;;QAgBpD,CAAC;AACT,CAAC;AAED,SAAS,oBAAoB,CAAC,eAAuB;IACnD,OAAO;;;;;;;;;;;;;;+BAcsB,IAAA,yBAAU,EAAC,eAAe,CAAC;;;QAGlD,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ParsedSectionId } from "@paroicms/anywhere-lib";
|
|
2
|
+
import type { Tracker } from "@paroicms/server-lib";
|
|
3
|
+
import type { SiteContext } from "../../../site-context/site-context.types";
|
|
4
|
+
export declare function getUrlOfDocument(siteContext: SiteContext, tracker: Tracker, documentId: ParsedSectionId): Promise<string>;
|
|
5
|
+
export declare function getUrlOfDocument(siteContext: SiteContext, tracker: Tracker, documentId: ParsedSectionId, options: {
|
|
6
|
+
returnUrlDependencyKeys: true;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
url: string;
|
|
9
|
+
dependencyKeys: string[];
|
|
10
|
+
}>;
|
|
11
|
+
export declare function getHomeUrl(siteContext: Pick<SiteContext, "multilingual">, lang: string): string;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHomeUrl = exports.getUrlOfDocument = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
6
|
+
const text_cache_1 = require("../../../common/text-cache");
|
|
7
|
+
const ddl_migration_1 = require("../../../site-context/db-init/ddl-migration");
|
|
8
|
+
const leaf_queries_1 = require("../../core/leaf/leaf.queries");
|
|
9
|
+
async function getUrlOfDocument(siteContext, tracker, documentId, options = {}) {
|
|
10
|
+
const cacheKey = (0, text_cache_1.makeCacheKey)({ kind: "url", documentId });
|
|
11
|
+
const cacheValue = await siteContext.textCache.getCacheValue(cacheKey, tracker);
|
|
12
|
+
if (cacheValue) {
|
|
13
|
+
if (!options.returnUrlDependencyKeys)
|
|
14
|
+
return cacheValue.value;
|
|
15
|
+
return {
|
|
16
|
+
url: cacheValue.value,
|
|
17
|
+
dependencyKeys: await siteContext.textCache.getDependencyKeys(cacheKey, tracker),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
let dependencyKeys;
|
|
21
|
+
let url;
|
|
22
|
+
const { leafId, lang } = documentId;
|
|
23
|
+
const depth = await (0, leaf_queries_1.getLeafDepth)(siteContext, tracker, leafId);
|
|
24
|
+
if (depth === 0) {
|
|
25
|
+
url = getHomeUrl(siteContext, lang);
|
|
26
|
+
dependencyKeys = [];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const query = buildUrlQuery(siteContext, documentId, depth);
|
|
30
|
+
const [row] = await query.getRawMany();
|
|
31
|
+
tracker.trackAccess(ddl_migration_1.dbSchemaName, "PaLeaf", "read");
|
|
32
|
+
if (!row) {
|
|
33
|
+
throw new Error(`invalid url data for document "${lang}:${leafId}"`);
|
|
34
|
+
}
|
|
35
|
+
const urlData = formatUrlData(row, depth);
|
|
36
|
+
url = makeUrl(siteContext, urlData, lang);
|
|
37
|
+
dependencyKeys = makeUrlDependencyKeys(urlData, lang);
|
|
38
|
+
}
|
|
39
|
+
await siteContext.textCache.setCacheValue({
|
|
40
|
+
cacheKey,
|
|
41
|
+
value: url,
|
|
42
|
+
dependencyKeys,
|
|
43
|
+
}, tracker);
|
|
44
|
+
return options.returnUrlDependencyKeys ? { url, dependencyKeys } : url;
|
|
45
|
+
}
|
|
46
|
+
exports.getUrlOfDocument = getUrlOfDocument;
|
|
47
|
+
function buildUrlQuery(siteContext, sectionId, depth) {
|
|
48
|
+
const { leafId, lang } = sectionId;
|
|
49
|
+
let cur = depth;
|
|
50
|
+
const query = siteContext.mainCn
|
|
51
|
+
.createQueryBuilder()
|
|
52
|
+
.addSelect(`l${cur}.id`, `id${cur}`)
|
|
53
|
+
.addSelect(`l${cur}.leafType`, `leafType${cur}`)
|
|
54
|
+
.addSelect(`l${cur}.relativeId`, `relativeId${cur}`)
|
|
55
|
+
.addSelect(`l${cur}.publishDate`, `publishDate${cur}`)
|
|
56
|
+
.addSelect(`d${cur}.slug`, `slug${cur}`)
|
|
57
|
+
.from("PaLeaf", `l${cur}`)
|
|
58
|
+
.innerJoin("PaSection", `s${cur}`, `s${cur}.leafId = l${cur}.id and s${cur}.lang = :lang`, {
|
|
59
|
+
lang,
|
|
60
|
+
})
|
|
61
|
+
.leftJoin("PaDocument", `d${cur}`, `d${cur}.leafId = s${cur}.leafId and d${cur}.lang = s${cur}.lang`)
|
|
62
|
+
.where(`l${cur}.id = :leafId`, { leafId })
|
|
63
|
+
.andWhere(`l${cur}.publishDate is not null`);
|
|
64
|
+
let prev = cur;
|
|
65
|
+
while (prev > 1) {
|
|
66
|
+
cur = prev - 1;
|
|
67
|
+
query
|
|
68
|
+
.addSelect(`l${cur}.id`, `id${cur}`)
|
|
69
|
+
.addSelect(`l${cur}.leafType`, `leafType${cur}`)
|
|
70
|
+
.addSelect(`l${cur}.relativeId`, `relativeId${cur}`)
|
|
71
|
+
.addSelect(`l${cur}.publishDate`, `publishDate${cur}`)
|
|
72
|
+
.addSelect(`d${cur}.slug`, `slug${cur}`)
|
|
73
|
+
.innerJoin("PaLeaf", `l${cur}`, `l${cur}.id = l${prev}.parentId`)
|
|
74
|
+
.innerJoin("PaSection", `s${cur}`, `s${cur}.leafId = l${cur}.id and s${cur}.lang = :lang`, {
|
|
75
|
+
lang,
|
|
76
|
+
})
|
|
77
|
+
.leftJoin("PaDocument", `d${cur}`, `d${cur}.leafId = s${cur}.leafId and d${cur}.lang = s${cur}.lang`)
|
|
78
|
+
.andWhere(`l${cur}.publishDate is not null`);
|
|
79
|
+
prev = cur;
|
|
80
|
+
}
|
|
81
|
+
query.andWhere(`l${prev}.parentId = :homeLeafId`, {
|
|
82
|
+
homeLeafId: siteContext.siteIds.homeIds.leafId,
|
|
83
|
+
});
|
|
84
|
+
return query;
|
|
85
|
+
}
|
|
86
|
+
function formatUrlData(row, depth) {
|
|
87
|
+
const parts = new Map();
|
|
88
|
+
for (let cur = 1; cur <= depth; ++cur) {
|
|
89
|
+
parts.set(cur, {
|
|
90
|
+
leafId: (0, data_formatters_lib_1.strVal)(row[`id${cur}`]),
|
|
91
|
+
leafType: (0, data_formatters_lib_1.strVal)(row[`leafType${cur}`]),
|
|
92
|
+
relativeId: (0, data_formatters_lib_1.strVal)(row[`relativeId${cur}`]),
|
|
93
|
+
slug: (0, data_formatters_lib_1.strValOrUndef)(row[`slug${cur}`]),
|
|
94
|
+
publishDate: (0, data_formatters_lib_1.dateVal)(row[`publishDate${cur}`]),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return { depth, parts };
|
|
98
|
+
}
|
|
99
|
+
function getHomeUrl(siteContext, lang) {
|
|
100
|
+
return siteContext.multilingual ? `/${lang}` : "/";
|
|
101
|
+
}
|
|
102
|
+
exports.getHomeUrl = getHomeUrl;
|
|
103
|
+
function makeUrl(siteContext, urlData, lang) {
|
|
104
|
+
const { siteSchema, multilingual } = siteContext;
|
|
105
|
+
const urlParts = multilingual ? [lang] : [];
|
|
106
|
+
let parent = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteSchema, "home");
|
|
107
|
+
for (let cur = 1; cur <= urlData.depth; ++cur) {
|
|
108
|
+
const part = urlData.parts.get(cur);
|
|
109
|
+
if (!part)
|
|
110
|
+
throw new Error(`missing url part for depth '${cur}'`);
|
|
111
|
+
if (!parent.children?.includes(part.leafType)) {
|
|
112
|
+
throw new Error(`schema and database are not compatible, '${part.leafType}' should not be a child of '${parent.leafType}'`);
|
|
113
|
+
}
|
|
114
|
+
const docType = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteSchema, part.leafType);
|
|
115
|
+
if (docType.kind === "routingPoint") {
|
|
116
|
+
const part = docType.urlPaths?.[lang];
|
|
117
|
+
if (!part) {
|
|
118
|
+
throw new Error(`missing urlPath['${lang}'] in document type '${docType.leafType}'`);
|
|
119
|
+
}
|
|
120
|
+
urlParts.push(part);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if (docType.route === ":relativeId-:slug") {
|
|
124
|
+
urlParts.push(makeRelativeIdSlugUrlPart(part));
|
|
125
|
+
}
|
|
126
|
+
else if (docType.route === ":yyyy/:mm/:dd/:relativeId-:slug") {
|
|
127
|
+
const { publishDate } = part;
|
|
128
|
+
urlParts.push(String(publishDate.getFullYear()).padStart(4, "0"));
|
|
129
|
+
urlParts.push(String(publishDate.getMonth() + 1).padStart(2, "0"));
|
|
130
|
+
urlParts.push(String(publishDate.getDate()).padStart(2, "0"));
|
|
131
|
+
urlParts.push(makeRelativeIdSlugUrlPart(part));
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
throw new Error(`in '${docType.leafType}', unknown value for route: '${docType.route}'`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
parent = docType;
|
|
138
|
+
}
|
|
139
|
+
return `/${urlParts.join("/")}`;
|
|
140
|
+
}
|
|
141
|
+
function makeRelativeIdSlugUrlPart(part) {
|
|
142
|
+
return part.slug ? `${part.relativeId}-${part.slug}` : part.relativeId;
|
|
143
|
+
}
|
|
144
|
+
function makeUrlDependencyKeys(urlData, lang) {
|
|
145
|
+
return Array.from(urlData.parts.values()).map((part) => (0, text_cache_1.makeCacheDependencyKey)({
|
|
146
|
+
documentId: { lang, leafId: part.leafId },
|
|
147
|
+
perimeter: "slug",
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=make-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-url.js","sourceRoot":"","sources":["../../../../src/modules/public-site/public-route/make-url.ts"],"names":[],"mappings":";;;AAAA,oEAA4E;AAC5E,yDAAmG;AAEnG,2DAAkF;AAClF,+EAA2E;AAE3E,+DAA4D;AA0BrD,KAAK,UAAU,gBAAgB,CACpC,WAAwB,EACxB,OAAgB,EAChB,UAA2B,EAC3B,UAAiD,EAAE;IAEnD,MAAM,QAAQ,GAAG,IAAA,yBAAY,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChF,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,CAAC,OAAO,CAAC,uBAAuB;YAAE,OAAO,UAAU,CAAC,KAAK,CAAC;QAC9D,OAAO;YACL,GAAG,EAAE,UAAU,CAAC,KAAK;YACrB,cAAc,EAAE,MAAM,WAAW,CAAC,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;SACjF,CAAC;IACJ,CAAC;IAED,IAAI,cAAwB,CAAC;IAC7B,IAAI,GAAW,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;IAEpC,MAAM,KAAK,GAAG,MAAM,IAAA,2BAAY,EAAC,WAAW,EAAE,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CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;AACzE,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAgB,EAAE,IAAY;IAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACrD,IAAA,mCAAsB,EAAC;QACrB,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACzC,SAAS,EAAE,MAAM;KAClB,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ClassicDocumentSchema, DocumentSchema, RoutingPointDocumentSchema } from "@paroicms/anywhere-lib";
|
|
2
|
+
import type { SiteContext } from "../../../site-context/site-context.types";
|
|
3
|
+
export interface ParsedPublicRoute {
|
|
4
|
+
lang: string;
|
|
5
|
+
routingPoints: RoutingPointDocumentSchema[];
|
|
6
|
+
classicRelativeIds: ClassicRelativeId[];
|
|
7
|
+
documentType: DocumentSchema;
|
|
8
|
+
depth: number;
|
|
9
|
+
urlCacheKey: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ClassicRelativeId {
|
|
12
|
+
relativeId: string;
|
|
13
|
+
documentType: ClassicDocumentSchema;
|
|
14
|
+
}
|
|
15
|
+
export declare function parsePublicRoute(siteContext: Pick<SiteContext, "siteSchema" | "multilingual">, path: string): ParsedPublicRoute | undefined;
|
|
16
|
+
export declare function findParentParsedRouteWithData(parsedRoute: ParsedPublicRoute): ParsedPublicRoute | undefined;
|