@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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSimpleTranslator = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
async function createSimpleTranslator(options) {
|
|
8
|
+
const labels = await loadLabels(options);
|
|
9
|
+
return {
|
|
10
|
+
translate: (options) => translate(labels, options),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.createSimpleTranslator = createSimpleTranslator;
|
|
14
|
+
function translate(labels, { args = [], key, lang }) {
|
|
15
|
+
let label = labels.get(lang)?.[key] ?? key;
|
|
16
|
+
const variables = findVariablesInString(label, args.length);
|
|
17
|
+
variables.reverse();
|
|
18
|
+
for (const { indexInString, variableName, variableNumber } of variables) {
|
|
19
|
+
const value = args[variableNumber - 1];
|
|
20
|
+
const before = label.substring(0, indexInString);
|
|
21
|
+
const after = label.substring(indexInString + variableName.length);
|
|
22
|
+
label = `${before}${value}${after}`;
|
|
23
|
+
}
|
|
24
|
+
return label;
|
|
25
|
+
}
|
|
26
|
+
function findVariablesInString(str, max) {
|
|
27
|
+
const matches = [];
|
|
28
|
+
const regex = /\$[0-9]+/g;
|
|
29
|
+
let match;
|
|
30
|
+
while (true) {
|
|
31
|
+
match = regex.exec(str);
|
|
32
|
+
if (!match)
|
|
33
|
+
break;
|
|
34
|
+
const [variableName] = match;
|
|
35
|
+
const variableNumber = (0, data_formatters_lib_1.nbVal)(variableName.substring(1), { varName: variableName });
|
|
36
|
+
if (variableNumber <= max) {
|
|
37
|
+
matches.push({
|
|
38
|
+
variableName,
|
|
39
|
+
variableNumber,
|
|
40
|
+
indexInString: match.index,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return matches;
|
|
45
|
+
}
|
|
46
|
+
async function loadLabels({ l10nDir, langs, appLog, }) {
|
|
47
|
+
const labels = new Map();
|
|
48
|
+
for (const lang of langs) {
|
|
49
|
+
let content;
|
|
50
|
+
try {
|
|
51
|
+
content = await (0, promises_1.readFile)((0, path_1.join)(l10nDir, `${lang}.json`), "utf-8");
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
labels.set(lang, flattenLocales(JSON.parse(content)));
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
appLog.warn(`invalid locale file '${(0, path_1.join)(l10nDir, `${lang}.json`)}'`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return labels;
|
|
64
|
+
}
|
|
65
|
+
function flattenLocales(source, prefix = "") {
|
|
66
|
+
const result = {};
|
|
67
|
+
for (const [key, val] of Object.entries(source)) {
|
|
68
|
+
if (val === null)
|
|
69
|
+
throw new Error(`invalid null value for '${key}'`);
|
|
70
|
+
if (typeof val === "string") {
|
|
71
|
+
result[`${prefix}${key}`] = val;
|
|
72
|
+
}
|
|
73
|
+
else if (typeof val === "object") {
|
|
74
|
+
Object.assign(result, flattenLocales(val, `${prefix}${key}.`));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw new Error(`invalid value for '${key}'`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=simple-i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-i18n.js","sourceRoot":"","sources":["../../src/helpers/simple-i18n.ts"],"names":[],"mappings":";;;AAAA,oEAAmD;AAEnD,0CAAuC;AACvC,+BAA4B;AAYrB,KAAK,UAAU,sBAAsB,CAAC,OAI5C;IACC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO;QACL,SAAS,EAAE,CAAC,OAA+B,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;KAC3E,CAAC;AACJ,CAAC;AATD,wDASC;AAED,SAAS,SAAS,CAChB,MAA4C,EAC5C,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG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AAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,GAAG,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AccountModel } from "../modules/core/account/account.model";
|
|
2
|
+
export declare const devAccountId = "dev:0";
|
|
3
|
+
export declare function isDevAccountId(id: string): boolean;
|
|
4
|
+
export interface ParsedPlatformAdminAccountId {
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function parsePlatformAdminAccountId(id: string): ParsedPlatformAdminAccountId | undefined;
|
|
8
|
+
export declare function getDevAccount(id: string): AccountModel;
|
|
9
|
+
export declare function getPlatformAdminAccount({ index }: ParsedPlatformAdminAccountId): AccountModel;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPlatformAdminAccount = exports.getDevAccount = exports.parsePlatformAdminAccountId = exports.isDevAccountId = exports.devAccountId = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
exports.devAccountId = "dev:0";
|
|
7
|
+
function isDevAccountId(id) {
|
|
8
|
+
return id === exports.devAccountId;
|
|
9
|
+
}
|
|
10
|
+
exports.isDevAccountId = isDevAccountId;
|
|
11
|
+
function parsePlatformAdminAccountId(id) {
|
|
12
|
+
if (!id.startsWith("pladm:"))
|
|
13
|
+
return;
|
|
14
|
+
return { index: Number(id.substring(6)) };
|
|
15
|
+
}
|
|
16
|
+
exports.parsePlatformAdminAccountId = parsePlatformAdminAccountId;
|
|
17
|
+
function getDevAccount(id) {
|
|
18
|
+
const devAccount = context_1.appConf.devAccount;
|
|
19
|
+
if (!devAccount || exports.devAccountId !== id) {
|
|
20
|
+
throw new common_1.NotFoundException();
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
email: devAccount.email,
|
|
24
|
+
id: exports.devAccountId,
|
|
25
|
+
name: devAccount.name,
|
|
26
|
+
special: "dev",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.getDevAccount = getDevAccount;
|
|
30
|
+
function getPlatformAdminAccount({ index }) {
|
|
31
|
+
const account = context_1.appConf.platformAdminAccounts?.[index];
|
|
32
|
+
if (!account) {
|
|
33
|
+
throw new common_1.NotFoundException();
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
id: `pladm:${index}`,
|
|
37
|
+
email: account.email,
|
|
38
|
+
name: account.name,
|
|
39
|
+
special: "platformAdmin",
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.getPlatformAdminAccount = getPlatformAdminAccount;
|
|
43
|
+
//# sourceMappingURL=special-account.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"special-account.helpers.js","sourceRoot":"","sources":["../../src/helpers/special-account.helpers.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AACnD,wCAAqC;AAGxB,QAAA,YAAY,GAAG,OAAO,CAAC;AAEpC,SAAgB,cAAc,CAAC,EAAU;IACvC,OAAO,EAAE,KAAK,oBAAY,CAAC;AAC7B,CAAC;AAFD,wCAEC;AAMD,SAAgB,2BAA2B,CAAC,EAAU;IACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO;IACrC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC;AAHD,kEAGC;AAED,SAAgB,aAAa,CAAC,EAAU;IACtC,MAAM,UAAU,GAAG,iBAAO,CAAC,UAAU,CAAC;IACtC,IAAI,CAAC,UAAU,IAAI,oBAAY,KAAK,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,0BAAiB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,EAAE,EAAE,oBAAY;QAChB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC;AAZD,sCAYC;AAED,SAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAgC;IAC7E,MAAM,OAAO,GAAG,iBAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,0BAAiB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO;QACL,EAAE,EAAE,SAAS,KAAK,EAAE;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,eAAe;KACzB,CAAC;AACJ,CAAC;AAZD,0DAYC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBoUrl = void 0;
|
|
4
|
+
const context_1 = require("../context");
|
|
5
|
+
function getBoUrl(siteConf, path) {
|
|
6
|
+
const { boPublicPort, https } = context_1.appConf.thisServer;
|
|
7
|
+
const { fqdn } = siteConf;
|
|
8
|
+
const protocol = https ? "https" : "http";
|
|
9
|
+
return `${protocol}://${fqdn}${boPublicPort ? `:${boPublicPort}` : ""}${path ?? ""}`;
|
|
10
|
+
}
|
|
11
|
+
exports.getBoUrl = getBoUrl;
|
|
12
|
+
//# sourceMappingURL=url.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.helpers.js","sourceRoot":"","sources":["../../src/helpers/url.helpers.ts"],"names":[],"mappings":";;;AAAA,wCAAqC;AAGrC,SAAgB,QAAQ,CAAC,QAAkB,EAAE,IAAa;IACxD,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,iBAAO,CAAC,UAAU,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,GAAG,QAAQ,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;AACvF,CAAC;AALD,4BAKC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function toHttpHeaderIfModifiedSince(time: unknown): string;
|
|
2
|
+
export declare function mediaTypeToFileExtension(mediaType: string): string;
|
|
3
|
+
export declare function pascalCaseToDashed(s: string): string;
|
|
4
|
+
export declare function toLeafId(leafOrSectionId: string): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toLeafId = exports.pascalCaseToDashed = exports.mediaTypeToFileExtension = exports.toHttpHeaderIfModifiedSince = void 0;
|
|
4
|
+
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
+
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
6
|
+
function toHttpHeaderIfModifiedSince(time) {
|
|
7
|
+
return (0, data_formatters_lib_1.dateVal)(time).toUTCString();
|
|
8
|
+
}
|
|
9
|
+
exports.toHttpHeaderIfModifiedSince = toHttpHeaderIfModifiedSince;
|
|
10
|
+
function mediaTypeToFileExtension(mediaType) {
|
|
11
|
+
const regexMatchArray = mediaType.match(/\w+\/([-+.\w]+)/);
|
|
12
|
+
if (!regexMatchArray) {
|
|
13
|
+
throw new Error("media extension is incorrect.");
|
|
14
|
+
}
|
|
15
|
+
return regexMatchArray[1];
|
|
16
|
+
}
|
|
17
|
+
exports.mediaTypeToFileExtension = mediaTypeToFileExtension;
|
|
18
|
+
function pascalCaseToDashed(s) {
|
|
19
|
+
return s
|
|
20
|
+
.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)
|
|
21
|
+
.replace(/^-+/, "")
|
|
22
|
+
.replace(/-+$/, "")
|
|
23
|
+
.replace(/--+/g, "-");
|
|
24
|
+
}
|
|
25
|
+
exports.pascalCaseToDashed = pascalCaseToDashed;
|
|
26
|
+
function toLeafId(leafOrSectionId) {
|
|
27
|
+
return leafOrSectionId.indexOf(":") !== -1
|
|
28
|
+
? (0, anywhere_lib_1.parseSectionId)(leafOrSectionId).leafId
|
|
29
|
+
: leafOrSectionId;
|
|
30
|
+
}
|
|
31
|
+
exports.toLeafId = toLeafId;
|
|
32
|
+
//# sourceMappingURL=utils-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-helper.js","sourceRoot":"","sources":["../../src/helpers/utils-helper.ts"],"names":[],"mappings":";;;AAAA,oEAAqD;AACrD,yDAAwD;AAExD,SAAgB,2BAA2B,CAAC,IAAa;IACvD,OAAO,IAAA,6BAAO,EAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;AACrC,CAAC;AAFD,kEAEC;AAED,SAAgB,wBAAwB,CAAC,SAAiB;IACxD,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE3D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AARD,4DAQC;AAED,SAAgB,kBAAkB,CAAC,CAAS;IAC1C,OAAO,CAAC;SACL,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;SAC/C,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AAND,gDAMC;AAED,SAAgB,QAAQ,CAAC,eAAuB;IAC9C,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC,CAAC,IAAA,6BAAc,EAAC,eAAe,CAAC,CAAC,MAAM;QACxC,CAAC,CAAC,eAAe,CAAC;AACtB,CAAC;AAJD,4BAIC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.start = void 0;
|
|
7
|
+
const core_1 = require("@nestjs/core");
|
|
8
|
+
const platform_express_1 = require("@nestjs/platform-express");
|
|
9
|
+
const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
|
|
10
|
+
const server_lib_1 = require("@paroicms/server-lib");
|
|
11
|
+
const express_1 = __importDefault(require("express"));
|
|
12
|
+
const context_1 = require("./context");
|
|
13
|
+
const static_middlewares_1 = require("./express/static-middlewares");
|
|
14
|
+
const configuration_helpers_1 = require("./helpers/configuration.helpers");
|
|
15
|
+
const maintenance_task_1 = require("./maintenance/maintenance-task");
|
|
16
|
+
const shutdown_1 = require("./maintenance/shutdown");
|
|
17
|
+
const app_module_1 = require("./modules/app.module");
|
|
18
|
+
const nest_custom_logger_1 = require("./nest-custom-logger");
|
|
19
|
+
const site_conf_1 = require("./site-context/site-conf");
|
|
20
|
+
const site_schema_lib_reader_1 = require("./site-schema/site-schema-lib-reader");
|
|
21
|
+
async function start(options = {}) {
|
|
22
|
+
try {
|
|
23
|
+
await context_1.platformLog.untilReady;
|
|
24
|
+
(0, server_image_cache_engine_1.setupImageProcessor)({ ...context_1.appConf.imageProcessor, appLog: context_1.platformLog });
|
|
25
|
+
const siteConfs = (0, configuration_helpers_1.isMultiSiteConfiguration)(context_1.appConf)
|
|
26
|
+
? await (0, site_conf_1.loadSitePackConfs)(context_1.appConf.sitePacks, options.sitePackPlaces)
|
|
27
|
+
: await (0, site_conf_1.createSiteConfsFromSingle)(context_1.appConf.singleSite);
|
|
28
|
+
await (0, context_1.initializeContext)(siteConfs);
|
|
29
|
+
(0, context_1.initSiteSchemaLib)(await (0, site_schema_lib_reader_1.readSiteSchemaLibraries)());
|
|
30
|
+
const stopCron = (0, server_lib_1.startCronLike)(maintenance_task_1.maintenanceTask, {
|
|
31
|
+
shouldExecute: (0, server_lib_1.eachDay)({ hours: 2 }),
|
|
32
|
+
appLog: context_1.platformLog,
|
|
33
|
+
});
|
|
34
|
+
const expressApp = (0, express_1.default)();
|
|
35
|
+
const app = await core_1.NestFactory.create(app_module_1.AppModule, new platform_express_1.ExpressAdapter(expressApp), {
|
|
36
|
+
logger: new nest_custom_logger_1.NestCustomLogger(),
|
|
37
|
+
});
|
|
38
|
+
app.enableCors({ credentials: true, origin: "*" });
|
|
39
|
+
app.use(static_middlewares_1.boMiddleware);
|
|
40
|
+
app.use(static_middlewares_1.themeAssetsMiddleware);
|
|
41
|
+
if (context_1.appConf.thisServer.hostName) {
|
|
42
|
+
await app.listen(context_1.appConf.thisServer.port, context_1.appConf.thisServer.hostName);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
await app.listen(context_1.appConf.thisServer.port);
|
|
46
|
+
}
|
|
47
|
+
(0, shutdown_1.handleShutdownEvents)({
|
|
48
|
+
appLog: context_1.platformLog,
|
|
49
|
+
onCloseCb: async () => {
|
|
50
|
+
await Promise.all([stopCron(), (0, maintenance_task_1.unloadAllActiveSites)(), app.close()]);
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
context_1.platformLog.info(`paroi-web-platform is up and running on port '${context_1.appConf.thisServer.port}', it serves:${getListOfSiteUrls()
|
|
54
|
+
.map((url) => `\n- ${url}`)
|
|
55
|
+
.join("")}`);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
context_1.platformLog.error(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.start = start;
|
|
62
|
+
function getListOfSiteUrls() {
|
|
63
|
+
return Array.from(context_1.siteConfs.values())
|
|
64
|
+
.map((siteConf) => siteConf.siteUrl)
|
|
65
|
+
.sort();
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA2C;AAC3C,+DAAkF;AAClF,mFAA0E;AAC1E,qDAA8D;AAC9D,sDAA8B;AAC9B,uCAAkG;AAClG,qEAAmF;AACnF,2EAA2E;AAC3E,qEAAuF;AACvF,qDAA8D;AAC9D,qDAAiD;AACjD,6DAAwD;AAExD,wDAAwF;AACxF,iFAA+E;AAQxE,KAAK,UAAU,KAAK,CAAC,UAAwB,EAAE;IACpD,IAAI,CAAC;QACH,MAAM,qBAAW,CAAC,UAAU,CAAC;QAE7B,IAAA,+CAAmB,EAAC,EAAE,GAAG,iBAAO,CAAC,cAAc,EAAE,MAAM,EAAE,qBAAW,EAAE,CAAC,CAAC;QACxE,MAAM,SAAS,GAAG,IAAA,gDAAwB,EAAC,iBAAO,CAAC;YACjD,CAAC,CAAC,MAAM,IAAA,6BAAiB,EAAC,iBAAO,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC;YACpE,CAAC,CAAC,MAAM,IAAA,qCAAyB,EAAC,iBAAO,CAAC,UAAU,CAAC,CAAC;QAExD,MAAM,IAAA,2BAAiB,EAAC,SAAS,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E,iBAAO,CAAC,UAAU,CAAC,IACrB,gBAAgB,iBAAiB,EAAE;aAChC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC;aAC1B,IAAI,CAAC,EAAE,CAAC,EAAE,CACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qBAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAtDD,sBAsDC;AAED,SAAS,iBAAiB;IACxB,OAAO,KAAK,CAAC,IAAI,CAAC,mBAAS,CAAC,MAAM,EAAE,CAAC;SAClC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;SACnC,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SiteContext } from "../site-context/site-context.types";
|
|
2
|
+
export declare function maintenanceTask(): Promise<void>;
|
|
3
|
+
export declare function siteMaintenanceTask(siteContext: Pick<SiteContext, "imageCache" | "textCache">): Promise<void>;
|
|
4
|
+
export declare function unloadAllActiveSites(): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unloadAllActiveSites = exports.siteMaintenanceTask = exports.maintenanceTask = void 0;
|
|
4
|
+
const context_1 = require("../context");
|
|
5
|
+
const site_context_1 = require("../site-context/site-context");
|
|
6
|
+
const shutdown_1 = require("./shutdown");
|
|
7
|
+
async function maintenanceTask() {
|
|
8
|
+
const siteContexts = (0, site_context_1.getActiveSiteContexts)();
|
|
9
|
+
for (const siteContext of siteContexts) {
|
|
10
|
+
if ((0, shutdown_1.isShuttingDown)())
|
|
11
|
+
return;
|
|
12
|
+
await siteMaintenanceTask(siteContext);
|
|
13
|
+
context_1.platformLog.info(`[${siteContext.siteName}] Maintenance done`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.maintenanceTask = maintenanceTask;
|
|
17
|
+
async function siteMaintenanceTask(siteContext) {
|
|
18
|
+
await siteContext.imageCache.cleanUnusedValues();
|
|
19
|
+
await siteContext.textCache.cleanUnusedValues();
|
|
20
|
+
}
|
|
21
|
+
exports.siteMaintenanceTask = siteMaintenanceTask;
|
|
22
|
+
async function unloadAllActiveSites() {
|
|
23
|
+
const siteContexts = Array.from((0, site_context_1.getActiveSiteContexts)());
|
|
24
|
+
await Promise.all(siteContexts.map((siteContext) => (0, site_context_1.unloadSiteContext)(siteContext)));
|
|
25
|
+
}
|
|
26
|
+
exports.unloadAllActiveSites = unloadAllActiveSites;
|
|
27
|
+
//# sourceMappingURL=maintenance-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance-task.js","sourceRoot":"","sources":["../../src/maintenance/maintenance-task.ts"],"names":[],"mappings":";;;AAAA,wCAAyC;AACzC,+DAAwF;AAExF,yCAA4C;AAErC,KAAK,UAAU,eAAe;IACnC,MAAM,YAAY,GAAG,IAAA,oCAAqB,GAAE,CAAC;IAC7C,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,IAAI,IAAA,yBAAc,GAAE;YAAE,OAAO;QAC7B,MAAM,mBAAmB,CAAC,WAAW,CAAC,CAAC;QACvC,qBAAW,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,QAAQ,oBAAoB,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAPD,0CAOC;AAEM,KAAK,UAAU,mBAAmB,CACvC,WAA0D;IAE1D,MAAM,WAAW,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;IACjD,MAAM,WAAW,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC;AAClD,CAAC;AALD,kDAKC;AAEM,KAAK,UAAU,oBAAoB;IACxC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAA,oCAAqB,GAAE,CAAC,CAAC;IACzD,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAA,gCAAiB,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACvF,CAAC;AAHD,oDAGC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PlatformLog } from "../share/pino-app-log";
|
|
2
|
+
export declare function isShuttingDown(): boolean;
|
|
3
|
+
export interface HandleShutdownEventsOptions {
|
|
4
|
+
appLog: PlatformLog;
|
|
5
|
+
onCloseCb?: (error?: unknown) => Promise<void> | void;
|
|
6
|
+
}
|
|
7
|
+
export declare function handleShutdownEvents({ appLog, onCloseCb }: HandleShutdownEventsOptions): void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleShutdownEvents = exports.isShuttingDown = void 0;
|
|
4
|
+
let shuttingDown = false;
|
|
5
|
+
function isShuttingDown() {
|
|
6
|
+
return shuttingDown;
|
|
7
|
+
}
|
|
8
|
+
exports.isShuttingDown = isShuttingDown;
|
|
9
|
+
function handleShutdownEvents({ appLog, onCloseCb }) {
|
|
10
|
+
process.on("uncaughtException", (error) => {
|
|
11
|
+
appLog.error("uncaughtException", error);
|
|
12
|
+
void stopAllAndExit(error);
|
|
13
|
+
});
|
|
14
|
+
process.on("unhandledRejection", (error) => {
|
|
15
|
+
appLog.error("unhandledRejection", error);
|
|
16
|
+
void stopAllAndExit(error);
|
|
17
|
+
});
|
|
18
|
+
process.on("SIGINT", () => {
|
|
19
|
+
appLog.info("Caught SIGINT signal.");
|
|
20
|
+
void stopAllAndExit();
|
|
21
|
+
});
|
|
22
|
+
process.on("SIGTERM", () => {
|
|
23
|
+
appLog.info("Caught SIGTERM signal.");
|
|
24
|
+
void stopAllAndExit();
|
|
25
|
+
});
|
|
26
|
+
process.on("SIGSEGV", () => {
|
|
27
|
+
appLog.error("Caught SIGSEGV signal. Exit.");
|
|
28
|
+
appLog.flushSync();
|
|
29
|
+
process.exit(1);
|
|
30
|
+
});
|
|
31
|
+
async function stopAllAndExit(error) {
|
|
32
|
+
shuttingDown = true;
|
|
33
|
+
try {
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
appLog.warn("Backend doesn't answer. Exit anyway.");
|
|
36
|
+
appLog.flushSync();
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}, error === undefined ? 30000 : 1000).unref();
|
|
39
|
+
if (onCloseCb)
|
|
40
|
+
await onCloseCb(error);
|
|
41
|
+
appLog.info("… server ended.");
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
appLog.error("Error during shutdown:", error);
|
|
45
|
+
}
|
|
46
|
+
appLog.flushSync();
|
|
47
|
+
process.exit(error ? 1 : 0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.handleShutdownEvents = handleShutdownEvents;
|
|
51
|
+
//# sourceMappingURL=shutdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../src/maintenance/shutdown.ts"],"names":[],"mappings":";;;AAEA,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,SAAgB,cAAc;IAC5B,OAAO,YAAY,CAAC;AACtB,CAAC;AAFD,wCAEC;AAOD,SAAgB,oBAAoB,CAAC,EAAE,MAAM,EAAE,SAAS,EAA+B;IACrF,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;QACxC,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QACzC,KAAK,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;QACzC,MAAM,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;QAC1C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CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AA9CD,oDA8CC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.AppController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const stream_1 = require("stream");
|
|
18
|
+
const media_handles_helpers_1 = require("../common/media-handles.helpers");
|
|
19
|
+
const serve_html_or_1 = require("../common/serve-html-or");
|
|
20
|
+
const context_1 = require("../context");
|
|
21
|
+
const http_helpers_1 = require("../express/http-helpers");
|
|
22
|
+
const utils_helper_1 = require("../helpers/utils-helper");
|
|
23
|
+
const site_context_1 = require("../site-context/site-context");
|
|
24
|
+
let AppController = class AppController {
|
|
25
|
+
robotsTxt(res) {
|
|
26
|
+
res.setHeader("Content-Type", "text/plain");
|
|
27
|
+
if (!context_1.appConf.allowRobots) {
|
|
28
|
+
res.send(`User-agent: *
|
|
29
|
+
Disallow: /`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
res.send();
|
|
33
|
+
}
|
|
34
|
+
async favicon(req, res) {
|
|
35
|
+
const siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
36
|
+
const handle = (0, media_handles_helpers_1.getHandleOfSiteFavicon)();
|
|
37
|
+
const media = await siteContext.mediaStorage.getMedia({ handle });
|
|
38
|
+
if (media?.kind !== "image")
|
|
39
|
+
return await (0, serve_html_or_1.render404Html)(siteContext, res);
|
|
40
|
+
const lastModified = (0, utils_helper_1.toHttpHeaderIfModifiedSince)(media.modifiedTs);
|
|
41
|
+
if (req.headers["if-modified-since"] === lastModified)
|
|
42
|
+
return (0, http_helpers_1.serve304NotModified)(res);
|
|
43
|
+
const file = await siteContext.imageCache.getOrCreateImageWithBinary({
|
|
44
|
+
variantName: "16x16",
|
|
45
|
+
imageRef: {
|
|
46
|
+
imageUid: media.uid,
|
|
47
|
+
width: media.width,
|
|
48
|
+
height: media.height,
|
|
49
|
+
mediaType: media.mediaType,
|
|
50
|
+
},
|
|
51
|
+
mediaType: "image/x-icon",
|
|
52
|
+
dependsOnCacheKey: "favicon16x16",
|
|
53
|
+
});
|
|
54
|
+
if (!file)
|
|
55
|
+
throw new Error(`favicon variant of '${media.uid}' should be available here`);
|
|
56
|
+
res.setHeader("content-type", file.mediaType);
|
|
57
|
+
res.append("Last-Modified", lastModified);
|
|
58
|
+
stream_1.Readable.from(file.binaryFile)
|
|
59
|
+
.on("data", (chunk) => {
|
|
60
|
+
res.write(chunk);
|
|
61
|
+
})
|
|
62
|
+
.on("error", (error) => {
|
|
63
|
+
res.end(error);
|
|
64
|
+
})
|
|
65
|
+
.on("end", () => {
|
|
66
|
+
res.end();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.AppController = AppController;
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, common_1.Get)("/robots.txt"),
|
|
73
|
+
__param(0, (0, common_1.Res)()),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [Object]),
|
|
76
|
+
__metadata("design:returntype", void 0)
|
|
77
|
+
], AppController.prototype, "robotsTxt", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, common_1.Get)("/favicon.ico"),
|
|
80
|
+
__param(0, (0, common_1.Req)()),
|
|
81
|
+
__param(1, (0, common_1.Res)()),
|
|
82
|
+
__metadata("design:type", Function),
|
|
83
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
84
|
+
__metadata("design:returntype", Promise)
|
|
85
|
+
], AppController.prototype, "favicon", null);
|
|
86
|
+
exports.AppController = AppController = __decorate([
|
|
87
|
+
(0, common_1.Controller)()
|
|
88
|
+
], AppController);
|
|
89
|
+
//# sourceMappingURL=app.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../src/modules/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2D;AAE3D,mCAAkC;AAClC,2EAAyE;AACzE,2DAAwD;AACxD,wCAAqC;AACrC,0DAA8D;AAC9D,0DAAsE;AACtE,+DAA8D;AAGvD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAExB,SAAS,CAAQ,GAAa;QAC5B,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;QAE5C,IAAI,CAAC,iBAAO,CAAC,WAAW,EAAE,CAAC;YACzB,GAAG,CAAC,IAAI,CAAC;YACH,CAAC,CAAC;YACR,OAAO;QACT,CAAC;QAED,GAAG,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAGK,AAAN,KAAK,CAAC,OAAO,CAAQ,GAAY,EAAS,GAAa;QACrD,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,MAAM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E;YACrB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC;aACD,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACd,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAA;AApDY,sCAAa;AAExB;IADC,IAAA,YAAG,EAAC,aAAa,CAAC;IACR,WAAA,IAAA,YAAG,GAAE,CAAA;;;;8CAUf;AAGK;IADL,IAAA,YAAG,EAAC,cAAc,CAAC;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;4CAoCxC;wBAnDU,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAoDzB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.AppModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const core_1 = require("@nestjs/core");
|
|
12
|
+
const throttler_1 = require("@nestjs/throttler");
|
|
13
|
+
const app_controller_1 = require("./app.controller");
|
|
14
|
+
const private_api_module_1 = require("./private-api.module");
|
|
15
|
+
const public_api_module_1 = require("./public-api/public-api.module");
|
|
16
|
+
const app_exception_filter_1 = require("./public-site/app-exception-filter");
|
|
17
|
+
const public_site_module_1 = require("./public-site/public-site.module");
|
|
18
|
+
const app_throttler_guard_1 = require("./security/app-throttler-guard");
|
|
19
|
+
let AppModule = class AppModule {
|
|
20
|
+
};
|
|
21
|
+
exports.AppModule = AppModule;
|
|
22
|
+
exports.AppModule = AppModule = __decorate([
|
|
23
|
+
(0, common_1.Module)({
|
|
24
|
+
imports: [
|
|
25
|
+
throttler_1.ThrottlerModule.forRoot([
|
|
26
|
+
{
|
|
27
|
+
limit: 50,
|
|
28
|
+
ttl: 2000,
|
|
29
|
+
},
|
|
30
|
+
]),
|
|
31
|
+
private_api_module_1.PrivateApiModule,
|
|
32
|
+
public_site_module_1.PublicSiteModule,
|
|
33
|
+
public_api_module_1.PublicApiModule,
|
|
34
|
+
],
|
|
35
|
+
controllers: [app_controller_1.AppController],
|
|
36
|
+
providers: [
|
|
37
|
+
{
|
|
38
|
+
provide: core_1.APP_FILTER,
|
|
39
|
+
useClass: app_exception_filter_1.NotFoundExceptionFilter,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
provide: core_1.APP_GUARD,
|
|
43
|
+
useClass: app_throttler_guard_1.AppThrottlerGuard,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
})
|
|
47
|
+
], AppModule);
|
|
48
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/modules/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uCAAqD;AACrD,iDAAoD;AACpD,qDAAiD;AACjD,6DAAwD;AACxD,sEAAiE;AACjE,6EAA6E;AAC7E,yEAAoE;AACpE,wEAAmE;AA0B5D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAxBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,2BAAe,CAAC,OAAO,CAAC;gBACtB;oBACE,KAAK,EAAE,EAAE;oBACT,GAAG,EAAE,IAAI;iBACV;aACF,CAAC;YACF,qCAAgB;YAChB,qCAAgB;YAChB,mCAAe;SAChB;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE;YACT;gBACE,OAAO,EAAE,iBAAU;gBACnB,QAAQ,EAAE,8CAAuB;aAClC;YACD;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,uCAAiB;aAC5B;SACF;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AccountModel {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
preferences?: string;
|
|
6
|
+
passwordHash?: string | null;
|
|
7
|
+
passwordResetToken?: string | null;
|
|
8
|
+
special?: "dev" | "platformAdmin";
|
|
9
|
+
}
|
|
10
|
+
export declare class AccountEntity implements AccountModel {
|
|
11
|
+
id: string;
|
|
12
|
+
email: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
preferences?: string;
|
|
15
|
+
passwordHash?: string | null;
|
|
16
|
+
passwordResetToken?: string | null;
|
|
17
|
+
idToString(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.AccountEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let AccountEntity = class AccountEntity {
|
|
15
|
+
id;
|
|
16
|
+
email;
|
|
17
|
+
name;
|
|
18
|
+
preferences;
|
|
19
|
+
passwordHash;
|
|
20
|
+
passwordResetToken;
|
|
21
|
+
idToString() {
|
|
22
|
+
this.id = this.id?.toString();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.AccountEntity = AccountEntity;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment", { type: "bigint" }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], AccountEntity.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ unique: true, type: "varchar" }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], AccountEntity.prototype, "email", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "varchar", nullable: true }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], AccountEntity.prototype, "name", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ nullable: true, type: "text" }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], AccountEntity.prototype, "preferences", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ nullable: true, type: "varchar", length: 200 }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], AccountEntity.prototype, "passwordHash", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ nullable: true, type: "varchar", length: 200 }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], AccountEntity.prototype, "passwordResetToken", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.AfterLoad)(),
|
|
52
|
+
__metadata("design:type", Function),
|
|
53
|
+
__metadata("design:paramtypes", []),
|
|
54
|
+
__metadata("design:returntype", void 0)
|
|
55
|
+
], AccountEntity.prototype, "idToString", null);
|
|
56
|
+
exports.AccountEntity = AccountEntity = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)("PaAccount")
|
|
58
|
+
], AccountEntity);
|
|
59
|
+
//# sourceMappingURL=account.model.js.map
|