@paroicms/server 0.150.0 → 0.151.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 +10 -7
- package/package.json +17 -8
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -5
- package/dist/cli.js.map +0 -1
- package/dist/common/child-ordering-query.d.ts +0 -13
- package/dist/common/child-ordering-query.js +0 -107
- package/dist/common/child-ordering-query.js.map +0 -1
- package/dist/common/data-format.d.ts +0 -19
- package/dist/common/data-format.js +0 -86
- package/dist/common/data-format.js.map +0 -1
- package/dist/common/mail/html-helpers.d.ts +0 -7
- package/dist/common/mail/html-helpers.js +0 -46
- package/dist/common/mail/html-helpers.js.map +0 -1
- package/dist/common/mail/sendMail.helpers.d.ts +0 -14
- package/dist/common/mail/sendMail.helpers.js +0 -51
- package/dist/common/mail/sendMail.helpers.js.map +0 -1
- package/dist/common/media-handles.helpers.d.ts +0 -19
- package/dist/common/media-handles.helpers.js +0 -52
- package/dist/common/media-handles.helpers.js.map +0 -1
- package/dist/common/serve-html-or.d.ts +0 -16
- package/dist/common/serve-html-or.js +0 -72
- package/dist/common/serve-html-or.js.map +0 -1
- package/dist/common/text-cache.d.ts +0 -57
- package/dist/common/text-cache.js +0 -87
- package/dist/common/text-cache.js.map +0 -1
- package/dist/common/tracker-report.d.ts +0 -2
- package/dist/common/tracker-report.js +0 -27
- package/dist/common/tracker-report.js.map +0 -1
- package/dist/context.d.ts +0 -29
- package/dist/context.js +0 -60
- package/dist/context.js.map +0 -1
- package/dist/express/http-helpers.d.ts +0 -16
- package/dist/express/http-helpers.js +0 -44
- package/dist/express/http-helpers.js.map +0 -1
- package/dist/express/static-middlewares.d.ts +0 -3
- package/dist/express/static-middlewares.js +0 -114
- package/dist/express/static-middlewares.js.map +0 -1
- package/dist/helpers/configuration.helpers.d.ts +0 -2
- package/dist/helpers/configuration.helpers.js +0 -8
- package/dist/helpers/configuration.helpers.js.map +0 -1
- package/dist/helpers/excerpt.helpers.d.ts +0 -2
- package/dist/helpers/excerpt.helpers.js +0 -31
- package/dist/helpers/excerpt.helpers.js.map +0 -1
- package/dist/helpers/jwt-secret.helpers.d.ts +0 -2
- package/dist/helpers/jwt-secret.helpers.js +0 -30
- package/dist/helpers/jwt-secret.helpers.js.map +0 -1
- package/dist/helpers/label-translator.helper.d.ts +0 -9
- package/dist/helpers/label-translator.helper.js +0 -14
- package/dist/helpers/label-translator.helper.js.map +0 -1
- package/dist/helpers/passwordEncrypt-helper.d.ts +0 -2
- package/dist/helpers/passwordEncrypt-helper.js +0 -37
- package/dist/helpers/passwordEncrypt-helper.js.map +0 -1
- package/dist/helpers/relative-id-helper.d.ts +0 -10
- package/dist/helpers/relative-id-helper.js +0 -37
- package/dist/helpers/relative-id-helper.js.map +0 -1
- package/dist/helpers/simple-i18n.d.ts +0 -14
- package/dist/helpers/simple-i18n.js +0 -82
- package/dist/helpers/simple-i18n.js.map +0 -1
- package/dist/helpers/special-account.helpers.d.ts +0 -9
- package/dist/helpers/special-account.helpers.js +0 -43
- package/dist/helpers/special-account.helpers.js.map +0 -1
- package/dist/helpers/url.helpers.d.ts +0 -2
- package/dist/helpers/url.helpers.js +0 -12
- package/dist/helpers/url.helpers.js.map +0 -1
- package/dist/helpers/utils-helper.d.ts +0 -4
- package/dist/helpers/utils-helper.js +0 -32
- package/dist/helpers/utils-helper.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -69
- package/dist/index.js.map +0 -1
- package/dist/liquidjs-tools/liquidjs-drop.d.ts +0 -31
- package/dist/liquidjs-tools/liquidjs-drop.js +0 -45
- package/dist/liquidjs-tools/liquidjs-drop.js.map +0 -1
- package/dist/liquidjs-tools/liquidjs-filter.d.ts +0 -10
- package/dist/liquidjs-tools/liquidjs-filter.js +0 -23
- package/dist/liquidjs-tools/liquidjs-filter.js.map +0 -1
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.d.ts +0 -6
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.js +0 -40
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.js.map +0 -1
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.d.ts +0 -25
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.js +0 -35
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.js.map +0 -1
- package/dist/liquidjs-tools/liquidjs-utils.d.ts +0 -5
- package/dist/liquidjs-tools/liquidjs-utils.js +0 -22
- package/dist/liquidjs-tools/liquidjs-utils.js.map +0 -1
- package/dist/liquidjs-tools/render-clone/collection.d.ts +0 -1
- package/dist/liquidjs-tools/render-clone/collection.js +0 -18
- package/dist/liquidjs-tools/render-clone/collection.js.map +0 -1
- package/dist/liquidjs-tools/render-clone/forloop-drop.d.ts +0 -15
- package/dist/liquidjs-tools/render-clone/forloop-drop.js +0 -40
- package/dist/liquidjs-tools/render-clone/forloop-drop.js.map +0 -1
- package/dist/liquidjs-tools/render-clone/render.d.ts +0 -13
- package/dist/liquidjs-tools/render-clone/render.js +0 -108
- package/dist/liquidjs-tools/render-clone/render.js.map +0 -1
- package/dist/maintenance/maintenance-task.d.ts +0 -4
- package/dist/maintenance/maintenance-task.js +0 -27
- package/dist/maintenance/maintenance-task.js.map +0 -1
- package/dist/maintenance/shutdown.d.ts +0 -7
- package/dist/maintenance/shutdown.js +0 -51
- package/dist/maintenance/shutdown.js.map +0 -1
- package/dist/modules/app.controller.d.ts +0 -5
- package/dist/modules/app.controller.js +0 -89
- package/dist/modules/app.controller.js.map +0 -1
- package/dist/modules/app.module.d.ts +0 -2
- package/dist/modules/app.module.js +0 -48
- package/dist/modules/app.module.js.map +0 -1
- package/dist/modules/core/account/account.model.d.ts +0 -18
- package/dist/modules/core/account/account.model.js +0 -59
- package/dist/modules/core/account/account.model.js.map +0 -1
- package/dist/modules/core/account/account.module.d.ts +0 -2
- package/dist/modules/core/account/account.module.js +0 -20
- package/dist/modules/core/account/account.module.js.map +0 -1
- package/dist/modules/core/account/account.queries.d.ts +0 -18
- package/dist/modules/core/account/account.queries.js +0 -150
- package/dist/modules/core/account/account.queries.js.map +0 -1
- package/dist/modules/core/account/account.resolver.d.ts +0 -11
- package/dist/modules/core/account/account.resolver.js +0 -107
- package/dist/modules/core/account/account.resolver.js.map +0 -1
- package/dist/modules/core/account/account.schema.d.ts +0 -24
- package/dist/modules/core/account/account.schema.js +0 -114
- package/dist/modules/core/account/account.schema.js.map +0 -1
- package/dist/modules/core/account-auth/account-auth.module.d.ts +0 -2
- package/dist/modules/core/account-auth/account-auth.module.js +0 -24
- package/dist/modules/core/account-auth/account-auth.module.js.map +0 -1
- package/dist/modules/core/account-auth/account-auth.service.d.ts +0 -5
- package/dist/modules/core/account-auth/account-auth.service.js +0 -41
- package/dist/modules/core/account-auth/account-auth.service.js.map +0 -1
- package/dist/modules/core/account-auth/account-auth.strategy.d.ts +0 -10
- package/dist/modules/core/account-auth/account-auth.strategy.js +0 -49
- package/dist/modules/core/account-auth/account-auth.strategy.js.map +0 -1
- package/dist/modules/core/auth/auth.module.d.ts +0 -2
- package/dist/modules/core/auth/auth.module.js +0 -35
- package/dist/modules/core/auth/auth.module.js.map +0 -1
- package/dist/modules/core/auth/auth.service.d.ts +0 -11
- package/dist/modules/core/auth/auth.service.js +0 -164
- package/dist/modules/core/auth/auth.service.js.map +0 -1
- package/dist/modules/core/auth/auth.types.d.ts +0 -27
- package/dist/modules/core/auth/auth.types.js +0 -3
- package/dist/modules/core/auth/auth.types.js.map +0 -1
- package/dist/modules/core/auth/jwt.auth.guard.d.ts +0 -6
- package/dist/modules/core/auth/jwt.auth.guard.js +0 -23
- package/dist/modules/core/auth/jwt.auth.guard.js.map +0 -1
- package/dist/modules/core/auth/jwt.strategy.d.ts +0 -10
- package/dist/modules/core/auth/jwt.strategy.js +0 -35
- package/dist/modules/core/auth/jwt.strategy.js.map +0 -1
- package/dist/modules/core/backup/backup.controller.d.ts +0 -7
- package/dist/modules/core/backup/backup.controller.js +0 -61
- package/dist/modules/core/backup/backup.controller.js.map +0 -1
- package/dist/modules/core/backup/backup.module.d.ts +0 -2
- package/dist/modules/core/backup/backup.module.js +0 -22
- package/dist/modules/core/backup/backup.module.js.map +0 -1
- package/dist/modules/core/backup/backup.resolver.d.ts +0 -8
- package/dist/modules/core/backup/backup.resolver.js +0 -54
- package/dist/modules/core/backup/backup.resolver.js.map +0 -1
- package/dist/modules/core/backup/backup.shema.d.ts +0 -4
- package/dist/modules/core/backup/backup.shema.js +0 -30
- package/dist/modules/core/backup/backup.shema.js.map +0 -1
- package/dist/modules/core/core.module.d.ts +0 -2
- package/dist/modules/core/core.module.js +0 -50
- package/dist/modules/core/core.module.js.map +0 -1
- package/dist/modules/core/document/document.helper.d.ts +0 -2
- package/dist/modules/core/document/document.helper.js +0 -10
- package/dist/modules/core/document/document.helper.js.map +0 -1
- package/dist/modules/core/document/document.model.d.ts +0 -9
- package/dist/modules/core/document/document.model.js +0 -59
- package/dist/modules/core/document/document.model.js.map +0 -1
- package/dist/modules/core/document/document.module.d.ts +0 -2
- package/dist/modules/core/document/document.module.js +0 -25
- package/dist/modules/core/document/document.module.js.map +0 -1
- package/dist/modules/core/document/document.resolver.d.ts +0 -12
- package/dist/modules/core/document/document.resolver.extend.d.ts +0 -10
- package/dist/modules/core/document/document.resolver.extend.js +0 -69
- package/dist/modules/core/document/document.resolver.extend.js.map +0 -1
- package/dist/modules/core/document/document.resolver.js +0 -154
- package/dist/modules/core/document/document.resolver.js.map +0 -1
- package/dist/modules/core/document/document.schema.d.ts +0 -39
- package/dist/modules/core/document/document.schema.js +0 -181
- package/dist/modules/core/document/document.schema.js.map +0 -1
- package/dist/modules/core/document/load-documents.queries.d.ts +0 -17
- package/dist/modules/core/document/load-documents.queries.js +0 -119
- package/dist/modules/core/document/load-documents.queries.js.map +0 -1
- package/dist/modules/core/document/save-documents.queries.d.ts +0 -18
- package/dist/modules/core/document/save-documents.queries.js +0 -199
- package/dist/modules/core/document/save-documents.queries.js.map +0 -1
- package/dist/modules/core/fields/_fields.helpers.d.ts +0 -2
- package/dist/modules/core/fields/_fields.helpers.js +0 -12
- package/dist/modules/core/fields/_fields.helpers.js.map +0 -1
- package/dist/modules/core/fields/fields.model.d.ts +0 -17
- package/dist/modules/core/fields/fields.model.js +0 -99
- package/dist/modules/core/fields/fields.model.js.map +0 -1
- package/dist/modules/core/fields/fields.module.d.ts +0 -2
- package/dist/modules/core/fields/fields.module.js +0 -20
- package/dist/modules/core/fields/fields.module.js.map +0 -1
- package/dist/modules/core/fields/fields.resolver.d.ts +0 -14
- package/dist/modules/core/fields/fields.resolver.js +0 -165
- package/dist/modules/core/fields/fields.resolver.js.map +0 -1
- package/dist/modules/core/fields/load-fields.queries.d.ts +0 -20
- package/dist/modules/core/fields/load-fields.queries.js +0 -233
- package/dist/modules/core/fields/load-fields.queries.js.map +0 -1
- package/dist/modules/core/fields/quill-delta.d.ts +0 -1
- package/dist/modules/core/fields/quill-delta.js +0 -40
- package/dist/modules/core/fields/quill-delta.js.map +0 -1
- package/dist/modules/core/fields/save-fields.queries.d.ts +0 -9
- package/dist/modules/core/fields/save-fields.queries.js +0 -135
- package/dist/modules/core/fields/save-fields.queries.js.map +0 -1
- package/dist/modules/core/leaf/leaf.model.d.ts +0 -9
- package/dist/modules/core/leaf/leaf.model.js +0 -61
- package/dist/modules/core/leaf/leaf.model.js.map +0 -1
- package/dist/modules/core/leaf/leaf.module.d.ts +0 -2
- package/dist/modules/core/leaf/leaf.module.js +0 -21
- package/dist/modules/core/leaf/leaf.module.js.map +0 -1
- package/dist/modules/core/leaf/leaf.queries.d.ts +0 -21
- package/dist/modules/core/leaf/leaf.queries.js +0 -159
- package/dist/modules/core/leaf/leaf.queries.js.map +0 -1
- package/dist/modules/core/leaf/leaf.resolver.d.ts +0 -9
- package/dist/modules/core/leaf/leaf.resolver.extend.d.ts +0 -6
- package/dist/modules/core/leaf/leaf.resolver.extend.js +0 -42
- package/dist/modules/core/leaf/leaf.resolver.extend.js.map +0 -1
- package/dist/modules/core/leaf/leaf.resolver.js +0 -84
- package/dist/modules/core/leaf/leaf.resolver.js.map +0 -1
- package/dist/modules/core/leaf/leaf.schema.d.ts +0 -7
- package/dist/modules/core/leaf/leaf.schema.js +0 -45
- package/dist/modules/core/leaf/leaf.schema.js.map +0 -1
- package/dist/modules/core/leaf-item/leaf-item.model.d.ts +0 -6
- package/dist/modules/core/leaf-item/leaf-item.model.js +0 -44
- package/dist/modules/core/leaf-item/leaf-item.model.js.map +0 -1
- package/dist/modules/core/leaf-item/leaf-item.queries.d.ts +0 -9
- package/dist/modules/core/leaf-item/leaf-item.queries.js +0 -120
- package/dist/modules/core/leaf-item/leaf-item.queries.js.map +0 -1
- package/dist/modules/core/login/login.controller.d.ts +0 -8
- package/dist/modules/core/login/login.controller.js +0 -54
- package/dist/modules/core/login/login.controller.js.map +0 -1
- package/dist/modules/core/login/login.module.d.ts +0 -2
- package/dist/modules/core/login/login.module.js +0 -22
- package/dist/modules/core/login/login.module.js.map +0 -1
- package/dist/modules/core/media/media-upload.controller.d.ts +0 -21
- package/dist/modules/core/media/media-upload.controller.js +0 -160
- package/dist/modules/core/media/media-upload.controller.js.map +0 -1
- package/dist/modules/core/media/media.d.ts +0 -22
- package/dist/modules/core/media/media.js +0 -53
- package/dist/modules/core/media/media.js.map +0 -1
- package/dist/modules/core/media/media.module.d.ts +0 -2
- package/dist/modules/core/media/media.module.js +0 -22
- package/dist/modules/core/media/media.module.js.map +0 -1
- package/dist/modules/core/media/media.resolver.d.ts +0 -14
- package/dist/modules/core/media/media.resolver.js +0 -199
- package/dist/modules/core/media/media.resolver.js.map +0 -1
- package/dist/modules/core/media/media.schema.d.ts +0 -30
- package/dist/modules/core/media/media.schema.js +0 -144
- package/dist/modules/core/media/media.schema.js.map +0 -1
- package/dist/modules/core/part/part.module.d.ts +0 -2
- package/dist/modules/core/part/part.module.js +0 -21
- package/dist/modules/core/part/part.module.js.map +0 -1
- package/dist/modules/core/part/part.queries.d.ts +0 -22
- package/dist/modules/core/part/part.queries.js +0 -167
- package/dist/modules/core/part/part.queries.js.map +0 -1
- package/dist/modules/core/part/part.resolver.d.ts +0 -14
- package/dist/modules/core/part/part.resolver.extend.d.ts +0 -5
- package/dist/modules/core/part/part.resolver.extend.js +0 -49
- package/dist/modules/core/part/part.resolver.extend.js.map +0 -1
- package/dist/modules/core/part/part.resolver.js +0 -135
- package/dist/modules/core/part/part.resolver.js.map +0 -1
- package/dist/modules/core/part/part.schema.d.ts +0 -12
- package/dist/modules/core/part/part.schema.js +0 -66
- package/dist/modules/core/part/part.schema.js.map +0 -1
- package/dist/modules/core/section/section-wrap.resolver.d.ts +0 -11
- package/dist/modules/core/section/section-wrap.resolver.js +0 -168
- package/dist/modules/core/section/section-wrap.resolver.js.map +0 -1
- package/dist/modules/core/section/section.model.d.ts +0 -6
- package/dist/modules/core/section/section.model.js +0 -44
- package/dist/modules/core/section/section.model.js.map +0 -1
- package/dist/modules/core/section/section.module.d.ts +0 -2
- package/dist/modules/core/section/section.module.js +0 -21
- package/dist/modules/core/section/section.module.js.map +0 -1
- package/dist/modules/core/section/section.queries.d.ts +0 -51
- package/dist/modules/core/section/section.queries.js +0 -228
- package/dist/modules/core/section/section.queries.js.map +0 -1
- package/dist/modules/core/section/section.resolver.d.ts +0 -7
- package/dist/modules/core/section/section.resolver.js +0 -78
- package/dist/modules/core/section/section.resolver.js.map +0 -1
- package/dist/modules/core/section/section.schema.d.ts +0 -27
- package/dist/modules/core/section/section.schema.js +0 -129
- package/dist/modules/core/section/section.schema.js.map +0 -1
- package/dist/modules/core/site-info/site-info.module.d.ts +0 -2
- package/dist/modules/core/site-info/site-info.module.js +0 -20
- package/dist/modules/core/site-info/site-info.module.js.map +0 -1
- package/dist/modules/core/site-info/site-info.resolver.d.ts +0 -5
- package/dist/modules/core/site-info/site-info.resolver.js +0 -44
- package/dist/modules/core/site-info/site-info.resolver.js.map +0 -1
- package/dist/modules/core/site-info/site-info.schema.d.ts +0 -6
- package/dist/modules/core/site-info/site-info.schema.js +0 -36
- package/dist/modules/core/site-info/site-info.schema.js.map +0 -1
- package/dist/modules/core/site-schema/site-schema.module.d.ts +0 -2
- package/dist/modules/core/site-schema/site-schema.module.js +0 -20
- package/dist/modules/core/site-schema/site-schema.module.js.map +0 -1
- package/dist/modules/core/site-schema/site-schema.resolver.d.ts +0 -4
- package/dist/modules/core/site-schema/site-schema.resolver.js +0 -35
- package/dist/modules/core/site-schema/site-schema.resolver.js.map +0 -1
- package/dist/modules/core/term-flag/term-flag.model.d.ts +0 -6
- package/dist/modules/core/term-flag/term-flag.model.js +0 -45
- package/dist/modules/core/term-flag/term-flag.model.js.map +0 -1
- package/dist/modules/core/term-flag/term-flag.module.d.ts +0 -2
- package/dist/modules/core/term-flag/term-flag.module.js +0 -20
- package/dist/modules/core/term-flag/term-flag.module.js.map +0 -1
- package/dist/modules/core/term-flag/term-flag.queries.d.ts +0 -7
- package/dist/modules/core/term-flag/term-flag.queries.js +0 -44
- package/dist/modules/core/term-flag/term-flag.queries.js.map +0 -1
- package/dist/modules/core/term-flag/term-flag.resolver.d.ts +0 -5
- package/dist/modules/core/term-flag/term-flag.resolver.js +0 -47
- package/dist/modules/core/term-flag/term-flag.resolver.js.map +0 -1
- package/dist/modules/core/term-flag/term-flag.schema.d.ts +0 -9
- package/dist/modules/core/term-flag/term-flag.schema.js +0 -51
- package/dist/modules/core/term-flag/term-flag.schema.js.map +0 -1
- package/dist/modules/core/unprotected/unprotected.module.d.ts +0 -2
- package/dist/modules/core/unprotected/unprotected.module.js +0 -20
- package/dist/modules/core/unprotected/unprotected.module.js.map +0 -1
- package/dist/modules/core/unprotected/unprotected.resolver.d.ts +0 -8
- package/dist/modules/core/unprotected/unprotected.resolver.js +0 -106
- package/dist/modules/core/unprotected/unprotected.resolver.js.map +0 -1
- package/dist/modules/core/unprotected/unprotected.schema.d.ts +0 -19
- package/dist/modules/core/unprotected/unprotected.schema.js +0 -93
- package/dist/modules/core/unprotected/unprotected.schema.js.map +0 -1
- package/dist/modules/graphql.types.d.ts +0 -6
- package/dist/modules/graphql.types.js +0 -3
- package/dist/modules/graphql.types.js.map +0 -1
- package/dist/modules/private-api.module.d.ts +0 -2
- package/dist/modules/private-api.module.js +0 -50
- package/dist/modules/private-api.module.js.map +0 -1
- package/dist/modules/public-api/class-validator-options.d.ts +0 -7
- package/dist/modules/public-api/class-validator-options.js +0 -11
- package/dist/modules/public-api/class-validator-options.js.map +0 -1
- package/dist/modules/public-api/mail/contact-form-mail.d.ts +0 -8
- package/dist/modules/public-api/mail/contact-form-mail.js +0 -96
- package/dist/modules/public-api/mail/contact-form-mail.js.map +0 -1
- package/dist/modules/public-api/mail/mail.dto.d.ts +0 -8
- package/dist/modules/public-api/mail/mail.dto.js +0 -56
- package/dist/modules/public-api/mail/mail.dto.js.map +0 -1
- package/dist/modules/public-api/partials/partials-params.dto.d.ts +0 -6
- package/dist/modules/public-api/partials/partials-params.dto.js +0 -45
- package/dist/modules/public-api/partials/partials-params.dto.js.map +0 -1
- package/dist/modules/public-api/password-reset/password-reset.controller.d.ts +0 -11
- package/dist/modules/public-api/password-reset/password-reset.controller.js +0 -59
- package/dist/modules/public-api/password-reset/password-reset.controller.js.map +0 -1
- package/dist/modules/public-api/password-reset/password-reset.dto.d.ts +0 -9
- package/dist/modules/public-api/password-reset/password-reset.dto.js +0 -55
- package/dist/modules/public-api/password-reset/password-reset.dto.js.map +0 -1
- package/dist/modules/public-api/password-reset/password-reset.module.d.ts +0 -2
- package/dist/modules/public-api/password-reset/password-reset.module.js +0 -22
- package/dist/modules/public-api/password-reset/password-reset.module.js.map +0 -1
- package/dist/modules/public-api/password-reset/password-reset.service.d.ts +0 -14
- package/dist/modules/public-api/password-reset/password-reset.service.js +0 -56
- package/dist/modules/public-api/password-reset/password-reset.service.js.map +0 -1
- package/dist/modules/public-api/public-api-controller.d.ts +0 -32
- package/dist/modules/public-api/public-api-controller.js +0 -198
- package/dist/modules/public-api/public-api-controller.js.map +0 -1
- package/dist/modules/public-api/public-api.module.d.ts +0 -2
- package/dist/modules/public-api/public-api.module.js +0 -22
- package/dist/modules/public-api/public-api.module.js.map +0 -1
- package/dist/modules/public-api/search-text/search-text.dto.d.ts +0 -7
- package/dist/modules/public-api/search-text/search-text.dto.js +0 -50
- package/dist/modules/public-api/search-text/search-text.dto.js.map +0 -1
- package/dist/modules/public-api/search-text/search-text.queries.d.ts +0 -14
- package/dist/modules/public-api/search-text/search-text.queries.js +0 -58
- package/dist/modules/public-api/search-text/search-text.queries.js.map +0 -1
- package/dist/modules/public-site/app-exception-filter.d.ts +0 -4
- package/dist/modules/public-site/app-exception-filter.js +0 -41
- package/dist/modules/public-site/app-exception-filter.js.map +0 -1
- package/dist/modules/public-site/helpers/format-date.helper.d.ts +0 -4
- package/dist/modules/public-site/helpers/format-date.helper.js +0 -35
- package/dist/modules/public-site/helpers/format-date.helper.js.map +0 -1
- package/dist/modules/public-site/helpers/medias.helpers.d.ts +0 -3
- package/dist/modules/public-site/helpers/medias.helpers.js +0 -16
- package/dist/modules/public-site/helpers/medias.helpers.js.map +0 -1
- package/dist/modules/public-site/helpers/obfuscate.helper.d.ts +0 -2
- package/dist/modules/public-site/helpers/obfuscate.helper.js +0 -27
- package/dist/modules/public-site/helpers/obfuscate.helper.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/format-date.d.ts +0 -7
- package/dist/modules/public-site/liquidjs-filters/format-date.js +0 -15
- package/dist/modules/public-site/liquidjs-filters/format-date.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/format-number.d.ts +0 -6
- package/dist/modules/public-site/liquidjs-filters/format-number.js +0 -17
- package/dist/modules/public-site/liquidjs-filters/format-number.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/info-filter.d.ts +0 -1
- package/dist/modules/public-site/liquidjs-filters/info-filter.js +0 -144
- package/dist/modules/public-site/liquidjs-filters/info-filter.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.d.ts +0 -1
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js +0 -40
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.d.ts +0 -6
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js +0 -25
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.d.ts +0 -3
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.js +0 -10
- package/dist/modules/public-site/liquidjs-filters/make-excerpt.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/obfuscate.d.ts +0 -2
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js +0 -18
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.d.ts +0 -6
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js +0 -41
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js.map +0 -1
- package/dist/modules/public-site/liquidjs-filters/translate-filter.d.ts +0 -7
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js +0 -23
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js.map +0 -1
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.d.ts +0 -13
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.js +0 -69
- package/dist/modules/public-site/liquidjs-tags/get-page-tag.js.map +0 -1
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.d.ts +0 -13
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js +0 -95
- package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js.map +0 -1
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.d.ts +0 -13
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.js +0 -54
- package/dist/modules/public-site/liquidjs-tags/use-image-tag.js.map +0 -1
- package/dist/modules/public-site/media-serve/_media-serve-helpers.d.ts +0 -11
- package/dist/modules/public-site/media-serve/_media-serve-helpers.js +0 -26
- package/dist/modules/public-site/media-serve/_media-serve-helpers.js.map +0 -1
- package/dist/modules/public-site/media-serve/media-serve.controller.d.ts +0 -4
- package/dist/modules/public-site/media-serve/media-serve.controller.js +0 -140
- package/dist/modules/public-site/media-serve/media-serve.controller.js.map +0 -1
- package/dist/modules/public-site/media-serve/media-serve.module.d.ts +0 -2
- package/dist/modules/public-site/media-serve/media-serve.module.js +0 -20
- package/dist/modules/public-site/media-serve/media-serve.module.js.map +0 -1
- package/dist/modules/public-site/oauth2-client.controller.d.ts +0 -10
- package/dist/modules/public-site/oauth2-client.controller.js +0 -144
- package/dist/modules/public-site/oauth2-client.controller.js.map +0 -1
- package/dist/modules/public-site/public-route/make-url.d.ts +0 -11
- package/dist/modules/public-site/public-route/make-url.js +0 -150
- package/dist/modules/public-site/public-route/make-url.js.map +0 -1
- package/dist/modules/public-site/public-route/public-route-parser.d.ts +0 -16
- package/dist/modules/public-site/public-route/public-route-parser.js +0 -154
- package/dist/modules/public-site/public-route/public-route-parser.js.map +0 -1
- package/dist/modules/public-site/public-route/raw-document-payload.d.ts +0 -8
- package/dist/modules/public-site/public-route/raw-document-payload.js +0 -86
- package/dist/modules/public-site/public-route/raw-document-payload.js.map +0 -1
- package/dist/modules/public-site/public-site.controller.d.ts +0 -7
- package/dist/modules/public-site/public-site.controller.js +0 -58
- package/dist/modules/public-site/public-site.controller.js.map +0 -1
- package/dist/modules/public-site/public-site.middleware.d.ts +0 -5
- package/dist/modules/public-site/public-site.middleware.js +0 -67
- package/dist/modules/public-site/public-site.middleware.js.map +0 -1
- package/dist/modules/public-site/public-site.module.d.ts +0 -4
- package/dist/modules/public-site/public-site.module.js +0 -27
- package/dist/modules/public-site/public-site.module.js.map +0 -1
- package/dist/modules/public-site/serve-document/serve-document.d.ts +0 -20
- package/dist/modules/public-site/serve-document/serve-document.js +0 -60
- package/dist/modules/public-site/serve-document/serve-document.js.map +0 -1
- package/dist/modules/security/app-throttler-guard.d.ts +0 -8
- package/dist/modules/security/app-throttler-guard.js +0 -18
- package/dist/modules/security/app-throttler-guard.js.map +0 -1
- package/dist/modules/security/complexity-plugin.d.ts +0 -8
- package/dist/modules/security/complexity-plugin.js +0 -46
- package/dist/modules/security/complexity-plugin.js.map +0 -1
- package/dist/nest-custom-logger.d.ts +0 -8
- package/dist/nest-custom-logger.js +0 -23
- package/dist/nest-custom-logger.js.map +0 -1
- package/dist/public-payload/breadcrumb.queries.d.ts +0 -5
- package/dist/public-payload/breadcrumb.queries.js +0 -26
- package/dist/public-payload/breadcrumb.queries.js.map +0 -1
- package/dist/public-payload/create-page-drop.d.ts +0 -11
- package/dist/public-payload/create-page-drop.js +0 -160
- package/dist/public-payload/create-page-drop.js.map +0 -1
- package/dist/public-payload/create-page-part-drop.d.ts +0 -7
- package/dist/public-payload/create-page-part-drop.js +0 -39
- package/dist/public-payload/create-page-part-drop.js.map +0 -1
- package/dist/public-payload/excerpt.queries.d.ts +0 -10
- package/dist/public-payload/excerpt.queries.js +0 -38
- package/dist/public-payload/excerpt.queries.js.map +0 -1
- package/dist/public-payload/field-values.d.ts +0 -9
- package/dist/public-payload/field-values.js +0 -99
- package/dist/public-payload/field-values.js.map +0 -1
- package/dist/public-payload/get-siblings.queries.d.ts +0 -5
- package/dist/public-payload/get-siblings.queries.js +0 -117
- package/dist/public-payload/get-siblings.queries.js.map +0 -1
- package/dist/public-payload/load-default-image.d.ts +0 -8
- package/dist/public-payload/load-default-image.js +0 -52
- package/dist/public-payload/load-default-image.js.map +0 -1
- package/dist/public-payload/make-basic-payload.d.ts +0 -6
- package/dist/public-payload/make-basic-payload.js +0 -19
- package/dist/public-payload/make-basic-payload.js.map +0 -1
- package/dist/public-payload/make-image-available.d.ts +0 -26
- package/dist/public-payload/make-image-available.js +0 -38
- package/dist/public-payload/make-image-available.js.map +0 -1
- package/dist/public-payload/page-values.queries.d.ts +0 -27
- package/dist/public-payload/page-values.queries.js +0 -110
- package/dist/public-payload/page-values.queries.js.map +0 -1
- package/dist/public-payload/parts.queries.d.ts +0 -6
- package/dist/public-payload/parts.queries.js +0 -123
- package/dist/public-payload/parts.queries.js.map +0 -1
- package/dist/public-payload/public-payload.types.d.ts +0 -130
- package/dist/public-payload/public-payload.types.js +0 -3
- package/dist/public-payload/public-payload.types.js.map +0 -1
- package/dist/public-payload/site-payload.d.ts +0 -4
- package/dist/public-payload/site-payload.js +0 -43
- package/dist/public-payload/site-payload.js.map +0 -1
- package/dist/public-payload/taxonomies.queries.d.ts +0 -13
- package/dist/public-payload/taxonomies.queries.js +0 -45
- package/dist/public-payload/taxonomies.queries.js.map +0 -1
- package/dist/public-payload/translations.queries.d.ts +0 -7
- package/dist/public-payload/translations.queries.js +0 -62
- package/dist/public-payload/translations.queries.js.map +0 -1
- package/dist/public.types.d.ts +0 -5
- package/dist/public.types.js +0 -3
- package/dist/public.types.js.map +0 -1
- package/dist/share/pino-app-log.d.ts +0 -26
- package/dist/share/pino-app-log.js +0 -138
- package/dist/share/pino-app-log.js.map +0 -1
- package/dist/share/read-configuration.d.ts +0 -7
- package/dist/share/read-configuration.js +0 -31
- package/dist/share/read-configuration.js.map +0 -1
- package/dist/site-backup/archiver.helper.d.ts +0 -12
- package/dist/site-backup/archiver.helper.js +0 -43
- package/dist/site-backup/archiver.helper.js.map +0 -1
- package/dist/site-backup/backup-tasks.d.ts +0 -10
- package/dist/site-backup/backup-tasks.js +0 -50
- package/dist/site-backup/backup-tasks.js.map +0 -1
- package/dist/site-backup/backup.d.ts +0 -11
- package/dist/site-backup/backup.helper.d.ts +0 -3
- package/dist/site-backup/backup.helper.js +0 -13
- package/dist/site-backup/backup.helper.js.map +0 -1
- package/dist/site-backup/backup.js +0 -35
- package/dist/site-backup/backup.js.map +0 -1
- package/dist/site-context/create-site-context.d.ts +0 -3
- package/dist/site-context/create-site-context.js +0 -183
- package/dist/site-context/create-site-context.js.map +0 -1
- package/dist/site-context/db-init/db-init.d.ts +0 -11
- package/dist/site-context/db-init/db-init.js +0 -38
- package/dist/site-context/db-init/db-init.js.map +0 -1
- package/dist/site-context/db-init/ddl-migration.d.ts +0 -13
- package/dist/site-context/db-init/ddl-migration.js +0 -26
- package/dist/site-context/db-init/ddl-migration.js.map +0 -1
- package/dist/site-context/db-init/init-routing-points.d.ts +0 -5
- package/dist/site-context/db-init/init-routing-points.js +0 -149
- package/dist/site-context/db-init/init-routing-points.js.map +0 -1
- package/dist/site-context/site-conf.d.ts +0 -17
- package/dist/site-context/site-conf.js +0 -103
- package/dist/site-context/site-conf.js.map +0 -1
- package/dist/site-context/site-context.d.ts +0 -12
- package/dist/site-context/site-context.js +0 -87
- package/dist/site-context/site-context.js.map +0 -1
- package/dist/site-context/site-context.types.d.ts +0 -46
- package/dist/site-context/site-context.types.js +0 -3
- package/dist/site-context/site-context.types.js.map +0 -1
- package/dist/site-context/theme-conf-reader.d.ts +0 -4
- package/dist/site-context/theme-conf-reader.js +0 -33
- package/dist/site-context/theme-conf-reader.js.map +0 -1
- package/dist/site-context/theme-conf-types.d.ts +0 -4
- package/dist/site-context/theme-conf-types.js +0 -3
- package/dist/site-context/theme-conf-types.js.map +0 -1
- package/dist/site-schema/common-schema-reader.d.ts +0 -6
- package/dist/site-schema/common-schema-reader.js +0 -29
- package/dist/site-schema/common-schema-reader.js.map +0 -1
- package/dist/site-schema/merged-schema-lib.d.ts +0 -30
- package/dist/site-schema/merged-schema-lib.js +0 -118
- package/dist/site-schema/merged-schema-lib.js.map +0 -1
- package/dist/site-schema/read-locales.d.ts +0 -24
- package/dist/site-schema/read-locales.js +0 -171
- package/dist/site-schema/read-locales.js.map +0 -1
- package/dist/site-schema/site-schema-factory.d.ts +0 -2
- package/dist/site-schema/site-schema-factory.js +0 -385
- package/dist/site-schema/site-schema-factory.js.map +0 -1
- package/dist/site-schema/site-schema-helpers.d.ts +0 -5
- package/dist/site-schema/site-schema-helpers.js +0 -27
- package/dist/site-schema/site-schema-helpers.js.map +0 -1
- package/dist/site-schema/site-schema-lib-reader.d.ts +0 -14
- package/dist/site-schema/site-schema-lib-reader.js +0 -48
- package/dist/site-schema/site-schema-lib-reader.js.map +0 -1
- package/dist/start.d.ts +0 -1
- package/dist/start.js +0 -5
- package/dist/start.js.map +0 -1
- package/dist/types.to.json +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;QACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM;QAClC,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC;QAC5C,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;QACvB,IAAI,SAAS,GAAG,CAAC;YAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;QAC9C,IAAI,SAAS,GAAG,YAAY;YAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC3D,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC;AA5BD,sDA4BC;AAED,SAAS,iBAAiB,CAAC,QAAgB;IACzC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC;AAKD,SAAS,SAAS,CAAC,GAAW,EAAE,GAAW;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
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>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSimpleTranslator = void 0;
|
|
4
|
-
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
-
const promises_1 = require("fs/promises");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
async function createSimpleTranslator(options) {
|
|
8
|
-
const labels = await loadLabels(options);
|
|
9
|
-
return {
|
|
10
|
-
translate: (options) => translate(labels, options),
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
exports.createSimpleTranslator = createSimpleTranslator;
|
|
14
|
-
function translate(labels, { args = [], key, lang }) {
|
|
15
|
-
let label = labels.get(lang)?.[key] ?? key;
|
|
16
|
-
const variables = findVariablesInString(label, args.length);
|
|
17
|
-
variables.reverse();
|
|
18
|
-
for (const { indexInString, variableName, variableNumber } of variables) {
|
|
19
|
-
const value = args[variableNumber - 1];
|
|
20
|
-
const before = label.substring(0, indexInString);
|
|
21
|
-
const after = label.substring(indexInString + variableName.length);
|
|
22
|
-
label = `${before}${value}${after}`;
|
|
23
|
-
}
|
|
24
|
-
return label;
|
|
25
|
-
}
|
|
26
|
-
function findVariablesInString(str, max) {
|
|
27
|
-
const matches = [];
|
|
28
|
-
const regex = /\$[0-9]+/g;
|
|
29
|
-
let match;
|
|
30
|
-
while (true) {
|
|
31
|
-
match = regex.exec(str);
|
|
32
|
-
if (!match)
|
|
33
|
-
break;
|
|
34
|
-
const [variableName] = match;
|
|
35
|
-
const variableNumber = (0, data_formatters_lib_1.nbVal)(variableName.substring(1), { varName: variableName });
|
|
36
|
-
if (variableNumber <= max) {
|
|
37
|
-
matches.push({
|
|
38
|
-
variableName,
|
|
39
|
-
variableNumber,
|
|
40
|
-
indexInString: match.index,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return matches;
|
|
45
|
-
}
|
|
46
|
-
async function loadLabels({ l10nDir, langs, appLog, }) {
|
|
47
|
-
const labels = new Map();
|
|
48
|
-
for (const lang of langs) {
|
|
49
|
-
let content;
|
|
50
|
-
try {
|
|
51
|
-
content = await (0, promises_1.readFile)((0, path_1.join)(l10nDir, `${lang}.json`), "utf-8");
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
labels.set(lang, flattenLocales(JSON.parse(content)));
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
appLog.warn(`invalid locale file '${(0, path_1.join)(l10nDir, `${lang}.json`)}'`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return labels;
|
|
64
|
-
}
|
|
65
|
-
function flattenLocales(source, prefix = "") {
|
|
66
|
-
const result = {};
|
|
67
|
-
for (const [key, val] of Object.entries(source)) {
|
|
68
|
-
if (val === null)
|
|
69
|
-
throw new Error(`invalid null value for '${key}'`);
|
|
70
|
-
if (typeof val === "string") {
|
|
71
|
-
result[`${prefix}${key}`] = val;
|
|
72
|
-
}
|
|
73
|
-
else if (typeof val === "object") {
|
|
74
|
-
Object.assign(result, flattenLocales(val, `${prefix}${key}.`));
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
throw new Error(`invalid value for '${key}'`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=simple-i18n.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-i18n.js","sourceRoot":"","sources":["../../src/helpers/simple-i18n.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AccountModel } from "../modules/core/account/account.model";
|
|
2
|
-
export declare const devAccountId = "dev:0";
|
|
3
|
-
export declare function isDevAccountId(id: string): boolean;
|
|
4
|
-
export interface ParsedPlatformAdminAccountId {
|
|
5
|
-
index: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function parsePlatformAdminAccountId(id: string): ParsedPlatformAdminAccountId | undefined;
|
|
8
|
-
export declare function getDevAccount(id: string): AccountModel;
|
|
9
|
-
export declare function getPlatformAdminAccount({ index }: ParsedPlatformAdminAccountId): AccountModel;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPlatformAdminAccount = exports.getDevAccount = exports.parsePlatformAdminAccountId = exports.isDevAccountId = exports.devAccountId = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const context_1 = require("../context");
|
|
6
|
-
exports.devAccountId = "dev:0";
|
|
7
|
-
function isDevAccountId(id) {
|
|
8
|
-
return id === exports.devAccountId;
|
|
9
|
-
}
|
|
10
|
-
exports.isDevAccountId = isDevAccountId;
|
|
11
|
-
function parsePlatformAdminAccountId(id) {
|
|
12
|
-
if (!id.startsWith("pladm:"))
|
|
13
|
-
return;
|
|
14
|
-
return { index: Number(id.substring(6)) };
|
|
15
|
-
}
|
|
16
|
-
exports.parsePlatformAdminAccountId = parsePlatformAdminAccountId;
|
|
17
|
-
function getDevAccount(id) {
|
|
18
|
-
const devAccount = context_1.appConf.devAccount;
|
|
19
|
-
if (!devAccount || exports.devAccountId !== id) {
|
|
20
|
-
throw new common_1.NotFoundException();
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
email: devAccount.email,
|
|
24
|
-
id: exports.devAccountId,
|
|
25
|
-
name: devAccount.name,
|
|
26
|
-
special: "dev",
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
exports.getDevAccount = getDevAccount;
|
|
30
|
-
function getPlatformAdminAccount({ index }) {
|
|
31
|
-
const account = context_1.appConf.platformAdminAccounts?.[index];
|
|
32
|
-
if (!account) {
|
|
33
|
-
throw new common_1.NotFoundException();
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
id: `pladm:${index}`,
|
|
37
|
-
email: account.email,
|
|
38
|
-
name: account.name,
|
|
39
|
-
special: "platformAdmin",
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
exports.getPlatformAdminAccount = getPlatformAdminAccount;
|
|
43
|
-
//# sourceMappingURL=special-account.helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"special-account.helpers.js","sourceRoot":"","sources":["../../src/helpers/special-account.helpers.ts"],"names":[],"mappings":";;;AAAA,2CAAmD;AACnD,wCAAqC;AAGxB,QAAA,YAAY,GAAG,OAAO,CAAC;AAEpC,SAAgB,cAAc,CAAC,EAAU;IACvC,OAAO,EAAE,KAAK,oBAAY,CAAC;AAC7B,CAAC;AAFD,wCAEC;AAMD,SAAgB,2BAA2B,CAAC,EAAU;IACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO;IACrC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC;AAHD,kEAGC;AAED,SAAgB,aAAa,CAAC,EAAU;IACtC,MAAM,UAAU,GAAG,iBAAO,CAAC,UAAU,CAAC;IACtC,IAAI,CAAC,UAAU,IAAI,oBAAY,KAAK,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,0BAAiB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,EAAE,EAAE,oBAAY;QAChB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC;AAZD,sCAYC;AAED,SAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAgC;IAC7E,MAAM,OAAO,GAAG,iBAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,0BAAiB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO;QACL,EAAE,EAAE,SAAS,KAAK,EAAE;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,eAAe;KACzB,CAAC;AACJ,CAAC;AAZD,0DAYC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBoUrl = void 0;
|
|
4
|
-
const context_1 = require("../context");
|
|
5
|
-
function getBoUrl(siteConf, path) {
|
|
6
|
-
const { boPublicPort, https } = context_1.appConf.thisServer;
|
|
7
|
-
const { fqdn } = siteConf;
|
|
8
|
-
const protocol = https ? "https" : "http";
|
|
9
|
-
return `${protocol}://${fqdn}${boPublicPort ? `:${boPublicPort}` : ""}${path ?? ""}`;
|
|
10
|
-
}
|
|
11
|
-
exports.getBoUrl = getBoUrl;
|
|
12
|
-
//# sourceMappingURL=url.helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url.helpers.js","sourceRoot":"","sources":["../../src/helpers/url.helpers.ts"],"names":[],"mappings":";;;AAAA,wCAAqC;AAGrC,SAAgB,QAAQ,CAAC,QAAkB,EAAE,IAAa;IACxD,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,iBAAO,CAAC,UAAU,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,GAAG,QAAQ,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;AACvF,CAAC;AALD,4BAKC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function toHttpHeaderIfModifiedSince(time: unknown): string;
|
|
2
|
-
export declare function mediaTypeToFileExtension(mediaType: string): string;
|
|
3
|
-
export declare function pascalCaseToDashed(s: string): string;
|
|
4
|
-
export declare function toLeafId(leafOrSectionId: string): string;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toLeafId = exports.pascalCaseToDashed = exports.mediaTypeToFileExtension = exports.toHttpHeaderIfModifiedSince = void 0;
|
|
4
|
-
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
-
const anywhere_lib_1 = require("@paroicms/anywhere-lib");
|
|
6
|
-
function toHttpHeaderIfModifiedSince(time) {
|
|
7
|
-
return (0, data_formatters_lib_1.dateVal)(time).toUTCString();
|
|
8
|
-
}
|
|
9
|
-
exports.toHttpHeaderIfModifiedSince = toHttpHeaderIfModifiedSince;
|
|
10
|
-
function mediaTypeToFileExtension(mediaType) {
|
|
11
|
-
const regexMatchArray = mediaType.match(/\w+\/([-+.\w]+)/);
|
|
12
|
-
if (!regexMatchArray) {
|
|
13
|
-
throw new Error("media extension is incorrect.");
|
|
14
|
-
}
|
|
15
|
-
return regexMatchArray[1];
|
|
16
|
-
}
|
|
17
|
-
exports.mediaTypeToFileExtension = mediaTypeToFileExtension;
|
|
18
|
-
function pascalCaseToDashed(s) {
|
|
19
|
-
return s
|
|
20
|
-
.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)
|
|
21
|
-
.replace(/^-+/, "")
|
|
22
|
-
.replace(/-+$/, "")
|
|
23
|
-
.replace(/--+/g, "-");
|
|
24
|
-
}
|
|
25
|
-
exports.pascalCaseToDashed = pascalCaseToDashed;
|
|
26
|
-
function toLeafId(leafOrSectionId) {
|
|
27
|
-
return leafOrSectionId.indexOf(":") !== -1
|
|
28
|
-
? (0, anywhere_lib_1.parseSectionId)(leafOrSectionId).leafId
|
|
29
|
-
: leafOrSectionId;
|
|
30
|
-
}
|
|
31
|
-
exports.toLeafId = toLeafId;
|
|
32
|
-
//# sourceMappingURL=utils-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-helper.js","sourceRoot":"","sources":["../../src/helpers/utils-helper.ts"],"names":[],"mappings":";;;AAAA,oEAAqD;AACrD,yDAAwD;AAExD,SAAgB,2BAA2B,CAAC,IAAa;IACvD,OAAO,IAAA,6BAAO,EAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;AACrC,CAAC;AAFD,kEAEC;AAED,SAAgB,wBAAwB,CAAC,SAAiB;IACxD,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE3D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AARD,4DAQC;AAED,SAAgB,kBAAkB,CAAC,CAAS;IAC1C,OAAO,CAAC;SACL,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;SAC/C,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AAND,gDAMC;AAED,SAAgB,QAAQ,CAAC,eAAuB;IAC9C,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC,CAAC,IAAA,6BAAc,EAAC,eAAe,CAAC,CAAC,MAAM;QACxC,CAAC,CAAC,eAAe,CAAC;AACtB,CAAC;AAJD,4BAIC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.start = void 0;
|
|
7
|
-
const core_1 = require("@nestjs/core");
|
|
8
|
-
const platform_express_1 = require("@nestjs/platform-express");
|
|
9
|
-
const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
|
|
10
|
-
const server_lib_1 = require("@paroicms/server-lib");
|
|
11
|
-
const express_1 = __importDefault(require("express"));
|
|
12
|
-
const context_1 = require("./context");
|
|
13
|
-
const static_middlewares_1 = require("./express/static-middlewares");
|
|
14
|
-
const configuration_helpers_1 = require("./helpers/configuration.helpers");
|
|
15
|
-
const maintenance_task_1 = require("./maintenance/maintenance-task");
|
|
16
|
-
const shutdown_1 = require("./maintenance/shutdown");
|
|
17
|
-
const app_module_1 = require("./modules/app.module");
|
|
18
|
-
const nest_custom_logger_1 = require("./nest-custom-logger");
|
|
19
|
-
const site_conf_1 = require("./site-context/site-conf");
|
|
20
|
-
const site_context_1 = require("./site-context/site-context");
|
|
21
|
-
const site_schema_lib_reader_1 = require("./site-schema/site-schema-lib-reader");
|
|
22
|
-
async function start(options = {}) {
|
|
23
|
-
try {
|
|
24
|
-
await context_1.platformLog.untilReady;
|
|
25
|
-
(0, site_context_1.watchForIdleSiteContexts)();
|
|
26
|
-
(0, server_image_cache_engine_1.setupImageProcessor)({ ...context_1.appConf.imageProcessor, appLog: context_1.platformLog });
|
|
27
|
-
const siteConfs = (0, configuration_helpers_1.isMultiSiteConfiguration)(context_1.appConf)
|
|
28
|
-
? await (0, site_conf_1.loadSitePackConfs)(context_1.appConf.sitePacks, options.sitePackPlaces)
|
|
29
|
-
: await (0, site_conf_1.createSiteConfsFromSingle)(context_1.appConf.singleSite);
|
|
30
|
-
await (0, context_1.initializeContext)(siteConfs);
|
|
31
|
-
(0, context_1.initSiteSchemaLib)(await (0, site_schema_lib_reader_1.readSiteSchemaLibraries)());
|
|
32
|
-
const stopCron = (0, server_lib_1.startCronLike)(maintenance_task_1.maintenanceTask, {
|
|
33
|
-
shouldExecute: (0, server_lib_1.eachDay)({ hours: 2 }),
|
|
34
|
-
appLog: context_1.platformLog,
|
|
35
|
-
});
|
|
36
|
-
const expressApp = (0, express_1.default)();
|
|
37
|
-
const app = await core_1.NestFactory.create(app_module_1.AppModule, new platform_express_1.ExpressAdapter(expressApp), {
|
|
38
|
-
logger: new nest_custom_logger_1.NestCustomLogger(),
|
|
39
|
-
});
|
|
40
|
-
app.enableCors({ credentials: true, origin: "*" });
|
|
41
|
-
app.use(static_middlewares_1.boMiddleware);
|
|
42
|
-
app.use(static_middlewares_1.themeAssetsMiddleware);
|
|
43
|
-
if (context_1.appConf.thisServer.hostName) {
|
|
44
|
-
await app.listen(context_1.appConf.thisServer.port, context_1.appConf.thisServer.hostName);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
await app.listen(context_1.appConf.thisServer.port);
|
|
48
|
-
}
|
|
49
|
-
(0, shutdown_1.handleShutdownEvents)({
|
|
50
|
-
appLog: context_1.platformLog,
|
|
51
|
-
onCloseCb: async () => {
|
|
52
|
-
await Promise.all([stopCron(), (0, maintenance_task_1.unloadAllActiveSites)(), app.close()]);
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
context_1.platformLog.info(`paroi-web-platform is up and running on port '${context_1.appConf.thisServer.port}', it serves:${getListOfSiteUrls()
|
|
56
|
-
.map((url) => `\n- ${url}`)
|
|
57
|
-
.join("")}`);
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
context_1.platformLog.error(error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.start = start;
|
|
64
|
-
function getListOfSiteUrls() {
|
|
65
|
-
return Array.from(context_1.siteConfs.values())
|
|
66
|
-
.map((siteConf) => siteConf.siteUrl)
|
|
67
|
-
.sort();
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ParsedSectionId } from "@paroicms/anywhere-lib";
|
|
2
|
-
import { Drop } from "liquidjs";
|
|
3
|
-
import { SiteContext } from "../site-context/site-context.types";
|
|
4
|
-
import { RenderingContext } from "./liquidjs-rendering/rendering-context";
|
|
5
|
-
export declare const valuesSymbol: unique symbol;
|
|
6
|
-
export type DropValues<T> = {
|
|
7
|
-
[name in keyof T]: DropOrLiquidValue;
|
|
8
|
-
};
|
|
9
|
-
export type DropOrLiquidValue = DropInst<any> | LiquidValue | (() => Promise<DropOrLiquidValue> | DropOrLiquidValue);
|
|
10
|
-
export type LiquidValue = PrimitiveLiquidValue | object | DropOrLiquidValue[];
|
|
11
|
-
export type PrimitiveLiquidValue = string | number | boolean | undefined;
|
|
12
|
-
export type DropInst<T> = Drop & {
|
|
13
|
-
[valuesSymbol]: DropValues<T>;
|
|
14
|
-
};
|
|
15
|
-
export type CacheKeyOptions = DocumentCacheKeyOptions | SiteCacheKeyOptions;
|
|
16
|
-
export interface DocumentCacheKeyOptions {
|
|
17
|
-
documentId: ParsedSectionId;
|
|
18
|
-
keySuffix?: string;
|
|
19
|
-
keyPrefix?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface SiteCacheKeyOptions {
|
|
22
|
-
lang: string;
|
|
23
|
-
keyPrefix?: string;
|
|
24
|
-
}
|
|
25
|
-
export declare function createLiquidJsDrop<T>({ renderingContext, cacheKeyOptions, values, }: {
|
|
26
|
-
renderingContext: RenderingContext;
|
|
27
|
-
cacheKeyOptions: CacheKeyOptions;
|
|
28
|
-
values: DropValues<T>;
|
|
29
|
-
}, { siteLog }: Pick<SiteContext, "siteLog">): DropInst<T>;
|
|
30
|
-
export declare function loadOrFromRenderingCache<T>(renderingContext: RenderingContext, cacheKey: string, load: () => T): Promise<T>;
|
|
31
|
-
export declare function makeDropCacheKeyForRendering(propName: string, cacheKeyOptions: CacheKeyOptions): string;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeDropCacheKeyForRendering = exports.loadOrFromRenderingCache = exports.createLiquidJsDrop = exports.valuesSymbol = void 0;
|
|
4
|
-
const liquidjs_1 = require("liquidjs");
|
|
5
|
-
exports.valuesSymbol = Symbol("values");
|
|
6
|
-
function createLiquidJsDrop({ renderingContext, cacheKeyOptions, values, }, { siteLog }) {
|
|
7
|
-
const drop = Object.create(liquidjs_1.Drop.prototype);
|
|
8
|
-
drop.liquidMethodMissing = async (name) => {
|
|
9
|
-
const val = values[name];
|
|
10
|
-
if (typeof val !== "function")
|
|
11
|
-
return val;
|
|
12
|
-
try {
|
|
13
|
-
return await loadOrFromRenderingCache(renderingContext, makeDropCacheKeyForRendering(name, cacheKeyOptions), val);
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
siteLog.error(`Error when generating '${name}':`, error);
|
|
17
|
-
throw error;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
drop[exports.valuesSymbol] = values;
|
|
21
|
-
return drop;
|
|
22
|
-
}
|
|
23
|
-
exports.createLiquidJsDrop = createLiquidJsDrop;
|
|
24
|
-
async function loadOrFromRenderingCache(renderingContext, cacheKey, load) {
|
|
25
|
-
const cacheVal = renderingContext.getValueFromCache(cacheKey);
|
|
26
|
-
if (cacheVal.found)
|
|
27
|
-
return cacheVal.val;
|
|
28
|
-
const result = await load();
|
|
29
|
-
renderingContext.setValueIntoCache(cacheKey, result);
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
exports.loadOrFromRenderingCache = loadOrFromRenderingCache;
|
|
33
|
-
function makeDropCacheKeyForRendering(propName, cacheKeyOptions) {
|
|
34
|
-
if ("documentId" in cacheKeyOptions) {
|
|
35
|
-
const { documentId, keySuffix, keyPrefix } = cacheKeyOptions;
|
|
36
|
-
return `drop:${documentId.lang}:${documentId.leafId}${keyPrefix ? `:${keyPrefix}` : ""}:${propName}${keySuffix ? `:${keySuffix}` : ""}`;
|
|
37
|
-
}
|
|
38
|
-
return makeSiteFieldDropCacheKeyForRendering(propName, cacheKeyOptions);
|
|
39
|
-
}
|
|
40
|
-
exports.makeDropCacheKeyForRendering = makeDropCacheKeyForRendering;
|
|
41
|
-
function makeSiteFieldDropCacheKeyForRendering(fieldName, cacheKeyOptions) {
|
|
42
|
-
const { lang, keyPrefix } = cacheKeyOptions;
|
|
43
|
-
return `drop${keyPrefix ? `:${keyPrefix}` : ""}:${lang}:${fieldName}`;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=liquidjs-drop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liquidjs-drop.js","sourceRoot":"","sources":["../../src/liquidjs-tools/liquidjs-drop.ts"],"names":[],"mappings":";;;AACA,uCAAgC;AAInB,QAAA,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAgC7C,SAAgB,kBAAkB,CAChC,EACE,gBAAgB,EAChB,eAAe,EACf,MAAM,GAKP,EACD,EAAE,OAAO,EAAgC;IAEzC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,eAAI,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,CAAC,mBAAmB,GAAG,KAAK,EAAE,IAAY,EAAgB,EAAE;QAC9D,MAAM,GAAG,GAAI,MAAc,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,OAAO,GAAG,KAAK,UAAU;YAAE,OAAO,GAAG,CAAC;QAC1C,IAAI,CAAC;YACH,OAAO,MAAM,wBAAwB,CACnC,gBAAgB,EAChB,4BAA4B,CAAC,IAAI,EAAE,eAAe,CAAC,EACnD,GAAG,CACJ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC;YACzD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IACF,IAAI,CAAC,oBAAY,CAAC,GAAG,MAAM,CAAC;IAC5B,OAAO,IAAI,CAAC;AAed,CAAC;AA3CD,gDA2CC;AAEM,KAAK,UAAU,wBAAwB,CAC5C,gBAAkC,EAClC,QAAgB,EAChB,IAAa;IAEb,MAAM,QAAQ,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,QAAQ,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC,GAAG,CAAC;IAExC,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAC5B,gBAAgB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,4DAWC;AAED,SAAgB,4BAA4B,CAAC,QAAgB,EAAE,eAAgC;IAC7F,IAAI,YAAY,IAAI,eAAe,EAAE,CAAC;QACpC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;QAC7D,OAAO,QAAQ,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,MAAM,GACjD,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAChC,IAAI,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,qCAAqC,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AAC1E,CAAC;AARD,oEAQC;AAED,SAAS,qCAAqC,CAC5C,SAAiB,EACjB,eAAoC;IAEpC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;IAC5C,OAAO,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Context } from "liquidjs";
|
|
2
|
-
import { SiteContext } from "../site-context/site-context.types";
|
|
3
|
-
export type LiquidFilterHandler = (value: unknown, options: {
|
|
4
|
-
ctx: Context;
|
|
5
|
-
args: any[];
|
|
6
|
-
siteContext: SiteContext;
|
|
7
|
-
}) => string | undefined | Promise<string | undefined>;
|
|
8
|
-
export declare function toLiquidJsFilterHandler(siteContext: SiteContext, handler: LiquidFilterHandler): (this: {
|
|
9
|
-
context: Context;
|
|
10
|
-
}, value: unknown, ...args: unknown[]) => string | Promise<string | undefined> | undefined;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toLiquidJsFilterHandler = void 0;
|
|
4
|
-
function toLiquidJsFilterHandler(siteContext, handler) {
|
|
5
|
-
return function (value, ...args) {
|
|
6
|
-
try {
|
|
7
|
-
const result = handler(value, { ctx: this.context, args, siteContext });
|
|
8
|
-
if (result && typeof result !== "string" && "then" in result) {
|
|
9
|
-
return result.then(undefined, (error) => {
|
|
10
|
-
siteContext.siteLog.error("Error in liquid filter:", error);
|
|
11
|
-
throw error;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
siteContext.siteLog.error("Error in liquid filter:", error);
|
|
18
|
-
throw error;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
exports.toLiquidJsFilterHandler = toLiquidJsFilterHandler;
|
|
23
|
-
//# sourceMappingURL=liquidjs-filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liquidjs-filter.js","sourceRoot":"","sources":["../../src/liquidjs-tools/liquidjs-filter.ts"],"names":[],"mappings":";;;AAYA,SAAgB,uBAAuB,CAAC,WAAwB,EAAE,OAA4B;IAC5F,OAAO,UAAsC,KAAc,EAAE,GAAG,IAAe;QAC7E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;YACxE,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;gBAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;oBACtC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;oBAC5D,MAAM,KAAK,CAAC;gBACd,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAC5D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAhBD,0DAgBC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SiteContext } from "../../site-context/site-context.types";
|
|
2
|
-
import { RenderingContext } from "./rendering-context";
|
|
3
|
-
export declare function renderLiquidTemplate(siteContext: SiteContext, renderingContext: RenderingContext, { templateNames, payload }: {
|
|
4
|
-
templateNames: string[];
|
|
5
|
-
payload: object;
|
|
6
|
-
}): Promise<string>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.renderLiquidTemplate = void 0;
|
|
7
|
-
const html_minifier_terser_1 = require("html-minifier-terser");
|
|
8
|
-
const render_1 = __importDefault(require("../render-clone/render"));
|
|
9
|
-
async function renderLiquidTemplate(siteContext, renderingContext, { templateNames, payload }) {
|
|
10
|
-
let html;
|
|
11
|
-
let usedTemplate;
|
|
12
|
-
for (const templateName of templateNames) {
|
|
13
|
-
try {
|
|
14
|
-
html = await siteContext.liquidEngine.renderFile(templateName, {
|
|
15
|
-
...payload,
|
|
16
|
-
[render_1.default.passThroughSymbol]: renderingContext,
|
|
17
|
-
});
|
|
18
|
-
usedTemplate = templateName;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
if (err.code === "ENOENT")
|
|
22
|
-
continue;
|
|
23
|
-
throw err;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (!html)
|
|
27
|
-
throw new Error(`missing template '${templateNames[0]}'`);
|
|
28
|
-
try {
|
|
29
|
-
return await (0, html_minifier_terser_1.minify)(html, {
|
|
30
|
-
collapseWhitespace: true,
|
|
31
|
-
removeComments: true,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
siteContext.siteLog.warn(`[${siteContext.fqdn}] invalid HTML generated by '${usedTemplate}'`);
|
|
36
|
-
}
|
|
37
|
-
return html;
|
|
38
|
-
}
|
|
39
|
-
exports.renderLiquidTemplate = renderLiquidTemplate;
|
|
40
|
-
//# sourceMappingURL=render-liquidjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-liquidjs.js","sourceRoot":"","sources":["../../../src/liquidjs-tools/liquidjs-rendering/render-liquidjs.ts"],"names":[],"mappings":";;;;;;AAAA,+DAA8C;AAE9C,oEAA+C;AAGxC,KAAK,UAAU,oBAAoB,CACxC,WAAwB,EACxB,gBAAkC,EAClC,EAAE,aAAa,EAAE,OAAO,EAAgD;IAExE,IAAI,IAAwB,CAAC;IAC7B,IAAI,YAAgC,CAAC;IACrC,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,IAAI,CAAC;YACH,IAAI,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,EAAE;gBAC7D,GAAG,OAAO;gBACV,CAAC,gBAAS,CAAC,iBAAiB,CAAC,EAAE,gBAAgB;aAChD,CAAC,CAAC;YACH,YAAY,GAAG,YAAY,CAAC;QAC9B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;gBAAE,SAAS;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IACD,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrE,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,6BAAM,EAAC,IAAI,EAAE;YACxB,kBAAkB,EAAE,IAAI;YACxB,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,gCAAgC,YAAY,GAAG,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA7BD,oDA6BC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Tracker } from "@paroicms/server-lib";
|
|
2
|
-
import { SiteContext } from "../../site-context/site-context.types";
|
|
3
|
-
export interface RenderingContext {
|
|
4
|
-
renderingId: bigint;
|
|
5
|
-
cacheKey: string;
|
|
6
|
-
tracker: Tracker;
|
|
7
|
-
getDependencyKeys: () => string[];
|
|
8
|
-
addDependencyKey: (...dependencyKeys: string[]) => void;
|
|
9
|
-
getValueFromCache: (key: string) => RenderingCacheResult;
|
|
10
|
-
setValueIntoCache: (key: string, val: any) => void;
|
|
11
|
-
}
|
|
12
|
-
export type RenderingCacheResult = {
|
|
13
|
-
found: false;
|
|
14
|
-
} | {
|
|
15
|
-
found: true;
|
|
16
|
-
val: any;
|
|
17
|
-
};
|
|
18
|
-
export declare function createRenderingContext(siteContext: Pick<SiteContext, "imageCache">, options: {
|
|
19
|
-
cacheKey: string;
|
|
20
|
-
tracker: Tracker;
|
|
21
|
-
dependencyKey?: string;
|
|
22
|
-
}): Promise<RenderingContext>;
|
|
23
|
-
export declare function makeTagCacheKeyForRendering(cacheKey: string, { tagParameters }: {
|
|
24
|
-
tagParameters?: any;
|
|
25
|
-
}): string;
|