@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
package/core/roles.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RoleNames } from "../types";
|
|
2
|
+
import { Vars } from "./vars";
|
|
3
|
+
import type * as types from "../types";
|
|
4
|
+
import { Logger } from "./logger";
|
|
5
|
+
export declare class Roles {
|
|
6
|
+
private vars;
|
|
7
|
+
private logger;
|
|
8
|
+
constructor(vars: Vars, logger: Logger);
|
|
9
|
+
set(roles: types.Roles): void;
|
|
10
|
+
get<T = "anonymous">(name: RoleNames | T): types.Role | undefined;
|
|
11
|
+
get all(): Record<string, {
|
|
12
|
+
name: string;
|
|
13
|
+
capabilities: string[];
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/core/roles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,qBACa,KAAK;IACJ,OAAO,CAAC,IAAI;IAAQ,OAAO,CAAC,MAAM;gBAA1B,IAAI,EAAE,IAAI,EAAU,MAAM,EAAE,MAAM;IAEtD,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK;IAWtB,GAAG,CAAC,CAAC,GAAG,WAAW,EAAE,IAAI,EAAE,SAAS,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,SAAS;IASjE,IAAI,GAAG;;;OAEN;CACF"}
|
package/core/roles.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.Roles = void 0;
|
|
46
|
+
const component_1 = require("../decorators/component");
|
|
47
|
+
const val = __importStar(require("../validators"));
|
|
48
|
+
const vars_1 = require("./vars");
|
|
49
|
+
const logger_1 = require("./logger");
|
|
50
|
+
let Roles = class Roles {
|
|
51
|
+
vars;
|
|
52
|
+
logger;
|
|
53
|
+
constructor(vars, logger) {
|
|
54
|
+
this.vars = vars;
|
|
55
|
+
this.logger = logger;
|
|
56
|
+
}
|
|
57
|
+
set(roles) {
|
|
58
|
+
try {
|
|
59
|
+
this.vars.USER_ROLES = {
|
|
60
|
+
...this.vars.USER_ROLES,
|
|
61
|
+
...val.roles.roles.parse(roles),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
this.logger.warn(`Validation error: ${error}`, { error });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
get(name) {
|
|
69
|
+
try {
|
|
70
|
+
return this.vars.USER_ROLES[name] ?? undefined;
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
throw new Error(`Invalid role ${name}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
get all() {
|
|
77
|
+
return this.vars.USER_ROLES;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.Roles = Roles;
|
|
81
|
+
exports.Roles = Roles = __decorate([
|
|
82
|
+
(0, component_1.component)(),
|
|
83
|
+
__metadata("design:paramtypes", [vars_1.Vars, logger_1.Logger])
|
|
84
|
+
], Roles);
|
package/core/schema.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Config } from "../config";
|
|
2
|
+
import { SchemaBuilder } from "../schema-builder/schema-builder";
|
|
3
|
+
type SchemaScope = "all" | "blog" | "global" | "ms_global";
|
|
4
|
+
export declare class Schema {
|
|
5
|
+
private schemaBuilder;
|
|
6
|
+
private config;
|
|
7
|
+
constructor(schemaBuilder: SchemaBuilder, config: Config);
|
|
8
|
+
usingBlog(id: number): this;
|
|
9
|
+
build(scope?: SchemaScope | ""): Promise<void>;
|
|
10
|
+
dropBlog(blogId: number): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGjE,KAAK,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE3D,qBACa,MAAM;IACL,OAAO,CAAC,aAAa;IAAiB,OAAO,CAAC,MAAM;gBAA5C,aAAa,EAAE,aAAa,EAAU,MAAM,EAAE,MAAM;IAExE,SAAS,CAAC,EAAE,EAAE,MAAM;IAMd,KAAK,CAAC,KAAK,GAAE,WAAW,GAAG,EAAU;IAsCrC,QAAQ,CAAC,MAAM,EAAE,MAAM;CAgB9B"}
|
package/core/schema.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Schema = void 0;
|
|
13
|
+
const config_1 = require("../config");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
15
|
+
const component_1 = require("../decorators/component");
|
|
16
|
+
const schema_builder_1 = require("../schema-builder/schema-builder");
|
|
17
|
+
let Schema = class Schema {
|
|
18
|
+
schemaBuilder;
|
|
19
|
+
config;
|
|
20
|
+
constructor(schemaBuilder, config) {
|
|
21
|
+
this.schemaBuilder = schemaBuilder;
|
|
22
|
+
this.config = config;
|
|
23
|
+
}
|
|
24
|
+
usingBlog(id) {
|
|
25
|
+
this.schemaBuilder.tables.index = id;
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
// dbDelta / make_db_current_silent / wp_get_db_schema
|
|
29
|
+
async build(scope = "all") {
|
|
30
|
+
let tableNames = [];
|
|
31
|
+
switch (scope) {
|
|
32
|
+
case "blog":
|
|
33
|
+
tableNames = constants_1.DEFAULT_DATABASE_TABLES.blog;
|
|
34
|
+
break;
|
|
35
|
+
case "global":
|
|
36
|
+
tableNames = [
|
|
37
|
+
...constants_1.DEFAULT_DATABASE_TABLES.global,
|
|
38
|
+
...(this.config.isMultiSite()
|
|
39
|
+
? constants_1.DEFAULT_DATABASE_TABLES.ms_global
|
|
40
|
+
: []),
|
|
41
|
+
];
|
|
42
|
+
break;
|
|
43
|
+
case "ms_global":
|
|
44
|
+
tableNames = constants_1.DEFAULT_DATABASE_TABLES.ms_global;
|
|
45
|
+
break;
|
|
46
|
+
case "all":
|
|
47
|
+
default:
|
|
48
|
+
tableNames = [
|
|
49
|
+
...constants_1.DEFAULT_DATABASE_TABLES.global,
|
|
50
|
+
...constants_1.DEFAULT_DATABASE_TABLES.blog,
|
|
51
|
+
...(this.config.isMultiSite()
|
|
52
|
+
? constants_1.DEFAULT_DATABASE_TABLES.ms_global
|
|
53
|
+
: []),
|
|
54
|
+
];
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
for (const tableName of tableNames) {
|
|
58
|
+
const builderList = await this.schemaBuilder.get(tableName);
|
|
59
|
+
for (const builder of builderList) {
|
|
60
|
+
await builder;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Part of wp_uninitialize_site
|
|
65
|
+
async dropBlog(blogId) {
|
|
66
|
+
const currentBlogId = this.schemaBuilder.tables.index;
|
|
67
|
+
if (blogId !== currentBlogId) {
|
|
68
|
+
this.usingBlog(blogId);
|
|
69
|
+
}
|
|
70
|
+
const tableNames = constants_1.DEFAULT_DATABASE_TABLES.blog;
|
|
71
|
+
for (const tableName of tableNames) {
|
|
72
|
+
await this.schemaBuilder.drop(tableName);
|
|
73
|
+
}
|
|
74
|
+
if (blogId !== currentBlogId) {
|
|
75
|
+
this.usingBlog(currentBlogId);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.Schema = Schema;
|
|
80
|
+
exports.Schema = Schema = __decorate([
|
|
81
|
+
(0, component_1.component)({ scope: constants_1.Scope.Transient }),
|
|
82
|
+
__metadata("design:paramtypes", [schema_builder_1.SchemaBuilder, config_1.Config])
|
|
83
|
+
], Schema);
|
package/core/site.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Meta } from "./meta";
|
|
2
|
+
import { QueryUtil } from "./utils/query.util";
|
|
3
|
+
import type * as types from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-site.php
|
|
6
|
+
*/
|
|
7
|
+
export declare class Site {
|
|
8
|
+
meta: Meta;
|
|
9
|
+
private queryUtil;
|
|
10
|
+
private siteRef;
|
|
11
|
+
private blogRef;
|
|
12
|
+
private _props;
|
|
13
|
+
constructor(meta: Meta, queryUtil: QueryUtil, siteRef: number | string, blogRef: number | string | undefined, _props: {
|
|
14
|
+
site: Partial<types.Tables["site"]>;
|
|
15
|
+
blog: Partial<types.Tables["blogs"]> & {
|
|
16
|
+
blog_id: number;
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
get props(): {
|
|
20
|
+
site: Partial<types.Tables["site"]>;
|
|
21
|
+
blog: Partial<types.Tables["blogs"]> & {
|
|
22
|
+
blog_id: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
setBlog(b: number | string): Promise<void>;
|
|
26
|
+
private init;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=site.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../src/core/site.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC;;GAEG;AACH,qBACa,IAAI;IAEN,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,MAAM;gBAJP,IAAI,EAAE,IAAI,EACT,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,YAAI,EAC5B,MAAM,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACpC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG;YACrC,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;IAQH,IAAI,KAAK;cAZC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;cAC7B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG;YACrC,OAAO,EAAE,MAAM,CAAC;SACjB;MAWJ;IAEK,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;YAiBlB,IAAI;CAUnB"}
|
package/core/site.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.Site = void 0;
|
|
46
|
+
const constants_1 = require("../constants");
|
|
47
|
+
const async_init_1 = require("../decorators/async-init");
|
|
48
|
+
const component_1 = require("../decorators/component");
|
|
49
|
+
const val = __importStar(require("../validators"));
|
|
50
|
+
const meta_1 = require("./meta");
|
|
51
|
+
const query_util_1 = require("./utils/query.util");
|
|
52
|
+
/**
|
|
53
|
+
* https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-site.php
|
|
54
|
+
*/
|
|
55
|
+
let Site = class Site {
|
|
56
|
+
meta;
|
|
57
|
+
queryUtil;
|
|
58
|
+
siteRef;
|
|
59
|
+
blogRef;
|
|
60
|
+
_props;
|
|
61
|
+
constructor(meta, queryUtil, siteRef, blogRef = 1, _props) {
|
|
62
|
+
this.meta = meta;
|
|
63
|
+
this.queryUtil = queryUtil;
|
|
64
|
+
this.siteRef = siteRef;
|
|
65
|
+
this.blogRef = blogRef;
|
|
66
|
+
this._props = _props;
|
|
67
|
+
//Set default if _props is not passed
|
|
68
|
+
if (!this._props) {
|
|
69
|
+
this._props = { site: { id: 1 }, blog: { blog_id: 1 } };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
get props() {
|
|
73
|
+
return this._props;
|
|
74
|
+
}
|
|
75
|
+
async setBlog(b) {
|
|
76
|
+
const blog = (await this.queryUtil.blogs((query) => {
|
|
77
|
+
query.get(b);
|
|
78
|
+
}, val.database.wpBlogs)) ?? this._props.blog;
|
|
79
|
+
if (this._props.site.id !== blog.site_id) {
|
|
80
|
+
throw new Error(`Site Id doesn't match ${this._props.site.id} - ${blog.site_id}`);
|
|
81
|
+
}
|
|
82
|
+
this._props.blog = blog;
|
|
83
|
+
this.blogRef = b;
|
|
84
|
+
}
|
|
85
|
+
async init() {
|
|
86
|
+
this._props.site =
|
|
87
|
+
(await this.queryUtil.sites((query) => {
|
|
88
|
+
query.get(this.siteRef);
|
|
89
|
+
}, val.database.wpSite)) ?? this._props.site;
|
|
90
|
+
await this.setBlog(this.blogRef);
|
|
91
|
+
this._props.site.id && this.meta.set("site", this._props.site.id);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.Site = Site;
|
|
95
|
+
__decorate([
|
|
96
|
+
async_init_1.asyncInit,
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", []),
|
|
99
|
+
__metadata("design:returntype", Promise)
|
|
100
|
+
], Site.prototype, "init", null);
|
|
101
|
+
exports.Site = Site = __decorate([
|
|
102
|
+
(0, component_1.component)({ scope: constants_1.Scope.Transient }),
|
|
103
|
+
__metadata("design:paramtypes", [meta_1.Meta,
|
|
104
|
+
query_util_1.QueryUtil, Object, Object, Object])
|
|
105
|
+
], Site);
|
package/core/tables.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Config } from "../config";
|
|
2
|
+
import { Vars } from "./vars";
|
|
3
|
+
import type * as types from "../types";
|
|
4
|
+
export declare class Tables {
|
|
5
|
+
#private;
|
|
6
|
+
private config;
|
|
7
|
+
private vars;
|
|
8
|
+
constructor(config: Config, vars: Vars);
|
|
9
|
+
private get indexInVars();
|
|
10
|
+
resetIndex(): void;
|
|
11
|
+
get index(): number;
|
|
12
|
+
set index(index: number);
|
|
13
|
+
get prefix(): string;
|
|
14
|
+
get basePrefix(): string;
|
|
15
|
+
get(name: string): string;
|
|
16
|
+
get(name: types.TableNames): string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/core/tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,qBACa,MAAM;;IAEL,OAAO,CAAC,MAAM;IAAU,OAAO,CAAC,IAAI;gBAA5B,MAAM,EAAE,MAAM,EAAU,IAAI,EAAE,IAAI;IAEtD,OAAO,KAAK,WAAW,GAEtB;IAED,UAAU;IAIV,IAAI,KAAK,IAUQ,MAAM,CAFtB;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAItB;IAED,IAAI,MAAM,WAGT;IAED,IAAI,UAAU,WAEb;IAED,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IACzB,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,GAAG,MAAM;CAUpC"}
|
package/core/tables.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Tables = void 0;
|
|
13
|
+
const config_1 = require("../config");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
15
|
+
const component_1 = require("../decorators/component");
|
|
16
|
+
const vars_1 = require("./vars");
|
|
17
|
+
let Tables = class Tables {
|
|
18
|
+
config;
|
|
19
|
+
vars;
|
|
20
|
+
#multiSiteIndex = -99;
|
|
21
|
+
constructor(config, vars) {
|
|
22
|
+
this.config = config;
|
|
23
|
+
this.vars = vars;
|
|
24
|
+
}
|
|
25
|
+
get indexInVars() {
|
|
26
|
+
return this.vars.TABLES_MS_CURRENT_INDEX ?? 0;
|
|
27
|
+
}
|
|
28
|
+
resetIndex() {
|
|
29
|
+
this.#multiSiteIndex = -99;
|
|
30
|
+
}
|
|
31
|
+
get index() {
|
|
32
|
+
if (this.config.isMultiSite()) {
|
|
33
|
+
if (this.#multiSiteIndex > 0) {
|
|
34
|
+
return this.#multiSiteIndex;
|
|
35
|
+
}
|
|
36
|
+
return this.indexInVars;
|
|
37
|
+
}
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
set index(index) {
|
|
41
|
+
if (this.config.isMultiSite()) {
|
|
42
|
+
this.#multiSiteIndex = index;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
get prefix() {
|
|
46
|
+
const msPrefex = this.index > 1 ? `${this.index}_` : "";
|
|
47
|
+
return `${this.config.config.tablePrefix}${msPrefex}`;
|
|
48
|
+
}
|
|
49
|
+
get basePrefix() {
|
|
50
|
+
return this.config.config.tablePrefix;
|
|
51
|
+
}
|
|
52
|
+
get(name) {
|
|
53
|
+
if (this.config.isMultiSite() &&
|
|
54
|
+
constants_1.DEFAULT_DATABASE_TABLES.blog.includes(name)) {
|
|
55
|
+
return `${this.prefix}${name}`;
|
|
56
|
+
}
|
|
57
|
+
return `${this.config.config.tablePrefix}${name}`;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.Tables = Tables;
|
|
61
|
+
exports.Tables = Tables = __decorate([
|
|
62
|
+
(0, component_1.component)({ scope: constants_1.Scope.Transient }),
|
|
63
|
+
__metadata("design:paramtypes", [config_1.Config, vars_1.Vars])
|
|
64
|
+
], Tables);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Config } from "../config";
|
|
3
|
+
import * as val from "../validators";
|
|
4
|
+
import { Components } from "./components";
|
|
5
|
+
import type * as types from "../types";
|
|
6
|
+
import { Logger } from "./logger";
|
|
7
|
+
type Props = z.infer<typeof val.config.config>["taxonomy"]["settings"][string] & {
|
|
8
|
+
default_term: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class Taxonomy {
|
|
11
|
+
#private;
|
|
12
|
+
private config;
|
|
13
|
+
private components;
|
|
14
|
+
private key;
|
|
15
|
+
constructor(config: Config, components: Components, logger: Logger, key: string);
|
|
16
|
+
get isDefault(): boolean;
|
|
17
|
+
get name(): types.TaxonomyName;
|
|
18
|
+
get props(): Props | undefined;
|
|
19
|
+
withProps(props: Partial<Props>): this;
|
|
20
|
+
private init;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=taxonomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../src/core/taxonomy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAClB,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CACzB,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG;IAClC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AASF,qBACa,QAAQ;;IAIjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAElB,OAAO,CAAC,GAAG;gBAHH,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EAC9B,MAAM,EAAE,MAAM,EACN,GAAG,EAAE,MAAM;IAWrB,IAAI,SAAS,YAEZ;IAED,IAAI,IAAI,IACa,KAAK,CAAC,YAAY,CACtC;IAED,IAAI,KAAK,sBAER;IAED,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC;YAMjB,IAAI;CAenB"}
|
package/core/taxonomy.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Taxonomy = void 0;
|
|
13
|
+
const config_1 = require("../config");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
15
|
+
const async_init_1 = require("../decorators/async-init");
|
|
16
|
+
const component_1 = require("../decorators/component");
|
|
17
|
+
const components_1 = require("./components");
|
|
18
|
+
const taxonomy_util_1 = require("./utils/taxonomy.util");
|
|
19
|
+
const logger_1 = require("./logger");
|
|
20
|
+
const defaultCapabilities = {
|
|
21
|
+
manage_terms: "manage_categories",
|
|
22
|
+
edit_terms: "manage_categories",
|
|
23
|
+
delete_terms: "manage_categories",
|
|
24
|
+
assign_terms: "edit_posts",
|
|
25
|
+
};
|
|
26
|
+
let Taxonomy = class Taxonomy {
|
|
27
|
+
config;
|
|
28
|
+
components;
|
|
29
|
+
key;
|
|
30
|
+
#props;
|
|
31
|
+
#isDefault;
|
|
32
|
+
constructor(config, components, logger, key) {
|
|
33
|
+
this.config = config;
|
|
34
|
+
this.components = components;
|
|
35
|
+
this.key = key;
|
|
36
|
+
if (!this.config.config.taxonomy.settings[key]) {
|
|
37
|
+
logger.info(`Taxonomy not found: ${key}`);
|
|
38
|
+
this.#props = undefined;
|
|
39
|
+
this.#isDefault = true;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.#isDefault = false;
|
|
43
|
+
}
|
|
44
|
+
get isDefault() {
|
|
45
|
+
return this.#isDefault;
|
|
46
|
+
}
|
|
47
|
+
get name() {
|
|
48
|
+
return this.key;
|
|
49
|
+
}
|
|
50
|
+
get props() {
|
|
51
|
+
return this.#props;
|
|
52
|
+
}
|
|
53
|
+
withProps(props) {
|
|
54
|
+
this.#props = { ...this.#props, ...props };
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
async init() {
|
|
58
|
+
const defaultTerm = await this.components
|
|
59
|
+
.get(taxonomy_util_1.TaxonomyUtil)
|
|
60
|
+
.getDefaultTerm(this.key);
|
|
61
|
+
this.#props = {
|
|
62
|
+
...this.config.config.taxonomy.settings[this.key],
|
|
63
|
+
default_term: defaultTerm,
|
|
64
|
+
};
|
|
65
|
+
this.#props.capabilities = {
|
|
66
|
+
...defaultCapabilities,
|
|
67
|
+
...this.#props.capabilities,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
exports.Taxonomy = Taxonomy;
|
|
72
|
+
__decorate([
|
|
73
|
+
async_init_1.asyncInit,
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", []),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], Taxonomy.prototype, "init", null);
|
|
78
|
+
exports.Taxonomy = Taxonomy = __decorate([
|
|
79
|
+
(0, component_1.component)({ scope: constants_1.Scope.Transient }),
|
|
80
|
+
__metadata("design:paramtypes", [config_1.Config,
|
|
81
|
+
components_1.Components,
|
|
82
|
+
logger_1.Logger, String])
|
|
83
|
+
], Taxonomy);
|
package/core/term.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Components } from "./components";
|
|
3
|
+
import { Taxonomy } from "./taxonomy";
|
|
4
|
+
import { QueryUtil } from "./utils/query.util";
|
|
5
|
+
import type * as types from "../types";
|
|
6
|
+
import { Meta } from "./meta";
|
|
7
|
+
import { Logger } from "./logger";
|
|
8
|
+
declare const schemaProps: z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
slug: z.ZodEffects<z.ZodString, string, string>;
|
|
11
|
+
term_group: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
} & {
|
|
13
|
+
term_id: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
taxonomy: z.ZodDefault<z.ZodString>;
|
|
15
|
+
description: z.ZodDefault<z.ZodString>;
|
|
16
|
+
parent: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
object_id: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
term_taxonomy_id: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
term_order: z.ZodDefault<z.ZodNumber>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
parent: number;
|
|
25
|
+
taxonomy: string;
|
|
26
|
+
count: number;
|
|
27
|
+
term_id: number;
|
|
28
|
+
object_id: number;
|
|
29
|
+
term_taxonomy_id: number;
|
|
30
|
+
term_order: number;
|
|
31
|
+
slug: string;
|
|
32
|
+
term_group: number;
|
|
33
|
+
}, {
|
|
34
|
+
name: string;
|
|
35
|
+
slug: string;
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
parent?: number | undefined;
|
|
38
|
+
taxonomy?: string | undefined;
|
|
39
|
+
count?: number | undefined;
|
|
40
|
+
term_id?: number | undefined;
|
|
41
|
+
object_id?: number | undefined;
|
|
42
|
+
term_taxonomy_id?: number | undefined;
|
|
43
|
+
term_order?: number | undefined;
|
|
44
|
+
term_group?: number | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
type Props = z.infer<typeof schemaProps>;
|
|
47
|
+
export declare class Term {
|
|
48
|
+
#private;
|
|
49
|
+
meta: Meta;
|
|
50
|
+
private logger;
|
|
51
|
+
private components;
|
|
52
|
+
private queryUtil;
|
|
53
|
+
private termId;
|
|
54
|
+
private _taxonomyName;
|
|
55
|
+
private _props;
|
|
56
|
+
constructor(meta: Meta, logger: Logger, components: Components, queryUtil: QueryUtil, termId: number, _taxonomyName: types.TaxonomyName | undefined, _props: Props);
|
|
57
|
+
get taxonomyName(): types.TaxonomyName | undefined;
|
|
58
|
+
get taxonomy(): Taxonomy | undefined;
|
|
59
|
+
get props(): {
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
parent: number;
|
|
63
|
+
taxonomy: string;
|
|
64
|
+
count: number;
|
|
65
|
+
term_id: number;
|
|
66
|
+
object_id: number;
|
|
67
|
+
term_taxonomy_id: number;
|
|
68
|
+
term_order: number;
|
|
69
|
+
slug: string;
|
|
70
|
+
term_group: number;
|
|
71
|
+
} | undefined;
|
|
72
|
+
children(): Promise<[{
|
|
73
|
+
name: string;
|
|
74
|
+
description: string;
|
|
75
|
+
parent: number;
|
|
76
|
+
taxonomy: string;
|
|
77
|
+
count: number;
|
|
78
|
+
term_id: number;
|
|
79
|
+
object_id: number;
|
|
80
|
+
term_taxonomy_id: number;
|
|
81
|
+
term_order: number;
|
|
82
|
+
slug: string;
|
|
83
|
+
term_group: number;
|
|
84
|
+
depth: number;
|
|
85
|
+
}, ...{
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
parent: number;
|
|
89
|
+
taxonomy: string;
|
|
90
|
+
count: number;
|
|
91
|
+
term_id: number;
|
|
92
|
+
object_id: number;
|
|
93
|
+
term_taxonomy_id: number;
|
|
94
|
+
term_order: number;
|
|
95
|
+
slug: string;
|
|
96
|
+
term_group: number;
|
|
97
|
+
depth: number;
|
|
98
|
+
}[]] | undefined>;
|
|
99
|
+
setTaxonomy(taxonomy: Taxonomy): void;
|
|
100
|
+
withProps(props: Partial<Props>): this;
|
|
101
|
+
private init;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=term.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.d.ts","sourceRoot":"","sources":["../../src/core/term.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEhB,CAAC;AAGF,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzC,qBACa,IAAI;;IAIN,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,aAAa;IAErB,OAAO,CAAC,MAAM;gBAPP,IAAI,EAAE,IAAI,EACT,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,KAAK,CAAC,YAAY,GAAG,SAAS,EAE7C,MAAM,EAAE,KAAK;IAKvB,IAAI,YAAY,mCAEf;IAED,IAAI,QAAQ,yBAEX;IAED,IAAI,KAAK;;;;;;;;;;;;kBAER;IAEK,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMd,WAAW,CAAC,QAAQ,EAAE,QAAQ;IAK9B,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC;YAMjB,IAAI;CAyBnB"}
|