@paroicms/server 0.146.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/ddl/main.ddl.sql +84 -0
- package/dist/backup/site/archiver.helper.d.ts +12 -0
- package/dist/backup/site/archiver.helper.js +46 -0
- package/dist/backup/site/archiver.helper.js.map +1 -0
- package/dist/backup/site/backup.d.ts +5 -0
- package/dist/backup/site/backup.js +118 -0
- package/dist/backup/site/backup.js.map +1 -0
- 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/excerpt.helpers.spec.d.ts +1 -0
- package/dist/helpers/excerpt.helpers.spec.js +133 -0
- package/dist/helpers/excerpt.helpers.spec.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/search-text-helper.d.ts +7 -0
- package/dist/helpers/search-text-helper.js +27 -0
- package/dist/helpers/search-text-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 +67 -0
- package/dist/index.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.controller.d.ts +5 -0
- package/dist/modules/core/account-auth/account-auth.controller.js +46 -0
- package/dist/modules/core/account-auth/account-auth.controller.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 +49 -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 +164 -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 +61 -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 +54 -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/document/search-document-item.resolver.d.ts +7 -0
- package/dist/modules/core/document/search-document-item.resolver.js +58 -0
- package/dist/modules/core/document/search-document-item.resolver.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 +143 -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 +54 -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.model.d.ts +6 -0
- package/dist/modules/core/part/part.model.js +44 -0
- package/dist/modules/core/part/part.model.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-fields/site-fields.model.d.ts +4 -0
- package/dist/modules/core/site-fields/site-fields.model.js +30 -0
- package/dist/modules/core/site-fields/site-fields.model.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.module.d.ts +2 -0
- package/dist/modules/core/site-fields/site-fields.module.js +20 -0
- package/dist/modules/core/site-fields/site-fields.module.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.queries.d.ts +9 -0
- package/dist/modules/core/site-fields/site-fields.queries.js +123 -0
- package/dist/modules/core/site-fields/site-fields.queries.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.resolver.d.ts +5 -0
- package/dist/modules/core/site-fields/site-fields.resolver.js +56 -0
- package/dist/modules/core/site-fields/site-fields.resolver.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/term-flag/term-flag.service.d.ts +9 -0
- package/dist/modules/core/term-flag/term-flag.service.js +50 -0
- package/dist/modules/core/term-flag/term-flag.service.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 +59 -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 +198 -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/google-auth.controller.d.ts +10 -0
- package/dist/modules/public-site/google-auth.controller.js +127 -0
- package/dist/modules/public-site/google-auth.controller.js.map +1 -0
- package/dist/modules/public-site/helpers/format-date.helper.d.ts +3 -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/format-date.helper.spec.d.ts +1 -0
- package/dist/modules/public-site/helpers/format-date.helper.spec.js +37 -0
- package/dist/modules/public-site/helpers/format-date.helper.spec.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/helpers/public-field-values.d.ts +10 -0
- package/dist/modules/public-site/helpers/public-field-values.js +76 -0
- package/dist/modules/public-site/helpers/public-field-values.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.js +14 -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 +2 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.js +18 -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 +2 -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 +2 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js +38 -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 +3 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js +21 -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 +2 -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 +3 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js +15 -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 +4 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js +39 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.1.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.1.js +12 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.1.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js +12 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.d.ts +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.js +18 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.d.ts +15 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.js +40 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/render.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/render.js +108 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/render.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.d.ts +6 -0
- package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.js +40 -0
- package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/rendering-context.d.ts +27 -0
- package/dist/modules/public-site/liquidjs-rendering/rendering-context.js +46 -0
- package/dist/modules/public-site/liquidjs-rendering/rendering-context.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.js +49 -0
- package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.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 +68 -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 +94 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.js +61 -0
- package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-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 +53 -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 +144 -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 +46 -0
- package/dist/modules/security/complexity-plugin.js.map +1 -0
- package/dist/modules/security/gqlThrottlerGuard.d.ts +8 -0
- package/dist/modules/security/gqlThrottlerGuard.js +24 -0
- package/dist/modules/security/gqlThrottlerGuard.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/create-page-payload-drop.d.ts +10 -0
- package/dist/public-payload/create-page-payload-drop.js +143 -0
- package/dist/public-payload/create-page-payload-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/liquidjs-drop.d.ts +31 -0
- package/dist/public-payload/liquidjs-drop.js +45 -0
- package/dist/public-payload/liquidjs-drop.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 +11 -0
- package/dist/site-backup/backup-tasks.js +98 -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 +34 -0
- package/dist/site-backup/backup.js.map +1 -0
- package/dist/site-backup/default-data/default-config.d.ts +1 -0
- package/dist/site-backup/default-data/default-config.js +50 -0
- package/dist/site-backup/default-data/default-config.js.map +1 -0
- package/dist/site-backup/default-data/default-readme.d.ts +1 -0
- package/dist/site-backup/default-data/default-readme.js +8 -0
- package/dist/site-backup/default-data/default-readme.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 +37 -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 +4 -0
- package/dist/site-context/db-init/init-routing-points.js +147 -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 +11 -0
- package/dist/site-context/site-context.js +234 -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 +382 -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/locales/en.json +18 -0
- package/locales/fr.json +18 -0
- package/package.json +99 -0
- package/schema.gql +293 -0
- package/site-schema-lib/common-schema.json +36 -0
- package/site-schema-lib/common-schema.l10n.en.json +10 -0
- package/site-schema-lib/common-schema.l10n.fr.json +10 -0
- package/site-schema-lib/fields.site-schema.json +79 -0
- package/site-schema-lib/fields.site-schema.l10n.en.json +26 -0
- package/site-schema-lib/fields.site-schema.l10n.fr.json +26 -0
- package/site-schema-lib/gallery-page.site-schema.json +19 -0
- package/site-schema-lib/gallery-page.site-schema.l10n.en.json +11 -0
- package/site-schema-lib/gallery-page.site-schema.l10n.fr.json +11 -0
- package/site-schema-lib/lowcost.site-schema.json +84 -0
- package/site-schema-lib/lowcost.site-schema.l10n.en.json +30 -0
- package/site-schema-lib/lowcost.site-schema.l10n.fr.json +30 -0
- package/site-schema-lib/media-policies.site-schema.json +26 -0
- package/site-schema-lib/portfolio.site-schema.json +28 -0
- package/site-schema-lib/portfolio.site-schema.l10n.en.json +16 -0
- package/site-schema-lib/portfolio.site-schema.l10n.fr.json +16 -0
- package/site-schema-lib/post.site-schema.json +48 -0
- package/site-schema-lib/post.site-schema.l10n.en.json +28 -0
- package/site-schema-lib/post.site-schema.l10n.fr.json +27 -0
- package/site-schema-lib/simple-pages.site-schema.json +19 -0
- package/site-schema-lib/simple-pages.site-schema.l10n.en.json +11 -0
- package/site-schema-lib/simple-pages.site-schema.l10n.fr.json +11 -0
- package/site-schema-lib/special-page.site-schema.json +42 -0
- package/site-schema-lib/special-page.site-schema.l10n.en.json +16 -0
- package/site-schema-lib/special-page.site-schema.l10n.fr.json +16 -0
- package/site-schema-lib/tour.site-schema.json +70 -0
- package/site-schema-lib/tour.site-schema.l10n.en.json +37 -0
- package/site-schema-lib/tour.site-schema.l10n.fr.json +37 -0
|
@@ -0,0 +1,56 @@
|
|
|
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.PasswordResetService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const passwordEncrypt_helper_1 = require("../../../helpers/passwordEncrypt-helper");
|
|
12
|
+
const account_model_1 = require("../../core/account/account.model");
|
|
13
|
+
let PasswordResetService = class PasswordResetService {
|
|
14
|
+
async setAccountPassword(siteContext, requestDto) {
|
|
15
|
+
const account = await this.#getAccount(siteContext, requestDto.accountId);
|
|
16
|
+
if (account.passwordResetToken !== requestDto.resetToken) {
|
|
17
|
+
throw new common_1.BadRequestException("Invalid reset token");
|
|
18
|
+
}
|
|
19
|
+
const passwordHash = await (0, passwordEncrypt_helper_1.hashPassword)(requestDto.password);
|
|
20
|
+
await siteContext.mainCn
|
|
21
|
+
.createQueryBuilder()
|
|
22
|
+
.update("PaAccount")
|
|
23
|
+
.set({ passwordHash, passwordResetToken: null })
|
|
24
|
+
.where("id = :id", { id: account.id })
|
|
25
|
+
.execute();
|
|
26
|
+
}
|
|
27
|
+
async checkPasswordReset(siteContext, requestDto) {
|
|
28
|
+
const account = await this.#getAccount(siteContext, requestDto.accountId);
|
|
29
|
+
if (account.passwordResetToken !== requestDto.resetToken) {
|
|
30
|
+
return {
|
|
31
|
+
authorized: false,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
authorized: true,
|
|
36
|
+
email: account.email,
|
|
37
|
+
name: account.name,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async #getAccount(siteContext, id) {
|
|
41
|
+
const account = await siteContext.mainCn.getRepository(account_model_1.AccountEntity).findOne({
|
|
42
|
+
where: {
|
|
43
|
+
id,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
if (!account) {
|
|
47
|
+
throw new common_1.NotFoundException(`Not found account with id:'${id}'`);
|
|
48
|
+
}
|
|
49
|
+
return account;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.PasswordResetService = PasswordResetService;
|
|
53
|
+
exports.PasswordResetService = PasswordResetService = __decorate([
|
|
54
|
+
(0, common_1.Injectable)()
|
|
55
|
+
], PasswordResetService);
|
|
56
|
+
//# sourceMappingURL=password-reset.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset.service.js","sourceRoot":"","sources":["../../../../src/modules/public-api/password-reset/password-reset.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoF;AACpF,oFAAuE;AAEvE,oEAAiE;AAU1D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,KAAK,CAAC,kBAAkB,CAAC,WAAwB,EAAE,UAAiC;QAClF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;QAE1E,IAAI,OAAO,CAAC,kBAAkB,KAAK,UAAU,CAAC,UAAU,EAAE,CAAC;YACzD,MAAM,IAAI,4BAAmB,CAAC,qBAAqB,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,IAAA,qCAAY,EAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAE7D,MAAM,WAAW,CAAC,MAAM;aACrB,kBAAkB,EAAE;aACpB,MAAM,CAAC,WAAW,CAAC;aACnB,GAAG,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;aAC/C,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;aACrC,OAAO,EAAE,CAAC;IACf,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,WAAwB,EACxB,UAAiC;QAOjC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;QAE1E,IAAI,OAAO,CAAC,kBAAkB,KAAK,UAAU,CAAC,UAAU,EAAE,CAAC;YACzD,OAAO;gBACL,UAAU,EAAE,KAAK;aAClB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,WAAwB,EAAE,EAAU;QACpD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,6BAAa,CAAC,CAAC,OAAO,CAAC;YAC5E,KAAK,EAAE;gBACL,EAAE;aACH;SACF,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,0BAAiB,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAtDY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CAsDhC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Tracker } from "@paroicms/server-lib";
|
|
2
|
+
import { Request, Response } from "express";
|
|
3
|
+
import { SiteContext } from "../../site-context/site-context.types";
|
|
4
|
+
import { SendMailResponseType } from "./mail/contact-form-mail";
|
|
5
|
+
import { SendMailInput } from "./mail/mail.dto";
|
|
6
|
+
import { PartialsParamsInput } from "./partials/partials-params.dto";
|
|
7
|
+
import { SearchTextOptionsInput } from "./search-text/search-text.dto";
|
|
8
|
+
import { SearchTextOptions } from "./search-text/search-text.queries";
|
|
9
|
+
interface HealthCheckType {
|
|
10
|
+
status: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ApiSearchResult {
|
|
13
|
+
html?: string;
|
|
14
|
+
total: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class PublicApiController {
|
|
17
|
+
healthCheck(): HealthCheckType;
|
|
18
|
+
partials(req: Request, res: Response, params: PartialsParamsInput, flaggedWithId?: string): Promise<void>;
|
|
19
|
+
search(query: SearchTextOptionsInput, req: Request, res: Response): Promise<{
|
|
20
|
+
total: number;
|
|
21
|
+
} | undefined>;
|
|
22
|
+
sendMail(req: Request, input: SendMailInput): Promise<SendMailResponseType>;
|
|
23
|
+
}
|
|
24
|
+
export interface SearchAndRenderOptions extends SearchTextOptions {
|
|
25
|
+
templateName: string;
|
|
26
|
+
cacheKey: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function searchAndRender(siteContext: SiteContext, tracker: Tracker, options: SearchAndRenderOptions): Promise<{
|
|
29
|
+
result: ApiSearchResult;
|
|
30
|
+
dependencyKeys: string[];
|
|
31
|
+
}>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,198 @@
|
|
|
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.searchAndRender = exports.PublicApiController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
18
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
19
|
+
const server_lib_1 = require("@paroicms/server-lib");
|
|
20
|
+
const serve_html_or_1 = require("../../common/serve-html-or");
|
|
21
|
+
const text_cache_1 = require("../../common/text-cache");
|
|
22
|
+
const tracker_report_1 = require("../../common/tracker-report");
|
|
23
|
+
const utils_helper_1 = require("../../helpers/utils-helper");
|
|
24
|
+
const create_page_drop_1 = require("../../public-payload/create-page-drop");
|
|
25
|
+
const page_values_queries_1 = require("../../public-payload/page-values.queries");
|
|
26
|
+
const site_payload_1 = require("../../public-payload/site-payload");
|
|
27
|
+
const site_context_1 = require("../../site-context/site-context");
|
|
28
|
+
const render_liquidjs_1 = require("../public-site/liquidjs-rendering/render-liquidjs");
|
|
29
|
+
const rendering_context_1 = require("../public-site/liquidjs-rendering/rendering-context");
|
|
30
|
+
const class_validator_options_1 = require("./class-validator-options");
|
|
31
|
+
const contact_form_mail_1 = require("./mail/contact-form-mail");
|
|
32
|
+
const mail_dto_1 = require("./mail/mail.dto");
|
|
33
|
+
const partials_params_dto_1 = require("./partials/partials-params.dto");
|
|
34
|
+
const search_text_dto_1 = require("./search-text/search-text.dto");
|
|
35
|
+
const search_text_queries_1 = require("./search-text/search-text.queries");
|
|
36
|
+
let PublicApiController = class PublicApiController {
|
|
37
|
+
healthCheck() {
|
|
38
|
+
return {
|
|
39
|
+
status: "ready",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async partials(req, res, params, flaggedWithId) {
|
|
43
|
+
const parentId = (0, anywhere_lib_1.parseSectionId)(params.documentId);
|
|
44
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
45
|
+
const flaggedWithLeafId = (0, anywhere_lib_1.isDef)(flaggedWithId) ? (0, utils_helper_1.toLeafId)(flaggedWithId) : undefined;
|
|
46
|
+
const cacheKey = (0, text_cache_1.makeCacheKey)({ kind: "api", url: req.url });
|
|
47
|
+
const tracker = (0, server_lib_1.createTracker)();
|
|
48
|
+
const serveOr = (0, serve_html_or_1.serveHtmlFromCacheOr)(siteContext, tracker, {
|
|
49
|
+
cacheKey,
|
|
50
|
+
req,
|
|
51
|
+
res,
|
|
52
|
+
contentType: "text/plain",
|
|
53
|
+
});
|
|
54
|
+
if (!(await serveOr.serveFromCache())) {
|
|
55
|
+
const { html, dependencyKeys } = await renderChildPages(siteContext, tracker, {
|
|
56
|
+
parentId,
|
|
57
|
+
limit: (0, data_formatters_lib_1.nbVal)(params.limit),
|
|
58
|
+
startIndex: (0, data_formatters_lib_1.nbVal)(params.startIndex),
|
|
59
|
+
templateName: params.templateName,
|
|
60
|
+
cacheKey,
|
|
61
|
+
flaggedWithTermId: flaggedWithLeafId,
|
|
62
|
+
});
|
|
63
|
+
await serveOr.putInCacheAndServe(html, dependencyKeys);
|
|
64
|
+
}
|
|
65
|
+
siteContext.siteLog.stats((0, tracker_report_1.trackerReportToMessage)(tracker.toReport(), `serve ${req.url}`));
|
|
66
|
+
}
|
|
67
|
+
async search(query, req, res) {
|
|
68
|
+
const { q, lang, limit, start, tpl } = query;
|
|
69
|
+
const words = q.split(/\s+/).filter((word) => word.length >= 2);
|
|
70
|
+
if (words.length === 0)
|
|
71
|
+
return { total: 0 };
|
|
72
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
73
|
+
const cacheKey = (0, text_cache_1.makeCacheKey)({ kind: "api", url: req.url });
|
|
74
|
+
const tracker = (0, server_lib_1.createTracker)();
|
|
75
|
+
const serveOr = (0, serve_html_or_1.serveHtmlFromCacheOr)(siteContext, tracker, {
|
|
76
|
+
cacheKey,
|
|
77
|
+
req,
|
|
78
|
+
res,
|
|
79
|
+
contentType: "application/json",
|
|
80
|
+
});
|
|
81
|
+
if (!(await serveOr.serveFromCache())) {
|
|
82
|
+
const { result, dependencyKeys } = await searchAndRender(siteContext, tracker, {
|
|
83
|
+
lang,
|
|
84
|
+
words,
|
|
85
|
+
limit: (0, data_formatters_lib_1.nbVal)(limit),
|
|
86
|
+
start: (0, data_formatters_lib_1.nbVal)(start),
|
|
87
|
+
templateName: tpl,
|
|
88
|
+
cacheKey,
|
|
89
|
+
});
|
|
90
|
+
const content = JSON.stringify(result);
|
|
91
|
+
await serveOr.putInCacheAndServe(content, dependencyKeys);
|
|
92
|
+
}
|
|
93
|
+
siteContext.siteLog.stats((0, tracker_report_1.trackerReportToMessage)(tracker.toReport(), `serve ${req.url}`));
|
|
94
|
+
}
|
|
95
|
+
async sendMail(req, input) {
|
|
96
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
97
|
+
return await (0, contact_form_mail_1.sendContactFormMail)(siteContext, input);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
exports.PublicApiController = PublicApiController;
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, common_1.Get)("healthcheck"),
|
|
103
|
+
__metadata("design:type", Function),
|
|
104
|
+
__metadata("design:paramtypes", []),
|
|
105
|
+
__metadata("design:returntype", Object)
|
|
106
|
+
], PublicApiController.prototype, "healthCheck", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, common_1.Get)("partials/:templateName/child-pages/:documentId/start/:startIndex/limit/:limit"),
|
|
109
|
+
__param(0, (0, common_1.Req)()),
|
|
110
|
+
__param(1, (0, common_1.Res)()),
|
|
111
|
+
__param(2, (0, common_1.Param)()),
|
|
112
|
+
__param(3, (0, common_1.Query)("flagged")),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", [Object, Object, partials_params_dto_1.PartialsParamsInput, String]),
|
|
115
|
+
__metadata("design:returntype", Promise)
|
|
116
|
+
], PublicApiController.prototype, "partials", null);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, common_1.Get)("search"),
|
|
119
|
+
__param(0, (0, common_1.Query)()),
|
|
120
|
+
__param(1, (0, common_1.Req)()),
|
|
121
|
+
__param(2, (0, common_1.Res)()),
|
|
122
|
+
__metadata("design:type", Function),
|
|
123
|
+
__metadata("design:paramtypes", [search_text_dto_1.SearchTextOptionsInput, Object, Object]),
|
|
124
|
+
__metadata("design:returntype", Promise)
|
|
125
|
+
], PublicApiController.prototype, "search", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, common_1.HttpCode)(200),
|
|
128
|
+
(0, common_1.Post)("submit-contact-form"),
|
|
129
|
+
__param(0, (0, common_1.Req)()),
|
|
130
|
+
__param(1, (0, common_1.Body)()),
|
|
131
|
+
__metadata("design:type", Function),
|
|
132
|
+
__metadata("design:paramtypes", [Object, mail_dto_1.SendMailInput]),
|
|
133
|
+
__metadata("design:returntype", Promise)
|
|
134
|
+
], PublicApiController.prototype, "sendMail", null);
|
|
135
|
+
exports.PublicApiController = PublicApiController = __decorate([
|
|
136
|
+
(0, common_1.Controller)("api/v1"),
|
|
137
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe(class_validator_options_1.classValidatorOptions))
|
|
138
|
+
], PublicApiController);
|
|
139
|
+
async function renderChildPages(siteContext, tracker, options) {
|
|
140
|
+
const { parentId, templateName } = options;
|
|
141
|
+
const pages = await (0, page_values_queries_1.getPageItems)(siteContext, tracker, options);
|
|
142
|
+
const renderingContext = await (0, rendering_context_1.createRenderingContext)(siteContext, {
|
|
143
|
+
tracker,
|
|
144
|
+
cacheKey: options.cacheKey,
|
|
145
|
+
dependencyKey: (0, text_cache_1.makeCacheDependencyKey)({ documentId: parentId, relation: "children" }),
|
|
146
|
+
});
|
|
147
|
+
const result = [];
|
|
148
|
+
for (const row of pages) {
|
|
149
|
+
const payload = {
|
|
150
|
+
site: (0, site_payload_1.makeSitePayload)(siteContext, renderingContext, parentId.lang),
|
|
151
|
+
page: (0, create_page_drop_1.createPagePayloadDrop)(siteContext, renderingContext, row),
|
|
152
|
+
};
|
|
153
|
+
const html = await (0, render_liquidjs_1.renderLiquidTemplate)(siteContext, renderingContext, {
|
|
154
|
+
payload,
|
|
155
|
+
templateNames: [`partials/${templateName}.public.liquid`],
|
|
156
|
+
});
|
|
157
|
+
result.push(html);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
html: result.join(""),
|
|
161
|
+
dependencyKeys: renderingContext.getDependencyKeys(),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
async function searchAndRender(siteContext, tracker, options) {
|
|
165
|
+
const { words, lang, start, limit, templateName } = options;
|
|
166
|
+
const pages = await (0, search_text_queries_1.searchText)(siteContext, { ...options, onlyPublished: true });
|
|
167
|
+
const renderingContext = await (0, rendering_context_1.createRenderingContext)(siteContext, {
|
|
168
|
+
cacheKey: options.cacheKey,
|
|
169
|
+
tracker,
|
|
170
|
+
});
|
|
171
|
+
const htmlList = [];
|
|
172
|
+
for (const row of pages) {
|
|
173
|
+
const payload = {
|
|
174
|
+
site: (0, site_payload_1.makeSitePayload)(siteContext, renderingContext, lang),
|
|
175
|
+
page: (0, create_page_drop_1.createPagePayloadDrop)(siteContext, renderingContext, row),
|
|
176
|
+
};
|
|
177
|
+
const tName = templateName.endsWith(".public") ? templateName : `${templateName}.public`;
|
|
178
|
+
const html = await (0, render_liquidjs_1.renderLiquidTemplate)(siteContext, renderingContext, {
|
|
179
|
+
payload,
|
|
180
|
+
templateNames: [`partials/${tName}.liquid`],
|
|
181
|
+
});
|
|
182
|
+
htmlList.push(html);
|
|
183
|
+
}
|
|
184
|
+
let total;
|
|
185
|
+
if (pages.length < limit)
|
|
186
|
+
total = start + pages.length;
|
|
187
|
+
else
|
|
188
|
+
total = await (0, search_text_queries_1.countSearchItems)(siteContext, { lang, words });
|
|
189
|
+
return {
|
|
190
|
+
result: {
|
|
191
|
+
html: htmlList.join(""),
|
|
192
|
+
total,
|
|
193
|
+
},
|
|
194
|
+
dependencyKeys: renderingContext.getDependencyKeys(),
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
exports.searchAndRender = searchAndRender;
|
|
198
|
+
//# sourceMappingURL=public-api-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api-controller.js","sourceRoot":"","sources":["../../../src/modules/public-api/public-api-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,oEAAmD;AACnD,yDAAgF;AAChF,qDAA8D;AAE9D,8DAAkE;AAClE,wDAA+E;AAC/E,gEAAqE;AACrE,6DAAsD;AACtD,4EAA8E;AAC9E,kFAAwE;AACxE,oEAAoE;AACpE,kEAAiE;AAEjE,uFAAyF;AACzF,2FAA6F;AAC7F,uEAAkE;AAClE,gEAAqF;AACrF,8CAAgD;AAChD,wEAAqE;AACrE,mEAAuE;AACvE,2EAAoG;AAa7F,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAE9B,WAAW;QACT,OAAO;YACL,MAAM,EAAE,OAAO;SAChB,CAAC;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CACL,GAAY,EACZ,GAAa,EACX,MAA2B,EAClB,aAAsB;QAExC,MAAM,QAAQ,GAAG,IAAA,6BAAc,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,iBAAiB,GAAG,IAAA,oBAAK,EAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAA,uBAAQ,EAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAErF,MAAM,QAAQ,GAAG,IAAA,yBAAY,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE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AAC;QACxB,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,IAAA,8BAAe,EAAC,WAAW,EAAE,gBAAgB,EAAE,IAAI,CAAC;YAC1D,IAAI,EAAE,IAAA,wCAAqB,EAAC,WAAW,EAAE,gBAAgB,EAAE,GAAG,CAAC;SAChE,CAAC;QAEF,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,SAAS,CAAC;QAEzF,MAAM,IAAI,GAAG,MAAM,IAAA,sCAAoB,EAAC,WAAW,EAAE,gBAAgB,EAAE;YACrE,OAAO;YACP,aAAa,EAAE,CAAC,YAAY,KAAK,SAAS,CAAC;SAC5C,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,KAAa,CAAC;IAClB,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK;QAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;;QAClD,KAAK,GAAG,MAAM,IAAA,sCAAgB,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAElE,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,KAAK;SACN;QACD,cAAc,EAAE,gBAAgB,CAAC,iBAAiB,EAAE;KACrD,CAAC;AACJ,CAAC;AAxCD,0CAwCC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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.PublicApiModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const password_reset_module_1 = require("./password-reset/password-reset.module");
|
|
12
|
+
const public_api_controller_1 = require("./public-api-controller");
|
|
13
|
+
let PublicApiModule = class PublicApiModule {
|
|
14
|
+
};
|
|
15
|
+
exports.PublicApiModule = PublicApiModule;
|
|
16
|
+
exports.PublicApiModule = PublicApiModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
controllers: [public_api_controller_1.PublicApiController],
|
|
19
|
+
imports: [password_reset_module_1.PasswordResetModule],
|
|
20
|
+
})
|
|
21
|
+
], PublicApiModule);
|
|
22
|
+
//# sourceMappingURL=public-api.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.module.js","sourceRoot":"","sources":["../../../src/modules/public-api/public-api.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,kFAA6E;AAC7E,mEAA8D;AAMvD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAJ3B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,2CAAmB,CAAC;QAClC,OAAO,EAAE,CAAC,2CAAmB,CAAC;KAC/B,CAAC;GACW,eAAe,CAAG"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SearchTextOptionsInput = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class SearchTextOptionsInput {
|
|
15
|
+
lang;
|
|
16
|
+
q;
|
|
17
|
+
limit;
|
|
18
|
+
start;
|
|
19
|
+
tpl;
|
|
20
|
+
}
|
|
21
|
+
exports.SearchTextOptionsInput = SearchTextOptionsInput;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsDefined)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], SearchTextOptionsInput.prototype, "lang", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsDefined)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], SearchTextOptionsInput.prototype, "q", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsNumberString)(),
|
|
36
|
+
(0, class_validator_1.IsDefined)(),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], SearchTextOptionsInput.prototype, "limit", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsNumberString)(),
|
|
41
|
+
(0, class_validator_1.IsDefined)(),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], SearchTextOptionsInput.prototype, "start", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
46
|
+
(0, class_validator_1.IsString)(),
|
|
47
|
+
(0, class_validator_1.IsDefined)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], SearchTextOptionsInput.prototype, "tpl", void 0);
|
|
50
|
+
//# sourceMappingURL=search-text.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-text.dto.js","sourceRoot":"","sources":["../../../../src/modules/public-api/search-text/search-text.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkF;AAElF,MAAa,sBAAsB;IAIjC,IAAI,CAAU;IAKd,CAAC,CAAU;IAIX,KAAK,CAAU;IAIf,KAAK,CAAU;IAKf,GAAG,CAAU;CACd;AAvBD,wDAuBC;AAnBC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,GAAE;;oDACE;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,GAAE;;iDACD;AAIX;IAFC,IAAA,gCAAc,GAAE;IAChB,IAAA,2BAAS,GAAE;;qDACG;AAIf;IAFC,IAAA,gCAAc,GAAE;IAChB,IAAA,2BAAS,GAAE;;qDACG;AAKf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,GAAE;;mDACC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PageValues } from "../../../public-payload/public-payload.types";
|
|
2
|
+
import { SiteContext } from "../../../site-context/site-context.types";
|
|
3
|
+
export interface SearchTextOptions {
|
|
4
|
+
lang: string;
|
|
5
|
+
words: string[];
|
|
6
|
+
limit: number;
|
|
7
|
+
start: number;
|
|
8
|
+
onlyPublished?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function searchText(siteContext: SiteContext, options: SearchTextOptions): Promise<PageValues[]>;
|
|
11
|
+
export declare function countSearchItems(siteContext: SiteContext, { lang, words }: {
|
|
12
|
+
lang: string;
|
|
13
|
+
words: string[];
|
|
14
|
+
}): Promise<number>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countSearchItems = exports.searchText = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const context_1 = require("../../../context");
|
|
7
|
+
const page_values_queries_1 = require("../../../public-payload/page-values.queries");
|
|
8
|
+
async function searchText(siteContext, options) {
|
|
9
|
+
const { words, lang, start, limit, onlyPublished } = options;
|
|
10
|
+
const query = createBaseSearchTextQueryBuilder(siteContext, { lang, words })
|
|
11
|
+
.distinct(true)
|
|
12
|
+
.orderBy("l.publishDate", "DESC")
|
|
13
|
+
.limit(limit)
|
|
14
|
+
.offset(start);
|
|
15
|
+
if (onlyPublished) {
|
|
16
|
+
query.andWhere("s.ready = 1").andWhere("l.publishDate <= current_timestamp");
|
|
17
|
+
}
|
|
18
|
+
(0, page_values_queries_1.querySelectPageValues)(query);
|
|
19
|
+
const rows = await query.getRawMany();
|
|
20
|
+
return rows.map((row) => (0, page_values_queries_1.formatPageValues)(row, { lang }));
|
|
21
|
+
}
|
|
22
|
+
exports.searchText = searchText;
|
|
23
|
+
async function countSearchItems(siteContext, { lang, words }) {
|
|
24
|
+
const row = await createBaseSearchTextQueryBuilder(siteContext, { lang, words })
|
|
25
|
+
.select("count(1)", "total")
|
|
26
|
+
.getRawOne();
|
|
27
|
+
return (0, data_formatters_lib_1.nbVal)(row?.total);
|
|
28
|
+
}
|
|
29
|
+
exports.countSearchItems = countSearchItems;
|
|
30
|
+
function createBaseSearchTextQueryBuilder(siteContext, { lang, words }) {
|
|
31
|
+
const query = siteContext.mainCn
|
|
32
|
+
.createQueryBuilder()
|
|
33
|
+
.from("PaDocument", "d")
|
|
34
|
+
.innerJoin("PaSection", "s", "s.leafId = d.leafId and s.lang = d.lang")
|
|
35
|
+
.innerJoin("PaLeaf", "l", "s.leafId = l.id")
|
|
36
|
+
.leftJoin("PaFieldVarchar", "fv", "fv.leafId = s.leafId and (fv.lang = s.lang or fv.lang = :dbAnyLang)")
|
|
37
|
+
.leftJoin("PaFieldText", "ft", "ft.leafId = d.leafId and (ft.lang = d.lang or ft.lang = :dbAnyLang)")
|
|
38
|
+
.where("s.lang = :lang");
|
|
39
|
+
for (let index = 0; index < words.length; index++) {
|
|
40
|
+
query.andWhere(new typeorm_1.Brackets((qb) => {
|
|
41
|
+
qb.where(`d.title like :word${index}`)
|
|
42
|
+
.orWhere(`ft.val like :word${index}`)
|
|
43
|
+
.orWhere(`fv.val like :word${index}`)
|
|
44
|
+
.orWhere(`exists (select 1
|
|
45
|
+
from PaLeaf l2
|
|
46
|
+
inner join PaSection s2 on s2.leafId = l2.id and s2.lang = :lang and s2.ready = 1
|
|
47
|
+
left join PaFieldVarchar fv2 on fv2.leafId = s2.leafId and (fv2.lang = s2.lang or fv2.lang = :dbAnyLang)
|
|
48
|
+
left join PaFieldText ft2 on ft2.leafId = s2.leafId and (ft2.lang = s2.lang or ft2.lang = :dbAnyLang)
|
|
49
|
+
where l2.parentId = l.id and l2.publishDate <= current_timestamp
|
|
50
|
+
and (fv2.val like :word${index} or ft2.val like :word${index}))`);
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
const parameters = words.map((val, index) => [`word${index}`, `%${val}%`]);
|
|
54
|
+
parameters.push(["lang", lang], ["dbAnyLang", context_1.dbAnyLang]);
|
|
55
|
+
query.setParameters(Object.fromEntries(parameters));
|
|
56
|
+
return query;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=search-text.queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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AEpD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.NotFoundExceptionFilter = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const serve_html_or_1 = require("../../common/serve-html-or");
|
|
12
|
+
const context_1 = require("../../context");
|
|
13
|
+
const http_helpers_1 = require("../../express/http-helpers");
|
|
14
|
+
const site_context_1 = require("../../site-context/site-context");
|
|
15
|
+
let NotFoundExceptionFilter = class NotFoundExceptionFilter {
|
|
16
|
+
async catch(error, host) {
|
|
17
|
+
if (host.getType() !== "http")
|
|
18
|
+
throw error;
|
|
19
|
+
const httpHost = host.switchToHttp();
|
|
20
|
+
const res = httpHost.getResponse();
|
|
21
|
+
const req = httpHost.getRequest();
|
|
22
|
+
try {
|
|
23
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname, { returnsUndef: true });
|
|
24
|
+
if (siteContext) {
|
|
25
|
+
await (0, serve_html_or_1.render404Html)(siteContext, res);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
(0, http_helpers_1.serve404NoSiteHtml)(res);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
context_1.platformLog.error("error when rendering a 404", error);
|
|
33
|
+
(0, http_helpers_1.serve500Html)(res);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.NotFoundExceptionFilter = NotFoundExceptionFilter;
|
|
38
|
+
exports.NotFoundExceptionFilter = NotFoundExceptionFilter = __decorate([
|
|
39
|
+
(0, common_1.Catch)(common_1.NotFoundException)
|
|
40
|
+
], NotFoundExceptionFilter);
|
|
41
|
+
//# sourceMappingURL=app-exception-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-exception-filter.js","sourceRoot":"","sources":["../../../src/modules/public-site/app-exception-filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA0F;AAE1F,8DAA2D;AAC3D,2CAA4C;AAC5C,6DAA8E;AAC9E,kEAAiE;AAG1D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,KAAK,CAAC,KAAK,CAAC,KAAwB,EAAE,IAAmB;QACvD,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,MAAM;YAAE,MAAM,KAAK,CAAC;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAY,CAAC;QAC7C,MAAM,GAAG,GAAG,QAAQ,CAAC,UAAU,EAAW,CAAC;QAC3C,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;YAE/E,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,IAAA,6BAAa,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,IAAA,iCAAkB,EAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qBAAW,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;YACvD,IAAA,2BAAY,EAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;CACF,CAAA;AAnBY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,cAAK,EAAC,0BAAiB,CAAC;GACZ,uBAAuB,CAmBnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JwtService } from "@nestjs/jwt";
|
|
2
|
+
import { Request, Response } from "express";
|
|
3
|
+
export declare class GoogleAuthController {
|
|
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
|
+
}
|