@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,838 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.TermTrx = void 0;
|
|
49
|
+
const zod_1 = require("zod");
|
|
50
|
+
const common_1 = require("../common");
|
|
51
|
+
const components_1 = require("../core/components");
|
|
52
|
+
const logger_1 = require("../core/logger");
|
|
53
|
+
const options_1 = require("../core/options");
|
|
54
|
+
const post_util_1 = require("../core/utils/post.util");
|
|
55
|
+
const query_util_1 = require("../core/utils/query.util");
|
|
56
|
+
const taxonomy_util_1 = require("../core/utils/taxonomy.util");
|
|
57
|
+
const term_util_1 = require("../core/utils/term.util");
|
|
58
|
+
const validator_1 = require("../core/validator");
|
|
59
|
+
const database_1 = __importDefault(require("../database"));
|
|
60
|
+
const component_1 = require("../decorators/component");
|
|
61
|
+
const query_builder_1 = require("../query-builder");
|
|
62
|
+
const val = __importStar(require("../validators"));
|
|
63
|
+
const meta_trx_1 = require("./meta.trx");
|
|
64
|
+
const trx_1 = require("./trx");
|
|
65
|
+
let TermTrx = class TermTrx extends trx_1.Trx {
|
|
66
|
+
database;
|
|
67
|
+
logger;
|
|
68
|
+
components;
|
|
69
|
+
taxonomyUtil;
|
|
70
|
+
termUtil;
|
|
71
|
+
postUtil;
|
|
72
|
+
validator;
|
|
73
|
+
constructor(database, logger, components, taxonomyUtil, termUtil, postUtil, validator) {
|
|
74
|
+
super(components);
|
|
75
|
+
this.database = database;
|
|
76
|
+
this.logger = logger;
|
|
77
|
+
this.components = components;
|
|
78
|
+
this.taxonomyUtil = taxonomyUtil;
|
|
79
|
+
this.termUtil = termUtil;
|
|
80
|
+
this.postUtil = postUtil;
|
|
81
|
+
this.validator = validator;
|
|
82
|
+
}
|
|
83
|
+
// wp_update_term_count
|
|
84
|
+
// wp_update_term_count_now
|
|
85
|
+
async updateCount(termTaxonomyIds, taxonomy) {
|
|
86
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
87
|
+
if (typeof taxonomy == "string") {
|
|
88
|
+
taxonomy = await this.taxonomyUtil.get(taxonomy);
|
|
89
|
+
}
|
|
90
|
+
if (taxonomy.isDefault || !taxonomy.props?.objectType) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let objectTypes = taxonomy.props.objectType.split(":");
|
|
94
|
+
let isAttachment = false;
|
|
95
|
+
if (objectTypes.includes("attachment")) {
|
|
96
|
+
isAttachment = true;
|
|
97
|
+
objectTypes = objectTypes.filter((o) => o != "attachment");
|
|
98
|
+
}
|
|
99
|
+
// To unique array
|
|
100
|
+
objectTypes = [...new Set(objectTypes)];
|
|
101
|
+
const isPostType = objectTypes.filter((objectType) => this.postUtil.getTypeObject(objectType)).length > 0;
|
|
102
|
+
// For posts - _update_post_term_count
|
|
103
|
+
for (const termTaxonomyId of termTaxonomyIds) {
|
|
104
|
+
let count = 0, counts;
|
|
105
|
+
const postStatuses = ["publish"];
|
|
106
|
+
if (isPostType || isAttachment) {
|
|
107
|
+
if (isAttachment) {
|
|
108
|
+
counts = await queryUtil.posts((query) => {
|
|
109
|
+
query.countAttachment(termTaxonomyId, postStatuses);
|
|
110
|
+
}, val.query.resultCount);
|
|
111
|
+
}
|
|
112
|
+
count += counts?.count ?? 0;
|
|
113
|
+
if (objectTypes.length > 0) {
|
|
114
|
+
counts = await queryUtil.posts((query) => {
|
|
115
|
+
query.countTerm(termTaxonomyId, postStatuses, objectTypes);
|
|
116
|
+
}, val.query.resultCount);
|
|
117
|
+
}
|
|
118
|
+
count += counts?.count ?? 0;
|
|
119
|
+
// _update_generic_term_count
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
counts = await queryUtil.terms((query) => {
|
|
123
|
+
query.selectTermRelationships
|
|
124
|
+
.where("terms_relationships.term_taxonomy_id", termTaxonomyId)
|
|
125
|
+
.builder.count("* as count")
|
|
126
|
+
.first();
|
|
127
|
+
}, val.query.resultCount);
|
|
128
|
+
count = counts?.count ?? 0;
|
|
129
|
+
}
|
|
130
|
+
const trx = await this.database.transaction;
|
|
131
|
+
try {
|
|
132
|
+
await trx
|
|
133
|
+
.table(this.tables.get("term_taxonomy"))
|
|
134
|
+
.update({
|
|
135
|
+
count,
|
|
136
|
+
})
|
|
137
|
+
.where("term_taxonomy_id", termTaxonomyId);
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
await trx.rollback();
|
|
141
|
+
throw new Error(`Failed to update term count - ${termTaxonomyId}`);
|
|
142
|
+
}
|
|
143
|
+
await trx.commit();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async updateTermOrder(objectId, taxonomyName, termTaxonomyIds, options) {
|
|
147
|
+
const { append = true } = options ?? {};
|
|
148
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
149
|
+
termTaxonomyIds = termTaxonomyIds ?? [];
|
|
150
|
+
// Get terms associated with the object
|
|
151
|
+
const existingTerms = (await queryUtil.terms((query) => {
|
|
152
|
+
query.withObjectIds([objectId]).where("taxonomy", taxonomyName);
|
|
153
|
+
})) ?? [];
|
|
154
|
+
// Get term taxonomy ids excluding the passed term taxonomy ids
|
|
155
|
+
const existingTermTaxonomyIds = existingTerms
|
|
156
|
+
.filter((term) => !termTaxonomyIds?.includes(term.term_taxonomy_id))
|
|
157
|
+
.map((term) => term.term_taxonomy_id);
|
|
158
|
+
// if append is true, append the termTaxonomyIds to the existingTermTaxonomyIds
|
|
159
|
+
// else, append the existingTermTaxonomyIds to the termTaxonomyIds
|
|
160
|
+
termTaxonomyIds = append
|
|
161
|
+
? [...existingTermTaxonomyIds, ...termTaxonomyIds]
|
|
162
|
+
: [...termTaxonomyIds, ...existingTermTaxonomyIds];
|
|
163
|
+
let termOrder = 0;
|
|
164
|
+
for (const termTaxonomyId of termTaxonomyIds) {
|
|
165
|
+
// Check if term relationships exists for the object
|
|
166
|
+
const term = existingTerms.find((term) => term.term_taxonomy_id === termTaxonomyId);
|
|
167
|
+
// Skip if term not found
|
|
168
|
+
if (!term) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const trx = await this.database.transaction;
|
|
172
|
+
try {
|
|
173
|
+
await trx
|
|
174
|
+
.table(this.tables.get("term_relationships"))
|
|
175
|
+
.where("object_id", objectId)
|
|
176
|
+
.where("term_taxonomy_id", termTaxonomyId)
|
|
177
|
+
.update({
|
|
178
|
+
term_order: termOrder++,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
catch (e) {
|
|
182
|
+
await trx.rollback();
|
|
183
|
+
throw new Error(`Failed to update term order - ${termTaxonomyId}`);
|
|
184
|
+
}
|
|
185
|
+
await trx.commit();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// wp_delete_object_term_relationships
|
|
189
|
+
async removeObjectTermRelationships(objectId, taxonomyNames) {
|
|
190
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
191
|
+
for (const taxonomyName of taxonomyNames) {
|
|
192
|
+
const termIds = ((await queryUtil.terms((query) => {
|
|
193
|
+
query.withObjectIds([objectId]).where("taxonomy", taxonomyName);
|
|
194
|
+
})) ?? []).map((term) => term.term_id);
|
|
195
|
+
if (termIds.length > 0) {
|
|
196
|
+
await this.removeObject(objectId, termIds, await this.taxonomyUtil.get(taxonomyName));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// wp_remove_object_terms
|
|
201
|
+
async removeObject(objectId, terms, taxonomy) {
|
|
202
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
203
|
+
if (taxonomy.isDefault) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
if (0 >= terms.length) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
const termsTaxonomyIds = ((await queryUtil.terms((query, builders) => {
|
|
210
|
+
query.where("taxonomy", taxonomy.name).builder.where((subBuilder) => {
|
|
211
|
+
const subQuery = builders.get(query_builder_1.TermsQuery, subBuilder, query.alias);
|
|
212
|
+
for (const slugOrTermId of terms) {
|
|
213
|
+
if (typeof slugOrTermId == "string") {
|
|
214
|
+
subQuery.andWhere((query) => query
|
|
215
|
+
.where("slug", common_1.formatting.slug(slugOrTermId))
|
|
216
|
+
.or.where("name", slugOrTermId));
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
subQuery.where("term_id", slugOrTermId);
|
|
220
|
+
}
|
|
221
|
+
subQuery.builder.or;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
})) ?? []).map((v) => v.term_taxonomy_id);
|
|
225
|
+
if (0 >= termsTaxonomyIds.length) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
const trx = await this.database.transaction;
|
|
229
|
+
try {
|
|
230
|
+
await trx
|
|
231
|
+
.table(this.tables.get("term_relationships"))
|
|
232
|
+
.where("object_id", objectId)
|
|
233
|
+
.whereIn("term_taxonomy_id", termsTaxonomyIds)
|
|
234
|
+
.del();
|
|
235
|
+
}
|
|
236
|
+
catch (e) {
|
|
237
|
+
await trx.rollback();
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
await trx.commit();
|
|
241
|
+
await this.updateCount(termsTaxonomyIds, taxonomy);
|
|
242
|
+
await this.updateTermOrder(objectId, taxonomy.name);
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
// wp_set_object_terms
|
|
246
|
+
async syncObject(objectId, namesOrTermIds, taxonomyName, append = false) {
|
|
247
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
248
|
+
const taxonomy = await this.taxonomyUtil.get(taxonomyName);
|
|
249
|
+
if (taxonomy.isDefault) {
|
|
250
|
+
throw new Error(`Taxonomy Not Found`);
|
|
251
|
+
}
|
|
252
|
+
// Format slugs
|
|
253
|
+
namesOrTermIds = namesOrTermIds
|
|
254
|
+
.map((namesOrTermIds) => typeof namesOrTermIds == "string"
|
|
255
|
+
? namesOrTermIds.trim()
|
|
256
|
+
: namesOrTermIds)
|
|
257
|
+
.filter((term) => (typeof term == "string" ? term.length > 0 : true));
|
|
258
|
+
const oldTermTaxonomyIds = ((await queryUtil.terms((query) => {
|
|
259
|
+
query.withObjectIds([objectId]).where("taxonomy", taxonomyName);
|
|
260
|
+
})) ?? []).map((v) => v.term_taxonomy_id);
|
|
261
|
+
const termTaxonomyIds = [], newTermTaxonomyIds = [];
|
|
262
|
+
for (const nameOrTermId of namesOrTermIds) {
|
|
263
|
+
const terms = await queryUtil.terms((query) => {
|
|
264
|
+
if (typeof nameOrTermId == "string") {
|
|
265
|
+
query.andWhere((query) => query
|
|
266
|
+
.where("slug", common_1.formatting.slug(nameOrTermId))
|
|
267
|
+
.or.where("name", nameOrTermId));
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
query.where("term_id", nameOrTermId);
|
|
271
|
+
}
|
|
272
|
+
query.where("taxonomy", taxonomyName);
|
|
273
|
+
});
|
|
274
|
+
let termTaxonomyId = 0;
|
|
275
|
+
if (!terms) {
|
|
276
|
+
// Skip if a non-existent term ID is passed.
|
|
277
|
+
if (typeof nameOrTermId == "number")
|
|
278
|
+
continue;
|
|
279
|
+
// Create a new term since slugOrTermId is a slug
|
|
280
|
+
const newTerm = await this.insert(nameOrTermId, taxonomyName);
|
|
281
|
+
termTaxonomyId = newTerm.term_taxonomy_id;
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
termTaxonomyId = terms[0].term_taxonomy_id;
|
|
285
|
+
}
|
|
286
|
+
termTaxonomyIds.push(termTaxonomyId);
|
|
287
|
+
// Check if term relationships already exists
|
|
288
|
+
const termRelationships = (await queryUtil.terms((query) => {
|
|
289
|
+
query.selectTermRelationships
|
|
290
|
+
.where("object_id", objectId)
|
|
291
|
+
.where("terms_relationships.term_taxonomy_id", termTaxonomyId);
|
|
292
|
+
}, zod_1.z.array(val.database.wpTermRelationships))) ?? [];
|
|
293
|
+
if (0 < termRelationships.length) {
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
const trx = await this.database.transaction;
|
|
297
|
+
try {
|
|
298
|
+
await trx
|
|
299
|
+
.insert({
|
|
300
|
+
object_id: objectId,
|
|
301
|
+
term_taxonomy_id: termTaxonomyId,
|
|
302
|
+
})
|
|
303
|
+
.into(this.tables.get("term_relationships"));
|
|
304
|
+
}
|
|
305
|
+
catch (e) {
|
|
306
|
+
await trx.rollback();
|
|
307
|
+
this.logger.warn(`Failed to insert terms relationships - ${e}`, {
|
|
308
|
+
error: e,
|
|
309
|
+
});
|
|
310
|
+
throw e;
|
|
311
|
+
}
|
|
312
|
+
await trx.commit();
|
|
313
|
+
// Add new taxonomy Id for later comparison
|
|
314
|
+
newTermTaxonomyIds.push(termTaxonomyId);
|
|
315
|
+
}
|
|
316
|
+
if (newTermTaxonomyIds.length > 0) {
|
|
317
|
+
await this.updateCount(newTermTaxonomyIds, taxonomy);
|
|
318
|
+
}
|
|
319
|
+
// If append is false, remove old term relationships
|
|
320
|
+
if (!append) {
|
|
321
|
+
const deleteTermTaxonomyIds = oldTermTaxonomyIds.filter((v) => !termTaxonomyIds.includes(v));
|
|
322
|
+
const deleteTermIds = ((await queryUtil.terms((query) => {
|
|
323
|
+
query.selectTermTaxonomy
|
|
324
|
+
.whereIn("term_taxonomy_id", deleteTermTaxonomyIds)
|
|
325
|
+
.where("taxonomy", taxonomyName);
|
|
326
|
+
}, zod_1.z.array(val.database.wpTermTaxonomy))) ?? []).map((v) => v.term_id);
|
|
327
|
+
if (0 < deleteTermTaxonomyIds.length) {
|
|
328
|
+
await this.removeObject(objectId, deleteTermIds, taxonomy);
|
|
329
|
+
}
|
|
330
|
+
// Update term_order
|
|
331
|
+
// let termOrder = 0;
|
|
332
|
+
// const dataInsert = (
|
|
333
|
+
// (await queryUtil.terms((query) => {
|
|
334
|
+
// query.withObjectIds([objectId]).where("taxonomy", taxonomyName);
|
|
335
|
+
// })) ?? []
|
|
336
|
+
// ).map((v) => ({
|
|
337
|
+
// object_id: objectId,
|
|
338
|
+
// term_taxonomy_id: v.term_taxonomy_id,
|
|
339
|
+
// term_order: termOrder++,
|
|
340
|
+
// }));
|
|
341
|
+
// if (dataInsert.length > 0) {
|
|
342
|
+
// const trx = await this.database.transaction;
|
|
343
|
+
// try {
|
|
344
|
+
// await trx
|
|
345
|
+
// .insert(dataInsert)
|
|
346
|
+
// .into(this.tables.get("term_relationships"))
|
|
347
|
+
// .onConflict("term_order")
|
|
348
|
+
// .merge(["term_order"]);
|
|
349
|
+
// } catch (e) {
|
|
350
|
+
// await trx.rollback();
|
|
351
|
+
// throw new Error(`Failed to insert term object - ${e}`);
|
|
352
|
+
// }
|
|
353
|
+
// await trx.commit();
|
|
354
|
+
// }
|
|
355
|
+
await this.updateCount(termTaxonomyIds, taxonomy);
|
|
356
|
+
}
|
|
357
|
+
await this.updateTermOrder(objectId, taxonomyName, termTaxonomyIds);
|
|
358
|
+
return termTaxonomyIds;
|
|
359
|
+
}
|
|
360
|
+
// _split_shared_term
|
|
361
|
+
async splitSharedTerm(termId, termTaxonomyId
|
|
362
|
+
//record: boolean = false
|
|
363
|
+
) {
|
|
364
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
365
|
+
// If there are no shared term_taxonomy rows, there's nothing to do here.
|
|
366
|
+
const sharedCount = (await queryUtil.terms((query) => {
|
|
367
|
+
query.selectTermTaxonomy
|
|
368
|
+
.where("term_id", termId)
|
|
369
|
+
.builder.not.__ref(query)
|
|
370
|
+
.where("term_taxonomy_id", termTaxonomyId)
|
|
371
|
+
.builder.clear("select")
|
|
372
|
+
.count("* as count");
|
|
373
|
+
}, zod_1.z.array(zod_1.z.object({ count: zod_1.z.number() })))) ?? [{ count: 0 }];
|
|
374
|
+
if (0 >= sharedCount[0]["count"]) {
|
|
375
|
+
return termId;
|
|
376
|
+
}
|
|
377
|
+
const checkTermId = await queryUtil.terms((query) => {
|
|
378
|
+
query.selectTermTaxonomy
|
|
379
|
+
.where("term_taxonomy_id", termTaxonomyId)
|
|
380
|
+
.builder.limit(1);
|
|
381
|
+
}, zod_1.z.array(val.database.wpTermTaxonomy));
|
|
382
|
+
if (checkTermId && checkTermId[0].term_taxonomy_id != termTaxonomyId) {
|
|
383
|
+
return checkTermId[0].term_taxonomy_id;
|
|
384
|
+
}
|
|
385
|
+
// / Pull up data about the currently shared slug, which we'll use to populate the new one.
|
|
386
|
+
const sharedTerm = await this.termUtil.get(termId);
|
|
387
|
+
if (!sharedTerm.props?.term_id) {
|
|
388
|
+
throw new Error(`Term Not Found - ${termId}`);
|
|
389
|
+
}
|
|
390
|
+
const newTermData = {
|
|
391
|
+
name: sharedTerm.props?.name,
|
|
392
|
+
slug: sharedTerm.props.slug,
|
|
393
|
+
term_group: sharedTerm.props.term_group,
|
|
394
|
+
};
|
|
395
|
+
const trx = await this.database.transaction;
|
|
396
|
+
let builder;
|
|
397
|
+
let newTermId = 0;
|
|
398
|
+
try {
|
|
399
|
+
await trx
|
|
400
|
+
.insert(newTermData)
|
|
401
|
+
.into(this.tables.get("terms"))
|
|
402
|
+
.then((r) => {
|
|
403
|
+
newTermId = r[0];
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
catch (e) {
|
|
407
|
+
await trx.rollback();
|
|
408
|
+
throw new Error(`Error to Insert - ${e}`);
|
|
409
|
+
}
|
|
410
|
+
if (0 >= newTermId) {
|
|
411
|
+
await trx.rollback();
|
|
412
|
+
throw new Error(`Failed to Insert new Term - ${termId}`);
|
|
413
|
+
}
|
|
414
|
+
try {
|
|
415
|
+
builder = trx
|
|
416
|
+
.table(this.tables.get("term_taxonomy"))
|
|
417
|
+
.where("term_taxonomy_id", termTaxonomyId)
|
|
418
|
+
.update({
|
|
419
|
+
term_id: newTermId,
|
|
420
|
+
});
|
|
421
|
+
await builder;
|
|
422
|
+
}
|
|
423
|
+
catch (e) {
|
|
424
|
+
await trx.rollback();
|
|
425
|
+
throw new Error(`Error to update Term Taxonomy - ${e}`);
|
|
426
|
+
}
|
|
427
|
+
const termTaxonomy = await queryUtil.terms((query) => {
|
|
428
|
+
query.where("term_taxonomy_id", termTaxonomyId);
|
|
429
|
+
});
|
|
430
|
+
if (!termTaxonomy || !termTaxonomy[0].taxonomy) {
|
|
431
|
+
await trx.rollback();
|
|
432
|
+
throw new Error(`Term Taxonomy not Found - ${termTaxonomyId}`);
|
|
433
|
+
}
|
|
434
|
+
const termTaxonomyName = termTaxonomy[0].taxonomy;
|
|
435
|
+
const childrenTermTaxonomies = (await queryUtil.terms((query) => {
|
|
436
|
+
query.selectTermTaxonomy
|
|
437
|
+
.where("parent", termId)
|
|
438
|
+
.where("taxonomy", termTaxonomyName);
|
|
439
|
+
}, zod_1.z.array(val.database.wpTermTaxonomy))) ?? [];
|
|
440
|
+
for (const termTaxonomy of childrenTermTaxonomies) {
|
|
441
|
+
try {
|
|
442
|
+
builder = trx
|
|
443
|
+
.table(this.tables.get("term_taxonomy"))
|
|
444
|
+
.where("term_taxonomy_id", termTaxonomy.term_taxonomy_id)
|
|
445
|
+
.update({
|
|
446
|
+
parent: newTermId,
|
|
447
|
+
});
|
|
448
|
+
await builder;
|
|
449
|
+
}
|
|
450
|
+
catch (e) {
|
|
451
|
+
await trx.rollback();
|
|
452
|
+
throw new Error(`Failed to update child term taxonomy - ${termTaxonomy.term_id}`);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
await trx.commit();
|
|
456
|
+
return newTermId;
|
|
457
|
+
}
|
|
458
|
+
async syncTermGroup(termGroup, aliasOf, taxonomyName) {
|
|
459
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
460
|
+
if (aliasOf.length > 0) {
|
|
461
|
+
const aliasTerms = await queryUtil.terms((query) => {
|
|
462
|
+
query.exists("slug", aliasOf, taxonomyName);
|
|
463
|
+
});
|
|
464
|
+
if (aliasTerms && 0 <= aliasTerms[0].term_group) {
|
|
465
|
+
termGroup = aliasTerms[0].term_group;
|
|
466
|
+
}
|
|
467
|
+
else if (aliasTerms && aliasTerms[0].term_id) {
|
|
468
|
+
const aliasTermId = aliasTerms[0].term_id;
|
|
469
|
+
const newTermGroup = await queryUtil.terms((query) => {
|
|
470
|
+
query.maxGroup();
|
|
471
|
+
}, val.query.termsGroupMaxCountResult);
|
|
472
|
+
if (!newTermGroup) {
|
|
473
|
+
throw new Error("new Max Group not obtained");
|
|
474
|
+
}
|
|
475
|
+
termGroup = newTermGroup[0]["max"];
|
|
476
|
+
await this.update(aliasTermId, taxonomyName, {
|
|
477
|
+
termGroup,
|
|
478
|
+
name: aliasTerms[0].name,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return termGroup;
|
|
483
|
+
}
|
|
484
|
+
// wp_insert_term
|
|
485
|
+
async insert(name, taxonomyName, args = {}) {
|
|
486
|
+
let { description = "", slug = "" } = args;
|
|
487
|
+
const { aliasOf = "", parentId = 0 } = args;
|
|
488
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
489
|
+
const taxonomy = await this.taxonomyUtil.get(taxonomyName);
|
|
490
|
+
if (taxonomy.isDefault) {
|
|
491
|
+
throw new Error("Invalid Taxonomy");
|
|
492
|
+
}
|
|
493
|
+
name = common_1.formatting.unslash(name);
|
|
494
|
+
description = common_1.formatting.unslash(description);
|
|
495
|
+
slug = common_1.formatting.slug(slug.length > 0 ? slug : `${name}`);
|
|
496
|
+
if (!name || 0 >= name.length) {
|
|
497
|
+
throw new Error(`A name is required for this term.`);
|
|
498
|
+
}
|
|
499
|
+
if (parentId > 0 &&
|
|
500
|
+
(!(await this.termUtil.get(parentId)).props ||
|
|
501
|
+
true !== taxonomy.props?.hierarchical)) {
|
|
502
|
+
throw new Error("Invalid Parent Term");
|
|
503
|
+
}
|
|
504
|
+
const data = {
|
|
505
|
+
name,
|
|
506
|
+
taxonomy: taxonomyName,
|
|
507
|
+
description,
|
|
508
|
+
parent: parentId,
|
|
509
|
+
};
|
|
510
|
+
const dupTerms = (await queryUtil.terms((query) => {
|
|
511
|
+
query
|
|
512
|
+
.where("taxonomy", taxonomyName)
|
|
513
|
+
.where("name", name)
|
|
514
|
+
.where("parent", parentId);
|
|
515
|
+
})) ?? [];
|
|
516
|
+
/*
|
|
517
|
+
* The `name` match in `get_terms()` doesn't differentiate accented characters,
|
|
518
|
+
* so we do a stricter comparison here.
|
|
519
|
+
*/
|
|
520
|
+
for (const dupTerm of dupTerms) {
|
|
521
|
+
if (typeof name === "string" &&
|
|
522
|
+
dupTerm.name?.toLowerCase() === name.toLowerCase()) {
|
|
523
|
+
throw new Error(`A term with the name provided already exists in this taxonomy. - ${name}`);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
data.term_group = await this.syncTermGroup(0, aliasOf, taxonomyName);
|
|
527
|
+
const term = await this.termUtil.get(0, taxonomy.name);
|
|
528
|
+
term.withProps({
|
|
529
|
+
parent: parentId,
|
|
530
|
+
});
|
|
531
|
+
data.slug = await this.termUtil.getUniqueSlug(slug, term);
|
|
532
|
+
const dataInsert = this.validator.execSafeAny(val.trx.termInsert, Object.entries(data)
|
|
533
|
+
.map(([key, value]) => ({
|
|
534
|
+
[key]: common_1.formatting.unslash(value),
|
|
535
|
+
}))
|
|
536
|
+
.reduce((obj, item) => ({ ...obj, ...item }), {}));
|
|
537
|
+
if (!dataInsert) {
|
|
538
|
+
throw new Error(`Invalid Data ${JSON.stringify(data)}`);
|
|
539
|
+
}
|
|
540
|
+
const trx = await this.database.transaction;
|
|
541
|
+
let termId = 0;
|
|
542
|
+
try {
|
|
543
|
+
await trx
|
|
544
|
+
.insert({
|
|
545
|
+
name: dataInsert.name,
|
|
546
|
+
slug: dataInsert.slug,
|
|
547
|
+
term_group: dataInsert.term_group,
|
|
548
|
+
})
|
|
549
|
+
.into(this.tables.get("terms"))
|
|
550
|
+
.then((v) => {
|
|
551
|
+
termId = v[0];
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
catch (e) {
|
|
555
|
+
await trx.rollback();
|
|
556
|
+
throw new Error(`Failed to insert term ${e}`);
|
|
557
|
+
}
|
|
558
|
+
// Check if term taxonomy already exists
|
|
559
|
+
const termTaxonomies = await queryUtil.terms((query) => {
|
|
560
|
+
query.where("term_id", termId).where("taxonomy", taxonomyName);
|
|
561
|
+
});
|
|
562
|
+
if (termTaxonomies) {
|
|
563
|
+
return {
|
|
564
|
+
term_id: termId,
|
|
565
|
+
term_taxonomy_id: termTaxonomies[0].term_taxonomy_id,
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
let termTaxonomyId = 0;
|
|
569
|
+
try {
|
|
570
|
+
await trx
|
|
571
|
+
.table(this.tables.get("term_taxonomy"))
|
|
572
|
+
.insert({
|
|
573
|
+
term_id: termId,
|
|
574
|
+
taxonomy: dataInsert.taxonomy,
|
|
575
|
+
description: dataInsert.description,
|
|
576
|
+
parent: dataInsert.parent,
|
|
577
|
+
})
|
|
578
|
+
.then((v) => {
|
|
579
|
+
termTaxonomyId = v[0];
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
catch (e) {
|
|
583
|
+
await trx.rollback();
|
|
584
|
+
throw new Error(`Failed to insert term taxonomy ${e}`);
|
|
585
|
+
}
|
|
586
|
+
/*
|
|
587
|
+
* Sanity check: if we just created a term with the same parent + taxonomy + slug but a higher term_id than
|
|
588
|
+
* an existing term, then we have unwittingly created a duplicate term. Delete the dupe, and use the term_id
|
|
589
|
+
* and term_taxonomy_id of the older term instead. Then return out of the function so that the "create" hooks
|
|
590
|
+
* are not fired.
|
|
591
|
+
*
|
|
592
|
+
* ok, but why are we doing this just for term?
|
|
593
|
+
*/
|
|
594
|
+
const sanityCheck = await queryUtil.terms((query) => {
|
|
595
|
+
query
|
|
596
|
+
.where("slug", slug)
|
|
597
|
+
.where("parent", parentId)
|
|
598
|
+
.where("taxonomy", taxonomyName)
|
|
599
|
+
.where("term_id", termId)
|
|
600
|
+
.builder.not.__ref(query)
|
|
601
|
+
.where("term_taxonomy_id", termTaxonomyId);
|
|
602
|
+
});
|
|
603
|
+
if (sanityCheck && sanityCheck[0].term_id) {
|
|
604
|
+
termId = sanityCheck[0].term_id;
|
|
605
|
+
termTaxonomyId = sanityCheck[0].term_taxonomy_id;
|
|
606
|
+
}
|
|
607
|
+
sanityCheck ? await trx.rollback() : await trx.commit();
|
|
608
|
+
return {
|
|
609
|
+
term_id: termId,
|
|
610
|
+
term_taxonomy_id: termTaxonomyId,
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
// wp_update_term
|
|
614
|
+
async update(termId, taxonomyName, args) {
|
|
615
|
+
const { aliasOf = "", parentId = 0, termGroup = 0 } = args;
|
|
616
|
+
let { description = "", slug = "", name } = args;
|
|
617
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
618
|
+
const taxonomy = await this.taxonomyUtil.get(taxonomyName);
|
|
619
|
+
if (taxonomy.isDefault) {
|
|
620
|
+
throw new Error("Invalid Taxonomy");
|
|
621
|
+
}
|
|
622
|
+
const term = await this.termUtil.get(termId);
|
|
623
|
+
if (!term.props?.term_id) {
|
|
624
|
+
throw new Error(`Invalid Term - ${termId}`);
|
|
625
|
+
}
|
|
626
|
+
name = name && common_1.formatting.unslash(name.length > 0 ? name : term.props.name);
|
|
627
|
+
description = common_1.formatting.unslash(description);
|
|
628
|
+
slug = common_1.formatting.slug(slug.length > 0 ? slug : `${name}`);
|
|
629
|
+
if (!name || 0 >= name.length) {
|
|
630
|
+
throw new Error(`A name is required for this term.`);
|
|
631
|
+
}
|
|
632
|
+
if (parentId > 0 &&
|
|
633
|
+
(!(await this.termUtil.get(parentId)).props ||
|
|
634
|
+
true !== taxonomy.props?.hierarchical)) {
|
|
635
|
+
throw new Error("Invalid Parent Term");
|
|
636
|
+
}
|
|
637
|
+
const data = {
|
|
638
|
+
name,
|
|
639
|
+
taxonomy: taxonomyName,
|
|
640
|
+
description,
|
|
641
|
+
parent: parentId,
|
|
642
|
+
slug,
|
|
643
|
+
};
|
|
644
|
+
// Check for duplicate slug.
|
|
645
|
+
const dupTerms = await queryUtil.terms((query) => {
|
|
646
|
+
query
|
|
647
|
+
.where("slug", slug)
|
|
648
|
+
.where("taxonomy", taxonomyName)
|
|
649
|
+
.builder.not.__ref(query)
|
|
650
|
+
.where("term_id", termId);
|
|
651
|
+
});
|
|
652
|
+
if (dupTerms) {
|
|
653
|
+
throw new Error(`duplicate_term_slug - ${slug} is already in use by another term.`);
|
|
654
|
+
}
|
|
655
|
+
const termTaxonomy = await queryUtil.terms((query) => {
|
|
656
|
+
query.where("taxonomy", taxonomyName).where("term_id", termId);
|
|
657
|
+
});
|
|
658
|
+
if (!termTaxonomy) {
|
|
659
|
+
throw new Error(`Term Taxonomy not found: taxonomy - ${taxonomy} termId - ${termId}`);
|
|
660
|
+
}
|
|
661
|
+
data.term_taxonomy_id = termTaxonomy[0].term_taxonomy_id;
|
|
662
|
+
data.term_group = await this.syncTermGroup(termGroup, aliasOf, taxonomyName);
|
|
663
|
+
termId = await this.splitSharedTerm(termId, termTaxonomy[0].term_taxonomy_id);
|
|
664
|
+
data.term_id = termId;
|
|
665
|
+
const dataInsert = this.validator.execSafeAny(val.trx.termUpdate, Object.entries(data)
|
|
666
|
+
.map(([key, value]) => ({
|
|
667
|
+
[key]: common_1.formatting.unslash(value),
|
|
668
|
+
}))
|
|
669
|
+
.reduce((obj, item) => ({ ...obj, ...item }), {}));
|
|
670
|
+
if (!dataInsert) {
|
|
671
|
+
throw new Error(`Invalid Data ${JSON.stringify(data)}`);
|
|
672
|
+
}
|
|
673
|
+
const trx = await this.database.transaction;
|
|
674
|
+
try {
|
|
675
|
+
await trx
|
|
676
|
+
.table(this.tables.get("terms"))
|
|
677
|
+
.where("term_id", dataInsert.term_id)
|
|
678
|
+
.update({
|
|
679
|
+
name: dataInsert.name,
|
|
680
|
+
slug: dataInsert.slug,
|
|
681
|
+
term_group: dataInsert.term_group,
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
catch (e) {
|
|
685
|
+
trx.rollback();
|
|
686
|
+
throw new Error(`Failed to update term ${e}`);
|
|
687
|
+
}
|
|
688
|
+
try {
|
|
689
|
+
await trx
|
|
690
|
+
.table(this.tables.get("term_taxonomy"))
|
|
691
|
+
.where("term_taxonomy_id", dataInsert.term_taxonomy_id)
|
|
692
|
+
.update({
|
|
693
|
+
term_id: dataInsert.term_id,
|
|
694
|
+
taxonomy: dataInsert.taxonomy,
|
|
695
|
+
description: dataInsert.description,
|
|
696
|
+
parent: dataInsert.parent,
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
catch (e) {
|
|
700
|
+
trx.rollback();
|
|
701
|
+
throw new Error(`Failed to update term taxonomy ${e}`);
|
|
702
|
+
}
|
|
703
|
+
await trx.commit();
|
|
704
|
+
}
|
|
705
|
+
// wp_delete_term
|
|
706
|
+
async remove(termId, taxonomyName, args) {
|
|
707
|
+
let { default: defaultTermId } = args ?? {};
|
|
708
|
+
const { forceDefault } = args ?? {};
|
|
709
|
+
const taxonomy = await this.taxonomyUtil.get(taxonomyName);
|
|
710
|
+
if (taxonomy.isDefault) {
|
|
711
|
+
throw new Error("Invalid Taxonomy");
|
|
712
|
+
}
|
|
713
|
+
const term = await this.termUtil.get(termId);
|
|
714
|
+
if (!term.props?.term_id) {
|
|
715
|
+
throw new Error(`Invalid Term - ${termId}`);
|
|
716
|
+
}
|
|
717
|
+
const termTaxonomyId = term.props.term_taxonomy_id;
|
|
718
|
+
const options = this.components.get(options_1.Options);
|
|
719
|
+
if (taxonomyName === "category") {
|
|
720
|
+
const defaultCategoryId = await options.get("default_category");
|
|
721
|
+
if (defaultCategoryId === termId) {
|
|
722
|
+
return false; // Don't delete the default category.
|
|
723
|
+
}
|
|
724
|
+
defaultTermId = defaultTermId ?? defaultCategoryId;
|
|
725
|
+
}
|
|
726
|
+
// Don't delete the default custom taxonomy term.
|
|
727
|
+
if (taxonomy.props?.default_term) {
|
|
728
|
+
const taxonomyDefaultTermId = await options.get(`default_term_${taxonomyName}`);
|
|
729
|
+
if (taxonomyDefaultTermId === termId) {
|
|
730
|
+
return false;
|
|
731
|
+
}
|
|
732
|
+
defaultTermId = taxonomyDefaultTermId ?? defaultTermId;
|
|
733
|
+
}
|
|
734
|
+
if (defaultTermId) {
|
|
735
|
+
const defaultTerm = await this.termUtil.get(defaultTermId, taxonomyName);
|
|
736
|
+
if (!defaultTerm.props) {
|
|
737
|
+
defaultTermId = undefined;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
// Update children to point to new parent.
|
|
741
|
+
if (taxonomy.props?.hierarchical) {
|
|
742
|
+
const trx = await this.database.transaction;
|
|
743
|
+
try {
|
|
744
|
+
await trx
|
|
745
|
+
.table(this.tables.get("term_taxonomy"))
|
|
746
|
+
.where("parent", term.props.term_id)
|
|
747
|
+
.where("taxonomy", taxonomyName)
|
|
748
|
+
.update({
|
|
749
|
+
parent: term.props.parent,
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
catch (e) {
|
|
753
|
+
await trx.rollback();
|
|
754
|
+
throw new Error(`Failed to update term taxonomy ${e}`);
|
|
755
|
+
}
|
|
756
|
+
await trx.commit();
|
|
757
|
+
}
|
|
758
|
+
const queryUtil = this.components.get(query_util_1.QueryUtil);
|
|
759
|
+
const objectIds = ((await queryUtil.terms((query) => {
|
|
760
|
+
query.selectTermRelationships.where("terms_relationships.term_taxonomy_id", termTaxonomyId);
|
|
761
|
+
}, val.query.termRelationshipsResult)) ?? []).map((term) => term.object_id);
|
|
762
|
+
for (const objectId of objectIds) {
|
|
763
|
+
if (!defaultTermId) {
|
|
764
|
+
await this.removeObject(objectId, [termId], taxonomy);
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
const terms = (await queryUtil.terms((query) => {
|
|
768
|
+
query.withObjectIds([objectId]).where("taxonomy", taxonomyName);
|
|
769
|
+
})) ?? [];
|
|
770
|
+
if (1 >= terms.length && defaultTermId) {
|
|
771
|
+
// - object has only one term that's being deleted.
|
|
772
|
+
// - attach default term to the object
|
|
773
|
+
await this.syncObject(objectId, [defaultTermId], taxonomyName);
|
|
774
|
+
continue;
|
|
775
|
+
}
|
|
776
|
+
const termIds = terms
|
|
777
|
+
.filter((term) => term.term_id !== termId)
|
|
778
|
+
.map((term) => term.term_id);
|
|
779
|
+
if (defaultTermId && forceDefault) {
|
|
780
|
+
termIds.push(defaultTermId);
|
|
781
|
+
}
|
|
782
|
+
await this.syncObject(objectId, termIds, taxonomyName);
|
|
783
|
+
}
|
|
784
|
+
const metas = (await queryUtil.meta("term", (query) => {
|
|
785
|
+
query.withIds([termId]);
|
|
786
|
+
})) ?? [];
|
|
787
|
+
const metaTrx = this.components.get(meta_trx_1.MetaTrx);
|
|
788
|
+
for (const meta of metas) {
|
|
789
|
+
if (!meta.meta_key)
|
|
790
|
+
continue;
|
|
791
|
+
await metaTrx.remove("term", {
|
|
792
|
+
objectId: termId,
|
|
793
|
+
key: meta.meta_key,
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
const trx = await this.database.transaction;
|
|
797
|
+
try {
|
|
798
|
+
await trx
|
|
799
|
+
.table(this.tables.get("term_taxonomy"))
|
|
800
|
+
.where("term_taxonomy_id", termTaxonomyId)
|
|
801
|
+
.del();
|
|
802
|
+
}
|
|
803
|
+
catch (e) {
|
|
804
|
+
await trx.rollback();
|
|
805
|
+
throw new Error(`Failed to delete term taxonomy ${e}`);
|
|
806
|
+
}
|
|
807
|
+
await trx.commit();
|
|
808
|
+
// Delete the term if no taxonomies use it.
|
|
809
|
+
if (!(await queryUtil.terms((query) => {
|
|
810
|
+
query.selectTermTaxonomy.where("term_taxonomy_id", termId);
|
|
811
|
+
}))) {
|
|
812
|
+
const trx = await this.database.transaction;
|
|
813
|
+
try {
|
|
814
|
+
await trx
|
|
815
|
+
.table(this.tables.get("terms"))
|
|
816
|
+
.where("term_id", termId)
|
|
817
|
+
.del();
|
|
818
|
+
}
|
|
819
|
+
catch (e) {
|
|
820
|
+
await trx.rollback();
|
|
821
|
+
throw new Error(`Failed to delete term ${e}`);
|
|
822
|
+
}
|
|
823
|
+
await trx.commit();
|
|
824
|
+
}
|
|
825
|
+
return true;
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
exports.TermTrx = TermTrx;
|
|
829
|
+
exports.TermTrx = TermTrx = __decorate([
|
|
830
|
+
(0, component_1.transactions)(),
|
|
831
|
+
__metadata("design:paramtypes", [database_1.default,
|
|
832
|
+
logger_1.Logger,
|
|
833
|
+
components_1.Components,
|
|
834
|
+
taxonomy_util_1.TaxonomyUtil,
|
|
835
|
+
term_util_1.TermUtil,
|
|
836
|
+
post_util_1.PostUtil,
|
|
837
|
+
validator_1.Validator])
|
|
838
|
+
], TermTrx);
|