@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,127 @@
|
|
|
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.GoogleAuthController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const jwt_1 = require("@nestjs/jwt");
|
|
18
|
+
const passport_1 = require("@nestjs/passport");
|
|
19
|
+
const html_helpers_1 = require("../../common/mail/html-helpers");
|
|
20
|
+
const context_1 = require("../../context");
|
|
21
|
+
const url_helpers_1 = require("../../helpers/url.helpers");
|
|
22
|
+
let GoogleAuthController = class GoogleAuthController {
|
|
23
|
+
jwtService;
|
|
24
|
+
constructor(jwtService) {
|
|
25
|
+
this.jwtService = jwtService;
|
|
26
|
+
}
|
|
27
|
+
async auth(req, res) {
|
|
28
|
+
if (req.hostname !== context_1.appConf.googleAuth.fqdn) {
|
|
29
|
+
throw new common_1.NotFoundException();
|
|
30
|
+
}
|
|
31
|
+
res.send(generateAuthPageHtml(context_1.platformAuthUrl));
|
|
32
|
+
}
|
|
33
|
+
googleLogin() { }
|
|
34
|
+
async googleLoginCallback(req, res) {
|
|
35
|
+
if (!req.user) {
|
|
36
|
+
throw new common_1.BadRequestException("Email not found in user payload");
|
|
37
|
+
}
|
|
38
|
+
const platformToken = await this.jwtService.signAsync(req.user, {
|
|
39
|
+
secret: context_1.jwtSecretPlatform,
|
|
40
|
+
expiresIn: "7d",
|
|
41
|
+
});
|
|
42
|
+
res.send(generateGoogleRedirectPageHtml({ platformToken, platformAuthUrl: context_1.platformAuthUrl }));
|
|
43
|
+
}
|
|
44
|
+
siteUrl(redirectTo) {
|
|
45
|
+
const siteConf = context_1.siteConfs.get(redirectTo);
|
|
46
|
+
if (!siteConf)
|
|
47
|
+
throw new common_1.BadRequestException("Site not found");
|
|
48
|
+
return (0, url_helpers_1.getBoUrl)(siteConf);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.GoogleAuthController = GoogleAuthController;
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, common_1.Get)(),
|
|
54
|
+
__param(0, (0, common_1.Req)()),
|
|
55
|
+
__param(1, (0, common_1.Res)()),
|
|
56
|
+
__metadata("design:type", Function),
|
|
57
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
58
|
+
__metadata("design:returntype", Promise)
|
|
59
|
+
], GoogleAuthController.prototype, "auth", null);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, common_1.Get)("google"),
|
|
62
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("google")),
|
|
63
|
+
__metadata("design:type", Function),
|
|
64
|
+
__metadata("design:paramtypes", []),
|
|
65
|
+
__metadata("design:returntype", void 0)
|
|
66
|
+
], GoogleAuthController.prototype, "googleLogin", null);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, common_1.Get)("google/callback"),
|
|
69
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("google")),
|
|
70
|
+
__param(0, (0, common_1.Req)()),
|
|
71
|
+
__param(1, (0, common_1.Res)()),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
74
|
+
__metadata("design:returntype", Promise)
|
|
75
|
+
], GoogleAuthController.prototype, "googleLoginCallback", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, common_1.Get)("site-url/:redirectTo"),
|
|
78
|
+
__param(0, (0, common_1.Param)("redirectTo")),
|
|
79
|
+
__metadata("design:type", Function),
|
|
80
|
+
__metadata("design:paramtypes", [String]),
|
|
81
|
+
__metadata("design:returntype", void 0)
|
|
82
|
+
], GoogleAuthController.prototype, "siteUrl", null);
|
|
83
|
+
exports.GoogleAuthController = GoogleAuthController = __decorate([
|
|
84
|
+
(0, common_1.Controller)("auth"),
|
|
85
|
+
__metadata("design:paramtypes", [jwt_1.JwtService])
|
|
86
|
+
], GoogleAuthController);
|
|
87
|
+
function generateGoogleRedirectPageHtml({ platformToken, platformAuthUrl, }) {
|
|
88
|
+
return `<!DOCTYPE html>
|
|
89
|
+
<html lang="en">
|
|
90
|
+
<head>
|
|
91
|
+
<meta charset="UTF-8">
|
|
92
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
93
|
+
<title>Document</title>
|
|
94
|
+
</head>
|
|
95
|
+
<body>
|
|
96
|
+
<script>
|
|
97
|
+
const redirectTo = sessionStorage.getItem("redirectTo");
|
|
98
|
+
const xmlHttp = new XMLHttpRequest();
|
|
99
|
+
xmlHttp.open("GET", "${(0, html_helpers_1.escapeHtml)(platformAuthUrl)}/site-url/" + redirectTo, false);
|
|
100
|
+
xmlHttp.send(null);
|
|
101
|
+
|
|
102
|
+
const redirectUrl = xmlHttp.responseText
|
|
103
|
+
window.location.replace(redirectUrl + "/adm/login/?token=${(0, html_helpers_1.escapeHtml)(platformToken)}");
|
|
104
|
+
</script>
|
|
105
|
+
</body>
|
|
106
|
+
</html>`;
|
|
107
|
+
}
|
|
108
|
+
function generateAuthPageHtml(platformAuthUrl) {
|
|
109
|
+
return `<!DOCTYPE html>
|
|
110
|
+
<html lang="en">
|
|
111
|
+
<head>
|
|
112
|
+
<meta charset="UTF-8">
|
|
113
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
114
|
+
<title>Document</title>
|
|
115
|
+
</head>
|
|
116
|
+
<body>
|
|
117
|
+
<script>
|
|
118
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
119
|
+
const redirectTo = urlParams.get("redirectTo");
|
|
120
|
+
sessionStorage.setItem("redirectTo", redirectTo);
|
|
121
|
+
|
|
122
|
+
window.location.replace("${(0, html_helpers_1.escapeHtml)(platformAuthUrl)}/google");
|
|
123
|
+
</script>
|
|
124
|
+
</body>
|
|
125
|
+
</html>`;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=google-auth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-auth.controller.js","sourceRoot":"","sources":["../../../src/modules/public-site/google-auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,qCAAyC;AACzC,+CAA6C;AAE7C,iEAA4D;AAC5D,2CAAuF;AACvF,2DAAqD;AAG9C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACF;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGjD,AAAN,KAAK,CAAC,IAAI,CAAQ,GAAY,EAAS,GAAa;QAClD,IAAI,GAAG,CAAC,QAAQ,KAAK,iBAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAC7C,MAAM,IAAI,0BAAiB,EAAE,CAAC;QAChC,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,yBAAe,CAAC,CAAC,CAAC;IAClD,CAAC;IAID,WAAW,KAAI,CAAC;IAIV,AAAN,KAAK,CAAC,mBAAmB,CAAQ,GAAY,EAAS,GAAa;QACjE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,IAAI,4BAAmB,CAAC,iCAAiC,CAAC,CAAC;QACnE,CAAC;QAED,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE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;;;QAGhF,CAAC;AACT,CAAC;AAED,SAAS,oBAAoB,CAAC,eAAuB;IACnD,OAAO;;;;;;;;;;;;;+BAasB,IAAA,yBAAU,EAAC,eAAe,CAAC;;;QAGlD,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatDate = void 0;
|
|
7
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
+
require("dayjs/locale/en");
|
|
9
|
+
require("dayjs/locale/fr");
|
|
10
|
+
const localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
|
|
11
|
+
dayjs_1.default.extend(localizedFormat_1.default);
|
|
12
|
+
function formatDate(date, lang, format = "short") {
|
|
13
|
+
const dayjsDate = (0, dayjs_1.default)(date);
|
|
14
|
+
let formattedDate;
|
|
15
|
+
if (format === "long") {
|
|
16
|
+
formattedDate = dayjsDate.locale(lang).format("LL");
|
|
17
|
+
}
|
|
18
|
+
else if (format === "long2") {
|
|
19
|
+
if (lang === "fr") {
|
|
20
|
+
formattedDate = dayjsDate.locale(lang).format("dddd LL");
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
formattedDate = dayjsDate.locale(lang).format("dddd, LL");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (format === "short") {
|
|
27
|
+
formattedDate = dayjsDate.locale(lang).format("l");
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
throw new Error("unknown format");
|
|
31
|
+
}
|
|
32
|
+
return formattedDate;
|
|
33
|
+
}
|
|
34
|
+
exports.formatDate = formatDate;
|
|
35
|
+
//# sourceMappingURL=format-date.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date.helper.js","sourceRoot":"","sources":["../../../../src/modules/public-site/helpers/format-date.helper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2BAAyB;AACzB,2BAAyB;AACzB,mFAA2D;AAE3D,eAAK,CAAC,MAAM,CAAC,yBAAe,CAAC,CAAC;AAE9B,SAAgB,UAAU,CAAC,IAAmB,EAAE,IAAY,EAAE,MAAM,GAAG,OAAO;IAC5E,MAAM,SAAS,GAAG,IAAA,eAAK,EAAC,IAAI,CAAC,CAAC;IAE9B,IAAI,aAAqB,CAAC;IAE1B,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;SAAM,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QAC9B,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;SAAM,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QAC9B,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAnBD,gCAmBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const format_date_helper_1 = require("./format-date.helper");
|
|
5
|
+
(0, vitest_1.describe)("formatDate", () => {
|
|
6
|
+
(0, vitest_1.it)("should return long format (fr)", () => {
|
|
7
|
+
const date = new Date("2023-09-20");
|
|
8
|
+
const formattedDateFr = (0, format_date_helper_1.formatDate)(date, "fr", "long");
|
|
9
|
+
(0, vitest_1.expect)(formattedDateFr).toBe("20 septembre 2023");
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.it)("should return long2 format (fr)", () => {
|
|
12
|
+
const date = new Date("2023-09-20");
|
|
13
|
+
const formattedDateFr = (0, format_date_helper_1.formatDate)(date, "fr", "long2");
|
|
14
|
+
(0, vitest_1.expect)(formattedDateFr).toBe("mercredi 20 septembre 2023");
|
|
15
|
+
});
|
|
16
|
+
(0, vitest_1.it)("should return short format (fr)", () => {
|
|
17
|
+
const date = new Date("2023-09-20");
|
|
18
|
+
const formattedDateFr = (0, format_date_helper_1.formatDate)(date, "fr", "short");
|
|
19
|
+
(0, vitest_1.expect)(formattedDateFr).toBe("20/9/2023");
|
|
20
|
+
});
|
|
21
|
+
(0, vitest_1.it)("should return long format (en)", () => {
|
|
22
|
+
const date = new Date("2023-09-20");
|
|
23
|
+
const formattedDateEn = (0, format_date_helper_1.formatDate)(date, "en", "long");
|
|
24
|
+
(0, vitest_1.expect)(formattedDateEn).toBe("September 20, 2023");
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.it)("should return long2 format (en)", () => {
|
|
27
|
+
const date = new Date("2023-09-20");
|
|
28
|
+
const formattedDateEn = (0, format_date_helper_1.formatDate)(date, "en", "long2");
|
|
29
|
+
(0, vitest_1.expect)(formattedDateEn).toBe("Wednesday, September 20, 2023");
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.it)("should return short format (en)", () => {
|
|
32
|
+
const date = new Date("2023-09-20");
|
|
33
|
+
const formattedDateEn = (0, format_date_helper_1.formatDate)(date, "en", "short");
|
|
34
|
+
(0, vitest_1.expect)(formattedDateEn).toBe("9/20/2023");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=format-date.helper.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date.helper.spec.js","sourceRoot":"","sources":["../../../../src/modules/public-site/helpers/format-date.helper.spec.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,6DAAkD;AAElD,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAA,WAAE,EAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,IAAA,+BAAU,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACvD,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,IAAA,+BAAU,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,IAAA,+BAAU,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,IAAA,+BAAU,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACvD,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,IAAA,+BAAU,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,eAAe,GAAG,IAAA,+BAAU,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,IAAA,eAAM,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFeaturedImageOf = void 0;
|
|
4
|
+
const media_handles_helpers_1 = require("../../../common/media-handles.helpers");
|
|
5
|
+
async function getFeaturedImageOf(siteContext, leafId) {
|
|
6
|
+
const handle = (0, media_handles_helpers_1.getHandleOfFeaturedImage)(leafId);
|
|
7
|
+
const media = await siteContext.mediaStorage.getMedia({ handle });
|
|
8
|
+
if (!media)
|
|
9
|
+
return;
|
|
10
|
+
if (media.kind !== "image") {
|
|
11
|
+
throw new Error(`media '${media.uid}' should be an image (${handle})`);
|
|
12
|
+
}
|
|
13
|
+
return media;
|
|
14
|
+
}
|
|
15
|
+
exports.getFeaturedImageOf = getFeaturedImageOf;
|
|
16
|
+
//# sourceMappingURL=medias.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"medias.helpers.js","sourceRoot":"","sources":["../../../../src/modules/public-site/helpers/medias.helpers.ts"],"names":[],"mappings":";;;AACA,iFAAiF;AAG1E,KAAK,UAAU,kBAAkB,CACtC,WAAwB,EACxB,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gDAAwB,EAAC,MAAM,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAClE,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,GAAG,yBAAyB,MAAM,GAAG,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAXD,gDAWC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.obfuscateAsHtmlLink = exports.generateObfuscatedHtml = void 0;
|
|
4
|
+
const html_helpers_1 = require("../../../common/mail/html-helpers");
|
|
5
|
+
function generateObfuscatedHtml(inputString) {
|
|
6
|
+
const jsString = JSON.stringify(btoa(inputString));
|
|
7
|
+
return `<script>document.write(atob(${jsString}))</script>`;
|
|
8
|
+
}
|
|
9
|
+
exports.generateObfuscatedHtml = generateObfuscatedHtml;
|
|
10
|
+
function obfuscateAsHtmlLink(phoneOrEmail) {
|
|
11
|
+
return generateObfuscatedHtml(generateTargetHtml(phoneOrEmail));
|
|
12
|
+
}
|
|
13
|
+
exports.obfuscateAsHtmlLink = obfuscateAsHtmlLink;
|
|
14
|
+
function generateTargetHtml(str) {
|
|
15
|
+
const inputString = str.trim();
|
|
16
|
+
const linkString = generateLinkString(inputString);
|
|
17
|
+
return `<a href="${(0, html_helpers_1.escapeHtml)(linkString)}">${(0, html_helpers_1.escapeHtml)(inputString)}</a>`;
|
|
18
|
+
}
|
|
19
|
+
function generateLinkString(inputString) {
|
|
20
|
+
if (inputString.includes("@")) {
|
|
21
|
+
return `mailto:${inputString}`;
|
|
22
|
+
}
|
|
23
|
+
const plus = inputString.startsWith("+");
|
|
24
|
+
const allDigits = inputString.replaceAll(/[^0-9]/g, "");
|
|
25
|
+
return plus ? `tel:+${allDigits}` : `tel:${allDigits}`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=obfuscate.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"obfuscate.helper.js","sourceRoot":"","sources":["../../../../src/modules/public-site/helpers/obfuscate.helper.ts"],"names":[],"mappings":";;;AAAA,oEAA+D;AAE/D,SAAgB,sBAAsB,CAAC,WAAmB;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACnD,OAAO,+BAA+B,QAAQ,aAAa,CAAC;AAC9D,CAAC;AAHD,wDAGC;AAED,SAAgB,mBAAmB,CAAC,YAAoB;IACtD,OAAO,sBAAsB,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,kDAEC;AAED,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACnD,OAAO,YAAY,IAAA,yBAAU,EAAC,UAAU,CAAC,KAAK,IAAA,yBAAU,EAAC,WAAW,CAAC,MAAM,CAAC;AAC9E,CAAC;AAED,SAAS,kBAAkB,CAAC,WAAmB;IAC7C,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,UAAU,WAAW,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,SAAS,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParsedSectionId } from "@paroicms/anywhere-lib";
|
|
2
|
+
import { SiteContext } from "../../../site-context/site-context.types";
|
|
3
|
+
import { RenderingContext } from "../liquidjs-rendering/rendering-context";
|
|
4
|
+
export declare function getPublicSiteFieldValues(siteContext: SiteContext, renderingContext: RenderingContext): any;
|
|
5
|
+
export declare function makeSiteFieldDropCacheKeyForRendering(fieldName: string): string;
|
|
6
|
+
export declare function loadPublicFieldValues(siteContext: SiteContext, renderingContext: RenderingContext, options: {
|
|
7
|
+
leafType: string;
|
|
8
|
+
sectionId: ParsedSectionId;
|
|
9
|
+
fieldNames?: string[];
|
|
10
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadPublicFieldValues = exports.makeSiteFieldDropCacheKeyForRendering = exports.getPublicSiteFieldValues = void 0;
|
|
4
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
5
|
+
const liquidjs_1 = require("liquidjs");
|
|
6
|
+
const load_fields_queries_1 = require("../../core/fields/load-fields.queries");
|
|
7
|
+
const site_fields_queries_1 = require("../../core/site-fields/site-fields.queries");
|
|
8
|
+
function getPublicSiteFieldValues(siteContext, renderingContext) {
|
|
9
|
+
const fieldTypes = new Map(siteContext.siteSchema.siteFields.map((f) => [f.name, f]));
|
|
10
|
+
return new (class extends liquidjs_1.Drop {
|
|
11
|
+
async liquidMethodMissing(fieldName) {
|
|
12
|
+
const cacheKey = makeSiteFieldDropCacheKeyForRendering(fieldName);
|
|
13
|
+
const cacheVal = renderingContext.getValueFromCache(cacheKey);
|
|
14
|
+
if (cacheVal.found)
|
|
15
|
+
return cacheVal.val;
|
|
16
|
+
const fType = fieldTypes.get(fieldName);
|
|
17
|
+
if (!fType)
|
|
18
|
+
throw new Error(`unknown site field '${fieldName}'`);
|
|
19
|
+
const val = await (0, site_fields_queries_1.getSiteFieldValue)(siteContext, fieldName);
|
|
20
|
+
const result = val === undefined ? undefined : await makePublicFieldValue(siteContext, fType, val);
|
|
21
|
+
renderingContext.setValueIntoCache(cacheKey, result);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
})();
|
|
25
|
+
}
|
|
26
|
+
exports.getPublicSiteFieldValues = getPublicSiteFieldValues;
|
|
27
|
+
function makeSiteFieldDropCacheKeyForRendering(fieldName) {
|
|
28
|
+
return `drop:siteField:${fieldName}`;
|
|
29
|
+
}
|
|
30
|
+
exports.makeSiteFieldDropCacheKeyForRendering = makeSiteFieldDropCacheKeyForRendering;
|
|
31
|
+
async function loadPublicFieldValues(siteContext, renderingContext, options) {
|
|
32
|
+
const keyPrefix = `drop:${options.sectionId.lang}:${options.sectionId.leafId}:field`;
|
|
33
|
+
const values = await (0, load_fields_queries_1.loadFieldValues)(siteContext, {
|
|
34
|
+
...options,
|
|
35
|
+
fetchFText: "html",
|
|
36
|
+
ignoreUnknownFieldNames: true,
|
|
37
|
+
});
|
|
38
|
+
const fields = (0, anywhere_lib_1.getDocumentOrPartSchema)(siteContext.siteSchema, options.leafType).data.fields;
|
|
39
|
+
const fieldTypes = new Map((fields ?? []).map((f) => [f.name, f]));
|
|
40
|
+
return new (class extends liquidjs_1.Drop {
|
|
41
|
+
async liquidMethodMissing(fieldName) {
|
|
42
|
+
const fType = fieldTypes.get(fieldName);
|
|
43
|
+
if (!fType || !(fType.name in values))
|
|
44
|
+
return;
|
|
45
|
+
const cacheKey = `${keyPrefix}:${fieldName}`;
|
|
46
|
+
const cacheVal = renderingContext.getValueFromCache(cacheKey);
|
|
47
|
+
if (cacheVal.found)
|
|
48
|
+
return cacheVal.val;
|
|
49
|
+
const result = await makePublicFieldValue(siteContext, fType, values[fieldName]);
|
|
50
|
+
renderingContext.setValueIntoCache(cacheKey, result);
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
})();
|
|
54
|
+
}
|
|
55
|
+
exports.loadPublicFieldValues = loadPublicFieldValues;
|
|
56
|
+
async function makePublicFieldValue(siteContext, fType, val) {
|
|
57
|
+
if (fType.type === "media") {
|
|
58
|
+
const handle = val.handle;
|
|
59
|
+
const media = await siteContext.mediaStorage.getMedia({ handle });
|
|
60
|
+
return media ? toPublicMedia(media) : undefined;
|
|
61
|
+
}
|
|
62
|
+
if (fType.type === "gallery") {
|
|
63
|
+
const handle = val.handle;
|
|
64
|
+
const medias = await siteContext.mediaStorage.getMedias({ handle });
|
|
65
|
+
return medias.length === 0 ? undefined : medias.map(toPublicMedia);
|
|
66
|
+
}
|
|
67
|
+
return val;
|
|
68
|
+
}
|
|
69
|
+
function toPublicMedia(media) {
|
|
70
|
+
return {
|
|
71
|
+
kind: media.kind === "image" ? "image" : "file",
|
|
72
|
+
mediaType: media.mediaType,
|
|
73
|
+
uid: media.uid,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=public-field-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-field-values.js","sourceRoot":"","sources":["../../../../src/modules/public-site/helpers/public-field-values.ts"],"names":[],"mappings":";;;AAAA,yDAKgC;AAEhC,uCAAgC;AAEhC,+EAAwE;AACxE,oFAA+E;AAG/E,SAAgB,wBAAwB,CACtC,WAAwB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UAAU,oBAAoB,CACjC,WAAwB,EACxB,KAAgC,EAChC,GAAY;IAEZ,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAI,GAA0B,CAAC,MAAM,CAAC;QAClD,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAI,GAA0B,CAAC,MAAM,CAAC;QAClD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACpE,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAQD,SAAS,aAAa,CAAC,KAAoB;IACzC,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;QAC/C,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDateLiquidJsFilter = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const liquidjs_drop_1 = require("../../../public-payload/liquidjs-drop");
|
|
6
|
+
const format_date_helper_1 = require("../helpers/format-date.helper");
|
|
7
|
+
function formatDateLiquidJsFilter(str, ctx, args) {
|
|
8
|
+
const page = ctx.getSync(["page"]);
|
|
9
|
+
const lang = (0, data_formatters_lib_1.strValOrUndef)(page?.[liquidjs_drop_1.valuesSymbol]?.lang) ?? "en";
|
|
10
|
+
const format = (0, data_formatters_lib_1.strValOrUndef)(args[0]);
|
|
11
|
+
return (0, format_date_helper_1.formatDate)(str, lang, format);
|
|
12
|
+
}
|
|
13
|
+
exports.formatDateLiquidJsFilter = formatDateLiquidJsFilter;
|
|
14
|
+
//# sourceMappingURL=format-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date.js","sourceRoot":"","sources":["../../../../src/modules/public-site/liquidjs-filters/format-date.ts"],"names":[],"mappings":";;;AAAA,oEAA2D;AAE3D,yEAAqE;AACrE,sEAA2D;AAE3D,SAAgB,wBAAwB,CAAC,GAAW,EAAE,GAAY,EAAE,IAAW;IAC7E,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAQ,CAAC;IAE1C,MAAM,IAAI,GAAG,IAAA,mCAAa,EAAC,IAAI,EAAE,CAAC,4BAAY,CAAC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;IAC/D,MAAM,MAAM,GAAG,IAAA,mCAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtC,OAAO,IAAA,+BAAU,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAPD,4DAOC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatNumberLiquidJsFilter = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
6
|
+
const liquidjs_drop_1 = require("../../../public-payload/liquidjs-drop");
|
|
7
|
+
function formatNumberLiquidJsFilter(str, ctx, args) {
|
|
8
|
+
const page = ctx.getSync(["page"]);
|
|
9
|
+
const lang = (0, data_formatters_lib_1.strValOrUndef)(page?.[liquidjs_drop_1.valuesSymbol]?.lang) ?? "en";
|
|
10
|
+
const localizeNumber = new anywhere_lib_1.NumberLocalization(lang);
|
|
11
|
+
const value = (0, data_formatters_lib_1.nbValOrUndef)(str);
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
return localizeNumber.format(value);
|
|
16
|
+
}
|
|
17
|
+
exports.formatNumberLiquidJsFilter = formatNumberLiquidJsFilter;
|
|
18
|
+
//# sourceMappingURL=format-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-number.js","sourceRoot":"","sources":["../../../../src/modules/public-site/liquidjs-filters/format-number.ts"],"names":[],"mappings":";;;AAAA,oEAAyE;AACzE,yDAA4D;AAE5D,yEAAqE;AAErE,SAAgB,0BAA0B,CAAC,GAAW,EAAE,GAAY,EAAE,IAAW;IAC/E,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAQ,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAA,mCAAa,EAAC,IAAI,EAAE,CAAC,4BAAY,CAAC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;IAC/D,MAAM,cAAc,GAAG,IAAI,iCAAkB,CAAC,IAAI,CAAC,CAAC;IAEpD,MAAM,KAAK,GAAG,IAAA,kCAAY,EAAC,GAAG,CAAC,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAXD,gEAWC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.infoLiquidJsFilter = void 0;
|
|
4
|
+
const html_helpers_1 = require("../../../common/mail/html-helpers");
|
|
5
|
+
const liquidjs_drop_1 = require("../../../public-payload/liquidjs-drop");
|
|
6
|
+
async function infoLiquidJsFilter(siteContext, val) {
|
|
7
|
+
const result = await valueToInfo(val);
|
|
8
|
+
const divCss = [
|
|
9
|
+
"background-color: #f8f8f8",
|
|
10
|
+
"border-bottom: 5px dotted #888",
|
|
11
|
+
"border-top: 5px dotted #888",
|
|
12
|
+
"margin: 20px 0",
|
|
13
|
+
];
|
|
14
|
+
return `<div style="${divCss.join("; ")}">${result}</div>`;
|
|
15
|
+
}
|
|
16
|
+
exports.infoLiquidJsFilter = infoLiquidJsFilter;
|
|
17
|
+
async function valueToInfo(val, options = {}) {
|
|
18
|
+
if (val === null)
|
|
19
|
+
return "null";
|
|
20
|
+
if (val === undefined)
|
|
21
|
+
return "-";
|
|
22
|
+
switch (typeof val) {
|
|
23
|
+
case "string":
|
|
24
|
+
return shortenStringAndEsc(val, { max: 80 });
|
|
25
|
+
case "number":
|
|
26
|
+
return `${val}`;
|
|
27
|
+
case "boolean":
|
|
28
|
+
return `${val}`;
|
|
29
|
+
case "bigint":
|
|
30
|
+
return `${val}n`;
|
|
31
|
+
case "symbol":
|
|
32
|
+
return `${(0, html_helpers_1.escapeHtml)(val.toString())} (symbol)`;
|
|
33
|
+
case "function":
|
|
34
|
+
try {
|
|
35
|
+
const result = await val();
|
|
36
|
+
return valueToInfo(result, options);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return "error calling function";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(val)) {
|
|
43
|
+
if (val.length === 0)
|
|
44
|
+
return "<i>empty array</i>";
|
|
45
|
+
const result = [];
|
|
46
|
+
let shortenAll = false;
|
|
47
|
+
for (const rawItem of val) {
|
|
48
|
+
const item = await rawItem;
|
|
49
|
+
const onDemand = typeof item === "function" ? getOnDemandTag() : "";
|
|
50
|
+
result.push(`${onDemand}${await valueToInfo(item, { isNested: true, shortenAll })}`);
|
|
51
|
+
shortenAll = true;
|
|
52
|
+
}
|
|
53
|
+
return `<table>${result.map((item) => `<tr><td>${item}</td></tr>`).join("")}</table>`;
|
|
54
|
+
}
|
|
55
|
+
const obj = val[liquidjs_drop_1.valuesSymbol] ?? val;
|
|
56
|
+
if (obj.kind && (options.shortenAll || (options.isNested && isBigPayload(obj)))) {
|
|
57
|
+
return makeExtractFromObject(obj);
|
|
58
|
+
}
|
|
59
|
+
return await makeTableInfo(obj, options);
|
|
60
|
+
}
|
|
61
|
+
async function makeTableInfo(obj, options) {
|
|
62
|
+
const items = [];
|
|
63
|
+
for (const [name, value] of Object.entries(obj)) {
|
|
64
|
+
items.push({
|
|
65
|
+
name,
|
|
66
|
+
value: await valueToInfo(value, { isNested: true }),
|
|
67
|
+
onDemand: typeof value === "function" ? getOnDemandTag() : "",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (items.length === 0)
|
|
71
|
+
return "<i>empty object</i>";
|
|
72
|
+
const tableCss = [];
|
|
73
|
+
if (options.isNested) {
|
|
74
|
+
tableCss.push("margin: 5px 0", "border: 1px solid #888");
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
tableCss.push("border-bottom: 3px solid #777", "border-right: 3px solid #777");
|
|
78
|
+
}
|
|
79
|
+
const trHeadCss = [
|
|
80
|
+
"background-color: #777",
|
|
81
|
+
"border-bottom: 1px solid #888",
|
|
82
|
+
"color: #fff",
|
|
83
|
+
"font-weight: bold",
|
|
84
|
+
];
|
|
85
|
+
const trCss = ["border-bottom: 1px solid #888"];
|
|
86
|
+
const thCss = [
|
|
87
|
+
"background-color: #eee",
|
|
88
|
+
"padding-left: 10px",
|
|
89
|
+
"text-align: left",
|
|
90
|
+
"width: 170px",
|
|
91
|
+
];
|
|
92
|
+
const tdCss = ["padding: 0 4px"];
|
|
93
|
+
const tableTitle = isBigPayload(obj) || obj.kind === "part" ? obj.kind : undefined;
|
|
94
|
+
return `<table style="${tableCss.join("; ")}">
|
|
95
|
+
${tableTitle
|
|
96
|
+
? `<tr style="${trHeadCss.join("; ")}"><th colspan="2">${tableTitle}</th></tr>`
|
|
97
|
+
: ""}
|
|
98
|
+
${items
|
|
99
|
+
.map(({ name, value, onDemand }) => `<tr style="${trCss.join("; ")}"><th style="${thCss.join("; ")}">${(0, html_helpers_1.escapeHtml)(name)}${onDemand}</th><td style="${tdCss.join("; ")}">${value}</td></tr>`)
|
|
100
|
+
.join("")}
|
|
101
|
+
</table>`;
|
|
102
|
+
}
|
|
103
|
+
function makeExtractFromObject(obj) {
|
|
104
|
+
if (!obj.kind) {
|
|
105
|
+
const keys = Object.keys(obj);
|
|
106
|
+
if (keys.length === 0)
|
|
107
|
+
return "-";
|
|
108
|
+
return `<i>object with properties: ${Object.keys(obj).join(", ")}</i>`;
|
|
109
|
+
}
|
|
110
|
+
const title = obj.title && typeof obj.title === "string" ? shortenStringAndEsc(obj.title) : obj.title;
|
|
111
|
+
switch (obj.kind) {
|
|
112
|
+
case "site":
|
|
113
|
+
return `<i>⇒ site ${obj.lang}</i>`;
|
|
114
|
+
case "detached":
|
|
115
|
+
return `<i>⇒ detached page ${obj.id} (${obj.leafType}), ${title}</i>`;
|
|
116
|
+
case "page":
|
|
117
|
+
return `<i>⇒ page ${obj.id} (${obj.leafType}), ${title}</i>`;
|
|
118
|
+
case "term":
|
|
119
|
+
return `<i>⇒ term ${obj.id} (${obj.leafType}), ${title}</i>`;
|
|
120
|
+
case "part":
|
|
121
|
+
return `<i>⇒ part ${obj.id} (${obj.leafType})</i>`;
|
|
122
|
+
default:
|
|
123
|
+
return `<i>/unknown kind '${obj.kind}'/</i>`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const bigKinds = new Set(["site", "detached", "page", "term"]);
|
|
127
|
+
function isBigPayload(obj) {
|
|
128
|
+
return typeof obj.kind === "string" && bigKinds.has(obj.kind);
|
|
129
|
+
}
|
|
130
|
+
function shortenStringAndEsc(s, { max = 40 } = {}) {
|
|
131
|
+
return (0, html_helpers_1.escapeHtml)(s.length < max ? s : `${s.slice(0, max)}…`);
|
|
132
|
+
}
|
|
133
|
+
function getOnDemandTag() {
|
|
134
|
+
const css = [
|
|
135
|
+
"background: #888",
|
|
136
|
+
"border-radius: 20px",
|
|
137
|
+
"color: #fff",
|
|
138
|
+
"font-size: 10px",
|
|
139
|
+
"padding: 1px 5px",
|
|
140
|
+
"white-space: nowrap",
|
|
141
|
+
];
|
|
142
|
+
return ` <span style="${css.join("; ")}">on demand</span> `;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=info-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-filter.js","sourceRoot":"","sources":["../../../../src/modules/public-site/liquidjs-filters/info-filter.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,yEAAqE;AAG9D,KAAK,UAAU,kBAAkB,CAAC,WAAwB,EAAE,GAAQ;IACzE,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG;QACb,2BAA2B;QAC3B,gCAAgC;QAChC,6BAA6B;QAC7B,gBAAgB;KACjB,CAAC;IACF,OAAO,eAAe,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,MAAM,QAAQ,CAAC;AAC7D,CAAC;AATD,gDASC;AAED,KAAK,UAAU,WAAW,CACxB,GAAQ,EACR,UAAwD,EAAE;IAE1D,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAChC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IAClC,QAAQ,OAAO,GAAG,EAAE,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,mBAAmB,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/C,KAAK,QAAQ;YACX,OAAO,GAA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