@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,71 @@
|
|
|
1
|
+
import { ROLE_CAPABILITY_ACTIONS, ROLE_CAPABILITIES } from "../constants";
|
|
2
|
+
|
|
3
|
+
export interface MapMetaCapArgs {
|
|
4
|
+
edit_user: [userId: number] | [];
|
|
5
|
+
remove_user: [userId: number] | [];
|
|
6
|
+
delete_post: [postId: number];
|
|
7
|
+
delete_page: [postId: number];
|
|
8
|
+
edit_post: [postId: number];
|
|
9
|
+
edit_page: [postId: number];
|
|
10
|
+
read_post: [postId: number];
|
|
11
|
+
read_page: [postId: number];
|
|
12
|
+
publish_post: [postId: number];
|
|
13
|
+
publish_page: [postId: number];
|
|
14
|
+
edit_post_meta: [objectId: number];
|
|
15
|
+
delete_post_meta: [objectId: number];
|
|
16
|
+
add_post_meta: [objectId: number];
|
|
17
|
+
edit_comment_meta: [objectId: number];
|
|
18
|
+
delete_comment_meta: [objectId: number];
|
|
19
|
+
add_comment_meta: [objectId: number];
|
|
20
|
+
edit_term_meta: [objectId: number];
|
|
21
|
+
delete_term_meta: [objectId: number];
|
|
22
|
+
add_term_meta: [objectId: number];
|
|
23
|
+
edit_user_meta: [objectId: number];
|
|
24
|
+
delete_user_meta: [objectId: number];
|
|
25
|
+
add_user_meta: [objectId: number];
|
|
26
|
+
edit_comment: [commentId: number];
|
|
27
|
+
edit_term: [termId: number];
|
|
28
|
+
delete_term: [termId: number];
|
|
29
|
+
assign_term: [termId: number];
|
|
30
|
+
create_app_password: [userId: number] | [];
|
|
31
|
+
list_app_passwords: [userId: number] | [];
|
|
32
|
+
read_app_password: [userId: number] | [];
|
|
33
|
+
edit_app_password: [userId: number] | [];
|
|
34
|
+
delete_app_passwords: [userId: number] | [];
|
|
35
|
+
delete_app_password: [userId: number] | [];
|
|
36
|
+
|
|
37
|
+
// In filter
|
|
38
|
+
create_users: [siteIds: number[]] | [];
|
|
39
|
+
edit_admin_roles: [blogId: number] | [];
|
|
40
|
+
edit_user_roles: [blogIds: number[]] | [];
|
|
41
|
+
manage_roles: [blogId: number] | [];
|
|
42
|
+
|
|
43
|
+
delete_user: [targetUserId: number];
|
|
44
|
+
manage_network_users: [blogIds: number[]] | [];
|
|
45
|
+
manage_network_user: [userId: number[]] | [];
|
|
46
|
+
manage_network: [siteIds: number[]] | [];
|
|
47
|
+
manage_network_options: [siteIds: number[]] | [];
|
|
48
|
+
|
|
49
|
+
manage_sites: [blogIds: number[]] | [];
|
|
50
|
+
delete_sites: [blogIds: number[]] | [];
|
|
51
|
+
create_sites: [blogIds: number[]] | [];
|
|
52
|
+
manage_options: [blogIds: number[]] | [];
|
|
53
|
+
|
|
54
|
+
manage_blog_users: [blogIds: number[]] | [];
|
|
55
|
+
manage_site_users: [siteIds: number[]] | [];
|
|
56
|
+
|
|
57
|
+
list_blog_users: [blogIds: number[]] | [];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type MapMetaCapArgsKeys = keyof MapMetaCapArgs;
|
|
61
|
+
|
|
62
|
+
export type RoleCapabilityActions =
|
|
63
|
+
| (typeof ROLE_CAPABILITY_ACTIONS)[number]
|
|
64
|
+
| (typeof ROLE_CAPABILITIES)[number]
|
|
65
|
+
| MapMetaCapArgsKeys;
|
|
66
|
+
|
|
67
|
+
export type TMapMetaCapArgs<T> = T extends keyof MapMetaCapArgs
|
|
68
|
+
? MapMetaCapArgs[T] extends Array<any> | undefined
|
|
69
|
+
? MapMetaCapArgs[T]
|
|
70
|
+
: any
|
|
71
|
+
: any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2
|
+
export type Abstract<T> = Function & { prototype: T };
|
|
3
|
+
export type Constructor<T = any> = new (...args: any[]) => T;
|
|
4
|
+
export type Class<T> = Abstract<T> | Constructor<T>;
|
|
5
|
+
|
|
6
|
+
export type JSONValue =
|
|
7
|
+
| string
|
|
8
|
+
| number
|
|
9
|
+
| boolean
|
|
10
|
+
| null
|
|
11
|
+
| { [x: string]: JSONValue }
|
|
12
|
+
| Array<JSONValue>;
|
|
13
|
+
|
|
14
|
+
export type DeepPartial<T> = {
|
|
15
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import * as val from "../validators";
|
|
4
|
+
import type { TaxonomyObject } from "./taxonomy";
|
|
5
|
+
import type { PostTypeObject, PostStatusObject } from "./post";
|
|
6
|
+
import type { DeepPartial } from "./common";
|
|
7
|
+
|
|
8
|
+
export type Config = z.infer<typeof val.config.config>;
|
|
9
|
+
export type Configs = z.infer<typeof val.config.configs>;
|
|
10
|
+
|
|
11
|
+
export type ConfigTaxonomy = Omit<TaxonomyObject, "objectType" | "_builtin"> & {
|
|
12
|
+
objectType?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ConfigPostTypeObject = Partial<
|
|
16
|
+
Omit<PostTypeObject[string], "_builtin" | "supports">
|
|
17
|
+
> & {
|
|
18
|
+
supports?: string[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ConfigPostStatusObject = Omit<
|
|
22
|
+
PostStatusObject[string],
|
|
23
|
+
"label" | "_builtin"
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type JSONWPConfig = DeepPartial<Exclude<Config, "database">> &
|
|
27
|
+
Required<{
|
|
28
|
+
staticAssetsPath: Config["staticAssetsPath"];
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
export type JSONConfigTaxonomy = Record<string, ConfigTaxonomy>;
|
|
32
|
+
export type JSONConfigPostTypeObject = Record<string, ConfigPostTypeObject>;
|
|
33
|
+
export type JSONConfigPostStatusObject = Record<string, ConfigPostStatusObject>;
|
package/types/crud.d.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { BlogCrud } from "../crud/blog.crud";
|
|
2
|
+
import { CommentCrud } from "../crud/comment.crud";
|
|
3
|
+
import { MetaCrud } from "../crud/meta.crud";
|
|
4
|
+
import { OptionsCrud } from "../crud/options.crud";
|
|
5
|
+
import { PostCrud } from "../crud/post.crud";
|
|
6
|
+
import { SiteCrud } from "../crud/site.crud";
|
|
7
|
+
import { SettingsCrud } from "../crud/settings.crud";
|
|
8
|
+
import { TermCrud } from "../crud/term.crud";
|
|
9
|
+
import { UserCrud } from "../crud/user.crud";
|
|
10
|
+
import { CrudUtil } from "../core/utils/crud.util";
|
|
11
|
+
import { Crud } from "../crud/crud";
|
|
12
|
+
import { RevisionCrud } from "../crud/revision.crud";
|
|
13
|
+
import { RolesCrud } from "../crud/roles.crud";
|
|
14
|
+
import { UserSelfRegistrationCrud } from "../crud/user-self-registration.crud";
|
|
15
|
+
|
|
16
|
+
export type ParseError = ReturnType<CrudUtil["parseError"]>;
|
|
17
|
+
|
|
18
|
+
type Operation =
|
|
19
|
+
| "list"
|
|
20
|
+
| "create"
|
|
21
|
+
| "get"
|
|
22
|
+
| "getAsUpsert"
|
|
23
|
+
| "update"
|
|
24
|
+
| "delete";
|
|
25
|
+
|
|
26
|
+
export type CrudKeys =
|
|
27
|
+
| "blog"
|
|
28
|
+
| "comment"
|
|
29
|
+
| "meta"
|
|
30
|
+
| "options"
|
|
31
|
+
| "post"
|
|
32
|
+
| "site"
|
|
33
|
+
| "term"
|
|
34
|
+
| "settings"
|
|
35
|
+
| "user"
|
|
36
|
+
| "revision"
|
|
37
|
+
| "roles";
|
|
38
|
+
|
|
39
|
+
type Context = "view" | "edit" | "embed";
|
|
40
|
+
|
|
41
|
+
interface CrudComponents {
|
|
42
|
+
blog: BlogCrud;
|
|
43
|
+
comment: CommentCrud;
|
|
44
|
+
meta: MetaCrud;
|
|
45
|
+
options: OptionsCrud;
|
|
46
|
+
post: PostCrud;
|
|
47
|
+
site: SiteCrud;
|
|
48
|
+
term: TermCrud;
|
|
49
|
+
settings: SettingsCrud;
|
|
50
|
+
user: UserCrud;
|
|
51
|
+
userSelfRegistration: UserSelfRegistrationCrud;
|
|
52
|
+
revision: RevisionCrud;
|
|
53
|
+
roles: RolesCrud;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// interface CrudOperations {
|
|
57
|
+
// blog: Exclude<Operation, "getAsUpsert">;
|
|
58
|
+
// comment: Operation;
|
|
59
|
+
// meta: Extract<Operation, "create" | "get" | "update" | "delete">;
|
|
60
|
+
// options: Extract<Operation, "get" | "update"> | "getAll";
|
|
61
|
+
// post: Operation | "trash" | "untrash";
|
|
62
|
+
// site: Exclude<Operation, "getAsUpsert">;
|
|
63
|
+
// settings: Extract<Operation, "get" | "update">;
|
|
64
|
+
// term: Exclude<Operation, "getAsUpsert"> | "taxonomies";
|
|
65
|
+
// user:
|
|
66
|
+
// | Operation
|
|
67
|
+
// | "updatePassword"
|
|
68
|
+
// | "updateRole"
|
|
69
|
+
// | "updateSuperAdmin"
|
|
70
|
+
// | "getAvailableSites"
|
|
71
|
+
// | "getBlogs";
|
|
72
|
+
// revision: Extract<Operation, "get" | "list">;
|
|
73
|
+
// roles: Exclude<Operation, "get" | "getAsUpsert"> | "count";
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
export type CrudParameters<
|
|
77
|
+
Component extends keyof CrudComponents,
|
|
78
|
+
Operation extends keyof CrudComponents[Component]
|
|
79
|
+
> = CrudComponents[Component][Operation] extends (...args: any) => any
|
|
80
|
+
? Parameters<CrudComponents[Component][Operation]>
|
|
81
|
+
: never;
|
|
82
|
+
|
|
83
|
+
export type CrudReturnType<
|
|
84
|
+
Component extends keyof CrudComponents,
|
|
85
|
+
Operation extends keyof CrudComponents[Component]
|
|
86
|
+
> = CrudComponents[Component][Operation] extends (...args: any) => any
|
|
87
|
+
? Awaited<ReturnType<CrudComponents[Component][Operation]>>
|
|
88
|
+
: never;
|
|
89
|
+
|
|
90
|
+
export type BlogOperations = Exclude<Operation, "getAsUpsert">;
|
|
91
|
+
|
|
92
|
+
export type BlogParams<T extends BlogOperations> = {
|
|
93
|
+
list: Parameters<BlogCrud["list"]>;
|
|
94
|
+
create: Parameters<BlogCrud["create"]>;
|
|
95
|
+
get: Parameters<BlogCrud["get"]>;
|
|
96
|
+
update: Parameters<BlogCrud["update"]>;
|
|
97
|
+
delete: Parameters<BlogCrud["delete"]>;
|
|
98
|
+
}[T];
|
|
99
|
+
|
|
100
|
+
export type CommentOperations = Operation;
|
|
101
|
+
|
|
102
|
+
export type CommentParams<T extends CommentOperations> = {
|
|
103
|
+
list: Parameters<CommentCrud["list"]>;
|
|
104
|
+
create: Parameters<CommentCrud["create"]>;
|
|
105
|
+
get: Parameters<CommentCrud["get"]>;
|
|
106
|
+
getAsUpsert: Parameters<CommentCrud["getAsUpsert"]>;
|
|
107
|
+
update: Parameters<CommentCrud["update"]>;
|
|
108
|
+
delete: Parameters<CommentCrud["delete"]>;
|
|
109
|
+
}[T];
|
|
110
|
+
|
|
111
|
+
export type MetaOperations = Extract<
|
|
112
|
+
Operation,
|
|
113
|
+
"create" | "get" | "update" | "delete"
|
|
114
|
+
>;
|
|
115
|
+
|
|
116
|
+
export type MetaParams<T extends MetaOperations> = {
|
|
117
|
+
create: Parameters<MetaCrud["create"]>;
|
|
118
|
+
get: Parameters<MetaCrud["get"]>;
|
|
119
|
+
update: Parameters<MetaCrud["update"]>;
|
|
120
|
+
delete: Parameters<MetaCrud["delete"]>;
|
|
121
|
+
}[T];
|
|
122
|
+
|
|
123
|
+
export type OptionsOperations = Extract<Operation, "get" | "update"> | "getAll";
|
|
124
|
+
|
|
125
|
+
export type OptionsParams<T extends OptionsOperations> = {
|
|
126
|
+
get: Parameters<OptionsCrud["get"]>;
|
|
127
|
+
getAll: Parameters<OptionsCrud["getAll"]>;
|
|
128
|
+
update: Parameters<OptionsCrud["update"]>;
|
|
129
|
+
}[T];
|
|
130
|
+
|
|
131
|
+
export type PostOperations = Operation;
|
|
132
|
+
|
|
133
|
+
export type PostParams<T extends PostOperations> = {
|
|
134
|
+
list: Parameters<PostCrud["list"]>;
|
|
135
|
+
create: Parameters<PostCrud["create"]>;
|
|
136
|
+
get: Parameters<PostCrud["get"]>;
|
|
137
|
+
getAsUpsert: Parameters<PostCrud["getAsUpsert"]>;
|
|
138
|
+
update: Parameters<PostCrud["update"]>;
|
|
139
|
+
delete: Parameters<PostCrud["delete"]>;
|
|
140
|
+
trash: Parameters<PostCrud["trash"]>;
|
|
141
|
+
untrash: Parameters<PostCrud["untrash"]>;
|
|
142
|
+
}[T];
|
|
143
|
+
|
|
144
|
+
export type SiteOperations = Exclude<Operation, "getAsUpsert">;
|
|
145
|
+
|
|
146
|
+
export type SiteParams<T extends SiteOperations> = {
|
|
147
|
+
list: Parameters<SiteCrud["list"]>;
|
|
148
|
+
create: Parameters<SiteCrud["create"]>;
|
|
149
|
+
get: Parameters<SiteCrud["get"]>;
|
|
150
|
+
update: Parameters<SiteCrud["update"]>;
|
|
151
|
+
delete: Parameters<SiteCrud["delete"]>;
|
|
152
|
+
}[T];
|
|
153
|
+
|
|
154
|
+
export type SettingsOperations = Extract<Operation, "get" | "update">;
|
|
155
|
+
|
|
156
|
+
export type SettingsParams<T extends SettingsOperations> = {
|
|
157
|
+
get: Parameters<SettingsCrud["get"]>;
|
|
158
|
+
update: Parameters<SettingsCrud["update"]>;
|
|
159
|
+
}[T];
|
|
160
|
+
|
|
161
|
+
export type TermOperations = Exclude<Operation, "getAsUpsert"> | "taxonomies";
|
|
162
|
+
|
|
163
|
+
export type TermParams<T extends TermOperations> = {
|
|
164
|
+
list: Parameters<TermCrud["list"]>;
|
|
165
|
+
create: Parameters<TermCrud["create"]>;
|
|
166
|
+
get: Parameters<TermCrud["get"]>;
|
|
167
|
+
update: Parameters<TermCrud["update"]>;
|
|
168
|
+
delete: Parameters<TermCrud["delete"]>;
|
|
169
|
+
taxonomies: Parameters<TermCrud["taxonomies"]>;
|
|
170
|
+
}[T];
|
|
171
|
+
|
|
172
|
+
export type UserOperations =
|
|
173
|
+
| Operation
|
|
174
|
+
| "updatePassword"
|
|
175
|
+
| "updateRole"
|
|
176
|
+
| "updateSuperAdmin"
|
|
177
|
+
| "getAvailableSites"
|
|
178
|
+
| "getBlogs";
|
|
179
|
+
|
|
180
|
+
export type UserParams<T extends UserOperations> = {
|
|
181
|
+
list: Parameters<UserCrud["list"]>;
|
|
182
|
+
create: Parameters<UserCrud["create"]>;
|
|
183
|
+
get: Parameters<UserCrud["get"]>;
|
|
184
|
+
getAsUpsert: Parameters<UserCrud["getAsUpsert"]>;
|
|
185
|
+
getAvailableSites: Parameters<UserCrud["getAvailableSites"]>;
|
|
186
|
+
getBlogs: Parameters<UserCrud["getBlogs"]>;
|
|
187
|
+
update: Parameters<UserCrud["update"]>;
|
|
188
|
+
updatePassword: Parameters<UserCrud["updatePassword"]>;
|
|
189
|
+
updateRole: Parameters<UserCrud["updateRole"]>;
|
|
190
|
+
updateSuperAdmin: Parameters<UserCrud["updateSuperAdmin"]>;
|
|
191
|
+
delete: Parameters<UserCrud["delete"]>;
|
|
192
|
+
}[T];
|
|
193
|
+
|
|
194
|
+
export type UserSelfRegistrationOperations =
|
|
195
|
+
| "update"
|
|
196
|
+
| "register"
|
|
197
|
+
| "activate"
|
|
198
|
+
| "registerWithoutActivation";
|
|
199
|
+
|
|
200
|
+
export type UserSelfRegistrationParams<
|
|
201
|
+
T extends UserSelfRegistrationOperations
|
|
202
|
+
> = {
|
|
203
|
+
update: Parameters<UserSelfRegistrationCrud["update"]>;
|
|
204
|
+
register: Parameters<UserSelfRegistrationCrud["register"]>;
|
|
205
|
+
activate: Parameters<UserSelfRegistrationCrud["activate"]>;
|
|
206
|
+
registerWithoutActivation: Parameters<
|
|
207
|
+
UserSelfRegistrationCrud["registerWithoutActivation"]
|
|
208
|
+
>;
|
|
209
|
+
}[T];
|
|
210
|
+
|
|
211
|
+
export type RevisionOperations = Extract<Operation, "get" | "list">;
|
|
212
|
+
|
|
213
|
+
export type RevisionParams<T extends RevisionOperations> = {
|
|
214
|
+
get: Parameters<RevisionCrud["get"]>;
|
|
215
|
+
list: Parameters<RevisionCrud["list"]>;
|
|
216
|
+
}[T];
|
|
217
|
+
|
|
218
|
+
export type RolesOperations =
|
|
219
|
+
| Extract<Operation, "create" | "list" | "update">
|
|
220
|
+
| "count";
|
|
221
|
+
|
|
222
|
+
export type RolesParams<T extends RolesOperations> = {
|
|
223
|
+
create: Parameters<RolesCrud["create"]>;
|
|
224
|
+
list: Parameters<RolesCrud["list"]>;
|
|
225
|
+
count: Parameters<RolesCrud["count"]>;
|
|
226
|
+
update: Parameters<RolesCrud["update"]>;
|
|
227
|
+
delete: Parameters<RolesCrud["delete"]>;
|
|
228
|
+
}[T];
|
|
229
|
+
|
|
230
|
+
export type Pagination = ReturnType<Crud["pagination"]>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import type * as val from "../validators";
|
|
4
|
+
|
|
5
|
+
export interface Tables {
|
|
6
|
+
blogmeta: WpBlogMeta;
|
|
7
|
+
blogs: WpBlogs;
|
|
8
|
+
commentmeta: WpCommentMeta;
|
|
9
|
+
comments: WpComments;
|
|
10
|
+
links: WpLinks;
|
|
11
|
+
options: WpOptions;
|
|
12
|
+
postmeta: WpPostMeta;
|
|
13
|
+
posts: WpPosts;
|
|
14
|
+
registration_log: WpRegistrationLog;
|
|
15
|
+
signups: WpSignups;
|
|
16
|
+
site: WpSite;
|
|
17
|
+
sitemeta: WpSiteMeta;
|
|
18
|
+
termmeta: WpTermMeta;
|
|
19
|
+
term_relationships: WpTermRelationships;
|
|
20
|
+
term_taxonomy: WpTermTaxonomy;
|
|
21
|
+
terms: WpTerms;
|
|
22
|
+
users: WpUsers;
|
|
23
|
+
usermeta: WpUserMeta;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type TableNames = keyof Tables;
|
|
27
|
+
export type Columns<K extends TableNames> = keyof Tables[K];
|
|
28
|
+
|
|
29
|
+
export interface WpBlogMeta extends z.infer<typeof val.database.wpBlogMeta> {}
|
|
30
|
+
export interface WpBlogs extends z.infer<typeof val.database.wpBlogs> {}
|
|
31
|
+
export interface WpCommentMeta
|
|
32
|
+
extends z.infer<typeof val.database.wpCommentMeta> {}
|
|
33
|
+
export interface WpComments extends z.infer<typeof val.database.wpComments> {}
|
|
34
|
+
export interface WpLinks extends z.infer<typeof val.database.wpLinks> {}
|
|
35
|
+
export interface WpOptions extends z.infer<typeof val.database.wpOptions> {}
|
|
36
|
+
export interface WpPostMeta extends z.infer<typeof val.database.wpPostMeta> {}
|
|
37
|
+
export interface WpPosts extends z.infer<typeof val.database.wpPosts> {}
|
|
38
|
+
export interface WpRegistrationLog
|
|
39
|
+
extends z.infer<typeof val.database.wpRegistrationLog> {}
|
|
40
|
+
export interface WpSignups extends z.infer<typeof val.database.wpSignups> {}
|
|
41
|
+
export interface WpSite extends z.infer<typeof val.database.wpSite> {}
|
|
42
|
+
export interface WpSiteMeta extends z.infer<typeof val.database.wpSiteMeta> {}
|
|
43
|
+
export interface WpTermMeta extends z.infer<typeof val.database.wpTermMeta> {}
|
|
44
|
+
export interface WpTerms extends z.infer<typeof val.database.wpTerms> {}
|
|
45
|
+
export interface WpTermRelationships
|
|
46
|
+
extends z.infer<typeof val.database.wpTermRelationships> {}
|
|
47
|
+
export interface WpTermTaxonomy
|
|
48
|
+
extends z.infer<typeof val.database.wpTermTaxonomy> {}
|
|
49
|
+
export interface WpUserMeta extends z.infer<typeof val.database.wpUserMeta> {}
|
|
50
|
+
export interface WpUsers extends z.infer<typeof val.database.wpUsers> {}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { User } from "../../core/user";
|
|
2
|
+
import type { LogLevel } from "../logging";
|
|
3
|
+
import { Context } from "../../core/context";
|
|
4
|
+
|
|
5
|
+
export interface Actions {
|
|
6
|
+
core_test_action: () => void;
|
|
7
|
+
core_test_async_action: () => Promise<void>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Triggered when the application context is initialized.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The application context.
|
|
13
|
+
* @returns void - No return value.
|
|
14
|
+
*/
|
|
15
|
+
core_init: (context: Context) => void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Triggered when the user requests a password reset.
|
|
19
|
+
*
|
|
20
|
+
* @param resetKey - The reset key.
|
|
21
|
+
* @param user - The user requesting the password reset.
|
|
22
|
+
* @param siteName - The name of the site.
|
|
23
|
+
* @param registration - Whether the reset key is generated while user self registration.
|
|
24
|
+
* @param context - The application context.
|
|
25
|
+
* @returns Promise<void> - A promise that resolves when the action is complete.
|
|
26
|
+
*/
|
|
27
|
+
core_reset_password: (
|
|
28
|
+
resetKey: string,
|
|
29
|
+
user: User,
|
|
30
|
+
siteName: string,
|
|
31
|
+
registration: boolean,
|
|
32
|
+
context: Context
|
|
33
|
+
) => Promise<void>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Triggered when a new user is registered.
|
|
37
|
+
*
|
|
38
|
+
* @param userId - The ID of the user.
|
|
39
|
+
* @returns void
|
|
40
|
+
*/
|
|
41
|
+
core_register_new_user: (
|
|
42
|
+
activationKey: string,
|
|
43
|
+
userLogin: string,
|
|
44
|
+
email: string,
|
|
45
|
+
context: Context
|
|
46
|
+
) => Promise<void>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* For logging messages.
|
|
50
|
+
*
|
|
51
|
+
* @param message - The message to log.
|
|
52
|
+
* @param meta - Additional metadata to log.
|
|
53
|
+
* @param level - The log level.
|
|
54
|
+
* @returns void - No return value.
|
|
55
|
+
*/
|
|
56
|
+
core_logging: (
|
|
57
|
+
message: string,
|
|
58
|
+
meta: Record<string, any> | undefined,
|
|
59
|
+
level: LogLevel
|
|
60
|
+
) => void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type ActionParameters<T extends keyof Actions> = Parameters<Actions[T]>;
|
|
64
|
+
export type ActionsReturnType<T extends keyof Actions> = ReturnType<Actions[T]>;
|
|
65
|
+
export type ActionsAwaitedReturnType<T extends keyof Actions> = Awaited<
|
|
66
|
+
ReturnType<Actions[T]>
|
|
67
|
+
>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Filters, FilterParameters } from "./filters";
|
|
2
|
+
export type HooksCommandPrefix = "__command_";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
export type CommandFilter<T1, T2 = null> = {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type CommandFilterSecondParam<T extends keyof Filters> =
|
|
10
|
+
FilterParameters<T>[1] extends NonNullable<FilterParameters<T>[1]>
|
|
11
|
+
? Exclude<FilterParameters<T>, FilterParameters<T>[0]>
|
|
12
|
+
: null;
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
export type CommandAction<T> = {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { RoleCapabilityActions } from "../capabilities";
|
|
2
|
+
import { Context } from "../../core/context";
|
|
3
|
+
import { User } from "../../core/user";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a collection of filters.
|
|
7
|
+
*/
|
|
8
|
+
export interface Filters {
|
|
9
|
+
/**
|
|
10
|
+
* Filter for testing a filter.
|
|
11
|
+
*
|
|
12
|
+
* @param data - The data to be filtered.
|
|
13
|
+
* @returns The filtered data.
|
|
14
|
+
*/
|
|
15
|
+
test_filter: (data: number) => number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Filter for validating a user's capabilities.
|
|
19
|
+
*
|
|
20
|
+
* @param capabilities - The set of capabilities to validate.
|
|
21
|
+
* @param context - The application context.
|
|
22
|
+
* @param action - The action being performed.
|
|
23
|
+
* @param user - The user performing the action.
|
|
24
|
+
* @param args - Additional arguments passed to the filter.
|
|
25
|
+
* @returns A promise that resolves with the validated capabilities.
|
|
26
|
+
*/
|
|
27
|
+
core_map_meta_cap: (
|
|
28
|
+
capabilities: Set<string>,
|
|
29
|
+
context: Context,
|
|
30
|
+
action: RoleCapabilityActions,
|
|
31
|
+
user: User,
|
|
32
|
+
...args: any
|
|
33
|
+
) => Promise<Set<string>>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Filter for validating a user's capabilities of managing network users.
|
|
37
|
+
*
|
|
38
|
+
* @param capabilities - The set of capabilities to validate.
|
|
39
|
+
* @param context - The application context.
|
|
40
|
+
* @param user - The user performing the action.
|
|
41
|
+
* @param args - Additional arguments passed to the filter.
|
|
42
|
+
* @returns A promise that resolves with the validated capabilities.
|
|
43
|
+
*/
|
|
44
|
+
core_map_meta_cap_manage_network_users: (
|
|
45
|
+
capabilities: Set<string>,
|
|
46
|
+
context: Context,
|
|
47
|
+
user: User,
|
|
48
|
+
...args: any
|
|
49
|
+
) => Promise<Set<string>>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Filter for validating a user's capabilities of deleting a user.
|
|
53
|
+
*
|
|
54
|
+
* @param capabilities - The set of capabilities to validate.
|
|
55
|
+
* @param context - The application context.
|
|
56
|
+
* @param user - The user performing the action.
|
|
57
|
+
* @param args - Additional arguments passed to the filter.
|
|
58
|
+
* @returns A promise that resolves with the validated capabilities.
|
|
59
|
+
*/
|
|
60
|
+
core_map_meta_cap_delete_user: (
|
|
61
|
+
capabilities: Set<string>,
|
|
62
|
+
context: Context,
|
|
63
|
+
user: User,
|
|
64
|
+
...args: any
|
|
65
|
+
) => Promise<Set<string>>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Filter for generating a unique user login.
|
|
69
|
+
*
|
|
70
|
+
* @param userLogin - Randomly generated user login
|
|
71
|
+
* @returns A promise that resolves with the unique user login.
|
|
72
|
+
*/
|
|
73
|
+
core_unigue_user_login: (userLogin: string) => Promise<string>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
type Parameters<T extends (...args: any) => any> = T extends (
|
|
77
|
+
...args: infer P
|
|
78
|
+
) => any
|
|
79
|
+
? P
|
|
80
|
+
: never;
|
|
81
|
+
|
|
82
|
+
export type FilterParameters<T extends keyof Filters> = Parameters<Filters[T]>;
|
|
83
|
+
export type FiltersReturnType<T extends keyof Filters> = ReturnType<Filters[T]>;
|
|
84
|
+
export type FiltersAwaitedReturnType<T extends keyof Filters> = Awaited<
|
|
85
|
+
ReturnType<Filters[T]>
|
|
86
|
+
>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type * from "./actions";
|
|
2
|
+
export type * from "./filters";
|
|
3
|
+
export type * from "./command";
|
|
4
|
+
|
|
5
|
+
import { Hooks as HooksCore } from "../../core/hooks/hooks";
|
|
6
|
+
import { Filters } from "./filters";
|
|
7
|
+
import { Actions } from "./actions";
|
|
8
|
+
|
|
9
|
+
export type Hooks<TFilters = Filters, TActions = Actions> = InstanceType<
|
|
10
|
+
typeof HooksCore<TFilters, TActions>
|
|
11
|
+
>;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type * from "./common";
|
|
2
|
+
export type * from "./component";
|
|
3
|
+
export type * from "./config";
|
|
4
|
+
export type * from "./role";
|
|
5
|
+
export type * from "./query-builder";
|
|
6
|
+
export type * from "./database";
|
|
7
|
+
export type * from "./capabilities";
|
|
8
|
+
export type * from "./taxonomy";
|
|
9
|
+
export type * from "./post";
|
|
10
|
+
export type * as validating from "./validating";
|
|
11
|
+
export type * from "./meta";
|
|
12
|
+
export type * from "./schema";
|
|
13
|
+
export type * as hooks from "./hooks/index.d";
|
|
14
|
+
export type * as crud from "./crud";
|
|
15
|
+
export type * from "./options";
|
|
16
|
+
export type * as trx from "./transactions";
|
|
17
|
+
export type * from "./user";
|
|
18
|
+
export type * from "./logging";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LogLevel = "debug" | "info" | "warn" | "error";
|
package/types/meta.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type MetaTable = "post" | "comment" | "blog" | "term" | "user" | "site";
|
|
2
|
+
export type MetaColumns =
|
|
3
|
+
| "meta_id"
|
|
4
|
+
| `${MetaTable}_id`
|
|
5
|
+
| "meta_key"
|
|
6
|
+
| "meta_value";
|
|
7
|
+
//export type MetaColumns = Extract<Columns, "meta_key" | "meta_value">;
|
|
8
|
+
export type MetaKey = Extract<MetaColumns, "meta_key">;
|
|
9
|
+
export type MetaValue = Extract<MetaColumns, "meta_value">;
|
package/types/post.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as defaults from "../defaults";
|
|
2
|
+
|
|
3
|
+
export interface PostTypeExtend {}
|
|
4
|
+
|
|
5
|
+
export type PostType =
|
|
6
|
+
| (typeof defaults.postTypes)[number]
|
|
7
|
+
| keyof PostTypeExtend;
|
|
8
|
+
|
|
9
|
+
type PostTypeSupports =
|
|
10
|
+
| "title"
|
|
11
|
+
| "editor"
|
|
12
|
+
| "author"
|
|
13
|
+
| "thumbnail"
|
|
14
|
+
| "excerpt"
|
|
15
|
+
| "trackbacks"
|
|
16
|
+
| "custom-fields"
|
|
17
|
+
| "comments"
|
|
18
|
+
| "revisions"
|
|
19
|
+
| "post-formats"
|
|
20
|
+
| "page-attributes";
|
|
21
|
+
|
|
22
|
+
export type PostTypeObject = Record<
|
|
23
|
+
string,
|
|
24
|
+
{
|
|
25
|
+
supports: PostTypeSupports[];
|
|
26
|
+
capabilityType: string | [string, string];
|
|
27
|
+
deleteWithUser: boolean;
|
|
28
|
+
mapMetaCap: boolean;
|
|
29
|
+
capabilities?: Record<string, string>;
|
|
30
|
+
hierarchical?: boolean;
|
|
31
|
+
showInRest: boolean;
|
|
32
|
+
publiclyQueryable?: boolean;
|
|
33
|
+
_builtin: boolean;
|
|
34
|
+
public: boolean;
|
|
35
|
+
}
|
|
36
|
+
>;
|
|
37
|
+
|
|
38
|
+
export interface PostStatusExtend {}
|
|
39
|
+
|
|
40
|
+
export type PostStatus =
|
|
41
|
+
| (typeof defaults.postStatuses)[number]
|
|
42
|
+
| keyof PostStatusExtend;
|
|
43
|
+
|
|
44
|
+
export type PostStatusObject = Record<
|
|
45
|
+
string,
|
|
46
|
+
{
|
|
47
|
+
label: string;
|
|
48
|
+
public?: boolean;
|
|
49
|
+
protected?: boolean;
|
|
50
|
+
private?: boolean;
|
|
51
|
+
internal?: boolean;
|
|
52
|
+
_builtin: boolean;
|
|
53
|
+
}
|
|
54
|
+
>;
|