@paroicms/server 0.151.0 → 0.151.2
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/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/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/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 +69 -0
- package/dist/index.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-drop.d.ts +31 -0
- package/dist/liquidjs-tools/liquidjs-drop.js +45 -0
- package/dist/liquidjs-tools/liquidjs-drop.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-filter.d.ts +10 -0
- package/dist/liquidjs-tools/liquidjs-filter.js +23 -0
- package/dist/liquidjs-tools/liquidjs-filter.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.d.ts +6 -0
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.js +40 -0
- package/dist/liquidjs-tools/liquidjs-rendering/render-liquidjs.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.d.ts +25 -0
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.js +35 -0
- package/dist/liquidjs-tools/liquidjs-rendering/rendering-context.js.map +1 -0
- package/dist/liquidjs-tools/liquidjs-utils.d.ts +5 -0
- package/dist/liquidjs-tools/liquidjs-utils.js +22 -0
- package/dist/liquidjs-tools/liquidjs-utils.js.map +1 -0
- package/dist/liquidjs-tools/render-clone/collection.d.ts +1 -0
- package/dist/liquidjs-tools/render-clone/collection.js +18 -0
- package/dist/liquidjs-tools/render-clone/collection.js.map +1 -0
- package/dist/liquidjs-tools/render-clone/forloop-drop.d.ts +15 -0
- package/dist/liquidjs-tools/render-clone/forloop-drop.js +40 -0
- package/dist/liquidjs-tools/render-clone/forloop-drop.js.map +1 -0
- package/dist/liquidjs-tools/render-clone/render.d.ts +13 -0
- package/dist/liquidjs-tools/render-clone/render.js +108 -0
- package/dist/liquidjs-tools/render-clone/render.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.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 +48 -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 +163 -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 +60 -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 +53 -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/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 +159 -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 +53 -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.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-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/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 +57 -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 +195 -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/helpers/format-date.helper.d.ts +4 -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/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/liquidjs-filters/format-date.d.ts +7 -0
- package/dist/modules/public-site/liquidjs-filters/format-date.js +15 -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 +6 -0
- package/dist/modules/public-site/liquidjs-filters/format-number.js +17 -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 +1 -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 +1 -0
- package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js +40 -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 +6 -0
- package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js +25 -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 +3 -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 +2 -0
- package/dist/modules/public-site/liquidjs-filters/obfuscate.js +18 -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 +6 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js +41 -0
- package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js.map +1 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.d.ts +7 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.js +23 -0
- package/dist/modules/public-site/liquidjs-filters/translate-filter.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 +69 -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 +95 -0
- package/dist/modules/public-site/liquidjs-tags/get-pages-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 +54 -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 +143 -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 +45 -0
- package/dist/modules/security/complexity-plugin.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/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/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 +10 -0
- package/dist/site-backup/backup-tasks.js +50 -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 +35 -0
- package/dist/site-backup/backup.js.map +1 -0
- package/dist/site-context/create-site-context.d.ts +3 -0
- package/dist/site-context/create-site-context.js +183 -0
- package/dist/site-context/create-site-context.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 +38 -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 +5 -0
- package/dist/site-context/db-init/init-routing-points.js +149 -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 +12 -0
- package/dist/site-context/site-context.js +87 -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 +385 -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/package.json +9 -8
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resetAccountPassword = exports.deleteAccount = exports.updateAccount = exports.createAccount = exports.setAccountPreferences = exports.getAllAccounts = exports.getAccount = exports.findAccountByEmail = exports.findAccountByIdAndEmail = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const data_format_1 = require("../../../common/data-format");
|
|
6
|
+
const sendMail_helpers_1 = require("../../../common/mail/sendMail.helpers");
|
|
7
|
+
const context_1 = require("../../../context");
|
|
8
|
+
const jwt_secret_helpers_1 = require("../../../helpers/jwt-secret.helpers");
|
|
9
|
+
const special_account_helpers_1 = require("../../../helpers/special-account.helpers");
|
|
10
|
+
const account_model_1 = require("./account.model");
|
|
11
|
+
async function findAccountByIdAndEmail(siteContext, payload) {
|
|
12
|
+
const account = await siteContext.mainCn.getRepository(account_model_1.AccountEntity).findOne({ where: payload });
|
|
13
|
+
if (!account)
|
|
14
|
+
throw new common_1.NotFoundException();
|
|
15
|
+
return account;
|
|
16
|
+
}
|
|
17
|
+
exports.findAccountByIdAndEmail = findAccountByIdAndEmail;
|
|
18
|
+
async function findAccountByEmail(siteContext, email) {
|
|
19
|
+
return await siteContext.mainCn.getRepository(account_model_1.AccountEntity).findOne({
|
|
20
|
+
where: { email },
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.findAccountByEmail = findAccountByEmail;
|
|
24
|
+
async function getAccount(siteContext, id) {
|
|
25
|
+
if ((0, special_account_helpers_1.isDevAccountId)(id))
|
|
26
|
+
return (0, data_format_1.formatToAccountObjectType)((0, special_account_helpers_1.getDevAccount)(id));
|
|
27
|
+
const parsedPlatformAccountId = (0, special_account_helpers_1.parsePlatformAdminAccountId)(id);
|
|
28
|
+
if (parsedPlatformAccountId) {
|
|
29
|
+
return (0, data_format_1.formatToAccountObjectType)((0, special_account_helpers_1.getPlatformAdminAccount)(parsedPlatformAccountId));
|
|
30
|
+
}
|
|
31
|
+
const account = await siteContext.mainCn.getRepository(account_model_1.AccountEntity).findOne({
|
|
32
|
+
where: { id },
|
|
33
|
+
select: { id: true, preferences: true, email: true, name: true, passwordResetToken: true },
|
|
34
|
+
});
|
|
35
|
+
if (!account)
|
|
36
|
+
throw new common_1.NotFoundException();
|
|
37
|
+
return (0, data_format_1.formatToAccountObjectType)(account);
|
|
38
|
+
}
|
|
39
|
+
exports.getAccount = getAccount;
|
|
40
|
+
async function getAllAccounts(siteContext) {
|
|
41
|
+
const accounts = await siteContext.mainCn.getRepository(account_model_1.AccountEntity).find({
|
|
42
|
+
select: { id: true, preferences: true, email: true, name: true, passwordResetToken: true },
|
|
43
|
+
});
|
|
44
|
+
const parsedAccounts = accounts.map((user) => (0, data_format_1.formatToAccountObjectType)(user));
|
|
45
|
+
return parsedAccounts;
|
|
46
|
+
}
|
|
47
|
+
exports.getAllAccounts = getAllAccounts;
|
|
48
|
+
async function setAccountPreferences(siteContext, accountId, values) {
|
|
49
|
+
await siteContext.mainCn.getRepository(account_model_1.AccountEntity).update(accountId, {
|
|
50
|
+
preferences: JSON.stringify(values),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.setAccountPreferences = setAccountPreferences;
|
|
54
|
+
async function createAccount(siteContext, payload) {
|
|
55
|
+
const account = await findAccountByEmail(siteContext, payload.email);
|
|
56
|
+
if (account)
|
|
57
|
+
throw new common_1.ConflictException("email already exists");
|
|
58
|
+
const newAccount = await siteContext.mainCn
|
|
59
|
+
.getRepository(account_model_1.AccountEntity)
|
|
60
|
+
.save({ ...payload, preferences: JSON.stringify({ lang: payload.lang }) });
|
|
61
|
+
if (payload.accountType === "googleAccount") {
|
|
62
|
+
return await createGoogleAccount(siteContext, {
|
|
63
|
+
payload,
|
|
64
|
+
newAccount,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
await resetAccountToken(siteContext, {
|
|
68
|
+
id: newAccount.id,
|
|
69
|
+
email: newAccount.email,
|
|
70
|
+
lang: payload.lang,
|
|
71
|
+
});
|
|
72
|
+
return (0, data_format_1.formatToAccountObjectType)(newAccount);
|
|
73
|
+
}
|
|
74
|
+
exports.createAccount = createAccount;
|
|
75
|
+
async function createGoogleAccount(siteContext, { payload, newAccount, }) {
|
|
76
|
+
const subject = context_1.simpleI18n.translate({
|
|
77
|
+
key: "accountCreation.subject",
|
|
78
|
+
lang: payload.lang,
|
|
79
|
+
});
|
|
80
|
+
const message = context_1.simpleI18n.translate({
|
|
81
|
+
key: "accountCreation.message",
|
|
82
|
+
lang: payload.lang,
|
|
83
|
+
args: [`${siteContext.siteUrl}/adm`],
|
|
84
|
+
});
|
|
85
|
+
await (0, sendMail_helpers_1.sendMail)({
|
|
86
|
+
subject: `${subject} - ${siteContext.fqdn}`,
|
|
87
|
+
html: message,
|
|
88
|
+
to: newAccount.email,
|
|
89
|
+
}, { appLog: siteContext.siteLog });
|
|
90
|
+
return (0, data_format_1.formatToAccountObjectType)(newAccount);
|
|
91
|
+
}
|
|
92
|
+
async function updateAccount(siteContext, accountId, payload) {
|
|
93
|
+
const account = await findAccountById(siteContext, accountId);
|
|
94
|
+
if (!account)
|
|
95
|
+
throw new common_1.NotFoundException("account don't exists");
|
|
96
|
+
await siteContext.mainCn.getRepository(account_model_1.AccountEntity).update(account.id, payload);
|
|
97
|
+
return (0, data_format_1.formatToAccountObjectType)({
|
|
98
|
+
...account,
|
|
99
|
+
email: payload.email ?? account.email,
|
|
100
|
+
name: payload.name ?? account.name,
|
|
101
|
+
idToString() { },
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
exports.updateAccount = updateAccount;
|
|
105
|
+
async function deleteAccount(siteContext, accountId) {
|
|
106
|
+
const account = await findAccountById(siteContext, accountId);
|
|
107
|
+
if (!account)
|
|
108
|
+
throw new common_1.NotFoundException("account don't exists");
|
|
109
|
+
await siteContext.mainCn.getRepository(account_model_1.AccountEntity).delete(account.id);
|
|
110
|
+
}
|
|
111
|
+
exports.deleteAccount = deleteAccount;
|
|
112
|
+
async function resetAccountPassword(siteContext, accountId) {
|
|
113
|
+
const account = await findAccountById(siteContext, accountId);
|
|
114
|
+
if (!account)
|
|
115
|
+
throw new common_1.NotFoundException("account don't exists");
|
|
116
|
+
const lang = getAccountLang(siteContext, account);
|
|
117
|
+
await resetAccountToken(siteContext, { id: account.id, email: account.email, lang });
|
|
118
|
+
}
|
|
119
|
+
exports.resetAccountPassword = resetAccountPassword;
|
|
120
|
+
function findAccountById(siteContext, id) {
|
|
121
|
+
return siteContext.mainCn.getRepository(account_model_1.AccountEntity).findOne({
|
|
122
|
+
where: { id },
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
async function resetAccountToken(siteContext, account) {
|
|
126
|
+
const passwordResetToken = (0, jwt_secret_helpers_1.makeSecret)(60);
|
|
127
|
+
await siteContext.mainCn
|
|
128
|
+
.getRepository(account_model_1.AccountEntity)
|
|
129
|
+
.update(account.id, { passwordHash: null, passwordResetToken });
|
|
130
|
+
const subject = context_1.simpleI18n.translate({
|
|
131
|
+
key: "accountPasswordReset.subject",
|
|
132
|
+
lang: account.lang,
|
|
133
|
+
});
|
|
134
|
+
const resetUrl = `${siteContext.siteUrl}/adm/?account=${account.id}&reset-password=${encodeURIComponent(passwordResetToken)}`;
|
|
135
|
+
const message = context_1.simpleI18n.translate({
|
|
136
|
+
key: "accountPasswordReset.message",
|
|
137
|
+
lang: account.lang,
|
|
138
|
+
args: [resetUrl],
|
|
139
|
+
});
|
|
140
|
+
await (0, sendMail_helpers_1.sendMail)({
|
|
141
|
+
subject: `${subject} - ${siteContext.fqdn}`,
|
|
142
|
+
html: message,
|
|
143
|
+
to: account.email,
|
|
144
|
+
}, { appLog: siteContext.siteLog });
|
|
145
|
+
}
|
|
146
|
+
function getAccountLang(siteContext, account) {
|
|
147
|
+
const preferences = account.preferences ? JSON.parse(account.preferences) : undefined;
|
|
148
|
+
return preferences?.lang ?? siteContext.siteSchema.defaultLang;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=account.queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.queries.js","sourceRoot":"","sources":["../../../../src/modules/core/account/account.queries.ts"],"names":[],"mappings":";;;AAAA,2CAAsE;AACtE,6DAAwE;AACxE,4EAAiE;AACjE,8CAA8C;AAC9C,4EAAiE;AACjE,sFAKkD;AAElD,mDAAgD;AAOzC,KAAK,UAAU,uBAAuB,CAC3C,WAAwB,EACxB,OAAsC;IAEtC,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,6BAAa,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,0BAAiB,EAAE,CAAC;IAC5C,OAAO,OAAO,CAAC;AACjB,CAAC;AAPD,0DAOC;AAEM,KAAK,UAAU,kBAAkB,CAAC,WAAwB,EAAE,KAAa;IAC9E,OAAO,MAAM,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,6BAAa,CAAC,CAAC,OAAO,CAAC;QACnE,KAAK,EAAE,EAAE,KAAK,EAAE;KACjB,CAAC,CAAC;AACL,CAAC;AAJD,gDAIC;AAEM,KAAK,UAAU,UAAU,CAAC,WAAwB,EAAE,EAAU;IACnE,IAAI,IAAA,wCAAc,EAAC,EAAE,CAAC;QAAE,OAAO,IAAA,uCAAyB,EAAC,IAAA,uCAAa,EAAC,EAAE,CAAC,CAAC,CAAC;IAE5E,MAAM,uBAAuB,GAAG,IAAA,qDAA2B,EAAC,EAAE,CAAC,CAAC;IAChE,IAAI,uBAAuB,EAAE,CAAC;QAC5B,OAAO,IAAA,uC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ClB,IAAI,EAAE,CAAC,QAAQ,CAAC;KACjB,CAAC,CAAC;IAEH,MAAM,IAAA,2BAAQ,EACZ;QACE,OAAO,EAAE,GAAG,OAAO,MAAM,WAAW,CAAC,IAAI,EAAE;QAC3C,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,OAAO,CAAC,KAAK;KAClB,EACD,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,CAChC,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,WAAwB,EAAE,OAAsB;IACtE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,OAAO,WAAW,EAAE,IAAI,IAAI,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GraphqlContext } from "../../graphql.types";
|
|
2
|
+
import { AccountObjectType, type AccountPreferencesInput, type CreateAccountInput, type UpdateAccountInput } from "./account.schema";
|
|
3
|
+
export declare class AccountResolver {
|
|
4
|
+
account({ fqdn }: GraphqlContext, id: string): Promise<AccountObjectType>;
|
|
5
|
+
allAccounts({ fqdn }: GraphqlContext): Promise<AccountObjectType[]>;
|
|
6
|
+
createAccount({ fqdn }: GraphqlContext, values: CreateAccountInput): Promise<AccountObjectType>;
|
|
7
|
+
updateAccount({ fqdn }: GraphqlContext, accountId: string, values: UpdateAccountInput): Promise<AccountObjectType>;
|
|
8
|
+
deleteAccount({ fqdn }: GraphqlContext, accountId: string): Promise<boolean>;
|
|
9
|
+
resetAccountPassword({ fqdn }: GraphqlContext, accountId: string): Promise<boolean>;
|
|
10
|
+
setAccountPreferences({ fqdn }: GraphqlContext, accountId: string, values: AccountPreferencesInput): Promise<string>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AccountResolver = void 0;
|
|
16
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
17
|
+
const site_context_1 = require("../../../site-context/site-context");
|
|
18
|
+
const account_queries_1 = require("./account.queries");
|
|
19
|
+
const account_schema_1 = require("./account.schema");
|
|
20
|
+
let AccountResolver = class AccountResolver {
|
|
21
|
+
async account({ fqdn }, id) {
|
|
22
|
+
return await (0, account_queries_1.getAccount)(await (0, site_context_1.getSiteContext)(fqdn), id);
|
|
23
|
+
}
|
|
24
|
+
async allAccounts({ fqdn }) {
|
|
25
|
+
return await (0, account_queries_1.getAllAccounts)(await (0, site_context_1.getSiteContext)(fqdn));
|
|
26
|
+
}
|
|
27
|
+
async createAccount({ fqdn }, values) {
|
|
28
|
+
return await (0, account_queries_1.createAccount)(await (0, site_context_1.getSiteContext)(fqdn), values);
|
|
29
|
+
}
|
|
30
|
+
async updateAccount({ fqdn }, accountId, values) {
|
|
31
|
+
return await (0, account_queries_1.updateAccount)(await (0, site_context_1.getSiteContext)(fqdn), accountId, values);
|
|
32
|
+
}
|
|
33
|
+
async deleteAccount({ fqdn }, accountId) {
|
|
34
|
+
await (0, account_queries_1.deleteAccount)(await (0, site_context_1.getSiteContext)(fqdn), accountId);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
async resetAccountPassword({ fqdn }, accountId) {
|
|
38
|
+
await (0, account_queries_1.resetAccountPassword)(await (0, site_context_1.getSiteContext)(fqdn), accountId);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
async setAccountPreferences({ fqdn }, accountId, values) {
|
|
42
|
+
await (0, account_queries_1.setAccountPreferences)(await (0, site_context_1.getSiteContext)(fqdn), accountId, values);
|
|
43
|
+
return accountId;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.AccountResolver = AccountResolver;
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, graphql_1.Query)(() => account_schema_1.AccountObjectType),
|
|
49
|
+
__param(0, (0, graphql_1.Context)()),
|
|
50
|
+
__param(1, (0, graphql_1.Args)("id", { type: () => graphql_1.ID })),
|
|
51
|
+
__metadata("design:type", Function),
|
|
52
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
53
|
+
__metadata("design:returntype", Promise)
|
|
54
|
+
], AccountResolver.prototype, "account", null);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, graphql_1.Query)(() => [account_schema_1.AccountObjectType]),
|
|
57
|
+
__param(0, (0, graphql_1.Context)()),
|
|
58
|
+
__metadata("design:type", Function),
|
|
59
|
+
__metadata("design:paramtypes", [Object]),
|
|
60
|
+
__metadata("design:returntype", Promise)
|
|
61
|
+
], AccountResolver.prototype, "allAccounts", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, graphql_1.Mutation)(() => account_schema_1.AccountObjectType),
|
|
64
|
+
__param(0, (0, graphql_1.Context)()),
|
|
65
|
+
__param(1, (0, graphql_1.Args)("values")),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], AccountResolver.prototype, "createAccount", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, graphql_1.Mutation)(() => account_schema_1.AccountObjectType),
|
|
72
|
+
__param(0, (0, graphql_1.Context)()),
|
|
73
|
+
__param(1, (0, graphql_1.Args)("accountId", { type: () => graphql_1.ID })),
|
|
74
|
+
__param(2, (0, graphql_1.Args)("values")),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [Object, String, Function]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], AccountResolver.prototype, "updateAccount", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, graphql_1.Mutation)(() => Boolean),
|
|
81
|
+
__param(0, (0, graphql_1.Context)()),
|
|
82
|
+
__param(1, (0, graphql_1.Args)("accountId", { type: () => graphql_1.ID })),
|
|
83
|
+
__metadata("design:type", Function),
|
|
84
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
85
|
+
__metadata("design:returntype", Promise)
|
|
86
|
+
], AccountResolver.prototype, "deleteAccount", null);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, graphql_1.Mutation)(() => Boolean),
|
|
89
|
+
__param(0, (0, graphql_1.Context)()),
|
|
90
|
+
__param(1, (0, graphql_1.Args)("accountId", { type: () => graphql_1.ID })),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
94
|
+
], AccountResolver.prototype, "resetAccountPassword", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, graphql_1.Mutation)(() => String),
|
|
97
|
+
__param(0, (0, graphql_1.Context)()),
|
|
98
|
+
__param(1, (0, graphql_1.Args)("accountId", { type: () => graphql_1.ID })),
|
|
99
|
+
__param(2, (0, graphql_1.Args)("values")),
|
|
100
|
+
__metadata("design:type", Function),
|
|
101
|
+
__metadata("design:paramtypes", [Object, String, Function]),
|
|
102
|
+
__metadata("design:returntype", Promise)
|
|
103
|
+
], AccountResolver.prototype, "setAccountPreferences", null);
|
|
104
|
+
exports.AccountResolver = AccountResolver = __decorate([
|
|
105
|
+
(0, graphql_1.Resolver)()
|
|
106
|
+
], AccountResolver);
|
|
107
|
+
//# sourceMappingURL=account.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.resolver.js","sourceRoot":"","sources":["../../../../src/modules/core/account/account.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA+E;AAE/E,qEAAoE;AAEpE,uDAQ2B;AAC3B,qDAK0B;AAGnB,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAE,IAAI,EAAkB,EAAkC,EAAU;QAC3F,OAAO,MAAM,IAAA,4BAAU,EAAC,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1D,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAY,EAAE,IAAI,EAAkB;QACnD,OAAO,MAAM,IAAA,gCAAc,EAAC,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CACN,EAAE,IAAI,EAAkB,EACnB,MAA0B;QAE1C,OAAO,MAAM,IAAA,+BAAa,EAAC,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAGK,AAAN,KAAK,CAAC,aAAa,CACN,EAAE,IAAI,EAAkB,EACI,SAAiB,EACxC,MAA0B;QAE1C,OAAO,MAAM,IAAA,+BAAa,EAAC,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC;IAGK,AAAN,KAAK,CAAC,a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AAA,cAAI,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,YAAE,EAAE,CAAC,CAAA;IACrC,WAAA,IAAA,cAAI,EAAC,QAAQ,CAAC,CAAA;;;;oDAGhB;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IAErB,WAAA,IAAA,iBAAO,GAAE,CAAA;IACT,WAAA,IAAA,cAAI,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,YAAE,EAAE,CAAC,CAAA;;;;oDAIvC;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IAErB,WAAA,IAAA,iBAAO,GAAE,CAAA;IACT,WAAA,IAAA,cAAI,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,YAAE,EAAE,CAAC,CAAA;;;;2DAIvC;AAGK;IADL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAEpB,WAAA,IAAA,iBAAO,GAAE,CAAA;IACT,WAAA,IAAA,cAAI,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,YAAE,EAAE,CAAC,CAAA;IACrC,WAAA,IAAA,cAAI,EAAC,QAAQ,CAAC,CAAA;;;;4DAIhB;0BAtDU,eAAe;IAD3B,IAAA,kBAAQ,GAAE;GACE,eAAe,CAuD3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class AccountPreferencesInput {
|
|
2
|
+
lang?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class CreateAccountInput {
|
|
5
|
+
email: string;
|
|
6
|
+
lang: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
accountType: "googleAccount" | "localAccount";
|
|
9
|
+
}
|
|
10
|
+
export declare class UpdateAccountInput {
|
|
11
|
+
email?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class AccountPreferencesObjectType {
|
|
15
|
+
lang?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class AccountObjectType {
|
|
18
|
+
id: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
email: string;
|
|
21
|
+
preferences?: AccountPreferencesObjectType;
|
|
22
|
+
hasPasswordResetToken?: boolean;
|
|
23
|
+
special?: "dev" | "platformAdmin";
|
|
24
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AccountObjectType = exports.AccountPreferencesObjectType = exports.UpdateAccountInput = exports.CreateAccountInput = exports.AccountPreferencesInput = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
let AccountPreferencesInput = class AccountPreferencesInput {
|
|
15
|
+
lang;
|
|
16
|
+
};
|
|
17
|
+
exports.AccountPreferencesInput = AccountPreferencesInput;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AccountPreferencesInput.prototype, "lang", void 0);
|
|
22
|
+
exports.AccountPreferencesInput = AccountPreferencesInput = __decorate([
|
|
23
|
+
(0, graphql_1.InputType)("AccountPreferencesValues")
|
|
24
|
+
], AccountPreferencesInput);
|
|
25
|
+
let CreateAccountInput = class CreateAccountInput {
|
|
26
|
+
email;
|
|
27
|
+
lang;
|
|
28
|
+
name;
|
|
29
|
+
accountType;
|
|
30
|
+
};
|
|
31
|
+
exports.CreateAccountInput = CreateAccountInput;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, graphql_1.Field)(() => String),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CreateAccountInput.prototype, "email", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, graphql_1.Field)(() => String),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CreateAccountInput.prototype, "lang", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], CreateAccountInput.prototype, "name", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, graphql_1.Field)(() => String),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], CreateAccountInput.prototype, "accountType", void 0);
|
|
48
|
+
exports.CreateAccountInput = CreateAccountInput = __decorate([
|
|
49
|
+
(0, graphql_1.InputType)("CreateAccountValues")
|
|
50
|
+
], CreateAccountInput);
|
|
51
|
+
let UpdateAccountInput = class UpdateAccountInput {
|
|
52
|
+
email;
|
|
53
|
+
name;
|
|
54
|
+
};
|
|
55
|
+
exports.UpdateAccountInput = UpdateAccountInput;
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], UpdateAccountInput.prototype, "email", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], UpdateAccountInput.prototype, "name", void 0);
|
|
64
|
+
exports.UpdateAccountInput = UpdateAccountInput = __decorate([
|
|
65
|
+
(0, graphql_1.InputType)("UpdateAccountValues")
|
|
66
|
+
], UpdateAccountInput);
|
|
67
|
+
let AccountPreferencesObjectType = class AccountPreferencesObjectType {
|
|
68
|
+
lang;
|
|
69
|
+
};
|
|
70
|
+
exports.AccountPreferencesObjectType = AccountPreferencesObjectType;
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], AccountPreferencesObjectType.prototype, "lang", void 0);
|
|
75
|
+
exports.AccountPreferencesObjectType = AccountPreferencesObjectType = __decorate([
|
|
76
|
+
(0, graphql_1.ObjectType)("AccountPreferences")
|
|
77
|
+
], AccountPreferencesObjectType);
|
|
78
|
+
let AccountObjectType = class AccountObjectType {
|
|
79
|
+
id;
|
|
80
|
+
name;
|
|
81
|
+
email;
|
|
82
|
+
preferences;
|
|
83
|
+
hasPasswordResetToken;
|
|
84
|
+
special;
|
|
85
|
+
};
|
|
86
|
+
exports.AccountObjectType = AccountObjectType;
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, graphql_1.Field)(() => graphql_1.ID),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], AccountObjectType.prototype, "id", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], AccountObjectType.prototype, "name", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, graphql_1.Field)(() => String),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], AccountObjectType.prototype, "email", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, graphql_1.Field)(() => AccountPreferencesObjectType, { nullable: true }),
|
|
101
|
+
__metadata("design:type", AccountPreferencesObjectType)
|
|
102
|
+
], AccountObjectType.prototype, "preferences", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, graphql_1.Field)(() => Boolean),
|
|
105
|
+
__metadata("design:type", Boolean)
|
|
106
|
+
], AccountObjectType.prototype, "hasPasswordResetToken", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
109
|
+
__metadata("design:type", String)
|
|
110
|
+
], AccountObjectType.prototype, "special", void 0);
|
|
111
|
+
exports.AccountObjectType = AccountObjectType = __decorate([
|
|
112
|
+
(0, graphql_1.ObjectType)("Account")
|
|
113
|
+
], AccountObjectType);
|
|
114
|
+
//# sourceMappingURL=account.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.schema.js","sourceRoot":"","sources":["../../../../src/modules/core/account/account.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AAG5D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAElC,IAAI,CAAU;CACf,CAAA;AAHY,0DAAuB;AAElC;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDAC1B;kCAFH,uBAAuB;IADnC,IAAA,mBAAS,EAAC,0BAA0B,CAAC;GACzB,uBAAuB,CAGnC;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAE7B,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,IAAI,CAAU;IAGd,WAAW,CAAoC;CAChD,CAAA;AAZY,gDAAkB;AAE7B;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;iDACL;AAGf;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;gDACN;AAGd;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC1B;AAGd;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;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A4B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAChD,4BAA4B;sDAAC;AAG3C;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;gEACW;AAGhC;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;4BAjBvB,iBAAiB;IAD7B,IAAA,oBAAU,EAAC,SAAS,CAAC;GACT,iBAAiB,CAkB7B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AccountAuthModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const context_1 = require("../../../context");
|
|
12
|
+
const account_module_1 = require("../account/account.module");
|
|
13
|
+
const account_auth_service_1 = require("./account-auth.service");
|
|
14
|
+
const account_auth_strategy_1 = require("./account-auth.strategy");
|
|
15
|
+
let AccountAuthModule = class AccountAuthModule {
|
|
16
|
+
};
|
|
17
|
+
exports.AccountAuthModule = AccountAuthModule;
|
|
18
|
+
exports.AccountAuthModule = AccountAuthModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
providers: [account_auth_service_1.AccountAuthService, ...(context_1.appConf.googleAuth.disabled ? [] : [account_auth_strategy_1.AccountAuthStrategy])],
|
|
21
|
+
imports: [account_module_1.AccountModule],
|
|
22
|
+
})
|
|
23
|
+
], AccountAuthModule);
|
|
24
|
+
//# sourceMappingURL=account-auth.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-auth.module.js","sourceRoot":"","sources":["../../../../src/modules/core/account-auth/account-auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8CAA2C;AAC3C,8DAA0D;AAC1D,iEAA4D;AAC5D,mEAA8D;AAMvD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAJ7B,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,yCAAkB,EAAE,GAAG,CAAC,iBAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,2CAAmB,CAAC,CAAC,CAAC;QAC9F,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,iBAAiB,CAAG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AccountAuthService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const context_1 = require("../../../context");
|
|
12
|
+
let AccountAuthService = class AccountAuthService {
|
|
13
|
+
async validateOAuthLogin(googleAccount) {
|
|
14
|
+
try {
|
|
15
|
+
const email = googleAccount._json.email;
|
|
16
|
+
const emailVerified = googleAccount._json.email_verified;
|
|
17
|
+
if (!email || emailVerified !== true) {
|
|
18
|
+
context_1.platformLog.error("Missing user email use scope:['email'] to retrieve email from google auth api");
|
|
19
|
+
return {
|
|
20
|
+
message: "Unauthorized",
|
|
21
|
+
statusCode: 401,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
email,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
context_1.platformLog.error(error);
|
|
30
|
+
return {
|
|
31
|
+
message: "Unauthorized",
|
|
32
|
+
statusCode: 401,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.AccountAuthService = AccountAuthService;
|
|
38
|
+
exports.AccountAuthService = AccountAuthService = __decorate([
|
|
39
|
+
(0, common_1.Injectable)()
|
|
40
|
+
], AccountAuthService);
|
|
41
|
+
//# sourceMappingURL=account-auth.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-auth.service.js","sourceRoot":"","sources":["../../../../src/modules/core/account-auth/account-auth.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAE5C,8CAA+C;AAIxC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,KAAK,CAAC,kBAAkB,CAAC,aAAsB;QAC7C,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC;YACxC,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,cAAqC,CAAC;YAChF,IAAI,CAAC,KAAK,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;gBACrC,qBAAW,CAAC,KAAK,CACf,+EAA+E,CAChF,CAAC;gBACF,OAAO;oBACL,OAAO,EAAE,cAAc;oBACvB,UAAU,EAAE,GAAG;iBAChB,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,KAAK;aACN,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qBAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACzB,OAAO;gBACL,OAAO,EAAE,cAAc;gBACvB,UAAU,EAAE,GAAG;aAChB,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA1BY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;GACA,kBAAkB,CA0B9B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Profile, Strategy } from "passport-google-oauth20";
|
|
2
|
+
import type { LoginFailed, OAuthSuccess } from "../auth/auth.types";
|
|
3
|
+
import type { AccountAuthService } from "./account-auth.service";
|
|
4
|
+
declare const AccountAuthStrategy_base: new (...args: any[]) => Strategy;
|
|
5
|
+
export declare class AccountAuthStrategy extends AccountAuthStrategy_base {
|
|
6
|
+
private readonly accountAuthService;
|
|
7
|
+
constructor(accountAuthService: AccountAuthService);
|
|
8
|
+
validate(req: any, accessToken: string, refreshToken: string, profile: Profile | null, done: (err: any, result: OAuthSuccess | LoginFailed | null) => void): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AccountAuthStrategy = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const passport_1 = require("@nestjs/passport");
|
|
15
|
+
const passport_google_oauth20_1 = require("passport-google-oauth20");
|
|
16
|
+
const context_1 = require("../../../context");
|
|
17
|
+
let AccountAuthStrategy = class AccountAuthStrategy extends (0, passport_1.PassportStrategy)(passport_google_oauth20_1.Strategy, "google") {
|
|
18
|
+
accountAuthService;
|
|
19
|
+
constructor(accountAuthService) {
|
|
20
|
+
const { clientId, clientSecret } = context_1.appConf.googleAuth;
|
|
21
|
+
super({
|
|
22
|
+
clientID: clientId,
|
|
23
|
+
clientSecret,
|
|
24
|
+
callbackURL: `${context_1.platformAuthUrl}/google/callback`,
|
|
25
|
+
passReqToCallback: true,
|
|
26
|
+
scope: ["email"],
|
|
27
|
+
});
|
|
28
|
+
this.accountAuthService = accountAuthService;
|
|
29
|
+
}
|
|
30
|
+
async validate(req, accessToken, refreshToken, profile, done) {
|
|
31
|
+
try {
|
|
32
|
+
if (!profile)
|
|
33
|
+
throw new Error(`Can't connect to google`);
|
|
34
|
+
const user = await this.accountAuthService.validateOAuthLogin(profile);
|
|
35
|
+
done(null, user);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
context_1.platformLog.error(err);
|
|
39
|
+
done(err, null);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.AccountAuthStrategy = AccountAuthStrategy;
|
|
44
|
+
exports.AccountAuthStrategy = AccountAuthStrategy = __decorate([
|
|
45
|
+
(0, common_1.Injectable)(),
|
|
46
|
+
__metadata("design:paramtypes", [Function])
|
|
47
|
+
], AccountAuthStrategy);
|
|
48
|
+
//# sourceMappingURL=account-auth.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-auth.strategy.js","sourceRoot":"","sources":["../../../../src/modules/core/account-auth/account-auth.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,qEAAiE;AACjE,8CAAyE;AAKlE,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,IAAA,2BAAgB,EAAC,kCAAQ,EAAE,QAAQ,CAAC;IAC9C;IAA7B,YAA6B,kBAAsC;QACjE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,iBAAO,CAAC,UAAU,CAAC;QACtD,KAAK,CAAC;YACJ,QAAQ,EAAE,QAAQ;YAClB,YAAY;YACZ,WAAW,EAAE,GAAG,yBAAe,kBAAkB;YACjD,iBAAiB,EAAE,IAAI;YACvB,KAAK,EAAE,CAAC,OAAO,CAAC;SACjB,CAAC,CAAC;QARwB,uBAAkB,GAAlB,kBAAkB,CAAoB;IASnE,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,GAAQ,EACR,WAAmB,EACnB,YAAoB,EACpB,OAAuB,EACvB,IAAmE;QAEnE,IAAI,CAAC;YACH,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;YACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YACvE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,qBAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACvB,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAA;AA5BY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;;GACA,mBAAmB,CA4B/B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AuthModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const jwt_1 = require("@nestjs/jwt");
|
|
12
|
+
const passport_1 = require("@nestjs/passport");
|
|
13
|
+
const context_1 = require("../../../context");
|
|
14
|
+
const account_module_1 = require("../account/account.module");
|
|
15
|
+
const auth_service_1 = require("./auth.service");
|
|
16
|
+
const jwt_strategy_1 = require("./jwt.strategy");
|
|
17
|
+
let AuthModule = class AuthModule {
|
|
18
|
+
};
|
|
19
|
+
exports.AuthModule = AuthModule;
|
|
20
|
+
exports.AuthModule = AuthModule = __decorate([
|
|
21
|
+
(0, common_1.Module)({
|
|
22
|
+
providers: [auth_service_1.AuthService, jwt_strategy_1.JwtStrategy],
|
|
23
|
+
imports: [
|
|
24
|
+
account_module_1.AccountModule,
|
|
25
|
+
passport_1.PassportModule,
|
|
26
|
+
jwt_1.JwtModule.register({
|
|
27
|
+
global: true,
|
|
28
|
+
secret: context_1.jwtSecret,
|
|
29
|
+
signOptions: { expiresIn: context_1.jwtExpiresIn },
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
exports: [auth_service_1.AuthService],
|
|
33
|
+
})
|
|
34
|
+
], AuthModule);
|
|
35
|
+
//# sourceMappingURL=auth.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../../src/modules/core/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qCAAwC;AACxC,+CAAkD;AAClD,8CAA2D;AAC3D,8DAA0D;AAC1D,iDAA6C;AAC7C,iDAA6C;AAetC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAbtB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,0BAAW,EAAE,0BAAW,CAAC;QACrC,OAAO,EAAE;YACP,8BAAa;YACb,yBAAc;YACd,eAAS,CAAC,QAAQ,CAAC;gBACjB,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,mBAAS;gBACjB,WAAW,EAAE,EAAE,SAAS,EAAE,sBAAY,EAAE;aACzC,CAAC;SACH;QACD,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JwtService } from "@nestjs/jwt";
|
|
2
|
+
import type { SiteContext } from "../../../site-context/site-context.types";
|
|
3
|
+
import type { LoginFailed, LoginInput, LoginSuccess } from "./auth.types";
|
|
4
|
+
export declare class AuthService {
|
|
5
|
+
#private;
|
|
6
|
+
private jwtService;
|
|
7
|
+
constructor(jwtService: JwtService);
|
|
8
|
+
login(siteContext: SiteContext, user: LoginInput): Promise<LoginSuccess | LoginFailed>;
|
|
9
|
+
verifyToken(siteContext: SiteContext, token: string): Promise<LoginSuccess | LoginFailed>;
|
|
10
|
+
loginByPlatformToken(siteContext: SiteContext, token: string): Promise<LoginSuccess | LoginFailed>;
|
|
11
|
+
}
|