@paroicms/server 0.146.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/ddl/main.ddl.sql +84 -0
- package/dist/backup/site/archiver.helper.d.ts +12 -0
- package/dist/backup/site/archiver.helper.js +46 -0
- package/dist/backup/site/archiver.helper.js.map +1 -0
- package/dist/backup/site/backup.d.ts +5 -0
- package/dist/backup/site/backup.js +118 -0
- package/dist/backup/site/backup.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -0
- package/dist/common/child-ordering-query.d.ts +13 -0
- package/dist/common/child-ordering-query.js +107 -0
- package/dist/common/child-ordering-query.js.map +1 -0
- package/dist/common/data-format.d.ts +19 -0
- package/dist/common/data-format.js +86 -0
- package/dist/common/data-format.js.map +1 -0
- package/dist/common/mail/html-helpers.d.ts +7 -0
- package/dist/common/mail/html-helpers.js +46 -0
- package/dist/common/mail/html-helpers.js.map +1 -0
- package/dist/common/mail/sendMail.helpers.d.ts +14 -0
- package/dist/common/mail/sendMail.helpers.js +51 -0
- package/dist/common/mail/sendMail.helpers.js.map +1 -0
- package/dist/common/media-handles.helpers.d.ts +19 -0
- package/dist/common/media-handles.helpers.js +52 -0
- package/dist/common/media-handles.helpers.js.map +1 -0
- package/dist/common/serve-html-or.d.ts +16 -0
- package/dist/common/serve-html-or.js +72 -0
- package/dist/common/serve-html-or.js.map +1 -0
- package/dist/common/text-cache.d.ts +57 -0
- package/dist/common/text-cache.js +87 -0
- package/dist/common/text-cache.js.map +1 -0
- package/dist/common/tracker-report.d.ts +2 -0
- package/dist/common/tracker-report.js +27 -0
- package/dist/common/tracker-report.js.map +1 -0
- package/dist/context.d.ts +29 -0
- package/dist/context.js +60 -0
- package/dist/context.js.map +1 -0
- package/dist/express/http-helpers.d.ts +16 -0
- package/dist/express/http-helpers.js +44 -0
- package/dist/express/http-helpers.js.map +1 -0
- package/dist/express/static-middlewares.d.ts +3 -0
- package/dist/express/static-middlewares.js +114 -0
- package/dist/express/static-middlewares.js.map +1 -0
- package/dist/helpers/configuration.helpers.d.ts +2 -0
- package/dist/helpers/configuration.helpers.js +8 -0
- package/dist/helpers/configuration.helpers.js.map +1 -0
- package/dist/helpers/excerpt.helpers.d.ts +2 -0
- package/dist/helpers/excerpt.helpers.js +31 -0
- package/dist/helpers/excerpt.helpers.js.map +1 -0
- package/dist/helpers/excerpt.helpers.spec.d.ts +1 -0
- package/dist/helpers/excerpt.helpers.spec.js +133 -0
- package/dist/helpers/excerpt.helpers.spec.js.map +1 -0
- package/dist/helpers/jwt-secret.helpers.d.ts +2 -0
- package/dist/helpers/jwt-secret.helpers.js +30 -0
- package/dist/helpers/jwt-secret.helpers.js.map +1 -0
- package/dist/helpers/label-translator.helper.d.ts +9 -0
- package/dist/helpers/label-translator.helper.js +14 -0
- package/dist/helpers/label-translator.helper.js.map +1 -0
- package/dist/helpers/passwordEncrypt-helper.d.ts +2 -0
- package/dist/helpers/passwordEncrypt-helper.js +37 -0
- package/dist/helpers/passwordEncrypt-helper.js.map +1 -0
- package/dist/helpers/relative-id-helper.d.ts +10 -0
- package/dist/helpers/relative-id-helper.js +37 -0
- package/dist/helpers/relative-id-helper.js.map +1 -0
- package/dist/helpers/search-text-helper.d.ts +7 -0
- package/dist/helpers/search-text-helper.js +27 -0
- package/dist/helpers/search-text-helper.js.map +1 -0
- package/dist/helpers/simple-i18n.d.ts +14 -0
- package/dist/helpers/simple-i18n.js +82 -0
- package/dist/helpers/simple-i18n.js.map +1 -0
- package/dist/helpers/special-account.helpers.d.ts +9 -0
- package/dist/helpers/special-account.helpers.js +43 -0
- package/dist/helpers/special-account.helpers.js.map +1 -0
- package/dist/helpers/url.helpers.d.ts +2 -0
- package/dist/helpers/url.helpers.js +12 -0
- package/dist/helpers/url.helpers.js.map +1 -0
- package/dist/helpers/utils-helper.d.ts +4 -0
- package/dist/helpers/utils-helper.js +32 -0
- package/dist/helpers/utils-helper.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/maintenance/maintenance-task.d.ts +4 -0
- package/dist/maintenance/maintenance-task.js +27 -0
- package/dist/maintenance/maintenance-task.js.map +1 -0
- package/dist/maintenance/shutdown.d.ts +7 -0
- package/dist/maintenance/shutdown.js +51 -0
- package/dist/maintenance/shutdown.js.map +1 -0
- package/dist/modules/app.controller.d.ts +5 -0
- package/dist/modules/app.controller.js +89 -0
- package/dist/modules/app.controller.js.map +1 -0
- package/dist/modules/app.module.d.ts +2 -0
- package/dist/modules/app.module.js +48 -0
- package/dist/modules/app.module.js.map +1 -0
- package/dist/modules/core/account/account.model.d.ts +18 -0
- package/dist/modules/core/account/account.model.js +59 -0
- package/dist/modules/core/account/account.model.js.map +1 -0
- package/dist/modules/core/account/account.module.d.ts +2 -0
- package/dist/modules/core/account/account.module.js +20 -0
- package/dist/modules/core/account/account.module.js.map +1 -0
- package/dist/modules/core/account/account.queries.d.ts +18 -0
- package/dist/modules/core/account/account.queries.js +150 -0
- package/dist/modules/core/account/account.queries.js.map +1 -0
- package/dist/modules/core/account/account.resolver.d.ts +11 -0
- package/dist/modules/core/account/account.resolver.js +107 -0
- package/dist/modules/core/account/account.resolver.js.map +1 -0
- package/dist/modules/core/account/account.schema.d.ts +24 -0
- package/dist/modules/core/account/account.schema.js +114 -0
- package/dist/modules/core/account/account.schema.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.controller.d.ts +5 -0
- package/dist/modules/core/account-auth/account-auth.controller.js +46 -0
- package/dist/modules/core/account-auth/account-auth.controller.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.module.d.ts +2 -0
- package/dist/modules/core/account-auth/account-auth.module.js +24 -0
- package/dist/modules/core/account-auth/account-auth.module.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.service.d.ts +5 -0
- package/dist/modules/core/account-auth/account-auth.service.js +41 -0
- package/dist/modules/core/account-auth/account-auth.service.js.map +1 -0
- package/dist/modules/core/account-auth/account-auth.strategy.d.ts +10 -0
- package/dist/modules/core/account-auth/account-auth.strategy.js +49 -0
- package/dist/modules/core/account-auth/account-auth.strategy.js.map +1 -0
- package/dist/modules/core/auth/auth.module.d.ts +2 -0
- package/dist/modules/core/auth/auth.module.js +35 -0
- package/dist/modules/core/auth/auth.module.js.map +1 -0
- package/dist/modules/core/auth/auth.service.d.ts +11 -0
- package/dist/modules/core/auth/auth.service.js +164 -0
- package/dist/modules/core/auth/auth.service.js.map +1 -0
- package/dist/modules/core/auth/auth.types.d.ts +27 -0
- package/dist/modules/core/auth/auth.types.js +3 -0
- package/dist/modules/core/auth/auth.types.js.map +1 -0
- package/dist/modules/core/auth/jwt.auth.guard.d.ts +6 -0
- package/dist/modules/core/auth/jwt.auth.guard.js +23 -0
- package/dist/modules/core/auth/jwt.auth.guard.js.map +1 -0
- package/dist/modules/core/auth/jwt.strategy.d.ts +10 -0
- package/dist/modules/core/auth/jwt.strategy.js +35 -0
- package/dist/modules/core/auth/jwt.strategy.js.map +1 -0
- package/dist/modules/core/backup/backup.controller.d.ts +7 -0
- package/dist/modules/core/backup/backup.controller.js +61 -0
- package/dist/modules/core/backup/backup.controller.js.map +1 -0
- package/dist/modules/core/backup/backup.module.d.ts +2 -0
- package/dist/modules/core/backup/backup.module.js +22 -0
- package/dist/modules/core/backup/backup.module.js.map +1 -0
- package/dist/modules/core/backup/backup.resolver.d.ts +8 -0
- package/dist/modules/core/backup/backup.resolver.js +54 -0
- package/dist/modules/core/backup/backup.resolver.js.map +1 -0
- package/dist/modules/core/backup/backup.shema.d.ts +4 -0
- package/dist/modules/core/backup/backup.shema.js +30 -0
- package/dist/modules/core/backup/backup.shema.js.map +1 -0
- package/dist/modules/core/core.module.d.ts +2 -0
- package/dist/modules/core/core.module.js +50 -0
- package/dist/modules/core/core.module.js.map +1 -0
- package/dist/modules/core/document/document.helper.d.ts +2 -0
- package/dist/modules/core/document/document.helper.js +10 -0
- package/dist/modules/core/document/document.helper.js.map +1 -0
- package/dist/modules/core/document/document.model.d.ts +9 -0
- package/dist/modules/core/document/document.model.js +59 -0
- package/dist/modules/core/document/document.model.js.map +1 -0
- package/dist/modules/core/document/document.module.d.ts +2 -0
- package/dist/modules/core/document/document.module.js +25 -0
- package/dist/modules/core/document/document.module.js.map +1 -0
- package/dist/modules/core/document/document.resolver.d.ts +12 -0
- package/dist/modules/core/document/document.resolver.extend.d.ts +10 -0
- package/dist/modules/core/document/document.resolver.extend.js +69 -0
- package/dist/modules/core/document/document.resolver.extend.js.map +1 -0
- package/dist/modules/core/document/document.resolver.js +154 -0
- package/dist/modules/core/document/document.resolver.js.map +1 -0
- package/dist/modules/core/document/document.schema.d.ts +39 -0
- package/dist/modules/core/document/document.schema.js +181 -0
- package/dist/modules/core/document/document.schema.js.map +1 -0
- package/dist/modules/core/document/load-documents.queries.d.ts +17 -0
- package/dist/modules/core/document/load-documents.queries.js +119 -0
- package/dist/modules/core/document/load-documents.queries.js.map +1 -0
- package/dist/modules/core/document/save-documents.queries.d.ts +18 -0
- package/dist/modules/core/document/save-documents.queries.js +199 -0
- package/dist/modules/core/document/save-documents.queries.js.map +1 -0
- package/dist/modules/core/document/search-document-item.resolver.d.ts +7 -0
- package/dist/modules/core/document/search-document-item.resolver.js +58 -0
- package/dist/modules/core/document/search-document-item.resolver.js.map +1 -0
- package/dist/modules/core/fields/_fields.helpers.d.ts +2 -0
- package/dist/modules/core/fields/_fields.helpers.js +12 -0
- package/dist/modules/core/fields/_fields.helpers.js.map +1 -0
- package/dist/modules/core/fields/fields.model.d.ts +17 -0
- package/dist/modules/core/fields/fields.model.js +99 -0
- package/dist/modules/core/fields/fields.model.js.map +1 -0
- package/dist/modules/core/fields/fields.module.d.ts +2 -0
- package/dist/modules/core/fields/fields.module.js +20 -0
- package/dist/modules/core/fields/fields.module.js.map +1 -0
- package/dist/modules/core/fields/fields.resolver.d.ts +14 -0
- package/dist/modules/core/fields/fields.resolver.js +165 -0
- package/dist/modules/core/fields/fields.resolver.js.map +1 -0
- package/dist/modules/core/fields/load-fields.queries.d.ts +20 -0
- package/dist/modules/core/fields/load-fields.queries.js +233 -0
- package/dist/modules/core/fields/load-fields.queries.js.map +1 -0
- package/dist/modules/core/fields/quill-delta.d.ts +1 -0
- package/dist/modules/core/fields/quill-delta.js +40 -0
- package/dist/modules/core/fields/quill-delta.js.map +1 -0
- package/dist/modules/core/fields/save-fields.queries.d.ts +9 -0
- package/dist/modules/core/fields/save-fields.queries.js +135 -0
- package/dist/modules/core/fields/save-fields.queries.js.map +1 -0
- package/dist/modules/core/leaf/leaf.model.d.ts +9 -0
- package/dist/modules/core/leaf/leaf.model.js +61 -0
- package/dist/modules/core/leaf/leaf.model.js.map +1 -0
- package/dist/modules/core/leaf/leaf.module.d.ts +2 -0
- package/dist/modules/core/leaf/leaf.module.js +21 -0
- package/dist/modules/core/leaf/leaf.module.js.map +1 -0
- package/dist/modules/core/leaf/leaf.queries.d.ts +21 -0
- package/dist/modules/core/leaf/leaf.queries.js +143 -0
- package/dist/modules/core/leaf/leaf.queries.js.map +1 -0
- package/dist/modules/core/leaf/leaf.resolver.d.ts +9 -0
- package/dist/modules/core/leaf/leaf.resolver.extend.d.ts +6 -0
- package/dist/modules/core/leaf/leaf.resolver.extend.js +42 -0
- package/dist/modules/core/leaf/leaf.resolver.extend.js.map +1 -0
- package/dist/modules/core/leaf/leaf.resolver.js +84 -0
- package/dist/modules/core/leaf/leaf.resolver.js.map +1 -0
- package/dist/modules/core/leaf/leaf.schema.d.ts +7 -0
- package/dist/modules/core/leaf/leaf.schema.js +45 -0
- package/dist/modules/core/leaf/leaf.schema.js.map +1 -0
- package/dist/modules/core/leaf-item/leaf-item.model.d.ts +6 -0
- package/dist/modules/core/leaf-item/leaf-item.model.js +44 -0
- package/dist/modules/core/leaf-item/leaf-item.model.js.map +1 -0
- package/dist/modules/core/leaf-item/leaf-item.queries.d.ts +9 -0
- package/dist/modules/core/leaf-item/leaf-item.queries.js +120 -0
- package/dist/modules/core/leaf-item/leaf-item.queries.js.map +1 -0
- package/dist/modules/core/login/login.controller.d.ts +8 -0
- package/dist/modules/core/login/login.controller.js +54 -0
- package/dist/modules/core/login/login.controller.js.map +1 -0
- package/dist/modules/core/login/login.module.d.ts +2 -0
- package/dist/modules/core/login/login.module.js +22 -0
- package/dist/modules/core/login/login.module.js.map +1 -0
- package/dist/modules/core/media/media-upload.controller.d.ts +21 -0
- package/dist/modules/core/media/media-upload.controller.js +160 -0
- package/dist/modules/core/media/media-upload.controller.js.map +1 -0
- package/dist/modules/core/media/media.d.ts +22 -0
- package/dist/modules/core/media/media.js +53 -0
- package/dist/modules/core/media/media.js.map +1 -0
- package/dist/modules/core/media/media.module.d.ts +2 -0
- package/dist/modules/core/media/media.module.js +22 -0
- package/dist/modules/core/media/media.module.js.map +1 -0
- package/dist/modules/core/media/media.resolver.d.ts +14 -0
- package/dist/modules/core/media/media.resolver.js +199 -0
- package/dist/modules/core/media/media.resolver.js.map +1 -0
- package/dist/modules/core/media/media.schema.d.ts +30 -0
- package/dist/modules/core/media/media.schema.js +144 -0
- package/dist/modules/core/media/media.schema.js.map +1 -0
- package/dist/modules/core/part/part.model.d.ts +6 -0
- package/dist/modules/core/part/part.model.js +44 -0
- package/dist/modules/core/part/part.model.js.map +1 -0
- package/dist/modules/core/part/part.module.d.ts +2 -0
- package/dist/modules/core/part/part.module.js +21 -0
- package/dist/modules/core/part/part.module.js.map +1 -0
- package/dist/modules/core/part/part.queries.d.ts +22 -0
- package/dist/modules/core/part/part.queries.js +167 -0
- package/dist/modules/core/part/part.queries.js.map +1 -0
- package/dist/modules/core/part/part.resolver.d.ts +14 -0
- package/dist/modules/core/part/part.resolver.extend.d.ts +5 -0
- package/dist/modules/core/part/part.resolver.extend.js +49 -0
- package/dist/modules/core/part/part.resolver.extend.js.map +1 -0
- package/dist/modules/core/part/part.resolver.js +135 -0
- package/dist/modules/core/part/part.resolver.js.map +1 -0
- package/dist/modules/core/part/part.schema.d.ts +12 -0
- package/dist/modules/core/part/part.schema.js +66 -0
- package/dist/modules/core/part/part.schema.js.map +1 -0
- package/dist/modules/core/section/section-wrap.resolver.d.ts +11 -0
- package/dist/modules/core/section/section-wrap.resolver.js +168 -0
- package/dist/modules/core/section/section-wrap.resolver.js.map +1 -0
- package/dist/modules/core/section/section.model.d.ts +6 -0
- package/dist/modules/core/section/section.model.js +44 -0
- package/dist/modules/core/section/section.model.js.map +1 -0
- package/dist/modules/core/section/section.module.d.ts +2 -0
- package/dist/modules/core/section/section.module.js +21 -0
- package/dist/modules/core/section/section.module.js.map +1 -0
- package/dist/modules/core/section/section.queries.d.ts +51 -0
- package/dist/modules/core/section/section.queries.js +228 -0
- package/dist/modules/core/section/section.queries.js.map +1 -0
- package/dist/modules/core/section/section.resolver.d.ts +7 -0
- package/dist/modules/core/section/section.resolver.js +78 -0
- package/dist/modules/core/section/section.resolver.js.map +1 -0
- package/dist/modules/core/section/section.schema.d.ts +27 -0
- package/dist/modules/core/section/section.schema.js +129 -0
- package/dist/modules/core/section/section.schema.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.model.d.ts +4 -0
- package/dist/modules/core/site-fields/site-fields.model.js +30 -0
- package/dist/modules/core/site-fields/site-fields.model.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.module.d.ts +2 -0
- package/dist/modules/core/site-fields/site-fields.module.js +20 -0
- package/dist/modules/core/site-fields/site-fields.module.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.queries.d.ts +9 -0
- package/dist/modules/core/site-fields/site-fields.queries.js +123 -0
- package/dist/modules/core/site-fields/site-fields.queries.js.map +1 -0
- package/dist/modules/core/site-fields/site-fields.resolver.d.ts +5 -0
- package/dist/modules/core/site-fields/site-fields.resolver.js +56 -0
- package/dist/modules/core/site-fields/site-fields.resolver.js.map +1 -0
- package/dist/modules/core/site-info/site-info.module.d.ts +2 -0
- package/dist/modules/core/site-info/site-info.module.js +20 -0
- package/dist/modules/core/site-info/site-info.module.js.map +1 -0
- package/dist/modules/core/site-info/site-info.resolver.d.ts +5 -0
- package/dist/modules/core/site-info/site-info.resolver.js +44 -0
- package/dist/modules/core/site-info/site-info.resolver.js.map +1 -0
- package/dist/modules/core/site-info/site-info.schema.d.ts +6 -0
- package/dist/modules/core/site-info/site-info.schema.js +36 -0
- package/dist/modules/core/site-info/site-info.schema.js.map +1 -0
- package/dist/modules/core/site-schema/site-schema.module.d.ts +2 -0
- package/dist/modules/core/site-schema/site-schema.module.js +20 -0
- package/dist/modules/core/site-schema/site-schema.module.js.map +1 -0
- package/dist/modules/core/site-schema/site-schema.resolver.d.ts +4 -0
- package/dist/modules/core/site-schema/site-schema.resolver.js +35 -0
- package/dist/modules/core/site-schema/site-schema.resolver.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.model.d.ts +6 -0
- package/dist/modules/core/term-flag/term-flag.model.js +45 -0
- package/dist/modules/core/term-flag/term-flag.model.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.module.d.ts +2 -0
- package/dist/modules/core/term-flag/term-flag.module.js +20 -0
- package/dist/modules/core/term-flag/term-flag.module.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.queries.d.ts +7 -0
- package/dist/modules/core/term-flag/term-flag.queries.js +44 -0
- package/dist/modules/core/term-flag/term-flag.queries.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.resolver.d.ts +5 -0
- package/dist/modules/core/term-flag/term-flag.resolver.js +47 -0
- package/dist/modules/core/term-flag/term-flag.resolver.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.schema.d.ts +9 -0
- package/dist/modules/core/term-flag/term-flag.schema.js +51 -0
- package/dist/modules/core/term-flag/term-flag.schema.js.map +1 -0
- package/dist/modules/core/term-flag/term-flag.service.d.ts +9 -0
- package/dist/modules/core/term-flag/term-flag.service.js +50 -0
- package/dist/modules/core/term-flag/term-flag.service.js.map +1 -0
- package/dist/modules/core/unprotected/unprotected.module.d.ts +2 -0
- package/dist/modules/core/unprotected/unprotected.module.js +20 -0
- package/dist/modules/core/unprotected/unprotected.module.js.map +1 -0
- package/dist/modules/core/unprotected/unprotected.resolver.d.ts +8 -0
- package/dist/modules/core/unprotected/unprotected.resolver.js +106 -0
- package/dist/modules/core/unprotected/unprotected.resolver.js.map +1 -0
- package/dist/modules/core/unprotected/unprotected.schema.d.ts +19 -0
- package/dist/modules/core/unprotected/unprotected.schema.js +93 -0
- package/dist/modules/core/unprotected/unprotected.schema.js.map +1 -0
- package/dist/modules/graphql.types.d.ts +6 -0
- package/dist/modules/graphql.types.js +3 -0
- package/dist/modules/graphql.types.js.map +1 -0
- package/dist/modules/private-api.module.d.ts +2 -0
- package/dist/modules/private-api.module.js +50 -0
- package/dist/modules/private-api.module.js.map +1 -0
- package/dist/modules/public-api/class-validator-options.d.ts +7 -0
- package/dist/modules/public-api/class-validator-options.js +11 -0
- package/dist/modules/public-api/class-validator-options.js.map +1 -0
- package/dist/modules/public-api/mail/contact-form-mail.d.ts +8 -0
- package/dist/modules/public-api/mail/contact-form-mail.js +96 -0
- package/dist/modules/public-api/mail/contact-form-mail.js.map +1 -0
- package/dist/modules/public-api/mail/mail.dto.d.ts +8 -0
- package/dist/modules/public-api/mail/mail.dto.js +56 -0
- package/dist/modules/public-api/mail/mail.dto.js.map +1 -0
- package/dist/modules/public-api/partials/partials-params.dto.d.ts +6 -0
- package/dist/modules/public-api/partials/partials-params.dto.js +45 -0
- package/dist/modules/public-api/partials/partials-params.dto.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.controller.d.ts +11 -0
- package/dist/modules/public-api/password-reset/password-reset.controller.js +59 -0
- package/dist/modules/public-api/password-reset/password-reset.controller.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.dto.d.ts +9 -0
- package/dist/modules/public-api/password-reset/password-reset.dto.js +55 -0
- package/dist/modules/public-api/password-reset/password-reset.dto.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.module.d.ts +2 -0
- package/dist/modules/public-api/password-reset/password-reset.module.js +22 -0
- package/dist/modules/public-api/password-reset/password-reset.module.js.map +1 -0
- package/dist/modules/public-api/password-reset/password-reset.service.d.ts +14 -0
- package/dist/modules/public-api/password-reset/password-reset.service.js +56 -0
- package/dist/modules/public-api/password-reset/password-reset.service.js.map +1 -0
- package/dist/modules/public-api/public-api-controller.d.ts +32 -0
- package/dist/modules/public-api/public-api-controller.js +198 -0
- package/dist/modules/public-api/public-api-controller.js.map +1 -0
- package/dist/modules/public-api/public-api.module.d.ts +2 -0
- package/dist/modules/public-api/public-api.module.js +22 -0
- package/dist/modules/public-api/public-api.module.js.map +1 -0
- package/dist/modules/public-api/search-text/search-text.dto.d.ts +7 -0
- package/dist/modules/public-api/search-text/search-text.dto.js +50 -0
- package/dist/modules/public-api/search-text/search-text.dto.js.map +1 -0
- package/dist/modules/public-api/search-text/search-text.queries.d.ts +14 -0
- package/dist/modules/public-api/search-text/search-text.queries.js +58 -0
- package/dist/modules/public-api/search-text/search-text.queries.js.map +1 -0
- package/dist/modules/public-site/app-exception-filter.d.ts +4 -0
- package/dist/modules/public-site/app-exception-filter.js +41 -0
- package/dist/modules/public-site/app-exception-filter.js.map +1 -0
- package/dist/modules/public-site/google-auth.controller.d.ts +10 -0
- package/dist/modules/public-site/google-auth.controller.js +127 -0
- package/dist/modules/public-site/google-auth.controller.js.map +1 -0
- package/dist/modules/public-site/helpers/format-date.helper.d.ts +3 -0
- package/dist/modules/public-site/helpers/format-date.helper.js +35 -0
- package/dist/modules/public-site/helpers/format-date.helper.js.map +1 -0
- package/dist/modules/public-site/helpers/format-date.helper.spec.d.ts +1 -0
- package/dist/modules/public-site/helpers/format-date.helper.spec.js +37 -0
- package/dist/modules/public-site/helpers/format-date.helper.spec.js.map +1 -0
- package/dist/modules/public-site/helpers/medias.helpers.d.ts +3 -0
- package/dist/modules/public-site/helpers/medias.helpers.js +16 -0
- package/dist/modules/public-site/helpers/medias.helpers.js.map +1 -0
- package/dist/modules/public-site/helpers/obfuscate.helper.d.ts +2 -0
- package/dist/modules/public-site/helpers/obfuscate.helper.js +27 -0
- package/dist/modules/public-site/helpers/obfuscate.helper.js.map +1 -0
- package/dist/modules/public-site/helpers/public-field-values.d.ts +10 -0
- package/dist/modules/public-site/helpers/public-field-values.js +76 -0
- package/dist/modules/public-site/helpers/public-field-values.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.js +14 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.js +18 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/info-filter.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/info-filter.js +144 -0
- package/dist/modules/public-site/liquidjs-filters/info-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js +38 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js +21 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.d.ts +2 -0
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.js +10 -0
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js +15 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.d.ts +4 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js +39 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.1.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.1.js +12 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.1.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.d.ts +3 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js +12 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.d.ts +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.js +18 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.d.ts +15 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.js +40 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/render.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/render.js +108 -0
- package/dist/modules/public-site/liquidjs-rendering/render-clone/render.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.d.ts +6 -0
- package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.js +40 -0
- package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.js.map +1 -0
- package/dist/modules/public-site/liquidjs-rendering/rendering-context.d.ts +27 -0
- package/dist/modules/public-site/liquidjs-rendering/rendering-context.js +46 -0
- package/dist/modules/public-site/liquidjs-rendering/rendering-context.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.js +49 -0
- package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.js +68 -0
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js +94 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.js +61 -0
- package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.js.map +1 -0
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.d.ts +13 -0
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.js +53 -0
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.js.map +1 -0
- package/dist/modules/public-site/media-serve/_media-serve-helpers.d.ts +11 -0
- package/dist/modules/public-site/media-serve/_media-serve-helpers.js +26 -0
- package/dist/modules/public-site/media-serve/_media-serve-helpers.js.map +1 -0
- package/dist/modules/public-site/media-serve/media-serve.controller.d.ts +4 -0
- package/dist/modules/public-site/media-serve/media-serve.controller.js +140 -0
- package/dist/modules/public-site/media-serve/media-serve.controller.js.map +1 -0
- package/dist/modules/public-site/media-serve/media-serve.module.d.ts +2 -0
- package/dist/modules/public-site/media-serve/media-serve.module.js +20 -0
- package/dist/modules/public-site/media-serve/media-serve.module.js.map +1 -0
- package/dist/modules/public-site/oauth2-client.controller.d.ts +10 -0
- package/dist/modules/public-site/oauth2-client.controller.js +144 -0
- package/dist/modules/public-site/oauth2-client.controller.js.map +1 -0
- package/dist/modules/public-site/public-route/make-url.d.ts +11 -0
- package/dist/modules/public-site/public-route/make-url.js +150 -0
- package/dist/modules/public-site/public-route/make-url.js.map +1 -0
- package/dist/modules/public-site/public-route/public-route-parser.d.ts +16 -0
- package/dist/modules/public-site/public-route/public-route-parser.js +154 -0
- package/dist/modules/public-site/public-route/public-route-parser.js.map +1 -0
- package/dist/modules/public-site/public-route/raw-document-payload.d.ts +8 -0
- package/dist/modules/public-site/public-route/raw-document-payload.js +86 -0
- package/dist/modules/public-site/public-route/raw-document-payload.js.map +1 -0
- package/dist/modules/public-site/public-site.controller.d.ts +7 -0
- package/dist/modules/public-site/public-site.controller.js +58 -0
- package/dist/modules/public-site/public-site.controller.js.map +1 -0
- package/dist/modules/public-site/public-site.middleware.d.ts +5 -0
- package/dist/modules/public-site/public-site.middleware.js +67 -0
- package/dist/modules/public-site/public-site.middleware.js.map +1 -0
- package/dist/modules/public-site/public-site.module.d.ts +4 -0
- package/dist/modules/public-site/public-site.module.js +27 -0
- package/dist/modules/public-site/public-site.module.js.map +1 -0
- package/dist/modules/public-site/serve-document/serve-document.d.ts +20 -0
- package/dist/modules/public-site/serve-document/serve-document.js +60 -0
- package/dist/modules/public-site/serve-document/serve-document.js.map +1 -0
- package/dist/modules/security/app-throttler-guard.d.ts +8 -0
- package/dist/modules/security/app-throttler-guard.js +18 -0
- package/dist/modules/security/app-throttler-guard.js.map +1 -0
- package/dist/modules/security/complexity-plugin.d.ts +8 -0
- package/dist/modules/security/complexity-plugin.js +46 -0
- package/dist/modules/security/complexity-plugin.js.map +1 -0
- package/dist/modules/security/gqlThrottlerGuard.d.ts +8 -0
- package/dist/modules/security/gqlThrottlerGuard.js +24 -0
- package/dist/modules/security/gqlThrottlerGuard.js.map +1 -0
- package/dist/nest-custom-logger.d.ts +8 -0
- package/dist/nest-custom-logger.js +23 -0
- package/dist/nest-custom-logger.js.map +1 -0
- package/dist/public-payload/breadcrumb.queries.d.ts +5 -0
- package/dist/public-payload/breadcrumb.queries.js +26 -0
- package/dist/public-payload/breadcrumb.queries.js.map +1 -0
- package/dist/public-payload/create-page-drop.d.ts +11 -0
- package/dist/public-payload/create-page-drop.js +160 -0
- package/dist/public-payload/create-page-drop.js.map +1 -0
- package/dist/public-payload/create-page-part-drop.d.ts +7 -0
- package/dist/public-payload/create-page-part-drop.js +39 -0
- package/dist/public-payload/create-page-part-drop.js.map +1 -0
- package/dist/public-payload/create-page-payload-drop.d.ts +10 -0
- package/dist/public-payload/create-page-payload-drop.js +143 -0
- package/dist/public-payload/create-page-payload-drop.js.map +1 -0
- package/dist/public-payload/excerpt.queries.d.ts +10 -0
- package/dist/public-payload/excerpt.queries.js +38 -0
- package/dist/public-payload/excerpt.queries.js.map +1 -0
- package/dist/public-payload/field-values.d.ts +9 -0
- package/dist/public-payload/field-values.js +99 -0
- package/dist/public-payload/field-values.js.map +1 -0
- package/dist/public-payload/get-siblings.queries.d.ts +5 -0
- package/dist/public-payload/get-siblings.queries.js +117 -0
- package/dist/public-payload/get-siblings.queries.js.map +1 -0
- package/dist/public-payload/liquidjs-drop.d.ts +31 -0
- package/dist/public-payload/liquidjs-drop.js +45 -0
- package/dist/public-payload/liquidjs-drop.js.map +1 -0
- package/dist/public-payload/load-default-image.d.ts +8 -0
- package/dist/public-payload/load-default-image.js +52 -0
- package/dist/public-payload/load-default-image.js.map +1 -0
- package/dist/public-payload/make-basic-payload.d.ts +6 -0
- package/dist/public-payload/make-basic-payload.js +19 -0
- package/dist/public-payload/make-basic-payload.js.map +1 -0
- package/dist/public-payload/make-image-available.d.ts +26 -0
- package/dist/public-payload/make-image-available.js +38 -0
- package/dist/public-payload/make-image-available.js.map +1 -0
- package/dist/public-payload/page-values.queries.d.ts +27 -0
- package/dist/public-payload/page-values.queries.js +110 -0
- package/dist/public-payload/page-values.queries.js.map +1 -0
- package/dist/public-payload/parts.queries.d.ts +6 -0
- package/dist/public-payload/parts.queries.js +123 -0
- package/dist/public-payload/parts.queries.js.map +1 -0
- package/dist/public-payload/public-payload.types.d.ts +130 -0
- package/dist/public-payload/public-payload.types.js +3 -0
- package/dist/public-payload/public-payload.types.js.map +1 -0
- package/dist/public-payload/site-payload.d.ts +4 -0
- package/dist/public-payload/site-payload.js +43 -0
- package/dist/public-payload/site-payload.js.map +1 -0
- package/dist/public-payload/taxonomies.queries.d.ts +13 -0
- package/dist/public-payload/taxonomies.queries.js +45 -0
- package/dist/public-payload/taxonomies.queries.js.map +1 -0
- package/dist/public-payload/translations.queries.d.ts +7 -0
- package/dist/public-payload/translations.queries.js +62 -0
- package/dist/public-payload/translations.queries.js.map +1 -0
- package/dist/public.types.d.ts +5 -0
- package/dist/public.types.js +3 -0
- package/dist/public.types.js.map +1 -0
- package/dist/share/pino-app-log.d.ts +26 -0
- package/dist/share/pino-app-log.js +138 -0
- package/dist/share/pino-app-log.js.map +1 -0
- package/dist/share/read-configuration.d.ts +7 -0
- package/dist/share/read-configuration.js +31 -0
- package/dist/share/read-configuration.js.map +1 -0
- package/dist/site-backup/archiver.helper.d.ts +12 -0
- package/dist/site-backup/archiver.helper.js +43 -0
- package/dist/site-backup/archiver.helper.js.map +1 -0
- package/dist/site-backup/backup-tasks.d.ts +11 -0
- package/dist/site-backup/backup-tasks.js +98 -0
- package/dist/site-backup/backup-tasks.js.map +1 -0
- package/dist/site-backup/backup.d.ts +11 -0
- package/dist/site-backup/backup.helper.d.ts +3 -0
- package/dist/site-backup/backup.helper.js +13 -0
- package/dist/site-backup/backup.helper.js.map +1 -0
- package/dist/site-backup/backup.js +34 -0
- package/dist/site-backup/backup.js.map +1 -0
- package/dist/site-backup/default-data/default-config.d.ts +1 -0
- package/dist/site-backup/default-data/default-config.js +50 -0
- package/dist/site-backup/default-data/default-config.js.map +1 -0
- package/dist/site-backup/default-data/default-readme.d.ts +1 -0
- package/dist/site-backup/default-data/default-readme.js +8 -0
- package/dist/site-backup/default-data/default-readme.js.map +1 -0
- package/dist/site-context/db-init/db-init.d.ts +11 -0
- package/dist/site-context/db-init/db-init.js +37 -0
- package/dist/site-context/db-init/db-init.js.map +1 -0
- package/dist/site-context/db-init/ddl-migration.d.ts +13 -0
- package/dist/site-context/db-init/ddl-migration.js +26 -0
- package/dist/site-context/db-init/ddl-migration.js.map +1 -0
- package/dist/site-context/db-init/init-routing-points.d.ts +4 -0
- package/dist/site-context/db-init/init-routing-points.js +147 -0
- package/dist/site-context/db-init/init-routing-points.js.map +1 -0
- package/dist/site-context/site-conf.d.ts +17 -0
- package/dist/site-context/site-conf.js +103 -0
- package/dist/site-context/site-conf.js.map +1 -0
- package/dist/site-context/site-context.d.ts +11 -0
- package/dist/site-context/site-context.js +234 -0
- package/dist/site-context/site-context.js.map +1 -0
- package/dist/site-context/site-context.types.d.ts +46 -0
- package/dist/site-context/site-context.types.js +3 -0
- package/dist/site-context/site-context.types.js.map +1 -0
- package/dist/site-context/theme-conf-reader.d.ts +4 -0
- package/dist/site-context/theme-conf-reader.js +33 -0
- package/dist/site-context/theme-conf-reader.js.map +1 -0
- package/dist/site-context/theme-conf-types.d.ts +4 -0
- package/dist/site-context/theme-conf-types.js +3 -0
- package/dist/site-context/theme-conf-types.js.map +1 -0
- package/dist/site-schema/common-schema-reader.d.ts +6 -0
- package/dist/site-schema/common-schema-reader.js +29 -0
- package/dist/site-schema/common-schema-reader.js.map +1 -0
- package/dist/site-schema/merged-schema-lib.d.ts +30 -0
- package/dist/site-schema/merged-schema-lib.js +118 -0
- package/dist/site-schema/merged-schema-lib.js.map +1 -0
- package/dist/site-schema/read-locales.d.ts +24 -0
- package/dist/site-schema/read-locales.js +171 -0
- package/dist/site-schema/read-locales.js.map +1 -0
- package/dist/site-schema/site-schema-factory.d.ts +2 -0
- package/dist/site-schema/site-schema-factory.js +382 -0
- package/dist/site-schema/site-schema-factory.js.map +1 -0
- package/dist/site-schema/site-schema-helpers.d.ts +5 -0
- package/dist/site-schema/site-schema-helpers.js +27 -0
- package/dist/site-schema/site-schema-helpers.js.map +1 -0
- package/dist/site-schema/site-schema-lib-reader.d.ts +14 -0
- package/dist/site-schema/site-schema-lib-reader.js +48 -0
- package/dist/site-schema/site-schema-lib-reader.js.map +1 -0
- package/dist/start.d.ts +1 -0
- package/dist/start.js +5 -0
- package/dist/start.js.map +1 -0
- package/dist/types.to.json +1 -0
- package/locales/en.json +18 -0
- package/locales/fr.json +18 -0
- package/package.json +99 -0
- package/schema.gql +293 -0
- package/site-schema-lib/common-schema.json +36 -0
- package/site-schema-lib/common-schema.l10n.en.json +10 -0
- package/site-schema-lib/common-schema.l10n.fr.json +10 -0
- package/site-schema-lib/fields.site-schema.json +79 -0
- package/site-schema-lib/fields.site-schema.l10n.en.json +26 -0
- package/site-schema-lib/fields.site-schema.l10n.fr.json +26 -0
- package/site-schema-lib/gallery-page.site-schema.json +19 -0
- package/site-schema-lib/gallery-page.site-schema.l10n.en.json +11 -0
- package/site-schema-lib/gallery-page.site-schema.l10n.fr.json +11 -0
- package/site-schema-lib/lowcost.site-schema.json +84 -0
- package/site-schema-lib/lowcost.site-schema.l10n.en.json +30 -0
- package/site-schema-lib/lowcost.site-schema.l10n.fr.json +30 -0
- package/site-schema-lib/media-policies.site-schema.json +26 -0
- package/site-schema-lib/portfolio.site-schema.json +28 -0
- package/site-schema-lib/portfolio.site-schema.l10n.en.json +16 -0
- package/site-schema-lib/portfolio.site-schema.l10n.fr.json +16 -0
- package/site-schema-lib/post.site-schema.json +48 -0
- package/site-schema-lib/post.site-schema.l10n.en.json +28 -0
- package/site-schema-lib/post.site-schema.l10n.fr.json +27 -0
- package/site-schema-lib/simple-pages.site-schema.json +19 -0
- package/site-schema-lib/simple-pages.site-schema.l10n.en.json +11 -0
- package/site-schema-lib/simple-pages.site-schema.l10n.fr.json +11 -0
- package/site-schema-lib/special-page.site-schema.json +42 -0
- package/site-schema-lib/special-page.site-schema.l10n.en.json +16 -0
- package/site-schema-lib/special-page.site-schema.l10n.fr.json +16 -0
- package/site-schema-lib/tour.site-schema.json +70 -0
- package/site-schema-lib/tour.site-schema.l10n.en.json +37 -0
- package/site-schema-lib/tour.site-schema.l10n.fr.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-conf-types.js","sourceRoot":"","sources":["../../src/site-context/theme-conf-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JsonOfCommonSchema } from "../typeonly/site-schema-json-types";
|
|
2
|
+
import { GroupedLabelLocales } from "./read-locales";
|
|
3
|
+
export interface CommonSchema extends JsonOfCommonSchema {
|
|
4
|
+
l10n: GroupedLabelLocales;
|
|
5
|
+
}
|
|
6
|
+
export declare function readCommonSchema(dir: string): Promise<CommonSchema>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readCommonSchema = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const context_1 = require("../context");
|
|
7
|
+
const read_locales_1 = require("./read-locales");
|
|
8
|
+
async function readCommonSchema(dir) {
|
|
9
|
+
const schema = await readJsonOfCommonSchema({ fileName: "common-schema.json", dir });
|
|
10
|
+
const l10n = (0, read_locales_1.createEmptyGroupedLabelLocales)(schema.langs);
|
|
11
|
+
await (0, read_locales_1.appendToSchemaLocales)({ dir, baseFileName: "common-schema.l10n" }, l10n);
|
|
12
|
+
return {
|
|
13
|
+
...schema,
|
|
14
|
+
l10n,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.readCommonSchema = readCommonSchema;
|
|
18
|
+
async function readJsonOfCommonSchema({ dir, fileName }) {
|
|
19
|
+
const json = await (0, promises_1.readFile)((0, node_path_1.join)(dir, fileName), {
|
|
20
|
+
encoding: "utf8",
|
|
21
|
+
});
|
|
22
|
+
const data = JSON.parse(json);
|
|
23
|
+
const result = context_1.typeValidator.validate("JsonOfCommonSchema", data);
|
|
24
|
+
if (!result.valid) {
|
|
25
|
+
throw new Error(`invalid common-schema file '${fileName}': ${result.error ?? "(missing message)"}`);
|
|
26
|
+
}
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=common-schema-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-schema-reader.js","sourceRoot":"","sources":["../../src/site-schema/common-schema-reader.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAiC;AACjC,wCAA2C;AAE3C,iDAIwB;AAMjB,KAAK,UAAU,gBAAgB,CAAC,GAAW;IAChD,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrF,MAAM,IAAI,GAAG,IAAA,6CAA8B,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,IAAA,oCAAqB,EAAC,EAAE,GAAG,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/E,OAAO;QACL,GAAG,MAAM;QACT,IAAI;KACL,CAAC;AACJ,CAAC;AARD,4CAQC;AAED,KAAK,UAAU,sBAAsB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAqC;IACxF,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAA,gBAAI,EAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;QAC/C,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,uBAAa,CAAC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAClE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,+BAA+B,QAAQ,MAAM,MAAM,CAAC,KAAK,IAAI,mBAAmB,EAAE,CACnF,CAAC;IACJ,CAAC;IACD,OAAO,IAA0B,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JsonOfFieldType, JsonOfImageCompressionQualityPolicy, JsonOfMediaPolicy, JsonOfModuleDocumentType, JsonOfPartSchema } from "../typeonly/site-schema-json-types";
|
|
2
|
+
import { CommonSchema } from "./common-schema-reader";
|
|
3
|
+
import { GroupedLabelLocales } from "./read-locales";
|
|
4
|
+
import { SiteSchemaLibrary } from "./site-schema-lib-reader";
|
|
5
|
+
export interface MergedSchemaLib {
|
|
6
|
+
common: CommonSchema;
|
|
7
|
+
module: {
|
|
8
|
+
siteFieldLib: {
|
|
9
|
+
[fieldName: string]: JsonOfFieldType;
|
|
10
|
+
};
|
|
11
|
+
sectionFieldLib: {
|
|
12
|
+
[fieldName: string]: JsonOfFieldType;
|
|
13
|
+
};
|
|
14
|
+
documentTypes: {
|
|
15
|
+
[leafType: string]: JsonOfModuleDocumentType;
|
|
16
|
+
};
|
|
17
|
+
partTypes: {
|
|
18
|
+
[leafType: string]: JsonOfPartSchema;
|
|
19
|
+
};
|
|
20
|
+
mediaPolicies: {
|
|
21
|
+
[policyName: string]: JsonOfMediaPolicy;
|
|
22
|
+
};
|
|
23
|
+
imageQualityPolicy?: JsonOfImageCompressionQualityPolicy[];
|
|
24
|
+
site?: {
|
|
25
|
+
fields?: (JsonOfFieldType | string)[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
l10n: GroupedLabelLocales;
|
|
29
|
+
}
|
|
30
|
+
export declare function prepareLib(useModules: string[] | undefined, siteSchemaLib: SiteSchemaLibrary, langs: string[]): MergedSchemaLib;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareLib = void 0;
|
|
4
|
+
const read_locales_1 = require("./read-locales");
|
|
5
|
+
function prepareLib(useModules, siteSchemaLib, langs) {
|
|
6
|
+
const result = {
|
|
7
|
+
common: siteSchemaLib.common,
|
|
8
|
+
module: {
|
|
9
|
+
siteFieldLib: {},
|
|
10
|
+
sectionFieldLib: {},
|
|
11
|
+
documentTypes: {},
|
|
12
|
+
partTypes: {},
|
|
13
|
+
mediaPolicies: {},
|
|
14
|
+
},
|
|
15
|
+
l10n: (0, read_locales_1.createEmptyGroupedLabelLocales)(langs),
|
|
16
|
+
};
|
|
17
|
+
if (!useModules)
|
|
18
|
+
return result;
|
|
19
|
+
const allUseModules = getAllUseModules(useModules, siteSchemaLib);
|
|
20
|
+
for (const moduleName of allUseModules) {
|
|
21
|
+
const modLib = siteSchemaLib.modules[moduleName];
|
|
22
|
+
if (!modLib)
|
|
23
|
+
throw new Error(`unknown module '${moduleName}'`);
|
|
24
|
+
const { module, l10n } = modLib;
|
|
25
|
+
if (!containsAllLangs(langs, module.langs)) {
|
|
26
|
+
throw new Error(`missing lang in module '${moduleName}'`);
|
|
27
|
+
}
|
|
28
|
+
if (modLib.module.site?.fields) {
|
|
29
|
+
if (!result.module.site) {
|
|
30
|
+
result.module.site = {};
|
|
31
|
+
}
|
|
32
|
+
if (result.module.site.fields)
|
|
33
|
+
throw new Error("duplicated 'site.fields' in site-schema");
|
|
34
|
+
result.module.site.fields = modLib.module.site.fields;
|
|
35
|
+
}
|
|
36
|
+
if (modLib.module.imageQualityPolicy) {
|
|
37
|
+
if (result.module.imageQualityPolicy) {
|
|
38
|
+
throw new Error("duplicated 'imageQualityPolicy' in site-schema");
|
|
39
|
+
}
|
|
40
|
+
result.module.imageQualityPolicy = modLib.module.imageQualityPolicy;
|
|
41
|
+
}
|
|
42
|
+
for (const item of module.siteFieldLib ?? []) {
|
|
43
|
+
if (result.module.siteFieldLib[item.name]) {
|
|
44
|
+
throw new Error(`duplicate site field '${item.name}'`);
|
|
45
|
+
}
|
|
46
|
+
result.module.siteFieldLib[item.name] = item;
|
|
47
|
+
}
|
|
48
|
+
for (const item of module.sectionFieldLib ?? []) {
|
|
49
|
+
if (result.module.sectionFieldLib[item.name]) {
|
|
50
|
+
throw new Error(`duplicate section field '${item.name}'`);
|
|
51
|
+
}
|
|
52
|
+
result.module.sectionFieldLib[item.name] = item;
|
|
53
|
+
}
|
|
54
|
+
for (const item of module.documentTypes ?? []) {
|
|
55
|
+
if (result.module.documentTypes[item.leafType]) {
|
|
56
|
+
throw new Error(`duplicate document type '${item.leafType}'`);
|
|
57
|
+
}
|
|
58
|
+
result.module.documentTypes[item.leafType] = item;
|
|
59
|
+
}
|
|
60
|
+
for (const item of module.partTypes ?? []) {
|
|
61
|
+
if (result.module.partTypes[item.leafType]) {
|
|
62
|
+
throw new Error(`duplicate part type '${item.leafType}'`);
|
|
63
|
+
}
|
|
64
|
+
result.module.partTypes[item.leafType] = item;
|
|
65
|
+
}
|
|
66
|
+
for (const item of module.mediaPolicies ?? []) {
|
|
67
|
+
if (typeof item === "string")
|
|
68
|
+
continue;
|
|
69
|
+
if (result.module.mediaPolicies[item.policyName]) {
|
|
70
|
+
throw new Error(`duplicate media policy '${item.policyName}'`);
|
|
71
|
+
}
|
|
72
|
+
result.module.mediaPolicies[item.policyName] = item;
|
|
73
|
+
}
|
|
74
|
+
(0, read_locales_1.mergeL10n)(l10n, result.l10n);
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
exports.prepareLib = prepareLib;
|
|
79
|
+
function containsAllLangs(requiredLangs, langsToCheck) {
|
|
80
|
+
for (const lang of requiredLangs) {
|
|
81
|
+
if (!langsToCheck.includes(lang))
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
function getAllUseModules(useModules, siteSchemaLib) {
|
|
87
|
+
const result = [...useModules];
|
|
88
|
+
const processed = new Set();
|
|
89
|
+
walkUseModules(useModules, siteSchemaLib, result, processed);
|
|
90
|
+
return result.length !== processed.size ? dedup(result) : result;
|
|
91
|
+
}
|
|
92
|
+
function walkUseModules(useModules, siteSchemaLib, result, processed) {
|
|
93
|
+
for (const moduleName of useModules) {
|
|
94
|
+
if (processed.has(moduleName))
|
|
95
|
+
continue;
|
|
96
|
+
processed.add(moduleName);
|
|
97
|
+
const modLib = siteSchemaLib.modules[moduleName];
|
|
98
|
+
if (!modLib)
|
|
99
|
+
throw new Error(`unknown module '${moduleName}'`);
|
|
100
|
+
const childUseModules = modLib.module.useModules;
|
|
101
|
+
if (!childUseModules)
|
|
102
|
+
continue;
|
|
103
|
+
result.push(...childUseModules);
|
|
104
|
+
walkUseModules(childUseModules, siteSchemaLib, result, processed);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function dedup(arr) {
|
|
108
|
+
const processed = new Set();
|
|
109
|
+
const result = [];
|
|
110
|
+
for (const item of arr) {
|
|
111
|
+
if (processed.has(item))
|
|
112
|
+
continue;
|
|
113
|
+
processed.add(item);
|
|
114
|
+
result.push(item);
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=merged-schema-lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merged-schema-lib.js","sourceRoot":"","sources":["../../src/site-schema/merged-schema-lib.ts"],"names":[],"mappings":";;;AAQA,iDAAgG;AA6BhG,SAAgB,UAAU,CACxB,UAAgC,EAChC,aAAgC,EAChC,KAAe;IAEf,MAAM,MAAM,GAAoB;QAC9B,MAAM,EAAE,aAAa,CAAC,MAAM;QAC5B,MAAM,EAAE;YACN,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,EAAE;YACnB,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;YACb,aAAa,EAAE,EAAE;SAClB;QACD,IAAI,EAAE,IAAA,6CAA8B,EAAC,KAAK,CAAC;KAC5C,CAAC;IAEF,IAAI,CAAC,UAAU;QAAE,OAAO,MAAM,CAAC;IAE/B,MAAM,aAAa,GAAG,gBAAgB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAElE,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;QAC/D,M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,IAAI,KAAK,CAAC,mBAAmB,UAAU,GAAG,CAAC,CAAC;QAC/D,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QACjD,IAAI,CAAC,eAAe;YAAE,SAAS;QAC/B,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;QAChC,cAAc,CAAC,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAI,GAAQ;IACxB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAK,CAAC;IAC/B,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QAClC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LabelLocales, SchemaLocales } from "@paroicms/anywhere-lib";
|
|
2
|
+
export declare function createEmptySchemaLocales(langs: string[]): SchemaLocales;
|
|
3
|
+
export interface GroupedLabelLocales {
|
|
4
|
+
[lang: string]: GroupedLanguageLabelLocales;
|
|
5
|
+
}
|
|
6
|
+
export interface GroupedLanguageLabelLocales {
|
|
7
|
+
[group: string]: {
|
|
8
|
+
[name: string]: LabelLocales;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function createEmptyGroupedLabelLocales(langs: string[]): GroupedLabelLocales;
|
|
12
|
+
export declare function mergeL10n(from: GroupedLabelLocales, to: GroupedLabelLocales): void;
|
|
13
|
+
export declare function importPartOfL10n(options: {
|
|
14
|
+
from: GroupedLabelLocales;
|
|
15
|
+
fromPath: string[];
|
|
16
|
+
to: SchemaLocales;
|
|
17
|
+
toPath?: string[];
|
|
18
|
+
ifDuplicate?: "overwrite" | "merge";
|
|
19
|
+
}): void;
|
|
20
|
+
export declare function appendToSchemaLocales({ dir, baseFileName, }: {
|
|
21
|
+
dir: string;
|
|
22
|
+
baseFileName: string;
|
|
23
|
+
}, l10n: GroupedLabelLocales): Promise<void>;
|
|
24
|
+
export declare function completeSchemaLocales(dir: string, l10n: SchemaLocales): Promise<void>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.completeSchemaLocales = exports.appendToSchemaLocales = exports.importPartOfL10n = exports.mergeL10n = exports.createEmptyGroupedLabelLocales = exports.createEmptySchemaLocales = void 0;
|
|
4
|
+
const server_lib_1 = require("@paroicms/server-lib");
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const context_1 = require("../context");
|
|
8
|
+
function createEmptySchemaLocales(langs) {
|
|
9
|
+
const locales = {};
|
|
10
|
+
for (const lang of langs) {
|
|
11
|
+
locales[lang] = {
|
|
12
|
+
documentTypes: {},
|
|
13
|
+
partTypes: {},
|
|
14
|
+
site: {
|
|
15
|
+
fields: {},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return locales;
|
|
20
|
+
}
|
|
21
|
+
exports.createEmptySchemaLocales = createEmptySchemaLocales;
|
|
22
|
+
function createEmptyGroupedLabelLocales(langs) {
|
|
23
|
+
const locales = {};
|
|
24
|
+
for (const lang of langs) {
|
|
25
|
+
locales[lang] = {};
|
|
26
|
+
}
|
|
27
|
+
return locales;
|
|
28
|
+
}
|
|
29
|
+
exports.createEmptyGroupedLabelLocales = createEmptyGroupedLabelLocales;
|
|
30
|
+
function mergeL10n(from, to) {
|
|
31
|
+
for (const lang of Object.keys(to)) {
|
|
32
|
+
const locales = from[lang];
|
|
33
|
+
if (!locales)
|
|
34
|
+
throw new Error(`missing lang '${lang}'`);
|
|
35
|
+
for (const [groupName, group] of Object.entries(locales)) {
|
|
36
|
+
if (!to[lang][groupName]) {
|
|
37
|
+
to[lang][groupName] = {};
|
|
38
|
+
}
|
|
39
|
+
for (const [name, item] of Object.entries(group)) {
|
|
40
|
+
if (to[lang][groupName][name]) {
|
|
41
|
+
throw new Error(`duplicate '${groupName}.${name}', for language '${lang}'`);
|
|
42
|
+
}
|
|
43
|
+
to[lang][groupName][name] = item;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.mergeL10n = mergeL10n;
|
|
49
|
+
function importPartOfL10n(options) {
|
|
50
|
+
for (const lang of Object.keys(options.to)) {
|
|
51
|
+
importPartOfL10nForLang(options, lang);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.importPartOfL10n = importPartOfL10n;
|
|
55
|
+
function importPartOfL10nForLang(options, lang) {
|
|
56
|
+
const { from, fromPath, to, ifDuplicate } = options;
|
|
57
|
+
const toPath = options.toPath ?? fromPath;
|
|
58
|
+
const fromLocales = from[lang];
|
|
59
|
+
if (!fromLocales)
|
|
60
|
+
throw new Error(`missing lang '${lang}'`);
|
|
61
|
+
let fromCurrent = fromLocales;
|
|
62
|
+
for (const token of fromPath) {
|
|
63
|
+
const cur = fromCurrent[token];
|
|
64
|
+
if (!cur || typeof cur === "string")
|
|
65
|
+
return;
|
|
66
|
+
fromCurrent = cur;
|
|
67
|
+
}
|
|
68
|
+
if (!fromCurrent)
|
|
69
|
+
return;
|
|
70
|
+
const toParentPath = [...toPath];
|
|
71
|
+
const lastKey = toParentPath.pop();
|
|
72
|
+
if (!lastKey)
|
|
73
|
+
throw new Error("toPath should not be empty");
|
|
74
|
+
let toCurrent = to[lang];
|
|
75
|
+
for (const token of toParentPath) {
|
|
76
|
+
let cur = toCurrent[token];
|
|
77
|
+
if (typeof cur === "string")
|
|
78
|
+
throw new Error(`should not be a string '${cur}'`);
|
|
79
|
+
if (!cur) {
|
|
80
|
+
toCurrent[token] = cur = {};
|
|
81
|
+
}
|
|
82
|
+
toCurrent = cur;
|
|
83
|
+
}
|
|
84
|
+
const copy = deepCopyLabelLocales(fromCurrent);
|
|
85
|
+
if (!toCurrent[lastKey]) {
|
|
86
|
+
toCurrent[lastKey] = copy;
|
|
87
|
+
}
|
|
88
|
+
else if (ifDuplicate === "overwrite") {
|
|
89
|
+
toCurrent[lastKey] = copy;
|
|
90
|
+
}
|
|
91
|
+
else if (ifDuplicate === "merge") {
|
|
92
|
+
Object.assign(toCurrent[lastKey], copy);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throw new Error(`duplicate '${toPath.join(".")}', for language '${lang}'`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function deepCopyLabelLocales(obj) {
|
|
99
|
+
const result = {};
|
|
100
|
+
for (const key of Object.keys(obj)) {
|
|
101
|
+
const val = obj[key];
|
|
102
|
+
result[key] = typeof val === "string" ? val : deepCopyLabelLocales(val);
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
async function appendToSchemaLocales({ dir, baseFileName, }, l10n) {
|
|
107
|
+
const langs = Object.keys(l10n);
|
|
108
|
+
for (const lang of langs) {
|
|
109
|
+
const file = (0, path_1.join)(dir, `${baseFileName}.${lang}.json`);
|
|
110
|
+
const jsonData = (await readJsonLocalesFile(file));
|
|
111
|
+
if (!jsonData)
|
|
112
|
+
continue;
|
|
113
|
+
for (const group of Object.keys(jsonData)) {
|
|
114
|
+
if (!l10n[lang][group]) {
|
|
115
|
+
l10n[lang][group] = {};
|
|
116
|
+
}
|
|
117
|
+
for (const name of Object.keys(jsonData[group])) {
|
|
118
|
+
if (l10n[lang][group][name])
|
|
119
|
+
throw new Error(`document '${name}' already exists`);
|
|
120
|
+
l10n[lang][group][name] = jsonData[group][name];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.appendToSchemaLocales = appendToSchemaLocales;
|
|
126
|
+
async function completeSchemaLocales(dir, l10n) {
|
|
127
|
+
const langs = Object.keys(l10n);
|
|
128
|
+
for (const lang of langs) {
|
|
129
|
+
const file = (0, path_1.join)(dir, `site-schema.l10n.${lang}.json`);
|
|
130
|
+
const jsonData = await readJsonLocalesFile(file);
|
|
131
|
+
if (!jsonData)
|
|
132
|
+
continue;
|
|
133
|
+
recursivelyMergeLocales(jsonData.site?.fields, l10n[lang].site.fields);
|
|
134
|
+
recursivelyMergeLocales(jsonData.documentTypes, l10n[lang].documentTypes);
|
|
135
|
+
recursivelyMergeLocales(jsonData.partTypes, l10n[lang].partTypes);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.completeSchemaLocales = completeSchemaLocales;
|
|
139
|
+
function recursivelyMergeLocales(from, to, debug = []) {
|
|
140
|
+
if (!from)
|
|
141
|
+
return;
|
|
142
|
+
for (const key of Object.keys(from)) {
|
|
143
|
+
const fromVal = from[key];
|
|
144
|
+
if (to[key]) {
|
|
145
|
+
const fromValType = typeof fromVal;
|
|
146
|
+
if (fromValType !== typeof to[key]) {
|
|
147
|
+
throw new Error(`inconsistant locales '${to[key]}' and '${fromVal}'`);
|
|
148
|
+
}
|
|
149
|
+
if (fromValType === "string") {
|
|
150
|
+
to[key] = fromVal;
|
|
151
|
+
}
|
|
152
|
+
else
|
|
153
|
+
recursivelyMergeLocales(fromVal, to[key], [...debug, key]);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
to[key] = fromVal;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async function readJsonLocalesFile(file) {
|
|
161
|
+
if (!(await (0, server_lib_1.pathExists)(file)))
|
|
162
|
+
return;
|
|
163
|
+
const jsonContent = await (0, promises_1.readFile)(file, "utf8");
|
|
164
|
+
const jsonData = JSON.parse(jsonContent);
|
|
165
|
+
const result = context_1.typeValidator.validate("JsonOfLanguageSchemaLocales", jsonData);
|
|
166
|
+
if (!result.valid) {
|
|
167
|
+
throw new Error(`invalid site-schema '${file}': ${result.error ?? "(missing message)"}`);
|
|
168
|
+
}
|
|
169
|
+
return jsonData;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=read-locales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-locales.js","sourceRoot":"","sources":["../../src/site-schema/read-locales.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,0CAAuC;AACvC,+BAA4B;AAC5B,wCAA2C;AAG3C,SAAgB,wBAAwB,CAAC,KAAe;IACtD,MAAM,OAAO,GAAkB,EAAE,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG;YACd,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;YACb,IAAI,EAAE;gBACJ,MAAM,EAAE,EAAE;aACX;SACF,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAZD,4DAYC;AAYD,SAAgB,8BAA8B,CAAC,KAAe;IAC5D,MAAM,OAAO,GAAwB,EAAE,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAND,wEAMC;AAED,SAAgB,SAAS,CAAC,IAAyB,EAAE,EAAuB;IAC1E,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,GAAG,CAAC,CAAC;QACxD,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,O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