@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,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
var QueryBuilders_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.QueryBuilders = void 0;
|
|
17
|
+
const knex_1 = require("knex");
|
|
18
|
+
const constants_1 = require("../constants");
|
|
19
|
+
const components_1 = require("../core/components");
|
|
20
|
+
const tables_1 = require("../core/tables");
|
|
21
|
+
const database_1 = __importDefault(require("../database"));
|
|
22
|
+
const component_1 = require("../decorators/component");
|
|
23
|
+
knex_1.knex.QueryBuilder.extend("__ref", function (ref) {
|
|
24
|
+
return ref;
|
|
25
|
+
});
|
|
26
|
+
let QueryBuilders = QueryBuilders_1 = class QueryBuilders {
|
|
27
|
+
database;
|
|
28
|
+
components;
|
|
29
|
+
tables;
|
|
30
|
+
#refList = new Map();
|
|
31
|
+
constructor(database, components, tables) {
|
|
32
|
+
this.database = database;
|
|
33
|
+
this.components = components;
|
|
34
|
+
this.tables = tables;
|
|
35
|
+
this.#refList.set(QueryBuilders_1, this);
|
|
36
|
+
this.#refList.set(tables_1.Tables, this.tables);
|
|
37
|
+
}
|
|
38
|
+
get queryBuilder() {
|
|
39
|
+
return this.database.connection.queryBuilder();
|
|
40
|
+
}
|
|
41
|
+
getTableName(table) {
|
|
42
|
+
return this.tables.get(table);
|
|
43
|
+
}
|
|
44
|
+
raw(raw, args) {
|
|
45
|
+
return this.database.connection.raw(raw, args ?? undefined);
|
|
46
|
+
}
|
|
47
|
+
get(target, builder, alias) {
|
|
48
|
+
const instance = this.components.get(target, [], {
|
|
49
|
+
refList: this.#refList,
|
|
50
|
+
});
|
|
51
|
+
instance.builder = builder ?? this.queryBuilder;
|
|
52
|
+
if (alias && instance?.alias) {
|
|
53
|
+
alias.cloneIndex(instance.alias);
|
|
54
|
+
}
|
|
55
|
+
return instance;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.QueryBuilders = QueryBuilders;
|
|
59
|
+
exports.QueryBuilders = QueryBuilders = QueryBuilders_1 = __decorate([
|
|
60
|
+
(0, component_1.component)({ scope: constants_1.Scope.Transient }),
|
|
61
|
+
__metadata("design:paramtypes", [database_1.default,
|
|
62
|
+
components_1.Components,
|
|
63
|
+
tables_1.Tables])
|
|
64
|
+
], QueryBuilders);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Alias } from "./alias";
|
|
2
|
+
import { QueryBuilder } from "./query-builder";
|
|
3
|
+
import { QueryBuilders } from "./query-builders";
|
|
4
|
+
import type * as types from "../types";
|
|
5
|
+
export declare class SiteQuery extends QueryBuilder<SiteQuery> {
|
|
6
|
+
#private;
|
|
7
|
+
alias: Alias;
|
|
8
|
+
protected builders: QueryBuilders;
|
|
9
|
+
builder: types.QueryBuilder;
|
|
10
|
+
readonly table = "site";
|
|
11
|
+
constructor(alias: Alias, builders: QueryBuilders, builder: types.QueryBuilder);
|
|
12
|
+
get from(): this;
|
|
13
|
+
get(s: string | number): this;
|
|
14
|
+
withMeta(type?: "inner" | "right"): this;
|
|
15
|
+
whereIn(column: types.Columns<"site"> | "meta_key" | "meta_value", values: Array<string | number>): this;
|
|
16
|
+
where(column: types.Columns<"site"> | "meta_key" | "meta_value" | "site_id", value: string | number | Array<string | number>, op?: string): this;
|
|
17
|
+
whereLike(column: types.Columns<"site">, value: string, options?: {
|
|
18
|
+
not: boolean;
|
|
19
|
+
}): this;
|
|
20
|
+
whereNotLike(column: types.Columns<"site">, value: string): this;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=site.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.query.d.ts","sourceRoot":"","sources":["../../src/query-builder/site.query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC,qBACa,SAAU,SAAQ,YAAY,CAAC,SAAS,CAAC;;IAI3C,KAAK,EAAE,KAAK;IACnB,SAAS,CAAC,QAAQ,EAAE,aAAa;IAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAJpC,QAAQ,CAAC,KAAK,UAAU;gBAEf,KAAK,EAAE,KAAK,EACT,QAAQ,EAAE,aAAa,EAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAKpC,IAAI,IAAI,SAGP;IAED,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAWtB,QAAQ,CAAC,IAAI,GAAE,OAAO,GAAG,OAAiB;IAU1C,OAAO,CACL,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,UAAU,GAAG,YAAY,EACzD,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAMhC,KAAK,CACH,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,EACrE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC/C,EAAE,GAAE,MAAY;IAoBlB,SAAS,CACP,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE;IAY5B,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM;CAG1D"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var SiteQuery_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SiteQuery = void 0;
|
|
14
|
+
const component_1 = require("../decorators/component");
|
|
15
|
+
const alias_1 = require("./alias");
|
|
16
|
+
const meta_query_1 = require("./meta.query");
|
|
17
|
+
const query_builder_1 = require("./query-builder");
|
|
18
|
+
const query_builders_1 = require("./query-builders");
|
|
19
|
+
let SiteQuery = SiteQuery_1 = class SiteQuery extends query_builder_1.QueryBuilder {
|
|
20
|
+
alias;
|
|
21
|
+
builders;
|
|
22
|
+
builder;
|
|
23
|
+
#metaJoined = false;
|
|
24
|
+
table = "site";
|
|
25
|
+
constructor(alias, builders, builder) {
|
|
26
|
+
super(alias, builders, builder, SiteQuery_1);
|
|
27
|
+
this.alias = alias;
|
|
28
|
+
this.builders = builders;
|
|
29
|
+
this.builder = builder;
|
|
30
|
+
}
|
|
31
|
+
get from() {
|
|
32
|
+
this.builder.table(this.alias.as("site"));
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
get(s) {
|
|
36
|
+
if (typeof s === "number") {
|
|
37
|
+
this.where("id", s);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.where("domain", s);
|
|
41
|
+
}
|
|
42
|
+
this.builder.first();
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
withMeta(type = "right") {
|
|
46
|
+
if (this.#metaJoined) {
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
const meta = this.builders.get(meta_query_1.MetaQuery, this.builder, this.alias);
|
|
50
|
+
meta.setPrimaryTable("site").from.joinPrimary(type);
|
|
51
|
+
this.#metaJoined = true;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
whereIn(column, values) {
|
|
55
|
+
this.where(column, values);
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
where(column, value, op = "=") {
|
|
59
|
+
const { column: toColumn } = this.alias;
|
|
60
|
+
if (Array.isArray(value)) {
|
|
61
|
+
op = "in";
|
|
62
|
+
}
|
|
63
|
+
this.builder.where(toColumn((column == "meta_key" || column == "meta_value" || column == "site_id"
|
|
64
|
+
? "sitemeta"
|
|
65
|
+
: "site"), column), op, value);
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
whereLike(column, value, options) {
|
|
69
|
+
const { column: toColumn } = this.alias;
|
|
70
|
+
if (options?.not === true) {
|
|
71
|
+
this.builder.not;
|
|
72
|
+
}
|
|
73
|
+
this.builder.whereILike(toColumn("site", column), `%${value}%`);
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
whereNotLike(column, value) {
|
|
77
|
+
return this.whereLike(column, value, { not: true });
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.SiteQuery = SiteQuery;
|
|
81
|
+
exports.SiteQuery = SiteQuery = SiteQuery_1 = __decorate([
|
|
82
|
+
(0, component_1.queryBuilder)(),
|
|
83
|
+
__metadata("design:paramtypes", [alias_1.Alias,
|
|
84
|
+
query_builders_1.QueryBuilders, Object])
|
|
85
|
+
], SiteQuery);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Alias } from "./alias";
|
|
2
|
+
import { QueryBuilder } from "./query-builder";
|
|
3
|
+
import { QueryBuilders } from "./query-builders";
|
|
4
|
+
import type * as types from "../types";
|
|
5
|
+
export declare class TermsQuery extends QueryBuilder<TermsQuery> {
|
|
6
|
+
alias: Alias<"cte_terms" | "c" | "c2">;
|
|
7
|
+
protected builders: QueryBuilders;
|
|
8
|
+
builder: types.QueryBuilder;
|
|
9
|
+
readonly table = "terms";
|
|
10
|
+
constructor(alias: Alias<"cte_terms" | "c" | "c2">, builders: QueryBuilders, builder: types.QueryBuilder);
|
|
11
|
+
get from(): this;
|
|
12
|
+
get selectTerms(): this;
|
|
13
|
+
get selectTermTaxonomy(): this;
|
|
14
|
+
get selectTermRelationships(): this;
|
|
15
|
+
exists(column: "term_id" | "name" | "slug", value: string | number, taxonomy?: string): this;
|
|
16
|
+
maxGroup(): import("knex").Knex.QueryBuilder<{}, {
|
|
17
|
+
max: any;
|
|
18
|
+
} | {
|
|
19
|
+
_base: unknown;
|
|
20
|
+
_hasSelection: boolean;
|
|
21
|
+
_keys: string;
|
|
22
|
+
_aliases: {};
|
|
23
|
+
_single: boolean;
|
|
24
|
+
_intersectProps: {
|
|
25
|
+
max: any;
|
|
26
|
+
};
|
|
27
|
+
_unionProps: unknown;
|
|
28
|
+
}>;
|
|
29
|
+
get(id: number): this;
|
|
30
|
+
joinTermRelationships(left: string): this;
|
|
31
|
+
joinTerms(): this;
|
|
32
|
+
joinTermTaxonomy(): this;
|
|
33
|
+
withMeta(type?: "inner" | "right"): this;
|
|
34
|
+
withoutObjectIds(ids: number[]): this;
|
|
35
|
+
withObjectIds(ids: number[], exclude?: boolean): this;
|
|
36
|
+
withChildren(column: "name" | "slug" | "term_id" | "taxonomy" | "parent" | "term_taxonomy_id", obj: Array<string | number>): this;
|
|
37
|
+
private getColumn;
|
|
38
|
+
select(columns: "*" | Array<Exclude<types.Columns<"terms">, "term_id"> | Exclude<types.Columns<"term_taxonomy">, "term_id"> | "object_id" | "depth" | "term_id" | "term_order">): this;
|
|
39
|
+
groupBy(column: Exclude<types.Columns<"terms">, "term_id"> | Exclude<types.Columns<"term_taxonomy">, "term_id"> | "object_id" | "depth" | "term_id"): this;
|
|
40
|
+
whereIn(column: Exclude<types.Columns<"term_taxonomy">, "parent"> | types.Columns<"terms">, obj: Array<string | number>): this;
|
|
41
|
+
where(column: types.Columns<"terms"> | types.Columns<"term_taxonomy"> | "terms.term_id" | "terms.slug" | "terms.name" | "object_id" | "term_order" | "terms_relationships.term_taxonomy_id", v: string | number | Array<string | number>, op?: string): this;
|
|
42
|
+
whereLike(column: "name" | "description" | "slug", search: string, options?: {
|
|
43
|
+
not: boolean;
|
|
44
|
+
}): this;
|
|
45
|
+
whereNotLike(column: "name" | "description" | "slug", search: string): this;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=terms.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terms.query.d.ts","sourceRoot":"","sources":["../../src/query-builder/terms.query.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var TermsQuery_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.TermsQuery = void 0;
|
|
14
|
+
const component_1 = require("../decorators/component");
|
|
15
|
+
const alias_1 = require("./alias");
|
|
16
|
+
const query_builder_1 = require("./query-builder");
|
|
17
|
+
const query_builders_1 = require("./query-builders");
|
|
18
|
+
const meta_query_1 = require("./meta.query");
|
|
19
|
+
let TermsQuery = TermsQuery_1 = class TermsQuery extends query_builder_1.QueryBuilder {
|
|
20
|
+
alias;
|
|
21
|
+
builders;
|
|
22
|
+
builder;
|
|
23
|
+
table = "terms";
|
|
24
|
+
constructor(alias, builders, builder) {
|
|
25
|
+
super(alias, builders, builder, TermsQuery_1);
|
|
26
|
+
this.alias = alias;
|
|
27
|
+
this.builders = builders;
|
|
28
|
+
this.builder = builder;
|
|
29
|
+
}
|
|
30
|
+
get from() {
|
|
31
|
+
const { column, as } = this.alias;
|
|
32
|
+
this.builder
|
|
33
|
+
.innerJoin(as("term_taxonomy"), column("terms", "term_id"), column("term_taxonomy", "term_id"))
|
|
34
|
+
// .leftJoin(
|
|
35
|
+
// as("term_relationships"),
|
|
36
|
+
// column("term_taxonomy", "term_taxonomy_id"),
|
|
37
|
+
// column("term_relationships", "term_taxonomy_id")
|
|
38
|
+
// )
|
|
39
|
+
.from(as(this.table))
|
|
40
|
+
.distinct();
|
|
41
|
+
//.select(column("terms", "term_id"));
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
get selectTerms() {
|
|
45
|
+
const { as } = this.alias;
|
|
46
|
+
this.builder
|
|
47
|
+
.clear("join")
|
|
48
|
+
.clear("columns")
|
|
49
|
+
.clear("select")
|
|
50
|
+
.from(as("terms"));
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
get selectTermTaxonomy() {
|
|
54
|
+
const { as } = this.alias;
|
|
55
|
+
this.builder
|
|
56
|
+
.clear("join")
|
|
57
|
+
.clear("columns")
|
|
58
|
+
.clear("select")
|
|
59
|
+
.from(as("term_taxonomy"));
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
get selectTermRelationships() {
|
|
63
|
+
const { as } = this.alias;
|
|
64
|
+
this.builder
|
|
65
|
+
.clear("join")
|
|
66
|
+
.clear("columns")
|
|
67
|
+
.clear("select")
|
|
68
|
+
.from(as("term_relationships"));
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
exists(column, value, taxonomy) {
|
|
72
|
+
this.builder.where((subBuilder) => {
|
|
73
|
+
const qb = this.builders.get(TermsQuery_1, subBuilder, this.alias);
|
|
74
|
+
qb.from.builder.where(qb.getColumn(column), value).limit(1);
|
|
75
|
+
if (taxonomy) {
|
|
76
|
+
qb.builder.where(qb.getColumn("taxonomy"), taxonomy);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
maxGroup() {
|
|
82
|
+
const { column, as } = this.alias;
|
|
83
|
+
return this.builder
|
|
84
|
+
.clear("select")
|
|
85
|
+
.clear("join")
|
|
86
|
+
.clear("where")
|
|
87
|
+
.max(column("terms", "term_group"), { as: "max" })
|
|
88
|
+
.from(as("terms"));
|
|
89
|
+
}
|
|
90
|
+
get(id) {
|
|
91
|
+
const { column } = this.alias;
|
|
92
|
+
this.builder.where(column("terms", "term_id"), id).first();
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
joinTermRelationships(left) {
|
|
96
|
+
const { as, column } = this.alias;
|
|
97
|
+
this.builder.join(as("term_relationships"), left, column("term_relationships", "object_id"));
|
|
98
|
+
// .innerJoin(
|
|
99
|
+
// as("term_taxonomy"),
|
|
100
|
+
// column("term_taxonomy", "term_taxonomy_id"),
|
|
101
|
+
// column("term_relationships", "term_taxonomy_id")
|
|
102
|
+
// )
|
|
103
|
+
// .innerJoin(
|
|
104
|
+
// as("terms"),
|
|
105
|
+
// column("terms", "term_id"),
|
|
106
|
+
// column("term_taxonomy", "term_id")
|
|
107
|
+
// );
|
|
108
|
+
//this.replaceBuilder(builder);
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
joinTerms() {
|
|
112
|
+
const { as, column } = this.alias;
|
|
113
|
+
this.builder.innerJoin(as("terms"), column("terms", "term_id"), column("term_taxonomy", "term_id"));
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
joinTermTaxonomy() {
|
|
117
|
+
const { as, column } = this.alias;
|
|
118
|
+
this.builder.innerJoin(as("term_taxonomy"), column("term_taxonomy", "term_taxonomy_id"), column("term_relationships", "term_taxonomy_id"));
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
withMeta(type = "right") {
|
|
122
|
+
const { column, as } = this.alias;
|
|
123
|
+
this.builder.clear("select").clear("join");
|
|
124
|
+
const meta = this.builders.get(meta_query_1.MetaQuery, this.builder, this.alias);
|
|
125
|
+
meta.setPrimaryTable("term").from.joinPrimary(type);
|
|
126
|
+
this.builder.innerJoin(as("term_taxonomy"), column("terms", "term_id"), column("term_taxonomy", "term_id"));
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
withoutObjectIds(ids) {
|
|
130
|
+
this.withObjectIds(ids, true);
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
withObjectIds(ids, exclude = false) {
|
|
134
|
+
const { as, column } = this.alias;
|
|
135
|
+
this.builder.innerJoin(as("term_relationships"), column("term_taxonomy", "term_taxonomy_id"), column("term_relationships", "term_taxonomy_id"));
|
|
136
|
+
if (!exclude)
|
|
137
|
+
this.builder.whereIn(column("term_relationships", "object_id"), ids);
|
|
138
|
+
else
|
|
139
|
+
this.builder.whereNotIn(column("term_relationships", "object_id"), ids);
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
withChildren(column, obj) {
|
|
143
|
+
const { as, column: toColumn, get } = this.alias;
|
|
144
|
+
this.builder
|
|
145
|
+
.withRecursive(get("cte_terms").table, (qb) => {
|
|
146
|
+
qb.select(toColumn("term_taxonomy", "term_taxonomy_id", "c"), toColumn("term_taxonomy", "term_id", "c"), toColumn("term_taxonomy", "parent", "c"), this.builders.raw("0 as depth"))
|
|
147
|
+
.from(as("term_taxonomy", "c"))
|
|
148
|
+
.join(as("terms", "c"), toColumn("term_taxonomy", "term_id", "c"), toColumn("terms", "term_id", "c"))
|
|
149
|
+
.whereIn(`${this.getColumn(column, "c")}`, obj)
|
|
150
|
+
.union((qb) => {
|
|
151
|
+
qb.select(toColumn("term_taxonomy", "term_taxonomy_id", "c2"), toColumn("term_taxonomy", "term_id", "c2"), toColumn("term_taxonomy", "parent", "c2"), this.builders.raw(`${get("cte_terms").key}.depth + 1`))
|
|
152
|
+
.from(as("term_taxonomy", "c2"))
|
|
153
|
+
.join(as("cte_terms"), toColumn("term_taxonomy", "parent", "c2"), toColumn("cte_terms", "term_taxonomy_id"));
|
|
154
|
+
});
|
|
155
|
+
})
|
|
156
|
+
.join(as("cte_terms"), toColumn("term_taxonomy", "term_id"), toColumn("cte_terms", "term_id"));
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
159
|
+
getColumn(column, alias) {
|
|
160
|
+
const { get } = this.alias;
|
|
161
|
+
let tableColumn;
|
|
162
|
+
switch (column) {
|
|
163
|
+
case "terms_relationships.term_taxonomy_id":
|
|
164
|
+
column = "term_taxonomy_id";
|
|
165
|
+
// eslint-disable-next-line no-fallthrough
|
|
166
|
+
case "object_id":
|
|
167
|
+
case "term_order":
|
|
168
|
+
tableColumn = get("term_relationships").key;
|
|
169
|
+
break;
|
|
170
|
+
case "terms.name":
|
|
171
|
+
column = "name";
|
|
172
|
+
tableColumn = get("terms").key;
|
|
173
|
+
break;
|
|
174
|
+
case "terms.term_id":
|
|
175
|
+
column = "term_id";
|
|
176
|
+
tableColumn = get("terms").key;
|
|
177
|
+
break;
|
|
178
|
+
case "name":
|
|
179
|
+
case "slug":
|
|
180
|
+
case "term_group":
|
|
181
|
+
tableColumn = get("terms").key;
|
|
182
|
+
break;
|
|
183
|
+
case "depth":
|
|
184
|
+
tableColumn = get("cte_terms").key;
|
|
185
|
+
break;
|
|
186
|
+
default:
|
|
187
|
+
tableColumn = get("term_taxonomy").key;
|
|
188
|
+
}
|
|
189
|
+
return alias
|
|
190
|
+
? `${tableColumn}_${alias}.${column}`
|
|
191
|
+
: `${tableColumn}.${column}`;
|
|
192
|
+
}
|
|
193
|
+
select(columns) {
|
|
194
|
+
this.builder.clear("select"); //.select(this.getColumn("term_id"));
|
|
195
|
+
if (columns === "*") {
|
|
196
|
+
this.builder.distinct().select("*");
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
columns.map((c) => c == "depth"
|
|
200
|
+
? this.builder.max(this.getColumn(c), { as: "depth" })
|
|
201
|
+
: this.builder.select(this.getColumn(c)));
|
|
202
|
+
}
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
groupBy(column) {
|
|
206
|
+
this.builder.groupBy(this.getColumn(column));
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
whereIn(column, obj) {
|
|
210
|
+
this.where(column, obj, "in");
|
|
211
|
+
return this;
|
|
212
|
+
}
|
|
213
|
+
where(column, v, op = "=") {
|
|
214
|
+
this.builder.where(this.getColumn(column), op, v);
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
whereLike(column, search, options) {
|
|
218
|
+
if (options?.not === true) {
|
|
219
|
+
this.builder.not;
|
|
220
|
+
}
|
|
221
|
+
this.builder.whereILike(this.getColumn(column), `%${search}%`);
|
|
222
|
+
return this;
|
|
223
|
+
}
|
|
224
|
+
whereNotLike(column, search) {
|
|
225
|
+
return this.whereLike(column, search);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
exports.TermsQuery = TermsQuery;
|
|
229
|
+
exports.TermsQuery = TermsQuery = TermsQuery_1 = __decorate([
|
|
230
|
+
(0, component_1.queryBuilder)(),
|
|
231
|
+
__metadata("design:paramtypes", [alias_1.Alias,
|
|
232
|
+
query_builders_1.QueryBuilders, Object])
|
|
233
|
+
], TermsQuery);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Components } from "../core/components";
|
|
2
|
+
import { Roles } from "../core/roles";
|
|
3
|
+
import { Alias } from "./alias";
|
|
4
|
+
import { QueryBuilder } from "./query-builder";
|
|
5
|
+
import { QueryBuilders } from "./query-builders";
|
|
6
|
+
import type * as types from "../types";
|
|
7
|
+
export declare class UsersQuery extends QueryBuilder<UsersQuery> {
|
|
8
|
+
#private;
|
|
9
|
+
private components;
|
|
10
|
+
private roles;
|
|
11
|
+
alias: Alias;
|
|
12
|
+
protected builders: QueryBuilders;
|
|
13
|
+
builder: types.QueryBuilder;
|
|
14
|
+
readonly table = "users";
|
|
15
|
+
constructor(components: Components, roles: Roles, alias: Alias, builders: QueryBuilders, builder: types.QueryBuilder);
|
|
16
|
+
get from(): this;
|
|
17
|
+
get(u: number | string): this;
|
|
18
|
+
select(columns: Array<types.Columns<"users"> | types.Columns<"usermeta">>): this;
|
|
19
|
+
withMeta(type?: "inner" | "right"): this;
|
|
20
|
+
withPublishedPosts(): this;
|
|
21
|
+
withBlogIds(blogIds: number[]): this;
|
|
22
|
+
hasRole(): this;
|
|
23
|
+
hasNoRole(): this;
|
|
24
|
+
withRoles(roleNames: types.RoleNames[], options?: {
|
|
25
|
+
blogIds?: number[];
|
|
26
|
+
}): this;
|
|
27
|
+
withRoles(roleNames: string[], options?: {
|
|
28
|
+
blogIds?: number[];
|
|
29
|
+
}): this;
|
|
30
|
+
whereIn(column: types.Columns<"users"> | "meta_key" | "meta_value", values: Array<string | number>): this;
|
|
31
|
+
where(column: types.Columns<"users"> | "meta_key" | "meta_value", value: string | number | Array<string | number>, op?: string): this;
|
|
32
|
+
whereLike(column: types.Columns<"users">, value: string, options?: {
|
|
33
|
+
not: boolean;
|
|
34
|
+
}): this;
|
|
35
|
+
whereNotLike(column: types.Columns<"users">, value: string): this;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=users.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.query.d.ts","sourceRoot":"","sources":["../../src/query-builder/users.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC,qBACa,UAAW,SAAQ,YAAY,CAAC,UAAU,CAAC;;IAIpD,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,KAAK;IACN,KAAK,EAAE,KAAK;IACnB,SAAS,CAAC,QAAQ,EAAE,aAAa;IAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAPpC,QAAQ,CAAC,KAAK,WAAW;gBAGf,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACb,KAAK,EAAE,KAAK,EACT,QAAQ,EAAE,aAAa,EAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAKpC,IAAI,IAAI,SAGP;IAED,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IActB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAKzE,QAAQ,CAAC,IAAI,GAAE,OAAO,GAAG,OAAiB;IAU1C,kBAAkB;IAalB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE;IAsB7B,OAAO;IAkBP,SAAS;IAwBT,SAAS,CACP,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,EAC5B,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAC/B,IAAI;IACP,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI;IAmCtE,OAAO,CACL,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,UAAU,GAAG,YAAY,EAC1D,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAMhC,KAAK,CACH,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,UAAU,GAAG,YAAY,EAC1D,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAC/C,EAAE,GAAE,MAAY;IAmBlB,SAAS,CACP,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE;IAY5B,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM;CAG3D"}
|