@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,168 @@
|
|
|
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.SectionWrapResolver = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
18
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
19
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
20
|
+
const server_lib_1 = require("@paroicms/server-lib");
|
|
21
|
+
const data_format_1 = require("../../../common/data-format");
|
|
22
|
+
const site_context_1 = require("../../../site-context/site-context");
|
|
23
|
+
const jwt_auth_guard_1 = require("../auth/jwt.auth.guard");
|
|
24
|
+
const section_queries_1 = require("./section.queries");
|
|
25
|
+
const section_schema_1 = require("./section.schema");
|
|
26
|
+
let SectionWrapResolver = class SectionWrapResolver {
|
|
27
|
+
async sectionWrap(sectionId) {
|
|
28
|
+
return { ...(0, anywhere_lib_1.parseSectionId)(sectionId), sectionId };
|
|
29
|
+
}
|
|
30
|
+
async pagedSectionWraps({ fqdn }, parentSectionId, start, limit) {
|
|
31
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
32
|
+
const parentId = (0, anywhere_lib_1.parseSectionId)(parentSectionId);
|
|
33
|
+
const result = await (0, section_queries_1.getSectionWraps)(siteContext, {
|
|
34
|
+
parentId,
|
|
35
|
+
pagination: {
|
|
36
|
+
limit,
|
|
37
|
+
start,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
if (result.total === undefined) {
|
|
41
|
+
throw new Error("property total not found");
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
items: result.sectionWraps,
|
|
45
|
+
total: result.total,
|
|
46
|
+
start,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async searchDocuments({ fqdn }, lang, queryString, start, limit) {
|
|
50
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
51
|
+
return await (0, section_queries_1.searchDocuments)(siteContext, {
|
|
52
|
+
lang,
|
|
53
|
+
queryString,
|
|
54
|
+
start,
|
|
55
|
+
limit,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async sectionWraps({ fqdn }, parentSectionId) {
|
|
59
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
60
|
+
const parentId = (0, anywhere_lib_1.parseSectionId)(parentSectionId);
|
|
61
|
+
return (await (0, section_queries_1.getSectionWraps)(siteContext, {
|
|
62
|
+
parentId,
|
|
63
|
+
})).sectionWraps;
|
|
64
|
+
}
|
|
65
|
+
async section({ fqdn }, { lang, leafId }) {
|
|
66
|
+
return (0, data_format_1.sectionEntityToObjectType)(await (0, section_queries_1.findOneSection)(await (0, site_context_1.getSiteContext)(fqdn), {
|
|
67
|
+
lang,
|
|
68
|
+
leafId,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
async translations({ fqdn }, { leafId }) {
|
|
72
|
+
const { mainCn } = await (0, site_context_1.getSiteContext)(fqdn);
|
|
73
|
+
const rows = await mainCn
|
|
74
|
+
.createQueryBuilder()
|
|
75
|
+
.select("section.lang", "lang")
|
|
76
|
+
.from("PaSection", "section")
|
|
77
|
+
.where("section.leafId = :leafId", { leafId })
|
|
78
|
+
.getRawMany();
|
|
79
|
+
const translations = rows.map((row) => {
|
|
80
|
+
const lang = (0, data_formatters_lib_1.strVal)(row.lang);
|
|
81
|
+
return {
|
|
82
|
+
lang,
|
|
83
|
+
sectionId: (0, anywhere_lib_1.encodeSectionId)({
|
|
84
|
+
lang,
|
|
85
|
+
leafId,
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
return translations;
|
|
90
|
+
}
|
|
91
|
+
async breadcrumb({ fqdn }, { leafId, lang }) {
|
|
92
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
93
|
+
const breadcrumb = await (0, section_queries_1.getBreadcrumb)(siteContext, (0, server_lib_1.createNoTracker)(), { leafId, lang });
|
|
94
|
+
return breadcrumb.map((item) => ({
|
|
95
|
+
lang: item.documentId.lang,
|
|
96
|
+
leafId: item.documentId.leafId,
|
|
97
|
+
leafType: item.leafType,
|
|
98
|
+
sectionId: (0, anywhere_lib_1.encodeSectionId)(item.documentId),
|
|
99
|
+
title: item.title,
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
exports.SectionWrapResolver = SectionWrapResolver;
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, graphql_1.Query)(() => section_schema_1.SectionWrapObjectType),
|
|
106
|
+
__param(0, (0, graphql_1.Args)("sectionId", { type: () => graphql_1.ID })),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [String]),
|
|
109
|
+
__metadata("design:returntype", Promise)
|
|
110
|
+
], SectionWrapResolver.prototype, "sectionWrap", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, graphql_1.Query)(() => section_schema_1.PagedSectionWrapsObjectType),
|
|
113
|
+
__param(0, (0, graphql_1.Context)()),
|
|
114
|
+
__param(1, (0, graphql_1.Args)("parentSectionId", { type: () => graphql_1.ID, description: "lang:leafId" })),
|
|
115
|
+
__param(2, (0, graphql_1.Args)("start", { type: () => graphql_1.Int })),
|
|
116
|
+
__param(3, (0, graphql_1.Args)("limit", { type: () => graphql_1.Int })),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", [Object, String, Number, Number]),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
120
|
+
], SectionWrapResolver.prototype, "pagedSectionWraps", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, graphql_1.Query)(() => section_schema_1.PagedSectionWrapsObjectType),
|
|
123
|
+
__param(0, (0, graphql_1.Context)()),
|
|
124
|
+
__param(1, (0, graphql_1.Args)("lang", { type: () => String })),
|
|
125
|
+
__param(2, (0, graphql_1.Args)("queryString", { type: () => String })),
|
|
126
|
+
__param(3, (0, graphql_1.Args)("start", { type: () => graphql_1.Int })),
|
|
127
|
+
__param(4, (0, graphql_1.Args)("limit", { type: () => graphql_1.Int })),
|
|
128
|
+
__metadata("design:type", Function),
|
|
129
|
+
__metadata("design:paramtypes", [Object, String, String, Number, Number]),
|
|
130
|
+
__metadata("design:returntype", Promise)
|
|
131
|
+
], SectionWrapResolver.prototype, "searchDocuments", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, graphql_1.Query)(() => [section_schema_1.SectionWrapObjectType]),
|
|
134
|
+
__param(0, (0, graphql_1.Context)()),
|
|
135
|
+
__param(1, (0, graphql_1.Args)("parentSectionId", { type: () => graphql_1.ID, description: "lang:leafId" })),
|
|
136
|
+
__metadata("design:type", Function),
|
|
137
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
138
|
+
__metadata("design:returntype", Promise)
|
|
139
|
+
], SectionWrapResolver.prototype, "sectionWraps", null);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, graphql_1.ResolveField)(() => section_schema_1.SectionObjectType),
|
|
142
|
+
__param(0, (0, graphql_1.Context)()),
|
|
143
|
+
__param(1, (0, graphql_1.Parent)()),
|
|
144
|
+
__metadata("design:type", Function),
|
|
145
|
+
__metadata("design:paramtypes", [Object, section_schema_1.SectionWrapObjectType]),
|
|
146
|
+
__metadata("design:returntype", Promise)
|
|
147
|
+
], SectionWrapResolver.prototype, "section", null);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, graphql_1.ResolveField)(() => [section_schema_1.SectionTranslationObjectType]),
|
|
150
|
+
__param(0, (0, graphql_1.Context)()),
|
|
151
|
+
__param(1, (0, graphql_1.Parent)()),
|
|
152
|
+
__metadata("design:type", Function),
|
|
153
|
+
__metadata("design:paramtypes", [Object, section_schema_1.SectionWrapObjectType]),
|
|
154
|
+
__metadata("design:returntype", Promise)
|
|
155
|
+
], SectionWrapResolver.prototype, "translations", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, graphql_1.ResolveField)(() => [section_schema_1.BreadcrumbItemObjectType]),
|
|
158
|
+
__param(0, (0, graphql_1.Context)()),
|
|
159
|
+
__param(1, (0, graphql_1.Parent)()),
|
|
160
|
+
__metadata("design:type", Function),
|
|
161
|
+
__metadata("design:paramtypes", [Object, section_schema_1.SectionWrapObjectType]),
|
|
162
|
+
__metadata("design:returntype", Promise)
|
|
163
|
+
], SectionWrapResolver.prototype, "breadcrumb", null);
|
|
164
|
+
exports.SectionWrapResolver = SectionWrapResolver = __decorate([
|
|
165
|
+
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
166
|
+
(0, graphql_1.Resolver)(() => section_schema_1.SectionWrapObjectType)
|
|
167
|
+
], SectionWrapResolver);
|
|
168
|
+
//# sourceMappingURL=section-wrap.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-wrap.resolver.js","sourceRoot":"","sources":["../../../../src/modules/core/section/section-wrap.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CAAgG;AAChG,oEAAoD;AACpD,yDAA8E;AAC9E,qDAAuD;AACvD,6DAAwE;AACxE,qEAAoE;AAEpE,2DAAsD;AACtD,uDAAoG;AACp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xC;8BApIU,mBAAmB;IAF/B,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,sCAAqB,CAAC;GACzB,mBAAmB,CAqI/B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.SectionEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let SectionEntity = class SectionEntity {
|
|
15
|
+
leafId;
|
|
16
|
+
lang;
|
|
17
|
+
ready;
|
|
18
|
+
idToString() {
|
|
19
|
+
this.leafId = this.leafId?.toString();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.SectionEntity = SectionEntity;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: "bigint", primary: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], SectionEntity.prototype, "leafId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: "varchar", primary: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], SectionEntity.prototype, "lang", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: "boolean", default: false }),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], SectionEntity.prototype, "ready", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.AfterLoad)(),
|
|
37
|
+
__metadata("design:type", Function),
|
|
38
|
+
__metadata("design:paramtypes", []),
|
|
39
|
+
__metadata("design:returntype", void 0)
|
|
40
|
+
], SectionEntity.prototype, "idToString", null);
|
|
41
|
+
exports.SectionEntity = SectionEntity = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)("PaSection")
|
|
43
|
+
], SectionEntity);
|
|
44
|
+
//# sourceMappingURL=section.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.model.js","sourceRoot":"","sources":["../../../../src/modules/core/section/section.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AAG7C,IAAM,aAAa,GAAnB,MAAM,aAAa;IAExB,MAAM,CAAU;IAGhB,IAAI,CAAU;IAGd,KAAK,CAAW;IAGhB,UAAU;QACR,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACxC,CAAC;CACF,CAAA;AAdY,sCAAa;AAExB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6CAC1B;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4CAC5B;AAGhB;IADC,IAAA,mBAAS,GAAE;;;;+CAGX;wBAbU,aAAa;IADzB,IAAA,gBAAM,EAAC,WAAW,CAAC;GACP,aAAa,CAczB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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.SectionModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const section_wrap_resolver_1 = require("./section-wrap.resolver");
|
|
12
|
+
const section_resolver_1 = require("./section.resolver");
|
|
13
|
+
let SectionModule = class SectionModule {
|
|
14
|
+
};
|
|
15
|
+
exports.SectionModule = SectionModule;
|
|
16
|
+
exports.SectionModule = SectionModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
providers: [section_resolver_1.SectionResolver, section_wrap_resolver_1.SectionWrapResolver],
|
|
19
|
+
})
|
|
20
|
+
], SectionModule);
|
|
21
|
+
//# sourceMappingURL=section.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.module.js","sourceRoot":"","sources":["../../../../src/modules/core/section/section.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mEAA8D;AAC9D,yDAAqD;AAK9C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAHzB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,kCAAe,EAAE,2CAAmB,CAAC;KAClD,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ParsedSectionId } from "@paroicms/anywhere-lib";
|
|
2
|
+
import { Tracker } from "@paroicms/server-lib";
|
|
3
|
+
import { DataSource, EntityManager } from "typeorm";
|
|
4
|
+
import { SiteContext } from "../../../site-context/site-context.types";
|
|
5
|
+
import { SectionEntity } from "./section.model";
|
|
6
|
+
import { PagedSectionWrapsObjectType, SectionObjectType } from "./section.schema";
|
|
7
|
+
export interface ChildSectionsListWithTotal {
|
|
8
|
+
list: SectionEntity[];
|
|
9
|
+
total: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function leafSections({ mainCn }: SiteContext, leafId: string): Promise<SectionEntity[]>;
|
|
12
|
+
export declare function findOneSection({ mainCn }: SiteContext, sectionId: ParsedSectionId): Promise<SectionEntity>;
|
|
13
|
+
export declare function getSectionWraps(siteContext: Pick<SiteContext, "mainCn" | "siteSchema">, { parentId, pagination, }: {
|
|
14
|
+
parentId: ParsedSectionId;
|
|
15
|
+
pagination?: {
|
|
16
|
+
start: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
};
|
|
19
|
+
}): Promise<{
|
|
20
|
+
total?: number;
|
|
21
|
+
sectionWraps: {
|
|
22
|
+
section: SectionObjectType;
|
|
23
|
+
sectionId: string;
|
|
24
|
+
lang: string;
|
|
25
|
+
leafId: string;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
28
|
+
export interface PaginationOptions {
|
|
29
|
+
start: number;
|
|
30
|
+
limit: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function setSectionReady(siteContext: SiteContext, { sectionId, ready }: {
|
|
33
|
+
sectionId: ParsedSectionId;
|
|
34
|
+
ready: boolean;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
export interface BreadcrumbItem {
|
|
37
|
+
documentId: ParsedSectionId;
|
|
38
|
+
leafType: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function getBreadcrumb(siteContext: Pick<SiteContext, "mainCn" | "siteSchema">, tracker: Tracker, documentId: ParsedSectionId, options?: {
|
|
42
|
+
ensurePublished?: boolean;
|
|
43
|
+
skipHome?: boolean;
|
|
44
|
+
}): Promise<BreadcrumbItem[]>;
|
|
45
|
+
export declare function isOrphanLeaf(cn: EntityManager | DataSource, leafId: string): Promise<boolean>;
|
|
46
|
+
export declare function searchDocuments(siteContext: SiteContext, options: {
|
|
47
|
+
lang: string;
|
|
48
|
+
queryString: string;
|
|
49
|
+
start: number;
|
|
50
|
+
limit: number;
|
|
51
|
+
}): Promise<PagedSectionWrapsObjectType>;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchDocuments = exports.isOrphanLeaf = exports.getBreadcrumb = exports.setSectionReady = exports.getSectionWraps = exports.findOneSection = exports.leafSections = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
6
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
7
|
+
const child_ordering_query_1 = require("../../../common/child-ordering-query");
|
|
8
|
+
const data_format_1 = require("../../../common/data-format");
|
|
9
|
+
const ddl_migration_1 = require("../../../site-context/db-init/ddl-migration");
|
|
10
|
+
const search_text_queries_1 = require("../../public-api/search-text/search-text.queries");
|
|
11
|
+
const leaf_queries_1 = require("../leaf/leaf.queries");
|
|
12
|
+
const section_model_1 = require("./section.model");
|
|
13
|
+
async function leafSections({ mainCn }, leafId) {
|
|
14
|
+
return await mainCn.getRepository(section_model_1.SectionEntity).find({
|
|
15
|
+
where: { leafId },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.leafSections = leafSections;
|
|
19
|
+
async function findOneSection({ mainCn }, sectionId) {
|
|
20
|
+
const section = await mainCn.getRepository(section_model_1.SectionEntity).findOne({
|
|
21
|
+
where: sectionId,
|
|
22
|
+
});
|
|
23
|
+
if (!section) {
|
|
24
|
+
throw new common_1.NotFoundException(`can't find section ${sectionId.lang}:${sectionId.leafId}`);
|
|
25
|
+
}
|
|
26
|
+
return section;
|
|
27
|
+
}
|
|
28
|
+
exports.findOneSection = findOneSection;
|
|
29
|
+
async function getSectionWraps(siteContext, { parentId, pagination, }) {
|
|
30
|
+
let total;
|
|
31
|
+
let sectionEntities;
|
|
32
|
+
if (pagination) {
|
|
33
|
+
const childSectionsResult = await getChildSectionsForAllLangs(siteContext, {
|
|
34
|
+
parentLeafId: parentId.leafId,
|
|
35
|
+
pagination,
|
|
36
|
+
});
|
|
37
|
+
sectionEntities = childSectionsResult.list;
|
|
38
|
+
total = childSectionsResult.total;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
sectionEntities = await getChildSectionsForAllLangs(siteContext, {
|
|
42
|
+
parentLeafId: parentId.leafId,
|
|
43
|
+
pagination,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const byLeafIdMap = new Map();
|
|
47
|
+
sectionEntities.forEach((sectionEntity) => {
|
|
48
|
+
let list = byLeafIdMap.get(sectionEntity.leafId);
|
|
49
|
+
if (!list) {
|
|
50
|
+
list = [];
|
|
51
|
+
byLeafIdMap.set(sectionEntity.leafId, list);
|
|
52
|
+
}
|
|
53
|
+
list.push(sectionEntity);
|
|
54
|
+
});
|
|
55
|
+
const result = [];
|
|
56
|
+
byLeafIdMap.forEach((list) => {
|
|
57
|
+
let found = list.find((i) => i.lang === parentId.lang);
|
|
58
|
+
found ??= list[0];
|
|
59
|
+
result.push(found);
|
|
60
|
+
});
|
|
61
|
+
const sectionWraps = result.map((item) => {
|
|
62
|
+
return {
|
|
63
|
+
...(0, data_format_1.sectionWrapToObjectType)(item),
|
|
64
|
+
section: (0, data_format_1.sectionEntityToObjectType)(item),
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
total,
|
|
69
|
+
sectionWraps,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
exports.getSectionWraps = getSectionWraps;
|
|
73
|
+
async function getChildSectionsForAllLangs(siteContext, options) {
|
|
74
|
+
const parentLeafType = await (0, leaf_queries_1.getLeafTypeOf)(siteContext, options.parentLeafId);
|
|
75
|
+
const leafTypes = (0, anywhere_lib_1.childrenClassicLeafTypesOf)(siteContext.siteSchema, parentLeafType);
|
|
76
|
+
const parentDocumentType = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteContext.siteSchema, parentLeafType);
|
|
77
|
+
const query = createBaseChildSectionsForAllLangsQueryBuilder(siteContext, {
|
|
78
|
+
parentLeafId: options.parentLeafId,
|
|
79
|
+
leafTypes,
|
|
80
|
+
})
|
|
81
|
+
.select("s.leafId", "leafId")
|
|
82
|
+
.addSelect("s.lang", "lang")
|
|
83
|
+
.addSelect("s.ready", "ready");
|
|
84
|
+
(0, child_ordering_query_1.applyChildOrderingOnQuery)(siteContext, {
|
|
85
|
+
query,
|
|
86
|
+
parentDocumentType,
|
|
87
|
+
leftJoinDocument: true,
|
|
88
|
+
});
|
|
89
|
+
if (options.pagination) {
|
|
90
|
+
query.limit(options.pagination.limit).offset(options.pagination.start);
|
|
91
|
+
}
|
|
92
|
+
const rows = await query.getRawMany();
|
|
93
|
+
const formatedRows = rows.map((row) => ({
|
|
94
|
+
leafId: (0, data_formatters_lib_1.strVal)(row.leafId),
|
|
95
|
+
lang: (0, data_formatters_lib_1.strVal)(row.lang),
|
|
96
|
+
ready: (0, data_formatters_lib_1.boolVal)(row.ready),
|
|
97
|
+
}));
|
|
98
|
+
if (options.pagination) {
|
|
99
|
+
let total;
|
|
100
|
+
if (rows.length < options.pagination.limit) {
|
|
101
|
+
total = options.pagination.start + rows.length;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
total = await countChildSectionsForAllLangs(siteContext, {
|
|
105
|
+
parentLeafId: options.parentLeafId,
|
|
106
|
+
leafTypes,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
list: formatedRows,
|
|
111
|
+
total,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return formatedRows;
|
|
115
|
+
}
|
|
116
|
+
async function countChildSectionsForAllLangs(siteContext, { parentLeafId, leafTypes }) {
|
|
117
|
+
const row = await createBaseChildSectionsForAllLangsQueryBuilder(siteContext, {
|
|
118
|
+
parentLeafId,
|
|
119
|
+
leafTypes,
|
|
120
|
+
})
|
|
121
|
+
.select("count(1)", "total")
|
|
122
|
+
.getRawOne();
|
|
123
|
+
return (0, data_formatters_lib_1.nbVal)(row.total);
|
|
124
|
+
}
|
|
125
|
+
function createBaseChildSectionsForAllLangsQueryBuilder(siteContext, { parentLeafId, leafTypes, }) {
|
|
126
|
+
return siteContext.mainCn
|
|
127
|
+
.createQueryBuilder()
|
|
128
|
+
.from("PaSection", "s")
|
|
129
|
+
.innerJoin("PaLeaf", "l", "l.id = s.leafId")
|
|
130
|
+
.where("l.parentId = :parentId", {
|
|
131
|
+
parentId: parentLeafId,
|
|
132
|
+
})
|
|
133
|
+
.andWhere("l.leafType in (:...leafTypes)", { leafTypes });
|
|
134
|
+
}
|
|
135
|
+
async function setSectionReady(siteContext, { sectionId, ready }) {
|
|
136
|
+
await siteContext.mainCn.getRepository(section_model_1.SectionEntity).update(sectionId, { ready });
|
|
137
|
+
}
|
|
138
|
+
exports.setSectionReady = setSectionReady;
|
|
139
|
+
async function getBreadcrumb(siteContext, tracker, documentId, options = {}) {
|
|
140
|
+
const depth = await (0, leaf_queries_1.getLeafDepth)(siteContext, tracker, documentId.leafId);
|
|
141
|
+
if (depth === 0)
|
|
142
|
+
return [];
|
|
143
|
+
const lang = documentId.lang;
|
|
144
|
+
const query = siteContext.mainCn
|
|
145
|
+
.createQueryBuilder()
|
|
146
|
+
.from("PaLeaf", `l${depth}`)
|
|
147
|
+
.where(`l${depth}.id = :leafId`, { leafId: documentId.leafId });
|
|
148
|
+
if (options.ensurePublished)
|
|
149
|
+
queryEnsurePublished(query, depth, lang);
|
|
150
|
+
const minDepth = options.skipHome ? 1 : 0;
|
|
151
|
+
let prev = depth;
|
|
152
|
+
for (let cur = depth - 1; cur >= minDepth; --cur) {
|
|
153
|
+
query
|
|
154
|
+
.addSelect(`l${cur}.id`, `leafId${cur}`)
|
|
155
|
+
.addSelect(`l${cur}.leafType`, `leafType${cur}`)
|
|
156
|
+
.addSelect(`d${cur}.title`, `title${cur}`)
|
|
157
|
+
.innerJoin("PaLeaf", `l${cur}`, `l${cur}.id = l${prev}.parentId`)
|
|
158
|
+
.leftJoin("PaDocument", `d${cur}`, `d${cur}.leafId = l${cur}.id and d${cur}.lang = :lang`, {
|
|
159
|
+
lang,
|
|
160
|
+
});
|
|
161
|
+
if (options.ensurePublished)
|
|
162
|
+
queryEnsurePublished(query, cur, lang);
|
|
163
|
+
prev = cur;
|
|
164
|
+
}
|
|
165
|
+
const row = await query.getRawOne();
|
|
166
|
+
tracker.trackAccess(ddl_migration_1.dbSchemaName, "PaLeaf", "read");
|
|
167
|
+
if (!row)
|
|
168
|
+
throw new Error(`cannot get breadcrumb of '${documentId.lang}:${documentId.leafId}'`);
|
|
169
|
+
const result = [];
|
|
170
|
+
for (let d = minDepth; d < depth; ++d) {
|
|
171
|
+
const leafId = (0, data_formatters_lib_1.strVal)(row[`leafId${d}`], { varName: `leafId${d}` });
|
|
172
|
+
const leafType = (0, data_formatters_lib_1.strVal)(row[`leafType${d}`], { varName: `leafType${d}` });
|
|
173
|
+
const title = (0, data_formatters_lib_1.strValOrUndef)(row[`title${d}`], { varName: `title${d}` });
|
|
174
|
+
if (options.ensurePublished) {
|
|
175
|
+
const documentType = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteContext.siteSchema, leafType);
|
|
176
|
+
if (!documentType.withData)
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
result.push({
|
|
180
|
+
documentId: { leafId, lang },
|
|
181
|
+
leafType,
|
|
182
|
+
title,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
exports.getBreadcrumb = getBreadcrumb;
|
|
188
|
+
function queryEnsurePublished(query, d, lang) {
|
|
189
|
+
query
|
|
190
|
+
.innerJoin("PaSection", `s${d}`, `s${d}.leafId = l${d}.id and s${d}.lang = :lang`, {
|
|
191
|
+
lang,
|
|
192
|
+
})
|
|
193
|
+
.andWhere(`s${d}.ready = 1`)
|
|
194
|
+
.andWhere(`l${d}.publishDate <= current_timestamp`);
|
|
195
|
+
}
|
|
196
|
+
async function isOrphanLeaf(cn, leafId) {
|
|
197
|
+
const count = await cn.getRepository(section_model_1.SectionEntity).count({ where: { leafId } });
|
|
198
|
+
return count === 0;
|
|
199
|
+
}
|
|
200
|
+
exports.isOrphanLeaf = isOrphanLeaf;
|
|
201
|
+
async function searchDocuments(siteContext, options) {
|
|
202
|
+
const { queryString, lang, start, limit } = options;
|
|
203
|
+
const words = (0, data_formatters_lib_1.strVal)(queryString)
|
|
204
|
+
.split(/\s+/)
|
|
205
|
+
.filter((word) => word.length >= 2);
|
|
206
|
+
if (words.length === 0)
|
|
207
|
+
return { total: 0, start, items: [] };
|
|
208
|
+
const result = await (0, search_text_queries_1.searchText)(siteContext, {
|
|
209
|
+
lang: (0, data_formatters_lib_1.strVal)(lang),
|
|
210
|
+
words,
|
|
211
|
+
start: (0, data_formatters_lib_1.nbVal)(start),
|
|
212
|
+
limit: (0, data_formatters_lib_1.nbVal)(limit),
|
|
213
|
+
});
|
|
214
|
+
const sectionWraps = result.map((row) => {
|
|
215
|
+
return {
|
|
216
|
+
sectionId: (0, anywhere_lib_1.encodeSectionId)({ lang: row.lang, leafId: row.leafId }),
|
|
217
|
+
lang: row.lang,
|
|
218
|
+
leafId: row.leafId,
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
return {
|
|
222
|
+
total: sectionWraps.length,
|
|
223
|
+
items: sectionWraps,
|
|
224
|
+
start,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
exports.searchDocuments = searchDocuments;
|
|
228
|
+
//# sourceMappingURL=section.queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.queries.js","sourceRoot":"","sources":["../../../../src/modules/core/section/section.queries.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AACnD,oEAAmF;AACnF,yDAMgC;AAGhC,+EAAiF;AACjF,6DAAiG;AACjG,+EAA2E;AAE3E,0FAA8E;AAC9E,uDAAmE;AACnE,mDAAgD;AAYzC,KAAK,UAAU,YAAY,CAAC,EAAE,MAAM,EAAe,EAAE,MAAc;IACxE,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,6BAAa,CAAC,CAAC,IAAI,CAAC;QACpD,KAAK,EAAE,EAAE,MAAM,EAAE;KAClB,CAAC,CAAC;AACL,CAAC;AAJD,oCAIC;AAEM,KAAK,UAAU,cAAc,CAAC,EAAE,MAAM,EAAe,EAAE,SAA0B;IACtF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,6BAAa,CAAC,CAAC,OAAO,CAAC;QAChE,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IAEH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,0BAAiB,CAAC,sBAAsB,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AATD,wCASC;AAEM,KAAK,UAAU,eAAe,CACnC,WAAuD,EACvD,EACE,QAAQ,EACR,UAAU,GAOX;IAUD,IAAI,KAAyB,CAAC;IAC9B,IAAI,eAAgC,CAAC;IACrC,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,mBAAmB,GAAG,MAAM,2BAA2B,CAAC,WAAW,EAAE;YACzE,YAAY,EAAE,QAAQ,CAAC,MAAM;YAC7B,UAAU;SACX,CAAC,CAAC;QAEH,eAAe,GAAG,mBAAmB,CAAC,IAAI,CAAC;QAC3C,KAAK,GAAG,mBAAmB,C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AM,MAAM,GAAG,MAAM,IAAA,gCAAU,EAAC,WAAW,EAAE;QAC3C,IAAI,EAAE,IAAA,4BAAM,EAAC,IAAI,CAAC;QAClB,KAAK;QACL,KAAK,EAAE,IAAA,2BAAK,EAAC,KAAK,CAAC;QACnB,KAAK,EAAE,IAAA,2BAAK,EAAC,KAAK,CAAC;KACpB,CAAC,CAAC;IAEH,MAAM,YAAY,GAA4B,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/D,OAAO;YACL,SAAS,EAAE,IAAA,8BAAe,EAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC;YAClE,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,GAAG,CAAC,MAAM;SACnB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,YAAY,CAAC,MAAM;QAC1B,KAAK,EAAE,YAAY;QACnB,KAAK;KACN,CAAC;AACJ,CAAC;AAhCD,0CAgCC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GraphqlContext } from "../../graphql.types";
|
|
2
|
+
import { SectionObjectType } from "./section.schema";
|
|
3
|
+
export declare class SectionResolver {
|
|
4
|
+
setSectionReady({ fqdn }: GraphqlContext, sectionId: string, ready: boolean): Promise<SectionObjectType>;
|
|
5
|
+
translatedInto({ fqdn }: GraphqlContext, { leafId }: SectionObjectType): Promise<unknown[]>;
|
|
6
|
+
routingPointIds({ fqdn }: GraphqlContext): Promise<string>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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.SectionResolver = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
18
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
19
|
+
const data_format_1 = require("../../../common/data-format");
|
|
20
|
+
const site_context_1 = require("../../../site-context/site-context");
|
|
21
|
+
const jwt_auth_guard_1 = require("../auth/jwt.auth.guard");
|
|
22
|
+
const section_queries_1 = require("./section.queries");
|
|
23
|
+
const section_schema_1 = require("./section.schema");
|
|
24
|
+
let SectionResolver = class SectionResolver {
|
|
25
|
+
async setSectionReady({ fqdn }, sectionId, ready) {
|
|
26
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
27
|
+
const parsedId = (0, anywhere_lib_1.parseSectionId)(sectionId);
|
|
28
|
+
await (0, section_queries_1.setSectionReady)(siteContext, {
|
|
29
|
+
sectionId: parsedId,
|
|
30
|
+
ready,
|
|
31
|
+
});
|
|
32
|
+
return (0, data_format_1.sectionEntityToObjectType)(await (0, section_queries_1.findOneSection)(siteContext, parsedId));
|
|
33
|
+
}
|
|
34
|
+
async translatedInto({ fqdn }, { leafId }) {
|
|
35
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
36
|
+
const sections = await siteContext.mainCn
|
|
37
|
+
.createQueryBuilder()
|
|
38
|
+
.select("s.lang", "lang")
|
|
39
|
+
.from("PaSection", "s")
|
|
40
|
+
.where("s.leafId = :leafId", { leafId })
|
|
41
|
+
.getRawMany();
|
|
42
|
+
return sections.map((item) => item.lang);
|
|
43
|
+
}
|
|
44
|
+
async routingPointIds({ fqdn }) {
|
|
45
|
+
const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
|
|
46
|
+
return JSON.stringify(siteContext.siteIds.homeIds);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.SectionResolver = SectionResolver;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, graphql_1.Mutation)(() => section_schema_1.SectionObjectType),
|
|
52
|
+
__param(0, (0, graphql_1.Context)()),
|
|
53
|
+
__param(1, (0, graphql_1.Args)("sectionId", { type: () => graphql_1.ID })),
|
|
54
|
+
__param(2, (0, graphql_1.Args)("ready", { type: () => Boolean })),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", [Object, String, Boolean]),
|
|
57
|
+
__metadata("design:returntype", Promise)
|
|
58
|
+
], SectionResolver.prototype, "setSectionReady", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, graphql_1.ResolveField)(() => [String]),
|
|
61
|
+
__param(0, (0, graphql_1.Context)()),
|
|
62
|
+
__param(1, (0, graphql_1.Parent)()),
|
|
63
|
+
__metadata("design:type", Function),
|
|
64
|
+
__metadata("design:paramtypes", [Object, section_schema_1.SectionObjectType]),
|
|
65
|
+
__metadata("design:returntype", Promise)
|
|
66
|
+
], SectionResolver.prototype, "translatedInto", null);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, graphql_1.Query)(() => String),
|
|
69
|
+
__param(0, (0, graphql_1.Context)()),
|
|
70
|
+
__metadata("design:type", Function),
|
|
71
|
+
__metadata("design:paramtypes", [Object]),
|
|
72
|
+
__metadata("design:returntype", Promise)
|
|
73
|
+
], SectionResolver.prototype, "routingPointIds", null);
|
|
74
|
+
exports.SectionResolver = SectionResolver = __decorate([
|
|
75
|
+
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
76
|
+
(0, graphql_1.Resolver)(() => section_schema_1.SectionObjectType)
|
|
77
|
+
], SectionResolver);
|
|
78
|
+
//# sourceMappingURL=section.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.resolver.js","sourceRoot":"","sources":["../../../../src/modules/core/section/section.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CASyB;AACzB,yDAA6D;AAC7D,6DAAwE;AACxE,qEAAoE;AAEpE,2DAAsD;AACtD,uDAAoE;AACpE,qDAAqD;AAI9C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,eAAe,CACR,EAAE,IAAI,EAAkB,EACI,SAAiB,EAChB,KAAc;QAEtD,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAA,6BAAc,EAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,IAAA,iCAAe,EAAC,WAAW,EAAE;YACjC,SAAS,EAAE,QAAQ;YACnB,KAAK;SACN,CAAC,CAAC;QACH,OAAO,IAAA,uCAAyB,EAAC,MAAM,IAAA,gCAAc,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChF,CAAC;IAGK,AAAN,KAAK,CAAC,cAAc,CACP,EAAE,IAAI,EAAkB,EAEnC,EAAE,MAAM,EAAqB;QAE7B,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,CAAC;QAE/C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,MAAM;aACtC,kBAAkB,EAAE;aACpB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;aACxB,IAAI,CAAC,WAAW,EAA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