@rnaga/wp-node 1.1.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/application.d.ts +76 -0
- package/application.d.ts.map +1 -0
- package/application.js +132 -0
- package/common/async-constructor.d.ts +2 -0
- package/common/async-constructor.d.ts.map +1 -0
- package/common/async-constructor.js +7 -0
- package/common/config/define-post-status.config.d.ts +4 -0
- package/common/config/define-post-status.config.d.ts.map +1 -0
- package/common/config/define-post-status.config.js +26 -0
- package/common/config/define-post-type.config.d.ts +4 -0
- package/common/config/define-post-type.config.d.ts.map +1 -0
- package/common/config/define-post-type.config.js +39 -0
- package/common/config/define-taxonomies.config.d.ts +4 -0
- package/common/config/define-taxonomies.config.d.ts.map +1 -0
- package/common/config/define-taxonomies.config.js +26 -0
- package/common/config/define-wp.config..d.ts +12 -0
- package/common/config/define-wp.config..d.ts.map +1 -0
- package/common/config/define-wp.config..js +110 -0
- package/common/config/index.d.ts +5 -0
- package/common/config/index.d.ts.map +1 -0
- package/common/config/index.js +20 -0
- package/common/date.d.ts +19 -0
- package/common/date.d.ts.map +1 -0
- package/common/date.js +116 -0
- package/common/define-hooks.d.ts +4 -0
- package/common/define-hooks.d.ts.map +1 -0
- package/common/define-hooks.js +16 -0
- package/common/diff.d.ts +3 -0
- package/common/diff.d.ts.map +1 -0
- package/common/diff.js +23 -0
- package/common/files.d.ts +14 -0
- package/common/files.d.ts.map +1 -0
- package/common/files.js +160 -0
- package/common/formatting.d.ts +47 -0
- package/common/formatting.d.ts.map +1 -0
- package/common/formatting.js +218 -0
- package/common/hierarchy.d.ts +21 -0
- package/common/hierarchy.d.ts.map +1 -0
- package/common/hierarchy.js +78 -0
- package/common/hooks-command.d.ts +7 -0
- package/common/hooks-command.d.ts.map +1 -0
- package/common/hooks-command.js +21 -0
- package/common/index.d.ts +11 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +49 -0
- package/common/password.d.ts +4 -0
- package/common/password.d.ts.map +1 -0
- package/common/password.js +224 -0
- package/common/php-serialize.d.ts +3 -0
- package/common/php-serialize.d.ts.map +1 -0
- package/common/php-serialize.js +17 -0
- package/common/validating.d.ts +10 -0
- package/common/validating.d.ts.map +1 -0
- package/common/validating.js +65 -0
- package/config.d.ts +99 -0
- package/config.d.ts.map +1 -0
- package/config.js +76 -0
- package/constants/async-init.d.ts +2 -0
- package/constants/async-init.d.ts.map +1 -0
- package/constants/async-init.js +4 -0
- package/constants/component.d.ts +3 -0
- package/constants/component.d.ts.map +1 -0
- package/constants/component.js +5 -0
- package/constants/database.d.ts +2 -0
- package/constants/database.d.ts.map +1 -0
- package/constants/database.js +9 -0
- package/constants/default-database-tables.d.ts +7 -0
- package/constants/default-database-tables.d.ts.map +1 -0
- package/constants/default-database-tables.js +26 -0
- package/constants/index.d.ts +9 -0
- package/constants/index.d.ts.map +1 -0
- package/constants/index.js +24 -0
- package/constants/role-capabilities.d.ts +3 -0
- package/constants/role-capabilities.d.ts.map +1 -0
- package/constants/role-capabilities.js +67 -0
- package/constants/role-capability-actions.d.ts +2 -0
- package/constants/role-capability-actions.d.ts.map +1 -0
- package/constants/role-capability-actions.js +90 -0
- package/constants/role-names.d.ts +2 -0
- package/constants/role-names.d.ts.map +1 -0
- package/constants/role-names.js +12 -0
- package/constants/scope.d.ts +6 -0
- package/constants/scope.d.ts.map +1 -0
- package/constants/scope.js +9 -0
- package/core/async-init-reflect.d.ts +5 -0
- package/core/async-init-reflect.d.ts.map +1 -0
- package/core/async-init-reflect.js +18 -0
- package/core/blog.d.ts +20 -0
- package/core/blog.d.ts.map +1 -0
- package/core/blog.js +123 -0
- package/core/capabilities.d.ts +12 -0
- package/core/capabilities.d.ts.map +1 -0
- package/core/capabilities.js +625 -0
- package/core/comment.d.ts +111 -0
- package/core/comment.d.ts.map +1 -0
- package/core/comment.js +173 -0
- package/core/components.d.ts +13 -0
- package/core/components.d.ts.map +1 -0
- package/core/components.js +129 -0
- package/core/context.d.ts +38 -0
- package/core/context.d.ts.map +1 -0
- package/core/context.js +77 -0
- package/core/current.d.ts +33 -0
- package/core/current.d.ts.map +1 -0
- package/core/current.js +229 -0
- package/core/date-time.d.ts +18 -0
- package/core/date-time.d.ts.map +1 -0
- package/core/date-time.js +71 -0
- package/core/hooks/action.d.ts +16 -0
- package/core/hooks/action.d.ts.map +1 -0
- package/core/hooks/action.js +44 -0
- package/core/hooks/actions/init.d.ts +5 -0
- package/core/hooks/actions/init.d.ts.map +1 -0
- package/core/hooks/actions/init.js +28 -0
- package/core/hooks/default-hooks.d.ts +7 -0
- package/core/hooks/default-hooks.d.ts.map +1 -0
- package/core/hooks/default-hooks.js +19 -0
- package/core/hooks/filter.d.ts +12 -0
- package/core/hooks/filter.d.ts.map +1 -0
- package/core/hooks/filter.js +76 -0
- package/core/hooks/filters/capabilities.d.ts +16 -0
- package/core/hooks/filters/capabilities.d.ts.map +1 -0
- package/core/hooks/filters/capabilities.js +395 -0
- package/core/hooks/hooks-command.d.ts +9 -0
- package/core/hooks/hooks-command.d.ts.map +1 -0
- package/core/hooks/hooks-command.js +28 -0
- package/core/hooks/hooks-reflect.d.ts +42 -0
- package/core/hooks/hooks-reflect.d.ts.map +1 -0
- package/core/hooks/hooks-reflect.js +73 -0
- package/core/hooks/hooks.d.ts +61 -0
- package/core/hooks/hooks.d.ts.map +1 -0
- package/core/hooks/hooks.js +82 -0
- package/core/hooks/index.d.ts +4 -0
- package/core/hooks/index.d.ts.map +1 -0
- package/core/hooks/index.js +19 -0
- package/core/installer.d.ts +56 -0
- package/core/installer.d.ts.map +1 -0
- package/core/installer.js +395 -0
- package/core/logger.d.ts +22 -0
- package/core/logger.d.ts.map +1 -0
- package/core/logger.js +65 -0
- package/core/meta.d.ts +20 -0
- package/core/meta.d.ts.map +1 -0
- package/core/meta.js +123 -0
- package/core/options.d.ts +20 -0
- package/core/options.d.ts.map +1 -0
- package/core/options.js +148 -0
- package/core/post.d.ts +39 -0
- package/core/post.d.ts.map +1 -0
- package/core/post.js +164 -0
- package/core/query.d.ts +14 -0
- package/core/query.d.ts.map +1 -0
- package/core/query.js +39 -0
- package/core/role.d.ts +21 -0
- package/core/role.d.ts.map +1 -0
- package/core/role.js +71 -0
- package/core/roles.d.ts +16 -0
- package/core/roles.d.ts.map +1 -0
- package/core/roles.js +84 -0
- package/core/schema.d.ts +13 -0
- package/core/schema.d.ts.map +1 -0
- package/core/schema.js +83 -0
- package/core/site.d.ts +28 -0
- package/core/site.d.ts.map +1 -0
- package/core/site.js +105 -0
- package/core/tables.d.ts +18 -0
- package/core/tables.d.ts.map +1 -0
- package/core/tables.js +64 -0
- package/core/taxonomy.d.ts +23 -0
- package/core/taxonomy.d.ts.map +1 -0
- package/core/taxonomy.js +83 -0
- package/core/term.d.ts +104 -0
- package/core/term.d.ts.map +1 -0
- package/core/term.js +136 -0
- package/core/user.d.ts +32 -0
- package/core/user.d.ts.map +1 -0
- package/core/user.js +273 -0
- package/core/utils/blog.util.d.ts +14 -0
- package/core/utils/blog.util.d.ts.map +1 -0
- package/core/utils/blog.util.js +97 -0
- package/core/utils/comment.util.d.ts +23 -0
- package/core/utils/comment.util.d.ts.map +1 -0
- package/core/utils/comment.util.js +312 -0
- package/core/utils/crud.util.d.ts +40 -0
- package/core/utils/crud.util.d.ts.map +1 -0
- package/core/utils/crud.util.js +97 -0
- package/core/utils/date-time.util.d.ts +9 -0
- package/core/utils/date-time.util.d.ts.map +1 -0
- package/core/utils/date-time.util.js +29 -0
- package/core/utils/link.util.d.ts +23 -0
- package/core/utils/link.util.d.ts.map +1 -0
- package/core/utils/link.util.js +148 -0
- package/core/utils/meta.util.d.ts +13 -0
- package/core/utils/meta.util.d.ts.map +1 -0
- package/core/utils/meta.util.js +73 -0
- package/core/utils/post.util.d.ts +34 -0
- package/core/utils/post.util.d.ts.map +1 -0
- package/core/utils/post.util.js +272 -0
- package/core/utils/query.util.d.ts +36 -0
- package/core/utils/query.util.d.ts.map +1 -0
- package/core/utils/query.util.js +168 -0
- package/core/utils/revision.util.d.ts +67 -0
- package/core/utils/revision.util.d.ts.map +1 -0
- package/core/utils/revision.util.js +105 -0
- package/core/utils/roles.util.d.ts +30 -0
- package/core/utils/roles.util.d.ts.map +1 -0
- package/core/utils/roles.util.js +189 -0
- package/core/utils/signup.util.d.ts +33 -0
- package/core/utils/signup.util.d.ts.map +1 -0
- package/core/utils/signup.util.js +227 -0
- package/core/utils/site.util.d.ts +22 -0
- package/core/utils/site.util.d.ts.map +1 -0
- package/core/utils/site.util.js +122 -0
- package/core/utils/taxonomy.util.d.ts +19 -0
- package/core/utils/taxonomy.util.d.ts.map +1 -0
- package/core/utils/taxonomy.util.js +52 -0
- package/core/utils/term.util.d.ts +13 -0
- package/core/utils/term.util.d.ts.map +1 -0
- package/core/utils/term.util.js +113 -0
- package/core/utils/trx.util.d.ts +24 -0
- package/core/utils/trx.util.d.ts.map +1 -0
- package/core/utils/trx.util.js +86 -0
- package/core/utils/user-self-registration.util.d.ts +46 -0
- package/core/utils/user-self-registration.util.d.ts.map +1 -0
- package/core/utils/user-self-registration.util.js +171 -0
- package/core/utils/user.util.d.ts +153 -0
- package/core/utils/user.util.d.ts.map +1 -0
- package/core/utils/user.util.js +550 -0
- package/core/utils/utils.d.ts +36 -0
- package/core/utils/utils.d.ts.map +1 -0
- package/core/utils/utils.js +85 -0
- package/core/validator.d.ts +11 -0
- package/core/validator.d.ts.map +1 -0
- package/core/validator.js +40 -0
- package/core/vars.d.ts +19 -0
- package/core/vars.d.ts.map +1 -0
- package/core/vars.js +54 -0
- package/crud/blog.crud.d.ts +56 -0
- package/crud/blog.crud.d.ts.map +1 -0
- package/crud/blog.crud.js +301 -0
- package/crud/comment.crud.d.ts +104 -0
- package/crud/comment.crud.d.ts.map +1 -0
- package/crud/comment.crud.js +431 -0
- package/crud/crud.d.ts +63 -0
- package/crud/crud.d.ts.map +1 -0
- package/crud/crud.js +278 -0
- package/crud/error.d.ts +23 -0
- package/crud/error.d.ts.map +1 -0
- package/crud/error.js +51 -0
- package/crud/meta.crud.d.ts +69 -0
- package/crud/meta.crud.d.ts.map +1 -0
- package/crud/meta.crud.js +244 -0
- package/crud/options.crud.d.ts +37 -0
- package/crud/options.crud.d.ts.map +1 -0
- package/crud/options.crud.js +178 -0
- package/crud/post.crud.d.ts +225 -0
- package/crud/post.crud.d.ts.map +1 -0
- package/crud/post.crud.js +589 -0
- package/crud/revision.crud.d.ts +76 -0
- package/crud/revision.crud.d.ts.map +1 -0
- package/crud/revision.crud.js +155 -0
- package/crud/roles.crud.d.ts +50 -0
- package/crud/roles.crud.d.ts.map +1 -0
- package/crud/roles.crud.js +198 -0
- package/crud/settings.crud.d.ts +50 -0
- package/crud/settings.crud.d.ts.map +1 -0
- package/crud/settings.crud.js +153 -0
- package/crud/site.crud.d.ts +62 -0
- package/crud/site.crud.d.ts.map +1 -0
- package/crud/site.crud.js +241 -0
- package/crud/sitemeta.crud.d.ts +55 -0
- package/crud/sitemeta.crud.d.ts.map +1 -0
- package/crud/sitemeta.crud.js +97 -0
- package/crud/term.crud.d.ts +85 -0
- package/crud/term.crud.d.ts.map +1 -0
- package/crud/term.crud.js +285 -0
- package/crud/user-self-registration.crud.d.ts +57 -0
- package/crud/user-self-registration.crud.d.ts.map +1 -0
- package/crud/user-self-registration.crud.js +173 -0
- package/crud/user.crud.d.ts +147 -0
- package/crud/user.crud.d.ts.map +1 -0
- package/crud/user.crud.js +626 -0
- package/database.d.ts +18 -0
- package/database.d.ts.map +1 -0
- package/database.js +80 -0
- package/decorators/async-init.d.ts +2 -0
- package/decorators/async-init.d.ts.map +1 -0
- package/decorators/async-init.js +7 -0
- package/decorators/component.d.ts +12 -0
- package/decorators/component.d.ts.map +1 -0
- package/decorators/component.js +47 -0
- package/decorators/hooks.d.ts +5 -0
- package/decorators/hooks.d.ts.map +1 -0
- package/decorators/hooks.js +30 -0
- package/defaults/extensions.d.ts +4 -0
- package/defaults/extensions.d.ts.map +1 -0
- package/defaults/extensions.js +34 -0
- package/defaults/index.d.ts +11 -0
- package/defaults/index.d.ts.map +1 -0
- package/defaults/index.js +49 -0
- package/defaults/options.d.ts +6 -0
- package/defaults/options.d.ts.map +1 -0
- package/defaults/options.js +267 -0
- package/defaults/post-status.d.ts +10 -0
- package/defaults/post-status.d.ts.map +1 -0
- package/defaults/post-status.js +83 -0
- package/defaults/post-types.d.ts +4 -0
- package/defaults/post-types.d.ts.map +1 -0
- package/defaults/post-types.js +72 -0
- package/defaults/roles.d.ts +31 -0
- package/defaults/roles.d.ts.map +1 -0
- package/defaults/roles.js +213 -0
- package/defaults/seeder.d.ts +34 -0
- package/defaults/seeder.d.ts.map +1 -0
- package/defaults/seeder.js +201 -0
- package/defaults/sitemeta.d.ts +2 -0
- package/defaults/sitemeta.d.ts.map +1 -0
- package/defaults/sitemeta.js +38 -0
- package/defaults/subdirectory-reserved-names.d.ts +2 -0
- package/defaults/subdirectory-reserved-names.d.ts.map +1 -0
- package/defaults/subdirectory-reserved-names.js +16 -0
- package/defaults/taxonomies.d.ts +5 -0
- package/defaults/taxonomies.d.ts.map +1 -0
- package/defaults/taxonomies.js +57 -0
- package/defaults/timezone.d.ts +2 -0
- package/defaults/timezone.d.ts.map +1 -0
- package/defaults/timezone.js +353 -0
- package/package.json +51 -0
- package/query-builder/alias.d.ts +24 -0
- package/query-builder/alias.d.ts.map +1 -0
- package/query-builder/alias.js +64 -0
- package/query-builder/blogs.query.d.ts +22 -0
- package/query-builder/blogs.query.d.ts.map +1 -0
- package/query-builder/blogs.query.js +85 -0
- package/query-builder/comments.query.d.ts +35 -0
- package/query-builder/comments.query.d.ts.map +1 -0
- package/query-builder/comments.query.js +211 -0
- package/query-builder/common.query.d.ts +18 -0
- package/query-builder/common.query.d.ts.map +1 -0
- package/query-builder/common.query.js +58 -0
- package/query-builder/index.d.ts +12 -0
- package/query-builder/index.d.ts.map +1 -0
- package/query-builder/index.js +27 -0
- package/query-builder/meta.query.d.ts +45 -0
- package/query-builder/meta.query.d.ts.map +1 -0
- package/query-builder/meta.query.js +188 -0
- package/query-builder/options.query.d.ts +19 -0
- package/query-builder/options.query.d.ts.map +1 -0
- package/query-builder/options.query.js +57 -0
- package/query-builder/posts.query.d.ts +30 -0
- package/query-builder/posts.query.d.ts.map +1 -0
- package/query-builder/posts.query.js +208 -0
- package/query-builder/query-builder.d.ts +21 -0
- package/query-builder/query-builder.d.ts.map +1 -0
- package/query-builder/query-builder.js +70 -0
- package/query-builder/query-builders.d.ts +18 -0
- package/query-builder/query-builders.d.ts.map +1 -0
- package/query-builder/query-builders.js +64 -0
- package/query-builder/site.query.d.ts +22 -0
- package/query-builder/site.query.d.ts.map +1 -0
- package/query-builder/site.query.js +85 -0
- package/query-builder/terms.query.d.ts +47 -0
- package/query-builder/terms.query.d.ts.map +1 -0
- package/query-builder/terms.query.js +233 -0
- package/query-builder/users.query.d.ts +37 -0
- package/query-builder/users.query.d.ts.map +1 -0
- package/query-builder/users.query.js +188 -0
- package/schema-builder/proxy.d.ts +10 -0
- package/schema-builder/proxy.d.ts.map +1 -0
- package/schema-builder/proxy.js +19 -0
- package/schema-builder/schema-builder.d.ts +21 -0
- package/schema-builder/schema-builder.d.ts.map +1 -0
- package/schema-builder/schema-builder.js +207 -0
- package/schema-builder/schema.d.ts +20 -0
- package/schema-builder/schema.d.ts.map +1 -0
- package/schema-builder/schema.js +527 -0
- package/transactions/blog.trx.d.ts +37 -0
- package/transactions/blog.trx.d.ts.map +1 -0
- package/transactions/blog.trx.js +296 -0
- package/transactions/comment.trx.d.ts +22 -0
- package/transactions/comment.trx.d.ts.map +1 -0
- package/transactions/comment.trx.js +311 -0
- package/transactions/index.d.ts +15 -0
- package/transactions/index.d.ts.map +1 -0
- package/transactions/index.js +30 -0
- package/transactions/link.trx.d.ts +22 -0
- package/transactions/link.trx.d.ts.map +1 -0
- package/transactions/link.trx.js +208 -0
- package/transactions/meta.trx.d.ts +30 -0
- package/transactions/meta.trx.d.ts.map +1 -0
- package/transactions/meta.trx.js +197 -0
- package/transactions/options.trx.d.ts +31 -0
- package/transactions/options.trx.d.ts.map +1 -0
- package/transactions/options.trx.js +192 -0
- package/transactions/post.trx.d.ts +48 -0
- package/transactions/post.trx.d.ts.map +1 -0
- package/transactions/post.trx.js +906 -0
- package/transactions/registration-log.trx.d.ts +14 -0
- package/transactions/registration-log.trx.d.ts.map +1 -0
- package/transactions/registration-log.trx.js +103 -0
- package/transactions/revision.trx.d.ts +32 -0
- package/transactions/revision.trx.d.ts.map +1 -0
- package/transactions/revision.trx.js +278 -0
- package/transactions/roles.trx.d.ts +20 -0
- package/transactions/roles.trx.d.ts.map +1 -0
- package/transactions/roles.trx.js +144 -0
- package/transactions/seeder.trx.d.ts +43 -0
- package/transactions/seeder.trx.d.ts.map +1 -0
- package/transactions/seeder.trx.js +530 -0
- package/transactions/signup.trx.d.ts +53 -0
- package/transactions/signup.trx.d.ts.map +1 -0
- package/transactions/signup.trx.js +305 -0
- package/transactions/site.trx.d.ts +21 -0
- package/transactions/site.trx.d.ts.map +1 -0
- package/transactions/site.trx.js +167 -0
- package/transactions/term.trx.d.ts +51 -0
- package/transactions/term.trx.d.ts.map +1 -0
- package/transactions/term.trx.js +838 -0
- package/transactions/trx.d.ts +9 -0
- package/transactions/trx.d.ts.map +1 -0
- package/transactions/trx.js +20 -0
- package/transactions/user.trx.d.ts +45 -0
- package/transactions/user.trx.d.ts.map +1 -0
- package/transactions/user.trx.js +535 -0
- package/types/capabilities.d.ts +71 -0
- package/types/common.d.ts +16 -0
- package/types/component.d.ts +3 -0
- package/types/config.d.ts +33 -0
- package/types/crud.d.ts +230 -0
- package/types/database.d.ts +50 -0
- package/types/hooks/actions.d.ts +67 -0
- package/types/hooks/command.d.ts +17 -0
- package/types/hooks/filters.d.ts +86 -0
- package/types/hooks/index.d.ts +11 -0
- package/types/index.d.ts +18 -0
- package/types/logging.d.ts +1 -0
- package/types/meta.d.ts +9 -0
- package/types/options.d.ts +3 -0
- package/types/post.d.ts +54 -0
- package/types/query-builder.d.ts +11 -0
- package/types/role.d.ts +34 -0
- package/types/schema.d.ts +11 -0
- package/types/schema.d.ts.map +1 -0
- package/types/schema.js +2 -0
- package/types/taxonomy.d.ts +29 -0
- package/types/timezone.d.ts +3 -0
- package/types/transactions.d.ts +32 -0
- package/types/user.d.ts +12 -0
- package/types/validating.d.ts +9 -0
- package/types/validating.d.ts.map +1 -0
- package/types/validating.js +2 -0
- package/validators/config.d.ts +948 -0
- package/validators/config.d.ts.map +1 -0
- package/validators/config.js +149 -0
- package/validators/crud.d.ts +571 -0
- package/validators/crud.d.ts.map +1 -0
- package/validators/crud.js +281 -0
- package/validators/database.d.ts +958 -0
- package/validators/database.d.ts.map +1 -0
- package/validators/database.js +245 -0
- package/validators/date.d.ts +4 -0
- package/validators/date.d.ts.map +1 -0
- package/validators/date.js +15 -0
- package/validators/helpers.d.ts +16 -0
- package/validators/helpers.d.ts.map +1 -0
- package/validators/helpers.js +86 -0
- package/validators/index.d.ts +10 -0
- package/validators/index.d.ts.map +1 -0
- package/validators/index.js +48 -0
- package/validators/options.d.ts +303 -0
- package/validators/options.d.ts.map +1 -0
- package/validators/options.js +106 -0
- package/validators/post-status.d.ts +42 -0
- package/validators/post-status.d.ts.map +1 -0
- package/validators/post-status.js +18 -0
- package/validators/query.d.ts +534 -0
- package/validators/query.d.ts.map +1 -0
- package/validators/query.js +110 -0
- package/validators/roles.d.ts +22 -0
- package/validators/roles.d.ts.map +1 -0
- package/validators/roles.js +9 -0
- package/validators/sitemeta.d.ts +105 -0
- package/validators/sitemeta.d.ts.map +1 -0
- package/validators/sitemeta.js +39 -0
- package/validators/transactions/blog.d.ts +225 -0
- package/validators/transactions/blog.d.ts.map +1 -0
- package/validators/transactions/blog.js +63 -0
- package/validators/transactions/comment.d.ts +155 -0
- package/validators/transactions/comment.d.ts.map +1 -0
- package/validators/transactions/comment.js +68 -0
- package/validators/transactions/index.d.ts +11 -0
- package/validators/transactions/index.d.ts.map +1 -0
- package/validators/transactions/index.js +26 -0
- package/validators/transactions/link.d.ts +128 -0
- package/validators/transactions/link.d.ts.map +1 -0
- package/validators/transactions/link.js +60 -0
- package/validators/transactions/meta.d.ts +23 -0
- package/validators/transactions/meta.d.ts.map +1 -0
- package/validators/transactions/meta.js +18 -0
- package/validators/transactions/post.d.ts +234 -0
- package/validators/transactions/post.d.ts.map +1 -0
- package/validators/transactions/post.js +100 -0
- package/validators/transactions/roles.d.ts +18 -0
- package/validators/transactions/roles.d.ts.map +1 -0
- package/validators/transactions/roles.js +13 -0
- package/validators/transactions/signup.d.ts +35 -0
- package/validators/transactions/signup.d.ts.map +1 -0
- package/validators/transactions/signup.js +51 -0
- package/validators/transactions/site.d.ts +36 -0
- package/validators/transactions/site.d.ts.map +1 -0
- package/validators/transactions/site.js +49 -0
- package/validators/transactions/term.d.ts +57 -0
- package/validators/transactions/term.d.ts.map +1 -0
- package/validators/transactions/term.js +44 -0
- package/validators/transactions/user.d.ts +182 -0
- package/validators/transactions/user.d.ts.map +1 -0
- package/validators/transactions/user.js +104 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Config } from "../../config";
|
|
2
|
+
import * as types from "../../types";
|
|
3
|
+
import { Blog } from "../blog";
|
|
4
|
+
import { Components } from "../components";
|
|
5
|
+
import { Site } from "../site";
|
|
6
|
+
export declare class SiteUtil {
|
|
7
|
+
private components;
|
|
8
|
+
private config;
|
|
9
|
+
constructor(components: Components, config: Config);
|
|
10
|
+
get(siteRef: string | number): Promise<Site>;
|
|
11
|
+
toSites(sites: types.Tables["site"][], blogId: number): Promise<Site[]>;
|
|
12
|
+
getBlogs(siteId: number): Promise<Blog[]>;
|
|
13
|
+
getReservedNames(siteId?: number): Promise<string[]>;
|
|
14
|
+
private getSiteOptions;
|
|
15
|
+
isEmailUnsafe(email: string, options?: {
|
|
16
|
+
siteId?: number;
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
isLimitedEmailDomains(email: string, options?: {
|
|
19
|
+
siteId: number;
|
|
20
|
+
}): Promise<boolean>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=site.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.util.d.ts","sourceRoot":"","sources":["../../../src/core/utils/site.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI/B,qBACa,QAAQ;IACP,OAAO,CAAC,UAAU;IAAc,OAAO,CAAC,MAAM;gBAAtC,UAAU,EAAE,UAAU,EAAU,MAAM,EAAE,MAAM;IAE5D,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAI5B,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM;IA+BrD,QAAQ,CAAC,MAAM,EAAE,MAAM;IAiBvB,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM;YAmBxB,cAAc;IAgBtB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IA2B1D,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAsBxE"}
|
|
@@ -0,0 +1,122 @@
|
|
|
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.SiteUtil = void 0;
|
|
13
|
+
const config_1 = require("../../config");
|
|
14
|
+
const component_1 = require("../../decorators/component");
|
|
15
|
+
const components_1 = require("../components");
|
|
16
|
+
const current_1 = require("../current");
|
|
17
|
+
const options_1 = require("../options");
|
|
18
|
+
const site_1 = require("../site");
|
|
19
|
+
const blog_util_1 = require("./blog.util");
|
|
20
|
+
const query_util_1 = require("./query.util");
|
|
21
|
+
let SiteUtil = class SiteUtil {
|
|
22
|
+
components;
|
|
23
|
+
config;
|
|
24
|
+
constructor(components, config) {
|
|
25
|
+
this.components = components;
|
|
26
|
+
this.config = config;
|
|
27
|
+
}
|
|
28
|
+
async get(siteRef) {
|
|
29
|
+
return await this.components.asyncGet(site_1.Site, [siteRef]);
|
|
30
|
+
}
|
|
31
|
+
async toSites(sites, blogId) {
|
|
32
|
+
const arr = [];
|
|
33
|
+
for (const site of sites) {
|
|
34
|
+
arr.push(await this.components.asyncGet(site_1.Site, [site.id, blogId]));
|
|
35
|
+
}
|
|
36
|
+
return arr;
|
|
37
|
+
}
|
|
38
|
+
// async getList() {
|
|
39
|
+
// const queryUtil = this.components.get(QueryUtil);
|
|
40
|
+
// const metaUtil = this.components.get(MetaUtil);
|
|
41
|
+
// const sites = (await queryUtil.sites((query) => query)) ?? [];
|
|
42
|
+
// const result: (types.Tables["site"] & {
|
|
43
|
+
// sitename: string;
|
|
44
|
+
// blogs: Awaited<ReturnType<InstanceType<typeof SiteUtil>["getBlogs"]>>;
|
|
45
|
+
// })[] = [];
|
|
46
|
+
// for (const site of sites) {
|
|
47
|
+
// result.push({
|
|
48
|
+
// ...site,
|
|
49
|
+
// sitename:
|
|
50
|
+
// (await metaUtil.getValue("site", site.id, "site_name")) ??
|
|
51
|
+
// site.domain,
|
|
52
|
+
// blogs: (await this.getBlogs(site.id)) ?? [],
|
|
53
|
+
// });
|
|
54
|
+
// }
|
|
55
|
+
// return result;
|
|
56
|
+
// }
|
|
57
|
+
async getBlogs(siteId) {
|
|
58
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
59
|
+
const blogUtil = this.components.get(blog_util_1.BlogUtil);
|
|
60
|
+
const blogArr = (await queryUtil.blogs((query) => {
|
|
61
|
+
query.where("site_id", siteId);
|
|
62
|
+
})) ?? [];
|
|
63
|
+
const result = [];
|
|
64
|
+
for (const item of blogArr) {
|
|
65
|
+
const blog = await blogUtil.get(item.blog_id);
|
|
66
|
+
blog.props && result.push(blog);
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
async getReservedNames(siteId) {
|
|
71
|
+
const options = this.components.get(options_1.Options);
|
|
72
|
+
const current = this.components.get(current_1.Current);
|
|
73
|
+
const illigalNames = await options.get("illegal_names", {
|
|
74
|
+
siteId: siteId ?? current.siteId,
|
|
75
|
+
});
|
|
76
|
+
const defaultReservedNames = this.config.config.multisite.subdirectoryReservedNames;
|
|
77
|
+
return Array.from(new Set([
|
|
78
|
+
...(Array.isArray(illigalNames) ? illigalNames : []),
|
|
79
|
+
...defaultReservedNames,
|
|
80
|
+
]));
|
|
81
|
+
}
|
|
82
|
+
async getSiteOptions(name, defaultValue, siteId) {
|
|
83
|
+
const optionsCore = this.components.get(options_1.Options);
|
|
84
|
+
const current = this.components.get(current_1.Current);
|
|
85
|
+
return ((await optionsCore.get(name, {
|
|
86
|
+
siteId: siteId ?? current.siteId,
|
|
87
|
+
})) ?? defaultValue);
|
|
88
|
+
}
|
|
89
|
+
// is_email_address_unsafe
|
|
90
|
+
async isEmailUnsafe(email, options) {
|
|
91
|
+
const { siteId } = options ?? {};
|
|
92
|
+
let isEmailAddressUnsafe = false;
|
|
93
|
+
const bannedNames = await this.getSiteOptions("banned_email_domains", [], siteId);
|
|
94
|
+
if (email.includes("@")) {
|
|
95
|
+
const normalizedEmail = email.toLowerCase();
|
|
96
|
+
const emailDomain = normalizedEmail.split("@")[1];
|
|
97
|
+
const bannedDomainsLower = !Array.isArray(bannedNames)
|
|
98
|
+
? []
|
|
99
|
+
: bannedNames.map((name) => name.toLowerCase());
|
|
100
|
+
isEmailAddressUnsafe = bannedDomainsLower.some((bannedDomain) => emailDomain === bannedDomain ||
|
|
101
|
+
normalizedEmail.endsWith(`.${bannedDomain}`));
|
|
102
|
+
}
|
|
103
|
+
return isEmailAddressUnsafe;
|
|
104
|
+
}
|
|
105
|
+
async isLimitedEmailDomains(email, options) {
|
|
106
|
+
const { siteId } = options ?? {};
|
|
107
|
+
let limitedEmailDomains = await this.getSiteOptions("limited_email_domains", [], siteId);
|
|
108
|
+
if (Array.isArray(limitedEmailDomains) && limitedEmailDomains.length > 0) {
|
|
109
|
+
limitedEmailDomains = limitedEmailDomains.map((domain) => domain.toLowerCase());
|
|
110
|
+
const emailDomain = email.substring(email.indexOf("@") + 1).toLowerCase();
|
|
111
|
+
if (!limitedEmailDomains.includes(emailDomain)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
exports.SiteUtil = SiteUtil;
|
|
119
|
+
exports.SiteUtil = SiteUtil = __decorate([
|
|
120
|
+
(0, component_1.component)(),
|
|
121
|
+
__metadata("design:paramtypes", [components_1.Components, config_1.Config])
|
|
122
|
+
], SiteUtil);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Components } from "../components";
|
|
2
|
+
import { Taxonomy } from "../taxonomy";
|
|
3
|
+
import type * as types from "../../types";
|
|
4
|
+
import { Config } from "../../config";
|
|
5
|
+
export declare class TaxonomyUtil {
|
|
6
|
+
private components;
|
|
7
|
+
private config;
|
|
8
|
+
constructor(components: Components, config: Config);
|
|
9
|
+
get(key: string): Promise<Taxonomy>;
|
|
10
|
+
getDefaultTerm(taxonomy: types.TaxonomyName): Promise<number>;
|
|
11
|
+
isHierarchical(taxonomyName: types.TaxonomyName): Promise<boolean>;
|
|
12
|
+
getList(args?: {
|
|
13
|
+
objectType?: types.TaxonomyObjectType;
|
|
14
|
+
}): Promise<Taxonomy[]>;
|
|
15
|
+
getList(args?: {
|
|
16
|
+
objectType: string | undefined;
|
|
17
|
+
}): Promise<Taxonomy[]>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=taxonomy.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taxonomy.util.d.ts","sourceRoot":"","sources":["../../../src/core/utils/taxonomy.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBACa,YAAY;IACX,OAAO,CAAC,UAAU;IAAc,OAAO,CAAC,MAAM;gBAAtC,UAAU,EAAE,UAAU,EAAU,MAAM,EAAE,MAAM;IAE5D,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY;IAQ3C,cAAc,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY;IAM/C,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,UAAU,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC;KACvC,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACjB,OAAO,CAAC,IAAI,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAa9E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.TaxonomyUtil = void 0;
|
|
13
|
+
const component_1 = require("../../decorators/component");
|
|
14
|
+
const components_1 = require("../components");
|
|
15
|
+
const options_1 = require("../options");
|
|
16
|
+
const taxonomy_1 = require("../taxonomy");
|
|
17
|
+
const config_1 = require("../../config");
|
|
18
|
+
let TaxonomyUtil = class TaxonomyUtil {
|
|
19
|
+
components;
|
|
20
|
+
config;
|
|
21
|
+
constructor(components, config) {
|
|
22
|
+
this.components = components;
|
|
23
|
+
this.config = config;
|
|
24
|
+
}
|
|
25
|
+
async get(key) {
|
|
26
|
+
return this.components.asyncGet(taxonomy_1.Taxonomy, [key]);
|
|
27
|
+
}
|
|
28
|
+
async getDefaultTerm(taxonomy) {
|
|
29
|
+
const options = this.components.get(options_1.Options);
|
|
30
|
+
const key = taxonomy == "category" ? "default_category" : `default_term_${taxonomy}`;
|
|
31
|
+
const result = await options.get(key);
|
|
32
|
+
return result ? parseInt(result) : 0;
|
|
33
|
+
}
|
|
34
|
+
async isHierarchical(taxonomyName) {
|
|
35
|
+
const taxonomy = await this.get(taxonomyName);
|
|
36
|
+
return taxonomy.props?.hierarchical ?? false;
|
|
37
|
+
}
|
|
38
|
+
async getList(args = { objectType: "post" }) {
|
|
39
|
+
const taxonomies = [];
|
|
40
|
+
for (const [taxonomyName, config] of Object.entries(this.config.config.taxonomy.settings)) {
|
|
41
|
+
if (config.objectType === args.objectType) {
|
|
42
|
+
taxonomies.push(await this.get(taxonomyName));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return taxonomies;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.TaxonomyUtil = TaxonomyUtil;
|
|
49
|
+
exports.TaxonomyUtil = TaxonomyUtil = __decorate([
|
|
50
|
+
(0, component_1.component)(),
|
|
51
|
+
__metadata("design:paramtypes", [components_1.Components, config_1.Config])
|
|
52
|
+
], TaxonomyUtil);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Components } from "../components";
|
|
2
|
+
import { Term } from "../term";
|
|
3
|
+
import { TaxonomyUtil } from "./taxonomy.util";
|
|
4
|
+
import type * as types from "../../types";
|
|
5
|
+
export declare class TermUtil {
|
|
6
|
+
private components;
|
|
7
|
+
private taxonomyUtil;
|
|
8
|
+
constructor(components: Components, taxonomyUtil: TaxonomyUtil);
|
|
9
|
+
get(id: number, taxonomyName?: types.TaxonomyName): Promise<Term>;
|
|
10
|
+
toTerms(terms: Array<types.Tables["terms"] & types.Tables["term_taxonomy"]>): Promise<Term[]>;
|
|
11
|
+
getUniqueSlug(slug: string, term: Term): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=term.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.util.d.ts","sourceRoot":"","sources":["../../../src/core/utils/term.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,qBACa,QAAQ;IAEjB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,YAAY;gBADZ,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY;IAG9B,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY;IAQjD,OAAO,CACX,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAe/D,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;CAqF7C"}
|
|
@@ -0,0 +1,113 @@
|
|
|
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.TermUtil = void 0;
|
|
13
|
+
const component_1 = require("../../decorators/component");
|
|
14
|
+
const components_1 = require("../components");
|
|
15
|
+
const term_1 = require("../term");
|
|
16
|
+
const query_util_1 = require("./query.util");
|
|
17
|
+
const taxonomy_util_1 = require("./taxonomy.util");
|
|
18
|
+
let TermUtil = class TermUtil {
|
|
19
|
+
components;
|
|
20
|
+
taxonomyUtil;
|
|
21
|
+
constructor(components, taxonomyUtil) {
|
|
22
|
+
this.components = components;
|
|
23
|
+
this.taxonomyUtil = taxonomyUtil;
|
|
24
|
+
}
|
|
25
|
+
async get(id, taxonomyName) {
|
|
26
|
+
if (taxonomyName) {
|
|
27
|
+
return await this.components.asyncGet(term_1.Term, [id, taxonomyName]);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return await this.components.asyncGet(term_1.Term, [id]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async toTerms(terms) {
|
|
34
|
+
const arr = [];
|
|
35
|
+
for (const term of terms) {
|
|
36
|
+
arr.push(await this.components.asyncGet(term_1.Term, [
|
|
37
|
+
term.term_id,
|
|
38
|
+
term.taxonomy,
|
|
39
|
+
term,
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
return arr;
|
|
43
|
+
}
|
|
44
|
+
async getUniqueSlug(slug, term) {
|
|
45
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
46
|
+
const taxonomyName = term.taxonomy?.name;
|
|
47
|
+
let parentId = term.props?.parent ?? 0;
|
|
48
|
+
if (!taxonomyName) {
|
|
49
|
+
throw new Error(`Invalid Term - ${taxonomyName}`);
|
|
50
|
+
}
|
|
51
|
+
const needsSuffix = ((await queryUtil.terms((query) => {
|
|
52
|
+
query.exists("slug", slug, taxonomyName);
|
|
53
|
+
})) ?? []).length > 0;
|
|
54
|
+
/*
|
|
55
|
+
* If the taxonomy supports hierarchy and the term has a parent, make the slug unique
|
|
56
|
+
* by incorporating parent slugs.
|
|
57
|
+
*/
|
|
58
|
+
let suffix = "", parentSuffix = "";
|
|
59
|
+
const maxLoop = 10;
|
|
60
|
+
let index = 0;
|
|
61
|
+
if (needsSuffix &&
|
|
62
|
+
(await this.taxonomyUtil.isHierarchical(taxonomyName)) &&
|
|
63
|
+
0 < parentId) {
|
|
64
|
+
for (; index < maxLoop; index++) {
|
|
65
|
+
const parentTerm = await queryUtil.terms((query) => {
|
|
66
|
+
query.exists("term_id", parentId, taxonomyName);
|
|
67
|
+
});
|
|
68
|
+
if (!parentTerm) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
parentSuffix = `${parentSuffix}-${parentTerm[0].slug}`;
|
|
72
|
+
if (!(await queryUtil.terms((query) => {
|
|
73
|
+
query.exists("slug", `${slug}${parentSuffix}`, taxonomyName);
|
|
74
|
+
}))) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
parentId = parentTerm[0].parent ?? 0;
|
|
78
|
+
if (0 >= parentId) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (needsSuffix) {
|
|
84
|
+
suffix = `${parentSuffix}`;
|
|
85
|
+
for (index = 1; index < maxLoop + 1; index++) {
|
|
86
|
+
const terms = await queryUtil.terms((query) => {
|
|
87
|
+
query
|
|
88
|
+
.where("taxonomy", taxonomyName)
|
|
89
|
+
.where("slug", `${slug}${suffix}`);
|
|
90
|
+
if (term.props?.term_id) {
|
|
91
|
+
query.builder.not
|
|
92
|
+
.__ref(query)
|
|
93
|
+
.where("term_id", term.props?.term_id);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
if (!terms) {
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
suffix = `${parentSuffix}-${index + 1}`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (index >= maxLoop) {
|
|
103
|
+
return `${slug}-${Math.floor(Math.random() * (maxLoop + 999990010 - maxLoop + 1) + maxLoop + 1)}`;
|
|
104
|
+
}
|
|
105
|
+
return `${slug}${suffix}`;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
exports.TermUtil = TermUtil;
|
|
109
|
+
exports.TermUtil = TermUtil = __decorate([
|
|
110
|
+
(0, component_1.component)(),
|
|
111
|
+
__metadata("design:paramtypes", [components_1.Components,
|
|
112
|
+
taxonomy_util_1.TaxonomyUtil])
|
|
113
|
+
], TermUtil);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BlogTrx, CommentTrx, LinkTrx, MetaTrx, PostTrx, RegistrationLogTrx, SeederTrx, SignupTrx, TermTrx, UserTrx, OptionsTrx, SiteTrx } from "../../transactions";
|
|
2
|
+
import { Components } from "../components";
|
|
3
|
+
import { Tables } from "../tables";
|
|
4
|
+
export declare class TrxUtil {
|
|
5
|
+
#private;
|
|
6
|
+
private components;
|
|
7
|
+
private tables;
|
|
8
|
+
constructor(components: Components, tables: Tables);
|
|
9
|
+
usingBlog(blogId: number): void;
|
|
10
|
+
private get;
|
|
11
|
+
get user(): UserTrx;
|
|
12
|
+
get term(): TermTrx;
|
|
13
|
+
get site(): SiteTrx;
|
|
14
|
+
get signup(): SignupTrx;
|
|
15
|
+
get seeder(): SeederTrx;
|
|
16
|
+
get registrationLog(): RegistrationLogTrx;
|
|
17
|
+
get post(): PostTrx;
|
|
18
|
+
get options(): OptionsTrx;
|
|
19
|
+
get meta(): MetaTrx;
|
|
20
|
+
get link(): LinkTrx;
|
|
21
|
+
get comment(): CommentTrx;
|
|
22
|
+
get blog(): BlogTrx;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=trx.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trx.util.d.ts","sourceRoot":"","sources":["../../../src/core/utils/trx.util.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,UAAU,EACV,OAAO,EACP,OAAO,EACP,OAAO,EACP,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EACP,UAAU,EACV,OAAO,EACR,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,qBACa,OAAO;;IAGN,OAAO,CAAC,UAAU;IAAc,OAAO,CAAC,MAAM;gBAAtC,UAAU,EAAE,UAAU,EAAU,MAAM,EAAE,MAAM;IAElE,SAAS,CAAC,MAAM,EAAE,MAAM;IAOxB,OAAO,CAAC,GAAG;IAeX,IAAI,IAAI,YAEP;IAED,IAAI,IAAI,YAEP;IAED,IAAI,IAAI,YAEP;IAED,IAAI,MAAM,cAET;IAED,IAAI,MAAM,cAET;IAED,IAAI,eAAe,uBAElB;IAED,IAAI,IAAI,YAEP;IAED,IAAI,OAAO,eAEV;IAED,IAAI,IAAI,YAEP;IAED,IAAI,IAAI,YAEP;IAED,IAAI,OAAO,eAEV;IAED,IAAI,IAAI,YAEP;CACF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.TrxUtil = void 0;
|
|
13
|
+
const constants_1 = require("../../constants");
|
|
14
|
+
const component_1 = require("../../decorators/component");
|
|
15
|
+
const transactions_1 = require("../../transactions");
|
|
16
|
+
const components_1 = require("../components");
|
|
17
|
+
const tables_1 = require("../tables");
|
|
18
|
+
const query_util_1 = require("./query.util");
|
|
19
|
+
let TrxUtil = class TrxUtil {
|
|
20
|
+
components;
|
|
21
|
+
tables;
|
|
22
|
+
#props = new Map();
|
|
23
|
+
constructor(components, tables) {
|
|
24
|
+
this.components = components;
|
|
25
|
+
this.tables = tables;
|
|
26
|
+
}
|
|
27
|
+
usingBlog(blogId) {
|
|
28
|
+
this.tables.index = blogId;
|
|
29
|
+
for (const [, obj] of this.#props.entries()) {
|
|
30
|
+
obj.tables.index = blogId;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
get(target) {
|
|
34
|
+
if (this.#props.has(target)) {
|
|
35
|
+
return this.#props.get(target);
|
|
36
|
+
}
|
|
37
|
+
const component = this.components.get(target);
|
|
38
|
+
component.tables.index = this.tables.index;
|
|
39
|
+
if (component?.queryUtil && component.queryUtil instanceof query_util_1.QueryUtil) {
|
|
40
|
+
component.queryUtil.usingBlog(this.tables.index);
|
|
41
|
+
}
|
|
42
|
+
this.#props.set(target, component);
|
|
43
|
+
return component;
|
|
44
|
+
}
|
|
45
|
+
get user() {
|
|
46
|
+
return this.get(transactions_1.UserTrx);
|
|
47
|
+
}
|
|
48
|
+
get term() {
|
|
49
|
+
return this.get(transactions_1.TermTrx);
|
|
50
|
+
}
|
|
51
|
+
get site() {
|
|
52
|
+
return this.get(transactions_1.SiteTrx);
|
|
53
|
+
}
|
|
54
|
+
get signup() {
|
|
55
|
+
return this.get(transactions_1.SignupTrx);
|
|
56
|
+
}
|
|
57
|
+
get seeder() {
|
|
58
|
+
return this.get(transactions_1.SeederTrx);
|
|
59
|
+
}
|
|
60
|
+
get registrationLog() {
|
|
61
|
+
return this.get(transactions_1.RegistrationLogTrx);
|
|
62
|
+
}
|
|
63
|
+
get post() {
|
|
64
|
+
return this.get(transactions_1.PostTrx);
|
|
65
|
+
}
|
|
66
|
+
get options() {
|
|
67
|
+
return this.get(transactions_1.OptionsTrx);
|
|
68
|
+
}
|
|
69
|
+
get meta() {
|
|
70
|
+
return this.get(transactions_1.MetaTrx);
|
|
71
|
+
}
|
|
72
|
+
get link() {
|
|
73
|
+
return this.get(transactions_1.LinkTrx);
|
|
74
|
+
}
|
|
75
|
+
get comment() {
|
|
76
|
+
return this.get(transactions_1.CommentTrx);
|
|
77
|
+
}
|
|
78
|
+
get blog() {
|
|
79
|
+
return this.get(transactions_1.BlogTrx);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.TrxUtil = TrxUtil;
|
|
83
|
+
exports.TrxUtil = TrxUtil = __decorate([
|
|
84
|
+
(0, component_1.component)({ scope: constants_1.Scope.Transient }),
|
|
85
|
+
__metadata("design:paramtypes", [components_1.Components, tables_1.Tables])
|
|
86
|
+
], TrxUtil);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Config } from "../../config";
|
|
2
|
+
import { OptionsTrx } from "../../transactions/options.trx";
|
|
3
|
+
import { SignupTrx } from "../../transactions/signup.trx";
|
|
4
|
+
import { UserTrx } from "../../transactions/user.trx";
|
|
5
|
+
import { Components } from "../components";
|
|
6
|
+
import { Logger } from "../logger";
|
|
7
|
+
import { Options } from "../options";
|
|
8
|
+
import { Vars } from "../vars";
|
|
9
|
+
import { SignupUtil } from "./signup.util";
|
|
10
|
+
import { UserUtil } from "./user.util";
|
|
11
|
+
export declare class UserSelfRegistrationUtil {
|
|
12
|
+
private config;
|
|
13
|
+
private components;
|
|
14
|
+
private signupUtil;
|
|
15
|
+
private signupTrx;
|
|
16
|
+
private options;
|
|
17
|
+
private optionsTrx;
|
|
18
|
+
private userTrx;
|
|
19
|
+
private userUtil;
|
|
20
|
+
private vars;
|
|
21
|
+
private logger;
|
|
22
|
+
constructor(config: Config, components: Components, signupUtil: SignupUtil, signupTrx: SignupTrx, options: Options, optionsTrx: OptionsTrx, userTrx: UserTrx, userUtil: UserUtil, vars: Vars, logger: Logger);
|
|
23
|
+
canSignup(): Promise<boolean>;
|
|
24
|
+
changeEligibility(enable: boolean): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Register a new user
|
|
27
|
+
*
|
|
28
|
+
* Multisite: create a new record in the signup table along with activation key
|
|
29
|
+
* Single site: create a new user in the users table along with activation key
|
|
30
|
+
*
|
|
31
|
+
* After this gets called, "activate" should be called to validate activation key and activate the user.
|
|
32
|
+
*
|
|
33
|
+
* @param userLogin - Username
|
|
34
|
+
* @param email - Email
|
|
35
|
+
* @returns number - New user ID
|
|
36
|
+
*/
|
|
37
|
+
registerNew(userLogin: string, email: string): Promise<{
|
|
38
|
+
id: number;
|
|
39
|
+
userLogin: string;
|
|
40
|
+
email: string;
|
|
41
|
+
activationKey: string;
|
|
42
|
+
}>;
|
|
43
|
+
getActivationKey(userLogin: string, email: string): Promise<string | undefined>;
|
|
44
|
+
activate(activationKey: string, userRef: string): Promise<[boolean, string]>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=user-self-registration.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-self-registration.util.d.ts","sourceRoot":"","sources":["../../../src/core/utils/user-self-registration.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBACa,wBAAwB;IAEjC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,MAAM;gBATN,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM;IAGlB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAa7B,iBAAiB,CAAC,MAAM,EAAE,OAAO;IAUvC;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;IAwD5C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAiBjD,QAAQ,CACZ,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAmC9B"}
|