@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/application.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import type * as types from "./types";
|
|
3
|
+
import { Context } from "./core/context";
|
|
4
|
+
import { Hooks } from "./core/hooks/hooks";
|
|
5
|
+
/**
|
|
6
|
+
* The Application class serves as a central helper for managing the lifecycle of the application.
|
|
7
|
+
* It provides methods to initialize and retrieve application contexts, register hooks, and manage configurations.
|
|
8
|
+
*
|
|
9
|
+
* Key Responsibilities:
|
|
10
|
+
* - **Context Initialization**: The `getContext` method initializes and retrieves the application context for a given environment.
|
|
11
|
+
* It ensures that hooks and configurations are properly set up and passed to the context.
|
|
12
|
+
* - **Hook Registration**: The `registerHooks` method allows registering custom hooks for specific environments.
|
|
13
|
+
* Hooks are used to extend or modify the application's behavior dynamically.
|
|
14
|
+
* - **Configuration Management**: The class holds global and environment-specific configurations, which are passed to the context during initialization.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* - Use `Application.getContext(env)` to retrieve the application context for a specific environment.
|
|
18
|
+
* - Use `Application.registerHooks(clazzes, env)` to register hooks for an environment.
|
|
19
|
+
* - Access `Application.configs` or `Application.config` to manage configurations.
|
|
20
|
+
*
|
|
21
|
+
* This class is designed to be used as a static utility and cannot be instantiated directly.
|
|
22
|
+
*/
|
|
23
|
+
export default class Application {
|
|
24
|
+
/**
|
|
25
|
+
* A flag to indicate if the application is currently installing.
|
|
26
|
+
*/
|
|
27
|
+
static installing: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Stores the global configurations accessible across different parts of the application.
|
|
30
|
+
*/
|
|
31
|
+
static configs: types.Configs;
|
|
32
|
+
/**
|
|
33
|
+
* A singular configuration object if only one environment configuration is needed.
|
|
34
|
+
*/
|
|
35
|
+
static config: types.Config;
|
|
36
|
+
/**
|
|
37
|
+
* A map storing instances of Hooks by environment keys.
|
|
38
|
+
*/
|
|
39
|
+
private static hooksInstanceMap;
|
|
40
|
+
/**
|
|
41
|
+
* Private constructor to prevent instantiation.
|
|
42
|
+
*/
|
|
43
|
+
private constructor();
|
|
44
|
+
/**
|
|
45
|
+
* Returns the map of hooks instances.
|
|
46
|
+
*/
|
|
47
|
+
static get hooks(): Map<string, Hooks<types.hooks.Filters, types.hooks.Actions>>;
|
|
48
|
+
/**
|
|
49
|
+
* Registers hooks for a given environment.
|
|
50
|
+
*
|
|
51
|
+
* @param clazzes - Array of hook class constructors to be registered.
|
|
52
|
+
* @param env - Optional environment name, defaults to "default".
|
|
53
|
+
*/
|
|
54
|
+
static registerHooks(clazzes: types.Constructor[], env?: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the application context for a given environment,
|
|
57
|
+
* initializing hooks and configurations.
|
|
58
|
+
*
|
|
59
|
+
* This method initializes the hooks based on the environment
|
|
60
|
+
* and hooks registered via the `registerHooks` method.
|
|
61
|
+
*
|
|
62
|
+
* It ensures the application configuration is valid
|
|
63
|
+
* and throws errors if not properly set.
|
|
64
|
+
*
|
|
65
|
+
* @param env - The environment identifier for which to get the context, defaults to "default".
|
|
66
|
+
* @returns Promise<Context> - A promise that resolves to the instance
|
|
67
|
+
* of Context configured with appropriate hooks and settings.
|
|
68
|
+
* @throws Error - If the configuration is invalid or undefined.
|
|
69
|
+
*/
|
|
70
|
+
static getContext(env?: string): Promise<Context>;
|
|
71
|
+
/**
|
|
72
|
+
* Closes all database connections gracefully.
|
|
73
|
+
*/
|
|
74
|
+
static terminate(): void;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=application.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,OAAO,CAAS;IACnC;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;IAE9B;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IAE5B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAiC;IAEhE;;OAEG;IACH,OAAO;IAEP;;OAEG;IACH,MAAM,KAAK,KAAK,iEAEf;IAED;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,GAAG,SAAY;IAgBlE;;;;;;;;;;;;;;OAcG;WACU,UAAU,CAAC,GAAG,GAAE,MAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IA2ClE;;OAEG;IACH,MAAM,CAAC,SAAS;CAGjB"}
|
package/application.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
require("reflect-metadata");
|
|
7
|
+
const context_1 = require("./core/context");
|
|
8
|
+
const database_1 = __importDefault(require("./database"));
|
|
9
|
+
const hooks_1 = require("./core/hooks/hooks");
|
|
10
|
+
const default_hooks_1 = require("./core/hooks/default-hooks");
|
|
11
|
+
/**
|
|
12
|
+
* The Application class serves as a central helper for managing the lifecycle of the application.
|
|
13
|
+
* It provides methods to initialize and retrieve application contexts, register hooks, and manage configurations.
|
|
14
|
+
*
|
|
15
|
+
* Key Responsibilities:
|
|
16
|
+
* - **Context Initialization**: The `getContext` method initializes and retrieves the application context for a given environment.
|
|
17
|
+
* It ensures that hooks and configurations are properly set up and passed to the context.
|
|
18
|
+
* - **Hook Registration**: The `registerHooks` method allows registering custom hooks for specific environments.
|
|
19
|
+
* Hooks are used to extend or modify the application's behavior dynamically.
|
|
20
|
+
* - **Configuration Management**: The class holds global and environment-specific configurations, which are passed to the context during initialization.
|
|
21
|
+
*
|
|
22
|
+
* Usage:
|
|
23
|
+
* - Use `Application.getContext(env)` to retrieve the application context for a specific environment.
|
|
24
|
+
* - Use `Application.registerHooks(clazzes, env)` to register hooks for an environment.
|
|
25
|
+
* - Access `Application.configs` or `Application.config` to manage configurations.
|
|
26
|
+
*
|
|
27
|
+
* This class is designed to be used as a static utility and cannot be instantiated directly.
|
|
28
|
+
*/
|
|
29
|
+
class Application {
|
|
30
|
+
/**
|
|
31
|
+
* A flag to indicate if the application is currently installing.
|
|
32
|
+
*/
|
|
33
|
+
static installing = false;
|
|
34
|
+
/**
|
|
35
|
+
* Stores the global configurations accessible across different parts of the application.
|
|
36
|
+
*/
|
|
37
|
+
static configs;
|
|
38
|
+
/**
|
|
39
|
+
* A singular configuration object if only one environment configuration is needed.
|
|
40
|
+
*/
|
|
41
|
+
static config;
|
|
42
|
+
/**
|
|
43
|
+
* A map storing instances of Hooks by environment keys.
|
|
44
|
+
*/
|
|
45
|
+
static hooksInstanceMap = new Map();
|
|
46
|
+
/**
|
|
47
|
+
* Private constructor to prevent instantiation.
|
|
48
|
+
*/
|
|
49
|
+
constructor() { }
|
|
50
|
+
/**
|
|
51
|
+
* Returns the map of hooks instances.
|
|
52
|
+
*/
|
|
53
|
+
static get hooks() {
|
|
54
|
+
return Application.hooksInstanceMap;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Registers hooks for a given environment.
|
|
58
|
+
*
|
|
59
|
+
* @param clazzes - Array of hook class constructors to be registered.
|
|
60
|
+
* @param env - Optional environment name, defaults to "default".
|
|
61
|
+
*/
|
|
62
|
+
static registerHooks(clazzes, env = "default") {
|
|
63
|
+
const hookMap = hooks_1.Hooks.get(env);
|
|
64
|
+
let clazz;
|
|
65
|
+
for (clazz of clazzes) {
|
|
66
|
+
// __name is set by @hook decorator
|
|
67
|
+
if (!clazz.__name) {
|
|
68
|
+
throw new Error("Hook name is not defined. Use @hook decorator to define a unique name for the hook.");
|
|
69
|
+
}
|
|
70
|
+
hookMap.set(clazz.__name, clazz);
|
|
71
|
+
}
|
|
72
|
+
hooks_1.Hooks.set(env, hookMap);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves the application context for a given environment,
|
|
76
|
+
* initializing hooks and configurations.
|
|
77
|
+
*
|
|
78
|
+
* This method initializes the hooks based on the environment
|
|
79
|
+
* and hooks registered via the `registerHooks` method.
|
|
80
|
+
*
|
|
81
|
+
* It ensures the application configuration is valid
|
|
82
|
+
* and throws errors if not properly set.
|
|
83
|
+
*
|
|
84
|
+
* @param env - The environment identifier for which to get the context, defaults to "default".
|
|
85
|
+
* @returns Promise<Context> - A promise that resolves to the instance
|
|
86
|
+
* of Context configured with appropriate hooks and settings.
|
|
87
|
+
* @throws Error - If the configuration is invalid or undefined.
|
|
88
|
+
*/
|
|
89
|
+
static async getContext(env = "default") {
|
|
90
|
+
// Load and add default hooks
|
|
91
|
+
default_hooks_1.DefaultHooks.load(env);
|
|
92
|
+
if (!Application.config && !Application.configs[env]) {
|
|
93
|
+
throw new Error("Invalid Config");
|
|
94
|
+
}
|
|
95
|
+
let config = undefined;
|
|
96
|
+
if (Application.configs && Application.configs[env]) {
|
|
97
|
+
config = Application.configs[env];
|
|
98
|
+
}
|
|
99
|
+
else if (Application.config) {
|
|
100
|
+
config = Application.config;
|
|
101
|
+
}
|
|
102
|
+
if (!config) {
|
|
103
|
+
throw new Error("Empty config");
|
|
104
|
+
}
|
|
105
|
+
let hooks = Application.hooksInstanceMap.get(env);
|
|
106
|
+
if (!hooks) {
|
|
107
|
+
// Merge default hooks to non-default hooks \}
|
|
108
|
+
if (env !== "default") {
|
|
109
|
+
const hookMap = hooks_1.Hooks.get(env);
|
|
110
|
+
const defaultHookSet = hooks_1.Hooks.get("default");
|
|
111
|
+
if (defaultHookSet) {
|
|
112
|
+
defaultHookSet.forEach((hook) => hookMap.set(hook.__name, hook));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
hooks = new hooks_1.Hooks(hooks_1.Hooks.get(env));
|
|
116
|
+
Application.hooksInstanceMap.set(env, hooks);
|
|
117
|
+
}
|
|
118
|
+
hooks.init();
|
|
119
|
+
return await context_1.Context.getInstance(config, {
|
|
120
|
+
env,
|
|
121
|
+
hooks,
|
|
122
|
+
installing: Application.installing,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Closes all database connections gracefully.
|
|
127
|
+
*/
|
|
128
|
+
static terminate() {
|
|
129
|
+
database_1.default.closeAll();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.default = Application;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-constructor.d.ts","sourceRoot":"","sources":["../../src/common/async-constructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,QAAQ,GAAG,EAAE,IAAI,MAAM,OAAO,CAAC,GAAG,CAAC,KACxB,CAC9C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type * as types from "../../types";
|
|
2
|
+
export declare const definePostStatus: (args: Partial<Record<string, types.ConfigPostStatusObject>>) => types.PostStatusObject;
|
|
3
|
+
export declare const definePostStatusFromDirectory: (directory: string) => types.PostStatusObject | undefined;
|
|
4
|
+
//# sourceMappingURL=define-post-status.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-post-status.config.d.ts","sourceRoot":"","sources":["../../../src/common/config/define-post-status.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAG1C,eAAO,MAAM,gBAAgB,GAC3B,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC,2BAkB5D,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,WAAW,MAAM,uCAM9D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.definePostStatusFromDirectory = exports.definePostStatus = void 0;
|
|
4
|
+
const files_1 = require("../files");
|
|
5
|
+
const definePostStatus = (args) => {
|
|
6
|
+
let postStatusObject = {};
|
|
7
|
+
for (const [name, settings] of Object.entries(args)) {
|
|
8
|
+
postStatusObject = {
|
|
9
|
+
...postStatusObject,
|
|
10
|
+
[name]: {
|
|
11
|
+
label: name,
|
|
12
|
+
public: settings?.public ?? true,
|
|
13
|
+
private: settings?.private ?? false,
|
|
14
|
+
internal: settings?.internal ?? true,
|
|
15
|
+
_builtin: false,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return postStatusObject;
|
|
20
|
+
};
|
|
21
|
+
exports.definePostStatus = definePostStatus;
|
|
22
|
+
const definePostStatusFromDirectory = (directory) => {
|
|
23
|
+
const json = (0, files_1.readJsonFiles)(directory);
|
|
24
|
+
return json ? (0, exports.definePostStatus)(json) : undefined;
|
|
25
|
+
};
|
|
26
|
+
exports.definePostStatusFromDirectory = definePostStatusFromDirectory;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type * as types from "../../types";
|
|
2
|
+
export declare const definePostType: (args: Partial<Record<string, types.ConfigPostTypeObject>>) => types.PostTypeObject;
|
|
3
|
+
export declare const definePostTypeFromDirectory: (directory: string) => types.PostTypeObject | undefined;
|
|
4
|
+
//# sourceMappingURL=define-post-type.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-post-type.config.d.ts","sourceRoot":"","sources":["../../../src/common/config/define-post-type.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAG1C,eAAO,MAAM,cAAc,GACzB,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,yBA+B1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,WAAW,MAAM,qCAM5D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.definePostTypeFromDirectory = exports.definePostType = void 0;
|
|
4
|
+
const files_1 = require("../files");
|
|
5
|
+
const definePostType = (args) => {
|
|
6
|
+
let postTypeObject = {};
|
|
7
|
+
for (const [name, settings] of Object.entries(args)) {
|
|
8
|
+
postTypeObject = {
|
|
9
|
+
...postTypeObject,
|
|
10
|
+
[name]: {
|
|
11
|
+
capabilityType: settings?.capabilityType ?? "post",
|
|
12
|
+
supports: (settings?.supports ?? [
|
|
13
|
+
"title",
|
|
14
|
+
"editor",
|
|
15
|
+
"author",
|
|
16
|
+
"thumbnail",
|
|
17
|
+
"excerpt",
|
|
18
|
+
"trackbacks",
|
|
19
|
+
"custom-fields",
|
|
20
|
+
"comments",
|
|
21
|
+
"revisions",
|
|
22
|
+
"post-formats",
|
|
23
|
+
]),
|
|
24
|
+
public: settings?.public ?? true,
|
|
25
|
+
deleteWithUser: settings?.deleteWithUser ?? true,
|
|
26
|
+
mapMetaCap: settings?.mapMetaCap ?? true,
|
|
27
|
+
showInRest: settings?.showInRest ?? true,
|
|
28
|
+
_builtin: false,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return postTypeObject;
|
|
33
|
+
};
|
|
34
|
+
exports.definePostType = definePostType;
|
|
35
|
+
const definePostTypeFromDirectory = (directory) => {
|
|
36
|
+
const json = (0, files_1.readJsonFiles)(directory);
|
|
37
|
+
return json ? (0, exports.definePostType)(json) : undefined;
|
|
38
|
+
};
|
|
39
|
+
exports.definePostTypeFromDirectory = definePostTypeFromDirectory;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type * as types from "../../types";
|
|
2
|
+
export declare const defineTaxonomies: (args: Partial<Record<string, types.ConfigTaxonomy>>) => types.TaxonomyRecord;
|
|
3
|
+
export declare const defineTaxonomiesFromDirectory: (directory: string) => types.TaxonomyRecord | undefined;
|
|
4
|
+
//# sourceMappingURL=define-taxonomies.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-taxonomies.config.d.ts","sourceRoot":"","sources":["../../../src/common/config/define-taxonomies.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAG1C,eAAO,MAAM,gBAAgB,GAC3B,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,yBAkBpD,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,WAAW,MAAM,qCAI9D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineTaxonomiesFromDirectory = exports.defineTaxonomies = void 0;
|
|
4
|
+
const files_1 = require("../files");
|
|
5
|
+
const defineTaxonomies = (args) => {
|
|
6
|
+
let taxonomies = {};
|
|
7
|
+
for (const [name, settings] of Object.entries(args)) {
|
|
8
|
+
taxonomies = {
|
|
9
|
+
...taxonomies,
|
|
10
|
+
[name]: {
|
|
11
|
+
hierarchical: settings?.hierarchical,
|
|
12
|
+
objectType: settings?.objectType ?? name,
|
|
13
|
+
_builtin: false,
|
|
14
|
+
capabilities: settings?.capabilities ?? {},
|
|
15
|
+
showUi: settings?.showUi ?? true,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return taxonomies;
|
|
20
|
+
};
|
|
21
|
+
exports.defineTaxonomies = defineTaxonomies;
|
|
22
|
+
const defineTaxonomiesFromDirectory = (directory) => {
|
|
23
|
+
const json = (0, files_1.readJsonFiles)(directory);
|
|
24
|
+
return json ? (0, exports.defineTaxonomies)(json) : undefined;
|
|
25
|
+
};
|
|
26
|
+
exports.defineTaxonomiesFromDirectory = defineTaxonomiesFromDirectory;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as types from "../../types";
|
|
2
|
+
export declare const defineWPConfig: (config: Required<{
|
|
3
|
+
staticAssetsPath: types.Config["staticAssetsPath"];
|
|
4
|
+
database: types.Config["database"];
|
|
5
|
+
}> & Partial<{
|
|
6
|
+
postTypeObject: types.PostTypeObject;
|
|
7
|
+
postStatusObject: types.PostStatusObject;
|
|
8
|
+
taxonomies: types.TaxonomyRecord;
|
|
9
|
+
}> & Partial<{
|
|
10
|
+
logLevel: types.LogLevel;
|
|
11
|
+
}> & types.JSONWPConfig) => types.Config;
|
|
12
|
+
//# sourceMappingURL=define-wp.config..d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-wp.config..d.ts","sourceRoot":"","sources":["../../../src/common/config/define-wp.config..ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAM1C,eAAO,MAAM,cAAc,GACzB,QAAQ,QAAQ,CAAC;IACf,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACnD,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;CACpC,CAAC,GACA,OAAO,CAAC;IACN,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC;IACrC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC;IACzC,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC;CAClC,CAAC,GACF,OAAO,CAAC;IACN,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;CAC1B,CAAC,GACF,KAAK,CAAC,YAAY,KAEnB,KAAK,CAAC,MAsER,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.defineWPConfig = void 0;
|
|
37
|
+
const defaults = __importStar(require("../../defaults"));
|
|
38
|
+
const val = __importStar(require("../../validators"));
|
|
39
|
+
//type DefineWPConfig = types.DeepPartial<Exclude<types.Config, "database">>;
|
|
40
|
+
const defineWPConfig = (config
|
|
41
|
+
//DefineWPConfig
|
|
42
|
+
) => {
|
|
43
|
+
const postTypes = [
|
|
44
|
+
...defaults.postTypes,
|
|
45
|
+
...Object.keys(config.postTypeObject ?? {}),
|
|
46
|
+
];
|
|
47
|
+
const postTypeObject = {
|
|
48
|
+
...defaults.postTypeObject,
|
|
49
|
+
...config.postTypeObject,
|
|
50
|
+
};
|
|
51
|
+
const postStatuses = [
|
|
52
|
+
...defaults.postStatuses,
|
|
53
|
+
...Object.keys(config.postStatusObject ?? {}),
|
|
54
|
+
];
|
|
55
|
+
const postStatusObject = {
|
|
56
|
+
...defaults.postStatusObject,
|
|
57
|
+
...config.postStatusObject,
|
|
58
|
+
};
|
|
59
|
+
const taxonomyNames = [
|
|
60
|
+
...defaults.taxonomyNames,
|
|
61
|
+
...Object.keys(config.taxonomies ?? {}),
|
|
62
|
+
];
|
|
63
|
+
const taxonomies = { ...defaults.taxonomies, ...config.taxonomies };
|
|
64
|
+
return val.config.config.parse({
|
|
65
|
+
constants: {
|
|
66
|
+
ALLOW_UNFILTERED_UPLOADS: false,
|
|
67
|
+
DISALLOW_FILE_EDIT: true,
|
|
68
|
+
DISALLOW_UNFILTERED_HTML: true,
|
|
69
|
+
TRASHED_SUFFIX_TO_POST_NAME_FOR_POST: "__trashed",
|
|
70
|
+
LINK_USE_SSL: true,
|
|
71
|
+
WP_LOG_LEVEL: config.logLevel ?? "info",
|
|
72
|
+
...config.constants,
|
|
73
|
+
},
|
|
74
|
+
extensions: {
|
|
75
|
+
misc: defaults.miscExtensions,
|
|
76
|
+
audio: defaults.audioExtensions,
|
|
77
|
+
video: defaults.videoExtensions,
|
|
78
|
+
...config.extensions,
|
|
79
|
+
},
|
|
80
|
+
options: {
|
|
81
|
+
// wp_protect_special_option
|
|
82
|
+
protected: ["alloptions", "notoptions"],
|
|
83
|
+
defaults: defaults.defaultOptionKeys,
|
|
84
|
+
...config.options,
|
|
85
|
+
},
|
|
86
|
+
multisite: {
|
|
87
|
+
enabled: false,
|
|
88
|
+
defaultBlogId: 0,
|
|
89
|
+
defaultSiteId: 0,
|
|
90
|
+
defaultSitemetaKeys: defaults.defaultSitemetaKeys,
|
|
91
|
+
subdirectoryReservedNames: defaults.subdirectoryReservedNames,
|
|
92
|
+
...config.multisite,
|
|
93
|
+
},
|
|
94
|
+
tablePrefix: "wp_",
|
|
95
|
+
posts: {
|
|
96
|
+
typeNames: postTypes,
|
|
97
|
+
types: postTypeObject,
|
|
98
|
+
statusNames: postStatuses,
|
|
99
|
+
statuses: postStatusObject,
|
|
100
|
+
},
|
|
101
|
+
taxonomy: {
|
|
102
|
+
names: taxonomyNames,
|
|
103
|
+
settings: taxonomies,
|
|
104
|
+
},
|
|
105
|
+
roles: defaults.roles,
|
|
106
|
+
database: config.database,
|
|
107
|
+
staticAssetsPath: config.staticAssetsPath,
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
exports.defineWPConfig = defineWPConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./define-taxonomies.config"), exports);
|
|
18
|
+
__exportStar(require("./define-post-status.config"), exports);
|
|
19
|
+
__exportStar(require("./define-post-type.config"), exports);
|
|
20
|
+
__exportStar(require("./define-wp.config."), exports);
|
package/common/date.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MomentInput } from "moment-timezone";
|
|
2
|
+
type DateArgsOptions = {
|
|
3
|
+
format?: string;
|
|
4
|
+
} & ({
|
|
5
|
+
offsetMinutes?: number;
|
|
6
|
+
withGMTOffset?: never;
|
|
7
|
+
} | {
|
|
8
|
+
offsetMinutes?: never;
|
|
9
|
+
withGMTOffset?: boolean;
|
|
10
|
+
});
|
|
11
|
+
type MySQLDateArgsOptions = Exclude<DateArgsOptions, "format">;
|
|
12
|
+
type DateArgs = [] | [MomentInput] | [MomentInput, DateArgsOptions] | [DateArgsOptions];
|
|
13
|
+
type MySQLDateArgs = [] | [MomentInput] | [MomentInput, MySQLDateArgsOptions] | [MySQLDateArgsOptions];
|
|
14
|
+
export declare const formatDate: (...args: DateArgs) => string;
|
|
15
|
+
export declare function formatDateMySQL(...args: MySQLDateArgs): string;
|
|
16
|
+
export declare function currentUnixTimestamp(): number;
|
|
17
|
+
export declare function convertYearToString(n?: number): string;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/common/date.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,KAAK,eAAe,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,CACA;IACE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB,GACD;IACE,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CACJ,CAAC;AAEF,KAAK,oBAAoB,GAAG,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AAE/D,KAAK,QAAQ,GACT,EAAE,GACF,CAAC,WAAW,CAAC,GACb,CAAC,WAAW,EAAE,eAAe,CAAC,GAC9B,CAAC,eAAe,CAAC,CAAC;AAEtB,KAAK,aAAa,GACd,EAAE,GACF,CAAC,WAAW,CAAC,GACb,CAAC,WAAW,EAAE,oBAAoB,CAAC,GACnC,CAAC,oBAAoB,CAAC,CAAC;AAuB3B,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,QAAQ,KAAG,MA6B9C,CAAC;AAEF,wBAAgB,eAAe,CAAC,GAAG,IAAI,EAAE,aAAa,GAAG,MAAM,CAO9D;AAGD,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,mBAAmB,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CA6DtD"}
|
package/common/date.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatDate = void 0;
|
|
7
|
+
exports.formatDateMySQL = formatDateMySQL;
|
|
8
|
+
exports.currentUnixTimestamp = currentUnixTimestamp;
|
|
9
|
+
exports.convertYearToString = convertYearToString;
|
|
10
|
+
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
11
|
+
const parseDateArgs = (...args) => {
|
|
12
|
+
if (0 >= args.length) {
|
|
13
|
+
return { date: undefined, options: undefined };
|
|
14
|
+
}
|
|
15
|
+
const [date, options] = typeof args[0] === "object" &&
|
|
16
|
+
!(args[0] instanceof Date) &&
|
|
17
|
+
!(args[0] instanceof moment_timezone_1.default)
|
|
18
|
+
? [undefined, args[0]]
|
|
19
|
+
: args.length > 1
|
|
20
|
+
? [args[0], args[1]]
|
|
21
|
+
: [args[0], undefined];
|
|
22
|
+
return { date, options };
|
|
23
|
+
};
|
|
24
|
+
const formatDate = (...args) => {
|
|
25
|
+
// Parse the date and options from the provided arguments
|
|
26
|
+
const { date, options } = parseDateArgs(...args);
|
|
27
|
+
// Set default values for the format, offsetMinutes, and withGMTOffset if not provided
|
|
28
|
+
const { format = "MM/DD/YYYY hh:mma", // Default format is "MM/DD/YYYY hh:mma"
|
|
29
|
+
offsetMinutes = 0, // No offset by default
|
|
30
|
+
withGMTOffset = false, // Do not include GMT offset by default
|
|
31
|
+
} = options ?? {};
|
|
32
|
+
// Initialize a moment object in UTC with the provided date
|
|
33
|
+
const dateMoment = moment_timezone_1.default.utc(date);
|
|
34
|
+
// If the output should include the GMT offset and the provided date is a Date object,
|
|
35
|
+
// adjust for the local timezone. This adjustment is necessary because JavaScript Date objects,
|
|
36
|
+
// regardless of the local timezone in which they are created, are internally converted to GMT.
|
|
37
|
+
if (withGMTOffset && date instanceof Date) {
|
|
38
|
+
// Subtract the local timezone offset to convert to local time
|
|
39
|
+
dateMoment.subtract(new Date().getTimezoneOffset(), "minutes");
|
|
40
|
+
}
|
|
41
|
+
// If an offset in minutes is provided, apply it to the date
|
|
42
|
+
if (typeof offsetMinutes === "number") {
|
|
43
|
+
dateMoment.add(offsetMinutes, "minutes");
|
|
44
|
+
}
|
|
45
|
+
// Format and return the date as a string according to the specified format
|
|
46
|
+
return dateMoment.format(format);
|
|
47
|
+
};
|
|
48
|
+
exports.formatDate = formatDate;
|
|
49
|
+
function formatDateMySQL(...args) {
|
|
50
|
+
const { date, options } = parseDateArgs(...args);
|
|
51
|
+
return (0, exports.formatDate)(date, {
|
|
52
|
+
...options,
|
|
53
|
+
format: "YYYY-MM-DD HH:mm:ss",
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// time()
|
|
57
|
+
function currentUnixTimestamp() {
|
|
58
|
+
return Math.floor(new Date().getTime() / 1000);
|
|
59
|
+
}
|
|
60
|
+
function convertYearToString(n) {
|
|
61
|
+
const year = n ?? new Date().getFullYear();
|
|
62
|
+
const numberToWords = (n) => {
|
|
63
|
+
const belowTwenty = [
|
|
64
|
+
"zero",
|
|
65
|
+
"one",
|
|
66
|
+
"two",
|
|
67
|
+
"three",
|
|
68
|
+
"four",
|
|
69
|
+
"five",
|
|
70
|
+
"six",
|
|
71
|
+
"seven",
|
|
72
|
+
"eight",
|
|
73
|
+
"nine",
|
|
74
|
+
"ten",
|
|
75
|
+
"eleven",
|
|
76
|
+
"twelve",
|
|
77
|
+
"thirteen",
|
|
78
|
+
"fourteen",
|
|
79
|
+
"fifteen",
|
|
80
|
+
"sixteen",
|
|
81
|
+
"seventeen",
|
|
82
|
+
"eighteen",
|
|
83
|
+
"nineteen",
|
|
84
|
+
];
|
|
85
|
+
const tens = [
|
|
86
|
+
"",
|
|
87
|
+
"",
|
|
88
|
+
"twenty",
|
|
89
|
+
"thirty",
|
|
90
|
+
"forty",
|
|
91
|
+
"fifty",
|
|
92
|
+
"sixty",
|
|
93
|
+
"seventy",
|
|
94
|
+
"eighty",
|
|
95
|
+
"ninety",
|
|
96
|
+
];
|
|
97
|
+
if (n < 20) {
|
|
98
|
+
return belowTwenty[n];
|
|
99
|
+
}
|
|
100
|
+
else if (n < 100) {
|
|
101
|
+
return (tens[Math.floor(n / 10)] + (n % 10 !== 0 ? belowTwenty[n % 10] : ""));
|
|
102
|
+
}
|
|
103
|
+
else if (n < 1000) {
|
|
104
|
+
return (belowTwenty[Math.floor(n / 100)] +
|
|
105
|
+
"hundred" +
|
|
106
|
+
(n % 100 !== 0 ? numberToWords(n % 100) : ""));
|
|
107
|
+
}
|
|
108
|
+
else if (n < 10000) {
|
|
109
|
+
const firstTwoDigits = Math.floor(n / 100);
|
|
110
|
+
const lastTwoDigits = n % 100;
|
|
111
|
+
return numberToWords(firstTwoDigits) + numberToWords(lastTwoDigits);
|
|
112
|
+
}
|
|
113
|
+
return "twentytwentyfour";
|
|
114
|
+
};
|
|
115
|
+
return numberToWords(year).replace(/\s+/g, "");
|
|
116
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Hooks } from "../core/hooks/hooks";
|
|
2
|
+
import * as types from "../types";
|
|
3
|
+
export declare const defineHooks: <TFilters = types.hooks.Filters, TActions = types.hooks.Actions>(env: string, clazzes?: types.Constructor[]) => Hooks<TFilters, TActions>;
|
|
4
|
+
//# sourceMappingURL=define-hooks.d.ts.map
|