@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,188 @@
|
|
|
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 MetaQuery_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.MetaQuery = 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
|
+
let MetaQuery = MetaQuery_1 = class MetaQuery extends query_builder_1.QueryBuilder {
|
|
19
|
+
alias;
|
|
20
|
+
builders;
|
|
21
|
+
builder;
|
|
22
|
+
table;
|
|
23
|
+
primaryTable;
|
|
24
|
+
columns;
|
|
25
|
+
#valueType = "CHAR";
|
|
26
|
+
constructor(alias, builders, builder, table, primaryTable, columns) {
|
|
27
|
+
super(alias, builders, builder, MetaQuery_1);
|
|
28
|
+
this.alias = alias;
|
|
29
|
+
this.builders = builders;
|
|
30
|
+
this.builder = builder;
|
|
31
|
+
this.table = table;
|
|
32
|
+
this.primaryTable = primaryTable;
|
|
33
|
+
this.columns = columns;
|
|
34
|
+
}
|
|
35
|
+
setPrimaryTable(table) {
|
|
36
|
+
this.columns = {
|
|
37
|
+
primary: "post" === table || "user" === table
|
|
38
|
+
? "ID"
|
|
39
|
+
: "site" === table
|
|
40
|
+
? "id"
|
|
41
|
+
: `${table}_id`,
|
|
42
|
+
meta: `${table}_id`,
|
|
43
|
+
};
|
|
44
|
+
this.primaryTable = table == "site" ? "site" : `${table}s`;
|
|
45
|
+
this.table = `${table}meta`;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
get from() {
|
|
49
|
+
this.builder.from(this.alias.as(this.table));
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
select(columns) {
|
|
53
|
+
this.builder.select(columns);
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
valueType(type) {
|
|
57
|
+
if (!type.match(/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:(d+(?:,s?d+)?))?|DECIMAL(?:(d+(?:,s?d+)?))?)$/)) {
|
|
58
|
+
type = "CHAR";
|
|
59
|
+
}
|
|
60
|
+
this.#valueType = "NUMERIC" === type ? "SIGNED" : type;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
joinPrimary(type = "inner") {
|
|
64
|
+
const { as, column } = this.alias;
|
|
65
|
+
this.builder[`${type}Join`](as(this.primaryTable), column(this.table, this.columns.meta), column(this.primaryTable, this.columns.primary));
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
withIds(ids, options) {
|
|
69
|
+
const { joinPrimary = true } = options ?? {};
|
|
70
|
+
this.builder.clear("join");
|
|
71
|
+
if (joinPrimary) {
|
|
72
|
+
this.joinPrimary();
|
|
73
|
+
}
|
|
74
|
+
if (options?.not === true) {
|
|
75
|
+
this.builder.not;
|
|
76
|
+
}
|
|
77
|
+
this.builder.whereIn(
|
|
78
|
+
//this.alias.column(this.primaryTable, this.columns.primary),
|
|
79
|
+
this.alias.column(this.table, this.columns.meta), ids);
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
onNotExists(column, value) {
|
|
83
|
+
return this.onExists(column, value, true);
|
|
84
|
+
}
|
|
85
|
+
onExists(column, value, not = false) {
|
|
86
|
+
this.builder.clear("join");
|
|
87
|
+
const { column: toColumn, as } = this.alias;
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
89
|
+
const self = this;
|
|
90
|
+
this.builder[not ? "leftJoin" : "innerJoin"](as(this.primaryTable), function (qb) {
|
|
91
|
+
qb.on(toColumn(self.table, self.columns.meta), toColumn(self.primaryTable, self.columns.primary))[not ? "onNotExists" : "onExists"](function () {
|
|
92
|
+
this.select(toColumn(self.table, self.columns.meta))
|
|
93
|
+
.from(as(self.table))
|
|
94
|
+
.where(toColumn(self.table, column), value)
|
|
95
|
+
.limit(1);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
castValue(v, as = this.#valueType) {
|
|
101
|
+
return this.builders.raw(`CAST(? as ${as})`, [v]);
|
|
102
|
+
}
|
|
103
|
+
whereKeyLike(value, options) {
|
|
104
|
+
const { column } = this.alias;
|
|
105
|
+
if (options?.not === true) {
|
|
106
|
+
this.builder.not.whereILike(column(this.table, "meta_key"), `%${value}%`);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.builder.whereILike(column(this.table, "meta_key"), `%${value}%`);
|
|
110
|
+
}
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
whereKeyNotLike(value) {
|
|
114
|
+
return this.whereKeyLike(value, { not: true });
|
|
115
|
+
}
|
|
116
|
+
whereLike(key, value, options) {
|
|
117
|
+
const { column } = this.alias;
|
|
118
|
+
this.builder.andWhere((subBuilder) => {
|
|
119
|
+
subBuilder.where(column(this.table, "meta_key"), key);
|
|
120
|
+
if (options?.not === true) {
|
|
121
|
+
subBuilder.not;
|
|
122
|
+
}
|
|
123
|
+
subBuilder.whereILike(column(this.table, "meta_value"), `%${value}%`);
|
|
124
|
+
});
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
whereNotLike(key, value) {
|
|
128
|
+
return this.whereLike(key, value, { not: true });
|
|
129
|
+
}
|
|
130
|
+
whereIn(key, obj) {
|
|
131
|
+
const { column } = this.alias;
|
|
132
|
+
this.builder.andWhere((subBuilder) => {
|
|
133
|
+
subBuilder
|
|
134
|
+
.where(column(this.table, "meta_key"), key)
|
|
135
|
+
.whereIn(column(this.table, "meta_value"), obj);
|
|
136
|
+
});
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
whereBetween(key, range) {
|
|
140
|
+
const { column } = this.alias;
|
|
141
|
+
this.builder.andWhere((subBuilder) => {
|
|
142
|
+
subBuilder
|
|
143
|
+
.where(column(this.table, "meta_key"), key)
|
|
144
|
+
.whereBetween(column(this.table, "meta_value"), range);
|
|
145
|
+
});
|
|
146
|
+
return this;
|
|
147
|
+
}
|
|
148
|
+
withKeys(keys) {
|
|
149
|
+
const { column } = this.alias;
|
|
150
|
+
this.builder.andWhere((subBuilder) => {
|
|
151
|
+
for (const key of keys) {
|
|
152
|
+
subBuilder.orWhere(column(this.table, "meta_key"), key);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
where(key, value, op = "=") {
|
|
158
|
+
const { column } = this.alias;
|
|
159
|
+
//this.builder.where(toColumn(this.table, column), op, this.castValue(value));
|
|
160
|
+
this.builder.andWhere((subBuilder) => {
|
|
161
|
+
subBuilder.where(column(this.table, "meta_key"), key);
|
|
162
|
+
if (value) {
|
|
163
|
+
subBuilder.where(column(this.table, "meta_value"), op, value
|
|
164
|
+
//this.castValue(value)
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
regex(key, regex) {
|
|
171
|
+
const { column } = this.alias;
|
|
172
|
+
const value = this.#valueType === "BINARY"
|
|
173
|
+
? this.castValue(regex.source)
|
|
174
|
+
: `'${regex.source}'`;
|
|
175
|
+
this.builder.andWhere((subBuilder) => {
|
|
176
|
+
subBuilder
|
|
177
|
+
.where(column(this.table, "meta_key"), key)
|
|
178
|
+
.whereRaw(`?? REGEXP ${value}`, [column(this.table, "meta_value")]);
|
|
179
|
+
});
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
exports.MetaQuery = MetaQuery;
|
|
184
|
+
exports.MetaQuery = MetaQuery = MetaQuery_1 = __decorate([
|
|
185
|
+
(0, component_1.queryBuilder)(),
|
|
186
|
+
__metadata("design:paramtypes", [alias_1.Alias,
|
|
187
|
+
query_builders_1.QueryBuilders, Object, String, String, Object])
|
|
188
|
+
], MetaQuery);
|
|
@@ -0,0 +1,19 @@
|
|
|
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 OptionsQuery extends QueryBuilder<OptionsQuery> {
|
|
6
|
+
alias: Alias;
|
|
7
|
+
protected builders: QueryBuilders;
|
|
8
|
+
builder: types.QueryBuilder;
|
|
9
|
+
readonly table = "options";
|
|
10
|
+
constructor(alias: Alias, builders: QueryBuilders, builder: types.QueryBuilder);
|
|
11
|
+
get from(): this;
|
|
12
|
+
get(name: string): this;
|
|
13
|
+
whereIn(names: string[]): void;
|
|
14
|
+
whereLike(column: types.Columns<"options">, value: string, options?: {
|
|
15
|
+
not: boolean;
|
|
16
|
+
}): this;
|
|
17
|
+
whereNotLike(column: types.Columns<"options">, value: string): this;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=options.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.query.d.ts","sourceRoot":"","sources":["../../src/query-builder/options.query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,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,YAAa,SAAQ,YAAY,CAAC,YAAY,CAAC;IAGjD,KAAK,EAAE,KAAK;IACnB,SAAS,CAAC,QAAQ,EAAE,aAAa;IAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAJpC,QAAQ,CAAC,KAAK,aAAa;gBAElB,KAAK,EAAE,KAAK,EACT,QAAQ,EAAE,aAAa,EAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAKpC,IAAI,IAAI,SAGP;IAED,GAAG,CAAC,IAAI,EAAE,MAAM;IAKhB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE;IAIvB,SAAS,CACP,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAChC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE;IAY5B,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM;CAG7D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 OptionsQuery_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.OptionsQuery = 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
|
+
let OptionsQuery = OptionsQuery_1 = class OptionsQuery extends query_builder_1.QueryBuilder {
|
|
19
|
+
alias;
|
|
20
|
+
builders;
|
|
21
|
+
builder;
|
|
22
|
+
table = "options";
|
|
23
|
+
constructor(alias, builders, builder) {
|
|
24
|
+
super(alias, builders, builder, OptionsQuery_1);
|
|
25
|
+
this.alias = alias;
|
|
26
|
+
this.builders = builders;
|
|
27
|
+
this.builder = builder;
|
|
28
|
+
}
|
|
29
|
+
get from() {
|
|
30
|
+
this.builder.table(this.alias.as("options"));
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
get(name) {
|
|
34
|
+
this.builder.where("option_name", name).first();
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
whereIn(names) {
|
|
38
|
+
this.builder.whereIn("option_name", names);
|
|
39
|
+
}
|
|
40
|
+
whereLike(column, value, options) {
|
|
41
|
+
const { column: toColumn } = this.alias;
|
|
42
|
+
if (options?.not === true) {
|
|
43
|
+
this.builder.not;
|
|
44
|
+
}
|
|
45
|
+
this.builder.whereILike(toColumn("options", column), `%${value}%`);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
whereNotLike(column, value) {
|
|
49
|
+
return this.whereLike(column, value, { not: true });
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.OptionsQuery = OptionsQuery;
|
|
53
|
+
exports.OptionsQuery = OptionsQuery = OptionsQuery_1 = __decorate([
|
|
54
|
+
(0, component_1.queryBuilder)(),
|
|
55
|
+
__metadata("design:paramtypes", [alias_1.Alias,
|
|
56
|
+
query_builders_1.QueryBuilders, Object])
|
|
57
|
+
], OptionsQuery);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Alias } from "./alias";
|
|
2
|
+
import { QueryBuilder } from "./query-builder";
|
|
3
|
+
import { QueryBuilders } from "./query-builders";
|
|
4
|
+
import { TermsQuery } from "./terms.query";
|
|
5
|
+
import type * as types from "../types";
|
|
6
|
+
export declare class PostsQuery extends QueryBuilder<PostsQuery> {
|
|
7
|
+
alias: Alias<"cte_p" | "p" | "p2" | "cte_c" | "c" | "c2">;
|
|
8
|
+
protected builders: QueryBuilders;
|
|
9
|
+
builder: types.QueryBuilder;
|
|
10
|
+
readonly table = "posts";
|
|
11
|
+
constructor(alias: Alias<"cte_p" | "p" | "p2" | "cte_c" | "c" | "c2">, builders: QueryBuilders, builder: types.QueryBuilder);
|
|
12
|
+
get from(): this;
|
|
13
|
+
get(id: number): this;
|
|
14
|
+
withMeta(type?: "inner" | "right"): this;
|
|
15
|
+
withoutMeta(key: string, value?: string): this;
|
|
16
|
+
withChildren(id: number): this;
|
|
17
|
+
withParents(id: number): this;
|
|
18
|
+
select(columns: Array<types.Columns<"posts"> | types.Columns<"postmeta">>): this;
|
|
19
|
+
whereIn(column: types.Columns<"posts"> | "meta_key" | "meta_value", values: Array<string | number>): this;
|
|
20
|
+
where(column: types.Columns<"posts"> | "meta_key" | "meta_value", value: string | number | Array<string | number>, op?: string): this;
|
|
21
|
+
whereLike(column: types.Columns<"posts">, value: string, options?: {
|
|
22
|
+
not: boolean;
|
|
23
|
+
}): this;
|
|
24
|
+
whereNotLike(column: types.Columns<"posts">, value: string): this;
|
|
25
|
+
countPublished(postType?: string): this;
|
|
26
|
+
withTerms(taxonomies: types.TaxonomyName[], fn?: (query: TermsQuery) => void): this;
|
|
27
|
+
countTerm(termTaxonomyId: number, postStatuses: types.PostStatus[], postTypes: types.PostType[]): this;
|
|
28
|
+
countAttachment(termTaxonomyId: number, postStatues: types.PostStatus[]): this;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=posts.query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.query.d.ts","sourceRoot":"","sources":["../../src/query-builder/posts.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;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAGvC,qBACa,UAAW,SAAQ,YAAY,CAAC,UAAU,CAAC;IAG7C,KAAK,EAAE,KAAK,CAAC,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC;IAChE,SAAS,CAAC,QAAQ,EAAE,aAAa;IAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAJpC,QAAQ,CAAC,KAAK,WAAW;gBAEhB,KAAK,EAAE,KAAK,CAAC,OAAO,GAAG,GAAG,GAAG,IAAI,GAAG,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,EACtD,QAAQ,EAAE,aAAa,EAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAKpC,IAAI,IAAI,SAGP;IAED,GAAG,CAAC,EAAE,EAAE,MAAM;IAMd,QAAQ,CAAC,IAAI,GAAE,OAAO,GAAG,OAAiB;IAM1C,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAsBvC,YAAY,CAAC,EAAE,EAAE,MAAM;IA0BvB,WAAW,CAAC,EAAE,EAAE,MAAM;IA+BtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAKzE,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;IAoBlB,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;IAI1D,cAAc,CAAC,QAAQ,GAAE,MAAe;IAWxC,SAAS,CACP,UAAU,EAAE,KAAK,CAAC,YAAY,EAAE,EAChC,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI;IAoBlC,SAAS,CACP,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,KAAK,CAAC,UAAU,EAAE,EAChC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE;IAoB7B,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE;CA2CxE"}
|
|
@@ -0,0 +1,208 @@
|
|
|
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 PostsQuery_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.PostsQuery = 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
|
+
const terms_query_1 = require("./terms.query");
|
|
20
|
+
let PostsQuery = PostsQuery_1 = class PostsQuery extends query_builder_1.QueryBuilder {
|
|
21
|
+
alias;
|
|
22
|
+
builders;
|
|
23
|
+
builder;
|
|
24
|
+
table = "posts";
|
|
25
|
+
constructor(alias, builders, builder) {
|
|
26
|
+
super(alias, builders, builder, PostsQuery_1);
|
|
27
|
+
this.alias = alias;
|
|
28
|
+
this.builders = builders;
|
|
29
|
+
this.builder = builder;
|
|
30
|
+
}
|
|
31
|
+
get from() {
|
|
32
|
+
this.builder.table(this.alias.as("posts"));
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
get(id) {
|
|
36
|
+
const { column } = this.alias;
|
|
37
|
+
this.builder.where(column("posts", "ID"), id).first();
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
withMeta(type = "right") {
|
|
41
|
+
const meta = this.builders.get(meta_query_1.MetaQuery, this.builder, this.alias);
|
|
42
|
+
meta.setPrimaryTable("post").from.joinPrimary(type);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
withoutMeta(key, value) {
|
|
46
|
+
const { column } = this.alias;
|
|
47
|
+
this.andWhere((query) => {
|
|
48
|
+
query.builder.where(column("posts", "ID"), "not in", (qb) => {
|
|
49
|
+
const meta = this.builders.get(meta_query_1.MetaQuery, qb);
|
|
50
|
+
meta
|
|
51
|
+
.setPrimaryTable("post")
|
|
52
|
+
.from.joinPrimary("inner")
|
|
53
|
+
.select(["post_id"]);
|
|
54
|
+
if (value)
|
|
55
|
+
meta.where(key, value);
|
|
56
|
+
else
|
|
57
|
+
meta.withKeys([key]);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
withChildren(id) {
|
|
63
|
+
const { as, column: toColumn, get } = this.alias;
|
|
64
|
+
this.builder
|
|
65
|
+
.withRecursive(get("cte_c").table, (qb) => {
|
|
66
|
+
qb.select(toColumn("posts", "ID", "c"), this.builders.raw("0 as depth"))
|
|
67
|
+
.from(as("posts", "c"))
|
|
68
|
+
.where(toColumn("posts", "post_parent", "c"), id)
|
|
69
|
+
.union((qb) => {
|
|
70
|
+
qb.select(toColumn("posts", "ID", "c2"), this.builders.raw(`${get("cte_c").key}.depth + 1`))
|
|
71
|
+
.from(as("posts", "c2"))
|
|
72
|
+
.join(as("cte_c"), toColumn("posts", "post_parent", "c2"), toColumn("cte_c", "ID"));
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
.select(toColumn("cte_c", "depth"), toColumn("posts", "*"))
|
|
76
|
+
.join(as("cte_c"), toColumn("posts", "ID"), toColumn("cte_c", "ID"));
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
withParents(id) {
|
|
80
|
+
const { as, column: toColumn, get } = this.alias;
|
|
81
|
+
this.builder
|
|
82
|
+
.withRecursive(get("cte_p").table, (qb) => {
|
|
83
|
+
qb.select(toColumn("posts", "ID", "p"), toColumn("posts", "post_parent", "p"), this.builders.raw("0 as depth"))
|
|
84
|
+
.from(as("posts", "p"))
|
|
85
|
+
.where(toColumn("posts", "ID", "p"), id)
|
|
86
|
+
.where(toColumn("posts", "post_parent", "p"), ">", 0)
|
|
87
|
+
.union((qb) => {
|
|
88
|
+
qb.select(toColumn("posts", "ID", "p2"), toColumn("posts", "post_parent", "p2"), this.builders.raw(`${get("cte_p").key}.depth + 1`))
|
|
89
|
+
.from(as("posts", "p2"))
|
|
90
|
+
.join(as("cte_p"), toColumn("cte_p", "ID"), toColumn("posts", "post_parent", "p2"));
|
|
91
|
+
});
|
|
92
|
+
})
|
|
93
|
+
.select(toColumn("cte_p", "depth"), toColumn("posts", "*"))
|
|
94
|
+
.join(as("cte_p"), toColumn("posts", "ID"), toColumn("cte_p", "ID"));
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
select(columns) {
|
|
98
|
+
this.builder.select(columns);
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
whereIn(column, values) {
|
|
102
|
+
this.where(column, values);
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
where(column, value, op = "=") {
|
|
106
|
+
const { column: toColumn } = this.alias;
|
|
107
|
+
if (Array.isArray(value)) {
|
|
108
|
+
op = "in";
|
|
109
|
+
}
|
|
110
|
+
this.builder.where(toColumn((column == "meta_key" || column == "meta_value"
|
|
111
|
+
? "postmeta"
|
|
112
|
+
: "posts"), column), op, value);
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
whereLike(column, value, options) {
|
|
116
|
+
const { column: toColumn } = this.alias;
|
|
117
|
+
if (options?.not === true) {
|
|
118
|
+
this.builder.not;
|
|
119
|
+
}
|
|
120
|
+
this.builder.whereILike(toColumn("posts", column), `%${value}%`);
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
whereNotLike(column, value) {
|
|
124
|
+
return this.whereLike(column, value, { not: true });
|
|
125
|
+
}
|
|
126
|
+
countPublished(postType = "post") {
|
|
127
|
+
const { column } = this.alias;
|
|
128
|
+
this.from.builder
|
|
129
|
+
.count("* as count")
|
|
130
|
+
.where(column("posts", "post_status"), "publish")
|
|
131
|
+
.where(column("posts", "post_type"), postType)
|
|
132
|
+
.first();
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
withTerms(taxonomies, fn) {
|
|
136
|
+
const termsQuery = this.builders.get(terms_query_1.TermsQuery, this.builder, this.alias);
|
|
137
|
+
const { column } = this.alias;
|
|
138
|
+
this.builder
|
|
139
|
+
.__ref(termsQuery)
|
|
140
|
+
.joinTermRelationships(column("posts", "ID"))
|
|
141
|
+
.joinTermTaxonomy()
|
|
142
|
+
.joinTerms()
|
|
143
|
+
.andWhere((query) => {
|
|
144
|
+
for (const taxonomy of taxonomies) {
|
|
145
|
+
query.or.where("taxonomy", taxonomy);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
fn && fn(termsQuery);
|
|
149
|
+
return this;
|
|
150
|
+
}
|
|
151
|
+
// Used by term.trx.ts / _update_post_term_count
|
|
152
|
+
countTerm(termTaxonomyId, postStatuses, postTypes) {
|
|
153
|
+
const termsQuery = this.builders.get(terms_query_1.TermsQuery, this.builder, this.alias);
|
|
154
|
+
const { column } = this.alias;
|
|
155
|
+
this.from.builder
|
|
156
|
+
.count("* as count")
|
|
157
|
+
.__ref(termsQuery)
|
|
158
|
+
.joinTermRelationships(column("posts", "ID"))
|
|
159
|
+
.builder.__ref(this)
|
|
160
|
+
.whereIn("post_status", postStatuses)
|
|
161
|
+
.whereIn("post_type", postTypes)
|
|
162
|
+
.builder.__ref(termsQuery)
|
|
163
|
+
.where("terms_relationships.term_taxonomy_id", termTaxonomyId)
|
|
164
|
+
.builder.first();
|
|
165
|
+
return this;
|
|
166
|
+
}
|
|
167
|
+
// Used by term.trx.ts / _update_post_term_count
|
|
168
|
+
countAttachment(termTaxonomyId, postStatues) {
|
|
169
|
+
const terms = this.builders.get(terms_query_1.TermsQuery, this.builder, this.alias);
|
|
170
|
+
const { column } = this.alias;
|
|
171
|
+
this.from.builder
|
|
172
|
+
.count("* as count")
|
|
173
|
+
.__ref(terms)
|
|
174
|
+
.joinTermRelationships(column("posts", "ID"))
|
|
175
|
+
.builder.__ref(this)
|
|
176
|
+
.builder.andWhere((subBuilder) => {
|
|
177
|
+
this.builders
|
|
178
|
+
.get(PostsQuery_1, subBuilder, this.alias)
|
|
179
|
+
.whereIn("post_status", postStatues)
|
|
180
|
+
.builder.orWhere((subBuilder2) => {
|
|
181
|
+
const subBuilderWhere = this.builders.get(PostsQuery_1);
|
|
182
|
+
const { column: innerColumn } = subBuilderWhere.alias;
|
|
183
|
+
subBuilderWhere
|
|
184
|
+
.select(["post_status"])
|
|
185
|
+
.from.builder.whereRaw(`${innerColumn("posts", "ID")} = ${column("posts", "post_parent")}`);
|
|
186
|
+
this.builders
|
|
187
|
+
.get(PostsQuery_1, subBuilder2, this.alias)
|
|
188
|
+
.whereIn("post_status", ["inherit"])
|
|
189
|
+
.where("post_parent", 0, ">")
|
|
190
|
+
.builder.whereRaw(`(${subBuilderWhere.builder}) in (${postStatues
|
|
191
|
+
.map(() => "?")
|
|
192
|
+
.join(",")})`, postStatues);
|
|
193
|
+
});
|
|
194
|
+
})
|
|
195
|
+
.__ref(this)
|
|
196
|
+
.where("post_type", "attachment")
|
|
197
|
+
.builder.__ref(terms)
|
|
198
|
+
.where("terms_relationships.term_taxonomy_id", termTaxonomyId)
|
|
199
|
+
.builder.first();
|
|
200
|
+
return this;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
exports.PostsQuery = PostsQuery;
|
|
204
|
+
exports.PostsQuery = PostsQuery = PostsQuery_1 = __decorate([
|
|
205
|
+
(0, component_1.queryBuilder)(),
|
|
206
|
+
__metadata("design:paramtypes", [alias_1.Alias,
|
|
207
|
+
query_builders_1.QueryBuilders, Object])
|
|
208
|
+
], PostsQuery);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Alias } from "./alias";
|
|
2
|
+
import { QueryBuilders } from "./query-builders";
|
|
3
|
+
import type * as types from "../types";
|
|
4
|
+
export declare abstract class QueryBuilder<T> {
|
|
5
|
+
alias: Alias;
|
|
6
|
+
protected builders: QueryBuilders;
|
|
7
|
+
builder: types.QueryBuilder;
|
|
8
|
+
clazz: types.Constructor<T>;
|
|
9
|
+
constructor(alias: Alias, builders: QueryBuilders, builder: types.QueryBuilder, clazz: types.Constructor<T>);
|
|
10
|
+
abstract get from(): this;
|
|
11
|
+
get or(): this;
|
|
12
|
+
get not(): this;
|
|
13
|
+
count<T extends keyof types.Tables>(table: T, column: types.Columns<T>): this;
|
|
14
|
+
countGroupby<T extends keyof types.Tables>(table: T, column: types.Columns<T>): this;
|
|
15
|
+
andWhere(fn: (query: T) => void, alias?: Alias): this;
|
|
16
|
+
andWhereNot(func: (query: T) => void, alias?: Alias): this;
|
|
17
|
+
orWhere(fn: (query: T) => void, alias?: Alias): this;
|
|
18
|
+
orWhereNot(func: (query: T) => void, alias?: Alias): this;
|
|
19
|
+
usingQuery<T>(target: types.Constructor<T>, alias?: Alias): T;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=query-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder.d.ts","sourceRoot":"","sources":["../../src/query-builder/query-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC,8BAAsB,YAAY,CAAC,CAAC;IAEzB,KAAK,EAAE,KAAK;IACnB,SAAS,CAAC,QAAQ,EAAE,aAAa;IAC1B,OAAO,EAAE,KAAK,CAAC,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;gBAH3B,KAAK,EAAE,KAAK,EACT,QAAQ,EAAE,aAAa,EAC1B,OAAO,EAAE,KAAK,CAAC,YAAY,EAC3B,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAGpC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC;IAE1B,IAAI,EAAE,SAGL;IAED,IAAI,GAAG,SAGN;IAED,KAAK,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAWtE,YAAY,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,MAAM,EACvC,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAa1B,QAAQ,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK;IAY9C,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK;IAKnD,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK;IAY7C,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK;IAKlD,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,GACE,CAAC;CAE7D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryBuilder = void 0;
|
|
4
|
+
class QueryBuilder {
|
|
5
|
+
alias;
|
|
6
|
+
builders;
|
|
7
|
+
builder;
|
|
8
|
+
clazz;
|
|
9
|
+
constructor(alias, builders, builder, clazz) {
|
|
10
|
+
this.alias = alias;
|
|
11
|
+
this.builders = builders;
|
|
12
|
+
this.builder = builder;
|
|
13
|
+
this.clazz = clazz;
|
|
14
|
+
}
|
|
15
|
+
get or() {
|
|
16
|
+
this.builder.or.__ref(this);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
get not() {
|
|
20
|
+
this.builder.not.__ref(this);
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
count(table, column) {
|
|
24
|
+
const { column: toColumn } = this.alias;
|
|
25
|
+
this.builder
|
|
26
|
+
.clear("select")
|
|
27
|
+
.clear("offset")
|
|
28
|
+
.clear("group")
|
|
29
|
+
.countDistinct(`${toColumn(table, column)} as count`)
|
|
30
|
+
.first();
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
countGroupby(table, column) {
|
|
34
|
+
const { column: toColumn } = this.alias;
|
|
35
|
+
this.builder
|
|
36
|
+
.clear("select")
|
|
37
|
+
.clear("offset")
|
|
38
|
+
.clear("group")
|
|
39
|
+
.select(`${toColumn(table, column)} as ${column.toString()}`)
|
|
40
|
+
.count(`${toColumn(table, column)} as count`)
|
|
41
|
+
.groupBy(toColumn(table, column));
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
andWhere(fn, alias) {
|
|
45
|
+
this.builder.andWhere((subBuilder) => {
|
|
46
|
+
const query = this.builders.get(this.clazz, subBuilder, alias ?? this.alias);
|
|
47
|
+
fn(query);
|
|
48
|
+
});
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
andWhereNot(func, alias) {
|
|
52
|
+
this.builder.not.__ref(this).andWhere(func, alias);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
orWhere(fn, alias) {
|
|
56
|
+
this.builder.orWhere((subBuilder) => {
|
|
57
|
+
const query = this.builders.get(this.clazz, subBuilder, alias ?? this.alias);
|
|
58
|
+
fn(query);
|
|
59
|
+
});
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
orWhereNot(func, alias) {
|
|
63
|
+
this.builder.not.__ref(this).orWhere(func, alias);
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
usingQuery(target, alias) {
|
|
67
|
+
return this.builders.get(target, this.builder, alias);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.QueryBuilder = QueryBuilder;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Knex } from "knex";
|
|
2
|
+
import { Components } from "../core/components";
|
|
3
|
+
import { Tables } from "../core/tables";
|
|
4
|
+
import Database from "../database";
|
|
5
|
+
import * as types from "../types";
|
|
6
|
+
import { Alias } from "./alias";
|
|
7
|
+
export declare class QueryBuilders {
|
|
8
|
+
#private;
|
|
9
|
+
database: Database;
|
|
10
|
+
private components;
|
|
11
|
+
tables: Tables;
|
|
12
|
+
constructor(database: Database, components: Components, tables: Tables);
|
|
13
|
+
get queryBuilder(): Knex.QueryBuilder<any, any[]>;
|
|
14
|
+
getTableName(table: string): string;
|
|
15
|
+
raw(raw: any, args?: any): Knex.Raw<any>;
|
|
16
|
+
get<T>(target: types.Constructor<T>, builder?: Knex.QueryBuilder, alias?: Alias): T;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=query-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builders.d.ts","sourceRoot":"","sources":["../../src/query-builder/query-builders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAQ,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMhC,qBACa,aAAa;;IAGf,QAAQ,EAAE,QAAQ;IACzB,OAAO,CAAC,UAAU;IACX,MAAM,EAAE,MAAM;gBAFd,QAAQ,EAAE,QAAQ,EACjB,UAAU,EAAE,UAAU,EACvB,MAAM,EAAE,MAAM;IAMvB,IAAI,YAAY,kCAEf;IAED,YAAY,CAAC,KAAK,EAAE,MAAM;IAI1B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG;IAIxB,GAAG,CAAC,CAAC,EACH,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,EAC3B,KAAK,CAAC,EAAE,KAAK,GACZ,CAAC;CAUL"}
|