@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,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.boMiddleware = exports.themeAssetsMiddleware = void 0;
|
|
4
|
+
const bo_1 = require("@paroicms/bo");
|
|
5
|
+
const server_lib_1 = require("@paroicms/server-lib");
|
|
6
|
+
const site_app_1 = require("@paroicms/site-app");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const data_format_1 = require("../common/data-format");
|
|
9
|
+
const serve_html_or_1 = require("../common/serve-html-or");
|
|
10
|
+
const context_1 = require("../context");
|
|
11
|
+
const site_context_1 = require("../site-context/site-context");
|
|
12
|
+
const http_helpers_1 = require("./http-helpers");
|
|
13
|
+
async function themeAssetsMiddleware(req, res, next) {
|
|
14
|
+
let path = req.path;
|
|
15
|
+
if (!path.startsWith("/assets/")) {
|
|
16
|
+
next();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let siteContext;
|
|
20
|
+
try {
|
|
21
|
+
siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
(0, http_helpers_1.serve404NoSiteHtml)(res);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let pathPrefix;
|
|
28
|
+
let baseDir;
|
|
29
|
+
if (path.startsWith("/assets/site-app/")) {
|
|
30
|
+
pathPrefix = `${(0, data_format_1.getSiteAppBaseUrl)()}/`;
|
|
31
|
+
baseDir = site_app_1.distDir;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
pathPrefix = `${(0, data_format_1.getAssetsBaseUrl)(siteContext)}/`;
|
|
35
|
+
baseDir = (0, path_1.join)(siteContext.themeDir, "assets");
|
|
36
|
+
}
|
|
37
|
+
if (!path.startsWith(pathPrefix)) {
|
|
38
|
+
void render404Asset(siteContext, res);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
path = path.substring(pathPrefix.length);
|
|
42
|
+
try {
|
|
43
|
+
res.sendFile(path, { root: baseDir, immutable: context_1.appConf.immutableAssets }, (error) => {
|
|
44
|
+
if (!error)
|
|
45
|
+
return;
|
|
46
|
+
sendFileErrorHandler(error, siteContext, res, path);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
siteContext.siteLog.error(error);
|
|
51
|
+
(0, http_helpers_1.serve500Html)(res, siteContext);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.themeAssetsMiddleware = themeAssetsMiddleware;
|
|
55
|
+
async function boMiddleware(req, res, next) {
|
|
56
|
+
let path = req.path;
|
|
57
|
+
if (req.method !== "GET" ||
|
|
58
|
+
path.startsWith("/adm/api/v1") ||
|
|
59
|
+
(path !== "/adm" && !path.startsWith("/adm/"))) {
|
|
60
|
+
next();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let siteContext;
|
|
64
|
+
try {
|
|
65
|
+
siteContext = await (0, site_context_1.getSiteContext)(req.hostname);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
(0, http_helpers_1.serve404NoSiteHtml)(res);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
path = path.substring("/adm/".length);
|
|
73
|
+
if (path === "")
|
|
74
|
+
path = "index.html";
|
|
75
|
+
if (!(await (0, server_lib_1.pathExists)((0, path_1.join)(bo_1.distDir, path)))) {
|
|
76
|
+
path = "index.html";
|
|
77
|
+
}
|
|
78
|
+
res.sendFile(path, { root: bo_1.distDir }, (error) => {
|
|
79
|
+
if (!error)
|
|
80
|
+
return;
|
|
81
|
+
sendFileErrorHandler(error, siteContext, res, path);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
siteContext.siteLog.error(error);
|
|
86
|
+
(0, http_helpers_1.serve500Html)(res, siteContext);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.boMiddleware = boMiddleware;
|
|
90
|
+
function sendFileErrorHandler(error, siteContext, res, path) {
|
|
91
|
+
if ("statusCode" in error && error.statusCode === 404) {
|
|
92
|
+
void render404Asset(siteContext, res);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
if ("code" in error) {
|
|
96
|
+
if (error.code === "ECONNABORTED") {
|
|
97
|
+
res.end();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
siteContext.siteLog.error(`failed to serve file '${path}':`, error.code, error);
|
|
101
|
+
}
|
|
102
|
+
(0, http_helpers_1.serve500Html)(res, siteContext);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function render404Asset(siteContext, res) {
|
|
106
|
+
try {
|
|
107
|
+
await (0, serve_html_or_1.render404Html)(siteContext, res);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
siteContext.siteLog.error("failed to render 404", error);
|
|
111
|
+
(0, http_helpers_1.serve500Html)(res, siteContext);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=static-middlewares.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-middlewares.js","sourceRoot":"","sources":["../../src/express/static-middlewares.ts"],"names":[],"mappings":";;;AAAA,qCAAoD;AACpD,qDAAkD;AAClD,iDAA+D;AAE/D,+BAA4B;AAC5B,uDAA4E;AAC5E,2DAAwD;AACxD,wCAAqC;AACrC,+DAA8D;AAE9D,iDAAkE;AAE3D,KAAK,UAAU,qBAAqB,CAAC,GAAY,EAAE,GAAa,EAAE,IAAgB;IACvF,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACpB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,IAAI,EAAE,CAAC;QACP,OAAO;IACT,CAAC;IAED,IAAI,WAAwB,CAAC;IAC7B,IAAI,CAAC;QACH,WAAW,GAAG,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,iCAAkB,EAAC,GAAG,CAAC,CAAC;QACxB,OAAO;IACT,C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F,IAAI,YAAY,IAAI,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;QACtD,KAAK,cAAc,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;gBAClC,GAAG,CAAC,GAAG,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YACD,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,IAAI,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClF,CAAC;QACD,IAAA,2BAAY,EAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,WAAwB,EAAE,GAAa;IACnE,IAAI,CAAC;QACH,MAAM,IAAA,6BAAa,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QACzD,IAAA,2BAAY,EAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMultiSiteConfiguration = void 0;
|
|
4
|
+
function isMultiSiteConfiguration(appConf) {
|
|
5
|
+
return "platformDataDir" in appConf;
|
|
6
|
+
}
|
|
7
|
+
exports.isMultiSiteConfiguration = isMultiSiteConfiguration;
|
|
8
|
+
//# sourceMappingURL=configuration.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.helpers.js","sourceRoot":"","sources":["../../src/helpers/configuration.helpers.ts"],"names":[],"mappings":";;;AAEA,SAAgB,wBAAwB,CACtC,OAAsB;IAEtB,OAAO,iBAAiB,IAAI,OAAO,CAAC;AACtC,CAAC;AAJD,4DAIC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.truncExcerptToWord = exports.toExcerptString = void 0;
|
|
4
|
+
function toExcerptString(rawText) {
|
|
5
|
+
return rawText.replaceAll(/[.…,;:!?\s]+/g, replacer).trim();
|
|
6
|
+
}
|
|
7
|
+
exports.toExcerptString = toExcerptString;
|
|
8
|
+
function replacer(match) {
|
|
9
|
+
return match === " " ? " " : " ";
|
|
10
|
+
}
|
|
11
|
+
function truncExcerptToWord(input, maxLength) {
|
|
12
|
+
const hasEllipsis = input.charAt(input.length - 1) === "…";
|
|
13
|
+
const excerpt = toExcerptString(input);
|
|
14
|
+
let sepIndex = maxLength;
|
|
15
|
+
if (sepIndex >= excerpt.length) {
|
|
16
|
+
sepIndex = excerpt.length;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
for (sepIndex = maxLength; sepIndex >= 0; --sepIndex) {
|
|
20
|
+
if (excerpt.charAt(sepIndex) === " ")
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const result = excerpt.substring(0, sepIndex);
|
|
25
|
+
if (hasEllipsis || sepIndex < excerpt.length) {
|
|
26
|
+
return `${result}…`;
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
exports.truncExcerptToWord = truncExcerptToWord;
|
|
31
|
+
//# sourceMappingURL=excerpt.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excerpt.helpers.js","sourceRoot":"","sources":["../../src/helpers/excerpt.helpers.ts"],"names":[],"mappings":";;;AACA,SAAgB,eAAe,CAAC,OAAe;IAC7C,OAAO,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC;AAFD,0CAEC;AAED,SAAS,QAAQ,CAAE,KAAa;IAC9B,OAAO,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAa,EAAE,SAAiB;IACjE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;IAC3D,MAAM,OAAO,GAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IAExC,IAAI,QAAQ,GAAG,SAAS,CAAC;IACzB,IAAI,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAC/B,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,KAAK,QAAQ,GAAG,SAAS,EAAE,QAAQ,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC;YACrD,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG;gBAAE,MAAM;QAC9C,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAE9C,IAAI,WAAW,IAAI,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAC7C,OAAO,GAAG,MAAM,GAAG,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAnBD,gDAmBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const excerpt_helpers_1 = require("./excerpt.helpers");
|
|
5
|
+
(0, vitest_1.describe)("toExcerptString", () => {
|
|
6
|
+
(0, vitest_1.it)("should trim all extra spaces", () => {
|
|
7
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)(" Lorem ipsum ")).toBe("Lorem ipsum");
|
|
8
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)(" \t \n\r Lorem \t\n\ripsum \t\n\r ")).toBe("Lorem ipsum");
|
|
9
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)(" Lorem ipsum ")).toBe("Lorem ipsum");
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.it)("should work with several kind of spaces", () => {
|
|
12
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem ipsum")).toBe("Lorem ipsum");
|
|
13
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem \t\n\ripsum")).toBe("Lorem ipsum");
|
|
14
|
+
});
|
|
15
|
+
(0, vitest_1.it)("should return the same string", () => {
|
|
16
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem 12")).toBe("Lorem 12");
|
|
17
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem12")).toBe("Lorem12");
|
|
18
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem2ipsum")).toBe("Lorem2ipsum");
|
|
19
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem_ipsum")).toBe("Lorem_ipsum");
|
|
20
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem-ipsum")).toBe("Lorem-ipsum");
|
|
21
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem'ipsum")).toBe("Lorem'ipsum");
|
|
22
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)('Lorem"ipsum')).toBe('Lorem"ipsum');
|
|
23
|
+
});
|
|
24
|
+
(0, vitest_1.it)("should keep non-breaking spaces", () => {
|
|
25
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem ipsum")).toBe("Lorem ipsum");
|
|
26
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("« Lorem ipsum »")).toBe("« Lorem ipsum »");
|
|
27
|
+
});
|
|
28
|
+
(0, vitest_1.it)("should ignore several non-breaking spaces", () => {
|
|
29
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem ipsum")).toBe("Lorem ipsum");
|
|
30
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem ipsum")).toBe("Lorem ipsum");
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.it)("should ignore non-breaking spaces when associated with other spaces", () => {
|
|
33
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)("Lorem \t\n\ripsum")).toBe("Lorem ipsum");
|
|
34
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.toExcerptString)(" Lorem \t\n\ripsum")).toBe("Lorem ipsum");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.describe)("truncExcerptToWord", () => {
|
|
38
|
+
(0, vitest_1.it)("should return no word", () => {
|
|
39
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem", 4);
|
|
40
|
+
(0, vitest_1.expect)(excerpt).toBe("…");
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.it)("should return the word", () => {
|
|
43
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem", 5);
|
|
44
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem");
|
|
45
|
+
});
|
|
46
|
+
(0, vitest_1.it)("should return the word (alt)", () => {
|
|
47
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem", 6);
|
|
48
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem");
|
|
49
|
+
});
|
|
50
|
+
(0, vitest_1.it)("should return no word with ellipsis", () => {
|
|
51
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem…", 4);
|
|
52
|
+
(0, vitest_1.expect)(excerpt).toBe("…");
|
|
53
|
+
});
|
|
54
|
+
(0, vitest_1.it)("should return the word with ellipsis", () => {
|
|
55
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem…", 5);
|
|
56
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem…");
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.it)("should return the word with ellipsis (alt)", () => {
|
|
59
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem…", 6);
|
|
60
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem…");
|
|
61
|
+
});
|
|
62
|
+
(0, vitest_1.it)("should return no word (from 5)", () => {
|
|
63
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 2);
|
|
64
|
+
(0, vitest_1.expect)(excerpt).toBe("…");
|
|
65
|
+
});
|
|
66
|
+
(0, vitest_1.it)("should return 2 words", () => {
|
|
67
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 13);
|
|
68
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem ipsum…");
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.it)("should return 3 words (v1)", () => {
|
|
71
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 17);
|
|
72
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem ipsum dolor…");
|
|
73
|
+
});
|
|
74
|
+
(0, vitest_1.it)("should return 3 words (v2)", () => {
|
|
75
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 18);
|
|
76
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem ipsum dolor…");
|
|
77
|
+
});
|
|
78
|
+
(0, vitest_1.it)("should return 3 words (v3)", () => {
|
|
79
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 19);
|
|
80
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem ipsum dolor…");
|
|
81
|
+
});
|
|
82
|
+
(0, vitest_1.it)("should return all the words (v1)", () => {
|
|
83
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 26);
|
|
84
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem ipsum dolor sit amet");
|
|
85
|
+
});
|
|
86
|
+
(0, vitest_1.it)("should return all the words (v2)", () => {
|
|
87
|
+
const excerpt = (0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum dolor sit amet", 100);
|
|
88
|
+
(0, vitest_1.expect)(excerpt).toBe("Lorem ipsum dolor sit amet");
|
|
89
|
+
});
|
|
90
|
+
(0, vitest_1.it)("should work with accent (part 1)", () => {
|
|
91
|
+
const input = "abc é ù ï œ à è ê ç éz ùz ïz œz àz èz êz çz def ghi";
|
|
92
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 3)).toBe("abc…");
|
|
93
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 5)).toBe("abc é…");
|
|
94
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 7)).toBe("abc é ù…");
|
|
95
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 9)).toBe("abc é ù ï…");
|
|
96
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 11)).toBe("abc é ù ï œ…");
|
|
97
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 13)).toBe("abc é ù ï œ à…");
|
|
98
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 15)).toBe("abc é ù ï œ à è…");
|
|
99
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 17)).toBe("abc é ù ï œ à è ê…");
|
|
100
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 19)).toBe("abc é ù ï œ à è ê ç…");
|
|
101
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 22)).toBe("abc é ù ï œ à è ê ç éz…");
|
|
102
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 25)).toBe("abc é ù ï œ à è ê ç éz ùz…");
|
|
103
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 28)).toBe("abc é ù ï œ à è ê ç éz ùz ïz…");
|
|
104
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 31)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz…");
|
|
105
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 34)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz àz…");
|
|
106
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 37)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz àz èz…");
|
|
107
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 40)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz àz èz êz…");
|
|
108
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 43)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz àz èz êz çz…");
|
|
109
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 47)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz àz èz êz çz def…");
|
|
110
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)(input, 51)).toBe("abc é ù ï œ à è ê ç éz ùz ïz œz àz èz êz çz def ghi");
|
|
111
|
+
});
|
|
112
|
+
(0, vitest_1.it)("should transform several kind of spaces", () => {
|
|
113
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem ipsum", 11)).toBe("Lorem ipsum");
|
|
114
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem\tipsum", 11)).toBe("Lorem ipsum");
|
|
115
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem\nipsum", 11)).toBe("Lorem ipsum");
|
|
116
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem\ripsum", 11)).toBe("Lorem ipsum");
|
|
117
|
+
});
|
|
118
|
+
(0, vitest_1.it)("should work with special characters", () => {
|
|
119
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem 12", 50)).toBe("Lorem 12");
|
|
120
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem12", 50)).toBe("Lorem12");
|
|
121
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem2ipsum", 50)).toBe("Lorem2ipsum");
|
|
122
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem2ipsum", 5)).toBe("…");
|
|
123
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem_ipsum", 50)).toBe("Lorem_ipsum");
|
|
124
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem_ipsum", 5)).toBe("…");
|
|
125
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem-ipsum", 50)).toBe("Lorem-ipsum");
|
|
126
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem-ipsum", 5)).toBe("…");
|
|
127
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem'ipsum", 50)).toBe("Lorem'ipsum");
|
|
128
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)("Lorem'ipsum", 5)).toBe("…");
|
|
129
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)('Lorem"ipsum', 50)).toBe('Lorem"ipsum');
|
|
130
|
+
(0, vitest_1.expect)((0, excerpt_helpers_1.truncExcerptToWord)('Lorem"ipsum', 5)).toBe("…");
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=excerpt.helpers.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excerpt.helpers.spec.js","sourceRoot":"","sources":["../../src/helpers/excerpt.helpers.spec.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,uDAAwE;AAExE,IAAA,iBAAQ,EAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAA,WAAE,EAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,IAAA,eAAM,EAAC,IAAA,iCAAe,EAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,IAAA,eAAM,EAAC,IAAA,iCAAe,EAAC,uCAAuC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrF,IAAA,eAAM,EAAC,IAAA,iCAAe,EAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,IAAA,eAAM,EAAC,IAAA,iCAAe,EAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5D,IAAA,eAAM,EAAC,IAAA,iCAAe,EAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,IAAA,eAAM,EAAC,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E,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeSecret = exports.getJwtSecretSync = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
function getJwtSecretSync(file) {
|
|
6
|
+
if (!pathExistsSync(file)) {
|
|
7
|
+
(0, fs_1.writeFileSync)(file, makeSecret(50), "utf8");
|
|
8
|
+
}
|
|
9
|
+
return (0, fs_1.readFileSync)(file, "utf8");
|
|
10
|
+
}
|
|
11
|
+
exports.getJwtSecretSync = getJwtSecretSync;
|
|
12
|
+
function makeSecret(length) {
|
|
13
|
+
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
14
|
+
let result = "";
|
|
15
|
+
for (let i = 0; i < length; i++) {
|
|
16
|
+
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
exports.makeSecret = makeSecret;
|
|
21
|
+
function pathExistsSync(path) {
|
|
22
|
+
try {
|
|
23
|
+
(0, fs_1.accessSync)(path);
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=jwt-secret.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-secret.helpers.js","sourceRoot":"","sources":["../../src/helpers/jwt-secret.helpers.ts"],"names":[],"mappings":";;;AAAA,2BAA6D;AAE7D,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,IAAA,kBAAa,EAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,IAAA,iBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC;AALD,4CAKC;AAED,SAAgB,UAAU,CAAC,MAAc;IACvC,MAAM,UAAU,GAAG,gEAAgE,CAAC;IACpF,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,gCAOC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,IAAI,CAAC;QACH,IAAA,eAAU,EAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SiteSchema } from "@paroicms/anywhere-lib";
|
|
2
|
+
export declare function getDocumentLeafTypeLabel(siteSchema: SiteSchema, options: {
|
|
3
|
+
leafType: string;
|
|
4
|
+
lang: string;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function getPartLeafTypeLabel(siteSchema: SiteSchema, options: {
|
|
7
|
+
leafType: string;
|
|
8
|
+
lang: string;
|
|
9
|
+
}): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPartLeafTypeLabel = exports.getDocumentLeafTypeLabel = void 0;
|
|
4
|
+
function getDocumentLeafTypeLabel(siteSchema, options) {
|
|
5
|
+
const label = siteSchema.l10n[options.lang]?.documentTypes[options.leafType]?.label;
|
|
6
|
+
return typeof label === "string" ? label : options.leafType;
|
|
7
|
+
}
|
|
8
|
+
exports.getDocumentLeafTypeLabel = getDocumentLeafTypeLabel;
|
|
9
|
+
function getPartLeafTypeLabel(siteSchema, options) {
|
|
10
|
+
const label = siteSchema.l10n[options.lang]?.partTypes[options.leafType]?.label;
|
|
11
|
+
return typeof label === "string" ? label : options.leafType;
|
|
12
|
+
}
|
|
13
|
+
exports.getPartLeafTypeLabel = getPartLeafTypeLabel;
|
|
14
|
+
//# sourceMappingURL=label-translator.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-translator.helper.js","sourceRoot":"","sources":["../../src/helpers/label-translator.helper.ts"],"names":[],"mappings":";;;AAEA,SAAgB,wBAAwB,CACtC,UAAsB,EACtB,OAA2C;IAE3C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IACpF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC9D,CAAC;AAND,4DAMC;AAED,SAAgB,oBAAoB,CAClC,UAAsB,EACtB,OAA2C;IAE3C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAChF,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC9D,CAAC;AAND,oDAMC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.comparePassword = exports.hashPassword = void 0;
|
|
27
|
+
const bcrypt = __importStar(require("bcrypt"));
|
|
28
|
+
const salt = 10;
|
|
29
|
+
async function hashPassword(password) {
|
|
30
|
+
return await bcrypt.hash(password, salt);
|
|
31
|
+
}
|
|
32
|
+
exports.hashPassword = hashPassword;
|
|
33
|
+
async function comparePassword(password, passwordHash) {
|
|
34
|
+
return await bcrypt.compare(password, passwordHash);
|
|
35
|
+
}
|
|
36
|
+
exports.comparePassword = comparePassword;
|
|
37
|
+
//# sourceMappingURL=passwordEncrypt-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passwordEncrypt-helper.js","sourceRoot":"","sources":["../../src/helpers/passwordEncrypt-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAM,IAAI,GAAG,EAAE,CAAC;AAET,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAFD,oCAEC;AAEM,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,YAAoB;IAC1E,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACtD,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RandomCharsGeneratorConfig {
|
|
2
|
+
chars: string;
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function makeDefaultRelativeId({ smallAlphabet, bigAlphabet, size, }?: {
|
|
7
|
+
smallAlphabet?: string | undefined;
|
|
8
|
+
bigAlphabet?: string | undefined;
|
|
9
|
+
size?: number | undefined;
|
|
10
|
+
}): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeDefaultRelativeId = void 0;
|
|
4
|
+
function makeDefaultRelativeId({ smallAlphabet = "023456789", bigAlphabet = "023456789abcdefghijkmnopqrstuvwxyz", size = 3, } = {}) {
|
|
5
|
+
const flags = Array(size);
|
|
6
|
+
const maxFlagIndex = size - 1;
|
|
7
|
+
while (true) {
|
|
8
|
+
const remaining = [];
|
|
9
|
+
for (let i = 0; i < size; ++i) {
|
|
10
|
+
if (flags[i] === undefined) {
|
|
11
|
+
remaining.push(i);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (remaining.length === 0)
|
|
15
|
+
break;
|
|
16
|
+
const remainingIndex = randomInt(0, remaining.length);
|
|
17
|
+
const flagIndex = remaining[remainingIndex];
|
|
18
|
+
flags[flagIndex] = "b";
|
|
19
|
+
if (flagIndex > 0)
|
|
20
|
+
flags[flagIndex - 1] = "s";
|
|
21
|
+
if (flagIndex < maxFlagIndex)
|
|
22
|
+
flags[flagIndex + 1] = "s";
|
|
23
|
+
}
|
|
24
|
+
const result = [];
|
|
25
|
+
for (let i = 0; i < size; ++i) {
|
|
26
|
+
result.push(randomCharacterOf(flags[i] === "b" ? bigAlphabet : smallAlphabet));
|
|
27
|
+
}
|
|
28
|
+
return result.join("");
|
|
29
|
+
}
|
|
30
|
+
exports.makeDefaultRelativeId = makeDefaultRelativeId;
|
|
31
|
+
function randomCharacterOf(alphabet) {
|
|
32
|
+
return alphabet[Math.floor(Math.random() * alphabet.length)];
|
|
33
|
+
}
|
|
34
|
+
function randomInt(min, max) {
|
|
35
|
+
return Math.floor(Math.random() * (max - min) + min);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=relative-id-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relative-id-helper.js","sourceRoot":"","sources":["../../src/helpers/relative-id-helper.ts"],"names":[],"mappings":";;;AAMA,SAAgB,qBAAqB,CAAC,EACpC,aAAa,GAAG,WAAW,EAC3B,WAAW,GAAG,oCAAoC,EAClD,IAAI,GAAG,CAAC,GACT,GAAG,EAAE;IACJ,MAAM,KAAK,GAA8B,KAAK,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC;IAE9B,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;YAC9B,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC3B,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,CAAC;QACH,CAAC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-context/site-context.types";
|
|
3
|
+
export declare function getSearchResultItemImage(siteContext: SiteContext, imageUid: string, variantName: VariantName): Promise<{
|
|
4
|
+
url: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
} | undefined>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSearchResultItemImage = void 0;
|
|
4
|
+
const utils_helper_1 = require("./utils-helper");
|
|
5
|
+
async function getSearchResultItemImage(siteContext, imageUid, variantName) {
|
|
6
|
+
const media = await siteContext.mediaStorage.getMedia({ uid: imageUid });
|
|
7
|
+
if (!media || media.kind !== "image")
|
|
8
|
+
return;
|
|
9
|
+
const { height, width, completeVariantName } = siteContext.variantEngine.makeImageAvailable({
|
|
10
|
+
imageRef: {
|
|
11
|
+
height: media.height,
|
|
12
|
+
imageUid: media.uid,
|
|
13
|
+
width: media.width,
|
|
14
|
+
mediaType: media.mediaType,
|
|
15
|
+
},
|
|
16
|
+
autoCrop: false,
|
|
17
|
+
variantName,
|
|
18
|
+
});
|
|
19
|
+
const baseUrl = `${siteContext.siteUrl}/medias`;
|
|
20
|
+
return {
|
|
21
|
+
url: `${baseUrl}/${imageUid}-${completeVariantName}.${(0, utils_helper_1.mediaTypeToFileExtension)(media.mediaType)}`,
|
|
22
|
+
width,
|
|
23
|
+
height,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.getSearchResultItemImage = getSearchResultItemImage;
|
|
27
|
+
//# sourceMappingURL=search-text-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-text-helper.js","sourceRoot":"","sources":["../../src/helpers/search-text-helper.ts"],"names":[],"mappings":";;;AAEA,iDAA0D;AAEnD,KAAK,UAAU,wBAAwB,CAC5C,WAAwB,EACxB,QAAgB,EAChB,WAAwB;IAExB,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO;IAE7C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC;QAC1F,QAAQ,EAAE;YACR,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,QAAQ,EAAE,KAAK,CAAC,GAAG;YACnB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B;QACD,QAAQ,EAAE,KAAK;QACf,WAAW;KACZ,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,GAAG,WAAW,CAAC,OAAO,SAAS,CAAC;IAChD,OAAO;QACL,GAAG,EAAE,GAAG,OAAO,IAAI,QAAQ,IAAI,mBAAmB,IAAI,IAAA,uCAAwB,EAC5E,KAAK,CAAC,SAAS,CAChB,EAAE;QACH,KAAK;QACL,MAAM;KACP,CAAC;AACJ,CAAC;AA1BD,4DA0BC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AppLog } from "@paroicms/server-lib";
|
|
2
|
+
export interface SimpleTranslator {
|
|
3
|
+
translate: (options: SimpleTranslateOptions) => string;
|
|
4
|
+
}
|
|
5
|
+
export interface SimpleTranslateOptions {
|
|
6
|
+
lang: string;
|
|
7
|
+
key: string;
|
|
8
|
+
args?: (string | number)[];
|
|
9
|
+
}
|
|
10
|
+
export declare function createSimpleTranslator(options: {
|
|
11
|
+
l10nDir: string;
|
|
12
|
+
langs: string[];
|
|
13
|
+
appLog: Pick<AppLog, "warn">;
|
|
14
|
+
}): Promise<SimpleTranslator>;
|