@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 @@
|
|
|
1
|
+
{"version":3,"file":"leaf.resolver.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf/leaf.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;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? 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.LeafObjectType = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
let LeafObjectType = class LeafObjectType {
|
|
15
|
+
id;
|
|
16
|
+
leafType;
|
|
17
|
+
parentId;
|
|
18
|
+
relativeId;
|
|
19
|
+
publishDate;
|
|
20
|
+
};
|
|
21
|
+
exports.LeafObjectType = LeafObjectType;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, graphql_1.Field)(() => graphql_1.ID),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], LeafObjectType.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, graphql_1.Field)(() => String),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], LeafObjectType.prototype, "leafType", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, graphql_1.Field)(() => graphql_1.ID, { nullable: true }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], LeafObjectType.prototype, "parentId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, graphql_1.Field)(() => String),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], LeafObjectType.prototype, "relativeId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, graphql_1.Field)(() => Date, { nullable: true }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], LeafObjectType.prototype, "publishDate", void 0);
|
|
42
|
+
exports.LeafObjectType = LeafObjectType = __decorate([
|
|
43
|
+
(0, graphql_1.ObjectType)("Leaf")
|
|
44
|
+
], LeafObjectType);
|
|
45
|
+
//# sourceMappingURL=leaf.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaf.schema.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf/leaf.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAwD;AAGjD,IAAM,cAAc,GAApB,MAAM,cAAc;IAEzB,EAAE,CAAU;IAGZ,QAAQ,CAAU;IAGlB,QAAQ,CAAU;IAGlB,UAAU,CAAU;IAGpB,WAAW,CAAQ;CACpB,CAAA;AAfY,wCAAc;AAEzB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,YAAE,CAAC;;0CACJ;AAGZ;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;gDACF;AAGlB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,YAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAClB;AAGlB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;kDACA;AAGpB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACxB,IAAI;mDAAC;yBAdR,cAAc;IAD1B,IAAA,oBAAU,EAAC,MAAM,CAAC;GACN,cAAc,CAe1B"}
|
|
@@ -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.LeafItemEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let LeafItemEntity = class LeafItemEntity {
|
|
15
|
+
leafId;
|
|
16
|
+
listName;
|
|
17
|
+
itemNum;
|
|
18
|
+
idToString() {
|
|
19
|
+
this.leafId = this.leafId?.toString();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.LeafItemEntity = LeafItemEntity;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ primary: true, type: "bigint" }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], LeafItemEntity.prototype, "leafId", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100 }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], LeafItemEntity.prototype, "listName", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], LeafItemEntity.prototype, "itemNum", 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
|
+
], LeafItemEntity.prototype, "idToString", null);
|
|
41
|
+
exports.LeafItemEntity = LeafItemEntity = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)("PaLeafItem")
|
|
43
|
+
], LeafItemEntity);
|
|
44
|
+
//# sourceMappingURL=leaf-item.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaf-item.model.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf-item/leaf-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AAG7C,IAAM,cAAc,GAApB,MAAM,cAAc;IAEzB,MAAM,CAAU;IAGhB,QAAQ,CAAU;IAGlB,OAAO,CAAU;IAGjB,UAAU;QACR,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACxC,CAAC;CACF,CAAA;AAdY,wCAAc;AAEzB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;8CAC1B;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;gDACvB;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAC3B;AAGjB;IADC,IAAA,mBAAS,GAAE;;;;gDAGX;yBAbU,cAAc;IAD1B,IAAA,gBAAM,EAAC,YAAY,CAAC;GACR,cAAc,CAc1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SiteContext } from "../../../site-context/site-context.types";
|
|
2
|
+
export declare function findOneLeafItemItemNum({ mainCn }: SiteContext, leafId: string): Promise<number | undefined>;
|
|
3
|
+
export declare function createLeafItem(siteContext: SiteContext, { leafId, listName, parentId }: {
|
|
4
|
+
leafId: string;
|
|
5
|
+
listName: string;
|
|
6
|
+
parentId: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function updatePartsItemNumAfterDeletetion(siteContext: SiteContext, leafId: string): Promise<void>;
|
|
9
|
+
export declare function reorderLeafItems(siteContext: SiteContext, leafIds: string[], parentLeafId: string, listName: string): Promise<string[]>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reorderLeafItems = exports.updatePartsItemNumAfterDeletetion = exports.createLeafItem = exports.findOneLeafItemItemNum = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
6
|
+
const text_cache_1 = require("../../../common/text-cache");
|
|
7
|
+
const leaf_item_model_1 = require("./leaf-item.model");
|
|
8
|
+
async function findOneLeafItemItemNum({ mainCn }, leafId) {
|
|
9
|
+
const leafItemRows = await mainCn
|
|
10
|
+
.createQueryBuilder()
|
|
11
|
+
.select("leafItem.itemNum", "itemNum")
|
|
12
|
+
.from("PaLeafItem", "leafItem")
|
|
13
|
+
.where("leafItem.leafId = :leafId", { leafId })
|
|
14
|
+
.getRawMany();
|
|
15
|
+
if (leafItemRows.length === 0)
|
|
16
|
+
throw new common_1.NotFoundException(`itemNum not found, leafId:${leafId}`);
|
|
17
|
+
return (0, data_formatters_lib_1.nbValOrUndef)(leafItemRows[0].itemNum);
|
|
18
|
+
}
|
|
19
|
+
exports.findOneLeafItemItemNum = findOneLeafItemItemNum;
|
|
20
|
+
async function createLeafItem(siteContext, { leafId, listName, parentId }) {
|
|
21
|
+
const leafItemRow = await siteContext.mainCn
|
|
22
|
+
.createQueryBuilder()
|
|
23
|
+
.select("max(leafItem.itemNum)", "itemNum")
|
|
24
|
+
.from("PaLeafItem", "leafItem")
|
|
25
|
+
.innerJoin("PaLeaf", "leaf", "leaf.id = leafItem.leafId")
|
|
26
|
+
.where("leaf.parentId = :parentId", { parentId })
|
|
27
|
+
.getRawOne();
|
|
28
|
+
await siteContext.mainCn
|
|
29
|
+
.createQueryBuilder()
|
|
30
|
+
.insert()
|
|
31
|
+
.into(leaf_item_model_1.LeafItemEntity)
|
|
32
|
+
.values({ leafId, listName, itemNum: ((0, data_formatters_lib_1.nbValOrUndef)(leafItemRow?.itemNum) ?? 0) + 1 })
|
|
33
|
+
.execute();
|
|
34
|
+
await (0, text_cache_1.invalidateMultipleDocumentsInCache)(siteContext, { parentOfLeafId: leafId });
|
|
35
|
+
}
|
|
36
|
+
exports.createLeafItem = createLeafItem;
|
|
37
|
+
async function updatePartsItemNumAfterDeletetion(siteContext, leafId) {
|
|
38
|
+
const { mainCn } = siteContext;
|
|
39
|
+
const leafItemToDeleteRow = await mainCn
|
|
40
|
+
.createQueryBuilder()
|
|
41
|
+
.select("leafItem.itemNum", "itemNum")
|
|
42
|
+
.from("PaLeafItem", "leafItem")
|
|
43
|
+
.where("leafItem.leafId = :leafId", { leafId })
|
|
44
|
+
.getRawOne();
|
|
45
|
+
if (!leafItemToDeleteRow)
|
|
46
|
+
throw new common_1.NotFoundException(`leafItem not found leafId:${leafId}`);
|
|
47
|
+
const itemNumToDelete = (0, data_formatters_lib_1.nbVal)(leafItemToDeleteRow.itemNum);
|
|
48
|
+
const nextLeafItemsRow = await mainCn
|
|
49
|
+
.createQueryBuilder()
|
|
50
|
+
.select("leafItem.leafId", "leafId")
|
|
51
|
+
.addSelect("leafItem.listName", "listName")
|
|
52
|
+
.addSelect("leafItem.itemNum", "itemNum")
|
|
53
|
+
.from("PaLeafItem", "leafItem")
|
|
54
|
+
.innerJoin("PaLeaf", "leaf", "leaf.id = :leafId", { leafId })
|
|
55
|
+
.innerJoin("PaLeaf", "leaf2", "leaf2.parentId = leaf.parentId")
|
|
56
|
+
.where("leafItem.leafId = leaf2.id")
|
|
57
|
+
.andWhere("leafItem.itemNum > :itemNumToDelete", { itemNumToDelete })
|
|
58
|
+
.getRawMany();
|
|
59
|
+
let newItemNum = itemNumToDelete;
|
|
60
|
+
const itemNumUpdateData = [];
|
|
61
|
+
nextLeafItemsRow.forEach((leafItemRow) => {
|
|
62
|
+
itemNumUpdateData.push({
|
|
63
|
+
listName: (0, data_formatters_lib_1.strVal)(leafItemRow.listName),
|
|
64
|
+
leafId: (0, data_formatters_lib_1.strVal)(leafItemRow.leafId),
|
|
65
|
+
itemNum: newItemNum,
|
|
66
|
+
});
|
|
67
|
+
++newItemNum;
|
|
68
|
+
});
|
|
69
|
+
await mainCn.getRepository(leaf_item_model_1.LeafItemEntity).save(itemNumUpdateData);
|
|
70
|
+
}
|
|
71
|
+
exports.updatePartsItemNumAfterDeletetion = updatePartsItemNumAfterDeletetion;
|
|
72
|
+
async function reorderLeafItems(siteContext, leafIds, parentLeafId, listName) {
|
|
73
|
+
const { mainCn } = siteContext;
|
|
74
|
+
const rows = await mainCn
|
|
75
|
+
.createQueryBuilder()
|
|
76
|
+
.select("l.id", "leafId")
|
|
77
|
+
.addSelect("i.itemNum", "itemNum")
|
|
78
|
+
.from("PaLeaf", "l")
|
|
79
|
+
.innerJoin("PaLeafItem", "i", "l.id = i.leafId")
|
|
80
|
+
.where("i.listName = :listName", { listName })
|
|
81
|
+
.where("l.parentId = :parentLeafId", { parentLeafId })
|
|
82
|
+
.orderBy("i.itemNum", "ASC")
|
|
83
|
+
.addOrderBy("l.id", "ASC")
|
|
84
|
+
.getRawMany();
|
|
85
|
+
const oldLeafItems = rows.map((row) => ({
|
|
86
|
+
leafId: (0, data_formatters_lib_1.strVal)(row.leafId),
|
|
87
|
+
itemNum: (0, data_formatters_lib_1.nbVal)(row.itemNum),
|
|
88
|
+
}));
|
|
89
|
+
let itemNum = 1;
|
|
90
|
+
const leafItems = [];
|
|
91
|
+
for (const leafId of leafIds) {
|
|
92
|
+
leafItems.push({ leafId, itemNum });
|
|
93
|
+
++itemNum;
|
|
94
|
+
}
|
|
95
|
+
for (const item of oldLeafItems) {
|
|
96
|
+
if (!leafIds.includes(item.leafId)) {
|
|
97
|
+
leafItems.push({ leafId: item.leafId, itemNum });
|
|
98
|
+
++itemNum;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
await mainCn.transaction(async (cn) => {
|
|
102
|
+
const leafItemRepository = cn.getRepository(leaf_item_model_1.LeafItemEntity);
|
|
103
|
+
for (const leafItem of leafItems) {
|
|
104
|
+
if (oldLeafItems.find((item) => item.leafId === leafItem.leafId)) {
|
|
105
|
+
await leafItemRepository.update({ leafId: leafItem.leafId }, { itemNum: leafItem.itemNum });
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
await leafItemRepository.insert({
|
|
109
|
+
leafId: leafItem.leafId,
|
|
110
|
+
itemNum: leafItem.itemNum,
|
|
111
|
+
listName: listName,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
await (0, text_cache_1.invalidateMultipleDocumentsInCache)(siteContext, { leafId: parentLeafId });
|
|
117
|
+
return leafIds;
|
|
118
|
+
}
|
|
119
|
+
exports.reorderLeafItems = reorderLeafItems;
|
|
120
|
+
//# sourceMappingURL=leaf-item.queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaf-item.queries.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf-item/leaf-item.queries.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AACnD,oEAAyE;AAEzE,2DAAgF;AAEhF,uDAAmD;AAE5C,KAAK,UAAU,sBAAsB,CAAC,EAAE,MAAM,EAAe,EAAE,MAAc;IAClF,MAAM,YAAY,GAAG,MAAM,MAAM;SAC9B,kBAAkB,EAAE;SACpB,MAAM,CAAC,kBAAkB,EAAE,SAAS,CAAC;SACrC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC;SAC9B,KAAK,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,CAAC;SAC9C,UAAU,EAAO,CAAC;IAErB,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,0BAAiB,CAAC,6B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EAAE,OAAO,CAAC;QACZ,CAAC;IACH,CAAC;IAED,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACpC,MAAM,kBAAkB,GAAG,EAAE,CAAC,aAAa,CAAC,gCAAc,CAAC,CAAC;QAE5D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjE,MAAM,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9F,CAAC;iBAAM,CAAC;gBACN,MAAM,kBAAkB,CAAC,MAAM,CAAC;oBAC9B,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,QAAQ,EAAE,QAAQ;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,IAAA,+CAAkC,EAAC,WAAW,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IAChF,OAAO,OAAO,CAAC;AACjB,CAAC;AAzDD,4CAyDC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Request } from "express";
|
|
2
|
+
import { AuthService } from "../auth/auth.service";
|
|
3
|
+
import type { LoginAction } from "../auth/auth.types";
|
|
4
|
+
export declare class LoginController {
|
|
5
|
+
private readonly authservice;
|
|
6
|
+
constructor(authservice: AuthService);
|
|
7
|
+
login(req: Request, loginInput: LoginAction): Promise<import("../auth/auth.types").LoginSuccess | import("../auth/auth.types").LoginFailed>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.LoginController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const site_context_1 = require("../../../site-context/site-context");
|
|
18
|
+
const class_validator_options_1 = require("../../public-api/class-validator-options");
|
|
19
|
+
const auth_service_1 = require("../auth/auth.service");
|
|
20
|
+
let LoginController = class LoginController {
|
|
21
|
+
authservice;
|
|
22
|
+
constructor(authservice) {
|
|
23
|
+
this.authservice = authservice;
|
|
24
|
+
}
|
|
25
|
+
async login(req, loginInput) {
|
|
26
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
27
|
+
if (loginInput.action === "loginWithPlatformToken") {
|
|
28
|
+
return await this.authservice.loginByPlatformToken(siteContext, loginInput.token);
|
|
29
|
+
}
|
|
30
|
+
if (loginInput.action === "signIn") {
|
|
31
|
+
return await this.authservice.login(siteContext, {
|
|
32
|
+
email: loginInput.email,
|
|
33
|
+
password: loginInput.password,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return this.authservice.verifyToken(await (0, site_context_1.getSiteContext)(req.hostname), loginInput.token);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.LoginController = LoginController;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, common_1.Post)("login"),
|
|
42
|
+
(0, common_1.HttpCode)(200),
|
|
43
|
+
__param(0, (0, common_1.Req)()),
|
|
44
|
+
__param(1, (0, common_1.Body)()),
|
|
45
|
+
__metadata("design:type", Function),
|
|
46
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
47
|
+
__metadata("design:returntype", Promise)
|
|
48
|
+
], LoginController.prototype, "login", null);
|
|
49
|
+
exports.LoginController = LoginController = __decorate([
|
|
50
|
+
(0, common_1.Controller)("api/v1"),
|
|
51
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe(class_validator_options_1.classValidatorOptions)),
|
|
52
|
+
__metadata("design:paramtypes", [auth_service_1.AuthService])
|
|
53
|
+
], LoginController);
|
|
54
|
+
//# sourceMappingURL=login.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.controller.js","sourceRoot":"","sources":["../../../../src/modules/core/login/login.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiG;AAEjG,qEAAoE;AACpE,sFAAiF;AACjF,uDAAmD;AAK5C,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAInD,AAAN,KAAK,CAAC,KAAK,CAAQ,GAAY,EAAU,UAAuB;QAC9D,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,UAAU,CAAC,MAAM,KAAK,wBAAwB,EAAE,CAAC;YACnD,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACpF,CAAC;QAED,IAAI,UAAU,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE;gBAC/C,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,QAAQ,EAAE,UAAU,CAAC,QAAQ;aAC9B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5F,CAAC;CACF,CAAA;AArBY,0CAAe;AAKpB;IAFL,IAAA,aAAI,EAAC,OAAO,CAAC;IACb,IAAA,iBAAQ,EAAC,GAAG,CAAC;IACD,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,aAAI,GAAE,CAAA;;;;4CAevC;0BApBU,eAAe;IAF3B,IAAA,mBAAU,EAAC,QAAQ,CAAC;IACpB,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,+CAAqB,CAAC,CAAC;qCAER,0BAAW;GAD1C,eAAe,CAqB3B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LoginModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const auth_module_1 = require("../auth/auth.module");
|
|
12
|
+
const login_controller_1 = require("./login.controller");
|
|
13
|
+
let LoginModule = class LoginModule {
|
|
14
|
+
};
|
|
15
|
+
exports.LoginModule = LoginModule;
|
|
16
|
+
exports.LoginModule = LoginModule = __decorate([
|
|
17
|
+
(0, common_1.Module)({
|
|
18
|
+
controllers: [login_controller_1.LoginController],
|
|
19
|
+
imports: [auth_module_1.AuthModule],
|
|
20
|
+
})
|
|
21
|
+
], LoginModule);
|
|
22
|
+
//# sourceMappingURL=login.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.module.js","sourceRoot":"","sources":["../../../../src/modules/core/login/login.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,yDAAqD;AAM9C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAJvB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,kCAAe,CAAC;QAC9B,OAAO,EAAE,CAAC,wBAAU,CAAC;KACtB,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="multer" />
|
|
2
|
+
import { Obj } from "@paroicms/anywhere-lib";
|
|
3
|
+
import { MediaBase } from "@paroicms/server-database-media-storage";
|
|
4
|
+
import type { Request } from "express";
|
|
5
|
+
export interface UploadedMedia extends Omit<MediaBase, "modifiedTs"> {
|
|
6
|
+
modifiedTs: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UploadedImage extends UploadedMedia {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
lossless: boolean;
|
|
13
|
+
thumbImage: {
|
|
14
|
+
url: string;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare class UploadMediaController {
|
|
20
|
+
uploadMedia(req: Request, file: Express.Multer.File, body: Obj): Promise<UploadedMedia | UploadedImage>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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.UploadMediaController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const platform_express_1 = require("@nestjs/platform-express");
|
|
18
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
19
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
20
|
+
const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
|
|
21
|
+
const media_handles_helpers_1 = require("../../../common/media-handles.helpers");
|
|
22
|
+
const text_cache_1 = require("../../../common/text-cache");
|
|
23
|
+
const context_1 = require("../../../context");
|
|
24
|
+
const site_context_1 = require("../../../site-context/site-context");
|
|
25
|
+
const leaf_queries_1 = require("../leaf/leaf.queries");
|
|
26
|
+
const media_1 = require("./media");
|
|
27
|
+
let UploadMediaController = class UploadMediaController {
|
|
28
|
+
async uploadMedia(req, file, body) {
|
|
29
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
30
|
+
if (!file)
|
|
31
|
+
throw new common_1.BadRequestException("missing 'file'");
|
|
32
|
+
const leafId = (0, data_formatters_lib_1.strValOrUndef)(body.leafId) ?? siteContext.siteIds.siteLeafId;
|
|
33
|
+
const payload = {
|
|
34
|
+
handle: (0, data_formatters_lib_1.strVal)(body.handle, { varName: "handle" }),
|
|
35
|
+
attachedData: (0, data_formatters_lib_1.strValOrUndef)(body.attachedData),
|
|
36
|
+
replace: (0, data_formatters_lib_1.boolVal)(body.replace),
|
|
37
|
+
};
|
|
38
|
+
const leafType = await (0, leaf_queries_1.getLeafTypeOf)(siteContext, leafId);
|
|
39
|
+
const leafSchema = (0, anywhere_lib_1.getLeafSchema)(siteContext.siteSchema, leafType);
|
|
40
|
+
const policyName = leafSchema.mediaPolicy ?? "default";
|
|
41
|
+
const mediaPolicy = siteContext.siteSchema.mediaPolicies[policyName];
|
|
42
|
+
const { buffer: binaryFile, originalname: originalName, mimetype: mediaType, size: weightB, } = file;
|
|
43
|
+
await checkMediaPolicy(siteContext, {
|
|
44
|
+
mediaPolicy,
|
|
45
|
+
mediaType,
|
|
46
|
+
weightB,
|
|
47
|
+
leafSchema,
|
|
48
|
+
leafId,
|
|
49
|
+
exceptHandle: payload.replace ? payload.handle : undefined,
|
|
50
|
+
});
|
|
51
|
+
let originalImage;
|
|
52
|
+
if (mediaType.startsWith("image/")) {
|
|
53
|
+
originalImage = await (0, server_image_cache_engine_1.processOriginalImage)({
|
|
54
|
+
binaryFile,
|
|
55
|
+
mediaType,
|
|
56
|
+
BadRequestError: common_1.BadRequestException,
|
|
57
|
+
policy: mediaPolicy.image,
|
|
58
|
+
defaultPolicy: siteContext.siteSchema.mediaPolicies.default.image,
|
|
59
|
+
qualityPolicy: siteContext.siteSchema.imageQualityPolicy,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const media = await siteContext.mediaStorage.addMedia({
|
|
63
|
+
binaryFile: originalImage ? originalImage.binaryFile : binaryFile,
|
|
64
|
+
mediaType: originalImage ? originalImage.mediaType : mediaType,
|
|
65
|
+
weightB: originalImage ? originalImage.weightB : weightB,
|
|
66
|
+
handle: payload.handle,
|
|
67
|
+
originalName,
|
|
68
|
+
image: originalImage
|
|
69
|
+
? {
|
|
70
|
+
width: originalImage.width,
|
|
71
|
+
height: originalImage.height,
|
|
72
|
+
lossless: originalImage.lossless,
|
|
73
|
+
}
|
|
74
|
+
: undefined,
|
|
75
|
+
attachedData: payload.attachedData,
|
|
76
|
+
replace: payload.replace,
|
|
77
|
+
leafId,
|
|
78
|
+
});
|
|
79
|
+
const result = {
|
|
80
|
+
uid: media.uid,
|
|
81
|
+
mediaType: media.mediaType,
|
|
82
|
+
modifiedTs: media.modifiedTs.toISOString(),
|
|
83
|
+
weightB: media.weightB,
|
|
84
|
+
attachedData: media.attachedData,
|
|
85
|
+
originalName: media.originalName,
|
|
86
|
+
url: (0, media_1.makeMediaUrl)(siteContext, media, { absoluteUrl: true }),
|
|
87
|
+
};
|
|
88
|
+
if (!originalImage || media.kind !== "image")
|
|
89
|
+
return result;
|
|
90
|
+
if (payload.handle === (0, media_handles_helpers_1.getHandleOfSiteFavicon)()) {
|
|
91
|
+
await (0, media_1.createBoFaviconFrom)(siteContext, binaryFile);
|
|
92
|
+
}
|
|
93
|
+
const thumbImage = (0, media_1.registerImageVariant)(siteContext, {
|
|
94
|
+
imageRef: {
|
|
95
|
+
height: originalImage.height,
|
|
96
|
+
imageUid: media.uid,
|
|
97
|
+
mediaType: media.mediaType,
|
|
98
|
+
width: originalImage.width,
|
|
99
|
+
},
|
|
100
|
+
variantName: context_1.thumbVariantName,
|
|
101
|
+
autoCrop: true,
|
|
102
|
+
absoluteUrl: true,
|
|
103
|
+
dependsOnCacheKey: "bo",
|
|
104
|
+
});
|
|
105
|
+
if (leafSchema.kind === "site") {
|
|
106
|
+
await siteContext.textCache.clearCache();
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
await (0, text_cache_1.invalidateMultipleDocumentsInCache)(siteContext, { leafId });
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
...result,
|
|
113
|
+
width: originalImage.width,
|
|
114
|
+
height: originalImage.height,
|
|
115
|
+
lossless: originalImage.lossless,
|
|
116
|
+
thumbImage,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
exports.UploadMediaController = UploadMediaController;
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, common_1.Post)("upload"),
|
|
123
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)("file")),
|
|
124
|
+
__param(0, (0, common_1.Req)()),
|
|
125
|
+
__param(1, (0, common_1.UploadedFile)()),
|
|
126
|
+
__param(2, (0, common_1.Body)()),
|
|
127
|
+
__metadata("design:type", Function),
|
|
128
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
129
|
+
__metadata("design:returntype", Promise)
|
|
130
|
+
], UploadMediaController.prototype, "uploadMedia", null);
|
|
131
|
+
exports.UploadMediaController = UploadMediaController = __decorate([
|
|
132
|
+
(0, common_1.Controller)("adm/api/v1"),
|
|
133
|
+
(0, common_1.UseInterceptors)(common_1.ClassSerializerInterceptor)
|
|
134
|
+
], UploadMediaController);
|
|
135
|
+
async function checkMediaPolicy(siteContext, { mediaPolicy, mediaType, weightB, leafSchema, leafId, exceptHandle, }) {
|
|
136
|
+
if (leafSchema.kind !== "site") {
|
|
137
|
+
const limit = leafSchema.kind === "part"
|
|
138
|
+
? mediaPolicy.mediaLimitPerPart
|
|
139
|
+
: mediaPolicy.mediaLimitPerDocument;
|
|
140
|
+
if (limit !== undefined) {
|
|
141
|
+
const count = await siteContext.mediaStorage.countMedias({
|
|
142
|
+
leafId,
|
|
143
|
+
exceptHandle,
|
|
144
|
+
});
|
|
145
|
+
if (count >= limit) {
|
|
146
|
+
throw new common_1.BadRequestException({ cause: "mediaLimitReached" });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (mediaType === "application/pdf") {
|
|
151
|
+
const siteWeightLimitB = mediaPolicy.attachedDocument?.siteWeightLimitB;
|
|
152
|
+
if (siteWeightLimitB !== undefined) {
|
|
153
|
+
const totalWeightB = await siteContext.mediaStorage.getAttachedDocumentsWeight();
|
|
154
|
+
if (totalWeightB + weightB > siteWeightLimitB) {
|
|
155
|
+
throw new common_1.BadRequestException({ cause: "weightLimitReached" });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=media-upload.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-upload.controller.js","sourceRoot":"","sources":["../../../../src/modules/core/media/media-upload.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+DAA2D;AAC3D,oEAA4E;AAC5E,yDAAqF;AAErF,mFAA0F;AAE1F,iFAA+E;AAC/E,2DAAgF;AAChF,8CAAoD;AACpD,qEAAoE;AAEpE,uDAAqD;AACrD,mCAAkF;AAoB3E,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAG1B,AAAN,KAAK,CAAC,WAAW,CACR,GAAY,EACH,IAAyB,EACjC,IAAS;QAEjB,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,4BAAmB,CAAC,gBAAgB,CAAC,CAAC;QAE3D,MAAM,MAAM,GAAG,IAAA,mCAAa,EAAC,IAAI,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC;QAC5E,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,IAAA,4BAAM,EAAC,IAAI,CAAC,MAAM,EAAE,EAAE,OAA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AAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC/B,MAAM,KAAK,GACT,UAAU,CAAC,IAAI,KAAK,MAAM;YACxB,CAAC,CAAC,WAAW,CAAC,iBAAiB;YAC/B,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC;QACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC;gBACvD,MAAM;gBACN,YAAY;aACb,CAAC,CAAC;YACH,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,4BAAmB,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,SAAS,KAAK,iBAAiB,EAAE,CAAC;QACpC,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;QACxE,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,0BAA0B,EAAE,CAAC;YACjF,IAAI,YAAY,GAAG,OAAO,GAAG,gBAAgB,EAAE,CAAC;gBAC9C,MAAM,IAAI,4BAAmB,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ImageRef, VariantName } from "@paroicms/server-image-cache-engine";
|
|
3
|
+
import { SiteContext } from "../../../site-context/site-context.types";
|
|
4
|
+
export declare function registerImageVariant(siteContext: Pick<SiteContext, "imageCache" | "siteUrl">, { imageRef, variantName, autoCrop, absoluteUrl, dependsOnCacheKey, }: {
|
|
5
|
+
imageRef: ImageRef;
|
|
6
|
+
variantName: VariantName;
|
|
7
|
+
autoCrop?: boolean;
|
|
8
|
+
absoluteUrl: boolean;
|
|
9
|
+
dependsOnCacheKey: string;
|
|
10
|
+
}): {
|
|
11
|
+
url: string;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
mediaType: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function makeMediaUrl(siteContext: SiteContext, media: {
|
|
17
|
+
uid: string;
|
|
18
|
+
mediaType: string;
|
|
19
|
+
}, { absoluteUrl }: {
|
|
20
|
+
absoluteUrl: boolean;
|
|
21
|
+
}): string;
|
|
22
|
+
export declare function createBoFaviconFrom(siteContext: SiteContext, binaryFile: Buffer): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBoFaviconFrom = exports.makeMediaUrl = exports.registerImageVariant = void 0;
|
|
4
|
+
const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
|
|
5
|
+
const media_handles_helpers_1 = require("../../../common/media-handles.helpers");
|
|
6
|
+
function registerImageVariant(siteContext, { imageRef, variantName, autoCrop = false, absoluteUrl, dependsOnCacheKey, }) {
|
|
7
|
+
const { width, height, completeVariantName } = siteContext.imageCache.makeImageAvailable({
|
|
8
|
+
imageRef,
|
|
9
|
+
variantName,
|
|
10
|
+
autoCrop,
|
|
11
|
+
dependsOnCacheKey,
|
|
12
|
+
});
|
|
13
|
+
const prefix = absoluteUrl ? siteContext.siteUrl : "";
|
|
14
|
+
return {
|
|
15
|
+
url: `${prefix}/medias/${imageRef.imageUid}-${completeVariantName}.${mediaTypeToFileExtension(imageRef.mediaType)}`,
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
mediaType: imageRef.mediaType,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.registerImageVariant = registerImageVariant;
|
|
22
|
+
function makeMediaUrl(siteContext, media, { absoluteUrl }) {
|
|
23
|
+
const prefix = absoluteUrl ? siteContext.siteUrl : "";
|
|
24
|
+
return `${prefix}/medias/${media.uid}.${mediaTypeToFileExtension(media.mediaType)}`;
|
|
25
|
+
}
|
|
26
|
+
exports.makeMediaUrl = makeMediaUrl;
|
|
27
|
+
function mediaTypeToFileExtension(mediaType) {
|
|
28
|
+
const regexMatchArray = mediaType.match(/\w+\/([-+.\w]+)/);
|
|
29
|
+
if (!regexMatchArray) {
|
|
30
|
+
throw new Error("media extension is incorrect.");
|
|
31
|
+
}
|
|
32
|
+
return regexMatchArray[1];
|
|
33
|
+
}
|
|
34
|
+
async function createBoFaviconFrom(siteContext, binaryFile) {
|
|
35
|
+
const result = await (0, server_image_cache_engine_1.createDefaultBoFavicon)(binaryFile);
|
|
36
|
+
await siteContext.mediaStorage.addMedia({
|
|
37
|
+
binaryFile: result.binaryFile,
|
|
38
|
+
mediaType: result.mediaType,
|
|
39
|
+
weightB: result.weightB,
|
|
40
|
+
handle: (0, media_handles_helpers_1.getHandleOfSiteBoFavicon)(),
|
|
41
|
+
image: result
|
|
42
|
+
? {
|
|
43
|
+
width: result.width,
|
|
44
|
+
height: result.height,
|
|
45
|
+
lossless: result.lossless,
|
|
46
|
+
}
|
|
47
|
+
: undefined,
|
|
48
|
+
replace: true,
|
|
49
|
+
leafId: siteContext.siteIds.siteLeafId,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.createBoFaviconFrom = createBoFaviconFrom;
|
|
53
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../../src/modules/core/media/media.ts"],"names":[],"mappings":";;;AAAA,mFAAoG;AACpG,iFAAiF;AAGjF,SAAgB,oBAAoB,CAClC,WAAwD,EACxD,EACE,QAAQ,EACR,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,iBAAiB,GAOlB;IAOD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,WAAW,CAAC,UAAU,CAA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