@rnaga/wp-node 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/application.d.ts +76 -0
- package/application.d.ts.map +1 -0
- package/application.js +132 -0
- package/common/async-constructor.d.ts +2 -0
- package/common/async-constructor.d.ts.map +1 -0
- package/common/async-constructor.js +7 -0
- package/common/config/define-post-status.config.d.ts +4 -0
- package/common/config/define-post-status.config.d.ts.map +1 -0
- package/common/config/define-post-status.config.js +26 -0
- package/common/config/define-post-type.config.d.ts +4 -0
- package/common/config/define-post-type.config.d.ts.map +1 -0
- package/common/config/define-post-type.config.js +39 -0
- package/common/config/define-taxonomies.config.d.ts +4 -0
- package/common/config/define-taxonomies.config.d.ts.map +1 -0
- package/common/config/define-taxonomies.config.js +26 -0
- package/common/config/define-wp.config..d.ts +12 -0
- package/common/config/define-wp.config..d.ts.map +1 -0
- package/common/config/define-wp.config..js +110 -0
- package/common/config/index.d.ts +5 -0
- package/common/config/index.d.ts.map +1 -0
- package/common/config/index.js +20 -0
- package/common/date.d.ts +19 -0
- package/common/date.d.ts.map +1 -0
- package/common/date.js +116 -0
- package/common/define-hooks.d.ts +4 -0
- package/common/define-hooks.d.ts.map +1 -0
- package/common/define-hooks.js +16 -0
- package/common/diff.d.ts +3 -0
- package/common/diff.d.ts.map +1 -0
- package/common/diff.js +23 -0
- package/common/files.d.ts +14 -0
- package/common/files.d.ts.map +1 -0
- package/common/files.js +160 -0
- package/common/formatting.d.ts +47 -0
- package/common/formatting.d.ts.map +1 -0
- package/common/formatting.js +218 -0
- package/common/hierarchy.d.ts +21 -0
- package/common/hierarchy.d.ts.map +1 -0
- package/common/hierarchy.js +78 -0
- package/common/hooks-command.d.ts +7 -0
- package/common/hooks-command.d.ts.map +1 -0
- package/common/hooks-command.js +21 -0
- package/common/index.d.ts +11 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +49 -0
- package/common/password.d.ts +4 -0
- package/common/password.d.ts.map +1 -0
- package/common/password.js +224 -0
- package/common/php-serialize.d.ts +3 -0
- package/common/php-serialize.d.ts.map +1 -0
- package/common/php-serialize.js +17 -0
- package/common/validating.d.ts +10 -0
- package/common/validating.d.ts.map +1 -0
- package/common/validating.js +65 -0
- package/config.d.ts +99 -0
- package/config.d.ts.map +1 -0
- package/config.js +76 -0
- package/constants/async-init.d.ts +2 -0
- package/constants/async-init.d.ts.map +1 -0
- package/constants/async-init.js +4 -0
- package/constants/component.d.ts +3 -0
- package/constants/component.d.ts.map +1 -0
- package/constants/component.js +5 -0
- package/constants/database.d.ts +2 -0
- package/constants/database.d.ts.map +1 -0
- package/constants/database.js +9 -0
- package/constants/default-database-tables.d.ts +7 -0
- package/constants/default-database-tables.d.ts.map +1 -0
- package/constants/default-database-tables.js +26 -0
- package/constants/index.d.ts +9 -0
- package/constants/index.d.ts.map +1 -0
- package/constants/index.js +24 -0
- package/constants/role-capabilities.d.ts +3 -0
- package/constants/role-capabilities.d.ts.map +1 -0
- package/constants/role-capabilities.js +67 -0
- package/constants/role-capability-actions.d.ts +2 -0
- package/constants/role-capability-actions.d.ts.map +1 -0
- package/constants/role-capability-actions.js +90 -0
- package/constants/role-names.d.ts +2 -0
- package/constants/role-names.d.ts.map +1 -0
- package/constants/role-names.js +12 -0
- package/constants/scope.d.ts +6 -0
- package/constants/scope.d.ts.map +1 -0
- package/constants/scope.js +9 -0
- package/core/async-init-reflect.d.ts +5 -0
- package/core/async-init-reflect.d.ts.map +1 -0
- package/core/async-init-reflect.js +18 -0
- package/core/blog.d.ts +20 -0
- package/core/blog.d.ts.map +1 -0
- package/core/blog.js +123 -0
- package/core/capabilities.d.ts +12 -0
- package/core/capabilities.d.ts.map +1 -0
- package/core/capabilities.js +625 -0
- package/core/comment.d.ts +111 -0
- package/core/comment.d.ts.map +1 -0
- package/core/comment.js +173 -0
- package/core/components.d.ts +13 -0
- package/core/components.d.ts.map +1 -0
- package/core/components.js +129 -0
- package/core/context.d.ts +38 -0
- package/core/context.d.ts.map +1 -0
- package/core/context.js +77 -0
- package/core/current.d.ts +33 -0
- package/core/current.d.ts.map +1 -0
- package/core/current.js +229 -0
- package/core/date-time.d.ts +18 -0
- package/core/date-time.d.ts.map +1 -0
- package/core/date-time.js +71 -0
- package/core/hooks/action.d.ts +16 -0
- package/core/hooks/action.d.ts.map +1 -0
- package/core/hooks/action.js +44 -0
- package/core/hooks/actions/init.d.ts +5 -0
- package/core/hooks/actions/init.d.ts.map +1 -0
- package/core/hooks/actions/init.js +28 -0
- package/core/hooks/default-hooks.d.ts +7 -0
- package/core/hooks/default-hooks.d.ts.map +1 -0
- package/core/hooks/default-hooks.js +19 -0
- package/core/hooks/filter.d.ts +12 -0
- package/core/hooks/filter.d.ts.map +1 -0
- package/core/hooks/filter.js +76 -0
- package/core/hooks/filters/capabilities.d.ts +16 -0
- package/core/hooks/filters/capabilities.d.ts.map +1 -0
- package/core/hooks/filters/capabilities.js +395 -0
- package/core/hooks/hooks-command.d.ts +9 -0
- package/core/hooks/hooks-command.d.ts.map +1 -0
- package/core/hooks/hooks-command.js +28 -0
- package/core/hooks/hooks-reflect.d.ts +42 -0
- package/core/hooks/hooks-reflect.d.ts.map +1 -0
- package/core/hooks/hooks-reflect.js +73 -0
- package/core/hooks/hooks.d.ts +61 -0
- package/core/hooks/hooks.d.ts.map +1 -0
- package/core/hooks/hooks.js +82 -0
- package/core/hooks/index.d.ts +4 -0
- package/core/hooks/index.d.ts.map +1 -0
- package/core/hooks/index.js +19 -0
- package/core/installer.d.ts +56 -0
- package/core/installer.d.ts.map +1 -0
- package/core/installer.js +395 -0
- package/core/logger.d.ts +22 -0
- package/core/logger.d.ts.map +1 -0
- package/core/logger.js +65 -0
- package/core/meta.d.ts +20 -0
- package/core/meta.d.ts.map +1 -0
- package/core/meta.js +123 -0
- package/core/options.d.ts +20 -0
- package/core/options.d.ts.map +1 -0
- package/core/options.js +148 -0
- package/core/post.d.ts +39 -0
- package/core/post.d.ts.map +1 -0
- package/core/post.js +164 -0
- package/core/query.d.ts +14 -0
- package/core/query.d.ts.map +1 -0
- package/core/query.js +39 -0
- package/core/role.d.ts +21 -0
- package/core/role.d.ts.map +1 -0
- package/core/role.js +71 -0
- package/core/roles.d.ts +16 -0
- package/core/roles.d.ts.map +1 -0
- package/core/roles.js +84 -0
- package/core/schema.d.ts +13 -0
- package/core/schema.d.ts.map +1 -0
- package/core/schema.js +83 -0
- package/core/site.d.ts +28 -0
- package/core/site.d.ts.map +1 -0
- package/core/site.js +105 -0
- package/core/tables.d.ts +18 -0
- package/core/tables.d.ts.map +1 -0
- package/core/tables.js +64 -0
- package/core/taxonomy.d.ts +23 -0
- package/core/taxonomy.d.ts.map +1 -0
- package/core/taxonomy.js +83 -0
- package/core/term.d.ts +104 -0
- package/core/term.d.ts.map +1 -0
- package/core/term.js +136 -0
- package/core/user.d.ts +32 -0
- package/core/user.d.ts.map +1 -0
- package/core/user.js +273 -0
- package/core/utils/blog.util.d.ts +14 -0
- package/core/utils/blog.util.d.ts.map +1 -0
- package/core/utils/blog.util.js +97 -0
- package/core/utils/comment.util.d.ts +23 -0
- package/core/utils/comment.util.d.ts.map +1 -0
- package/core/utils/comment.util.js +312 -0
- package/core/utils/crud.util.d.ts +40 -0
- package/core/utils/crud.util.d.ts.map +1 -0
- package/core/utils/crud.util.js +97 -0
- package/core/utils/date-time.util.d.ts +9 -0
- package/core/utils/date-time.util.d.ts.map +1 -0
- package/core/utils/date-time.util.js +29 -0
- package/core/utils/link.util.d.ts +23 -0
- package/core/utils/link.util.d.ts.map +1 -0
- package/core/utils/link.util.js +148 -0
- package/core/utils/meta.util.d.ts +13 -0
- package/core/utils/meta.util.d.ts.map +1 -0
- package/core/utils/meta.util.js +73 -0
- package/core/utils/post.util.d.ts +34 -0
- package/core/utils/post.util.d.ts.map +1 -0
- package/core/utils/post.util.js +272 -0
- package/core/utils/query.util.d.ts +36 -0
- package/core/utils/query.util.d.ts.map +1 -0
- package/core/utils/query.util.js +168 -0
- package/core/utils/revision.util.d.ts +67 -0
- package/core/utils/revision.util.d.ts.map +1 -0
- package/core/utils/revision.util.js +105 -0
- package/core/utils/roles.util.d.ts +30 -0
- package/core/utils/roles.util.d.ts.map +1 -0
- package/core/utils/roles.util.js +189 -0
- package/core/utils/signup.util.d.ts +33 -0
- package/core/utils/signup.util.d.ts.map +1 -0
- package/core/utils/signup.util.js +227 -0
- package/core/utils/site.util.d.ts +22 -0
- package/core/utils/site.util.d.ts.map +1 -0
- package/core/utils/site.util.js +122 -0
- package/core/utils/taxonomy.util.d.ts +19 -0
- package/core/utils/taxonomy.util.d.ts.map +1 -0
- package/core/utils/taxonomy.util.js +52 -0
- package/core/utils/term.util.d.ts +13 -0
- package/core/utils/term.util.d.ts.map +1 -0
- package/core/utils/term.util.js +113 -0
- package/core/utils/trx.util.d.ts +24 -0
- package/core/utils/trx.util.d.ts.map +1 -0
- package/core/utils/trx.util.js +86 -0
- package/core/utils/user-self-registration.util.d.ts +46 -0
- package/core/utils/user-self-registration.util.d.ts.map +1 -0
- package/core/utils/user-self-registration.util.js +171 -0
- package/core/utils/user.util.d.ts +153 -0
- package/core/utils/user.util.d.ts.map +1 -0
- package/core/utils/user.util.js +550 -0
- package/core/utils/utils.d.ts +36 -0
- package/core/utils/utils.d.ts.map +1 -0
- package/core/utils/utils.js +85 -0
- package/core/validator.d.ts +11 -0
- package/core/validator.d.ts.map +1 -0
- package/core/validator.js +40 -0
- package/core/vars.d.ts +19 -0
- package/core/vars.d.ts.map +1 -0
- package/core/vars.js +54 -0
- package/crud/blog.crud.d.ts +56 -0
- package/crud/blog.crud.d.ts.map +1 -0
- package/crud/blog.crud.js +301 -0
- package/crud/comment.crud.d.ts +104 -0
- package/crud/comment.crud.d.ts.map +1 -0
- package/crud/comment.crud.js +431 -0
- package/crud/crud.d.ts +63 -0
- package/crud/crud.d.ts.map +1 -0
- package/crud/crud.js +278 -0
- package/crud/error.d.ts +23 -0
- package/crud/error.d.ts.map +1 -0
- package/crud/error.js +51 -0
- package/crud/meta.crud.d.ts +69 -0
- package/crud/meta.crud.d.ts.map +1 -0
- package/crud/meta.crud.js +244 -0
- package/crud/options.crud.d.ts +37 -0
- package/crud/options.crud.d.ts.map +1 -0
- package/crud/options.crud.js +178 -0
- package/crud/post.crud.d.ts +225 -0
- package/crud/post.crud.d.ts.map +1 -0
- package/crud/post.crud.js +589 -0
- package/crud/revision.crud.d.ts +76 -0
- package/crud/revision.crud.d.ts.map +1 -0
- package/crud/revision.crud.js +155 -0
- package/crud/roles.crud.d.ts +50 -0
- package/crud/roles.crud.d.ts.map +1 -0
- package/crud/roles.crud.js +198 -0
- package/crud/settings.crud.d.ts +50 -0
- package/crud/settings.crud.d.ts.map +1 -0
- package/crud/settings.crud.js +153 -0
- package/crud/site.crud.d.ts +62 -0
- package/crud/site.crud.d.ts.map +1 -0
- package/crud/site.crud.js +241 -0
- package/crud/sitemeta.crud.d.ts +55 -0
- package/crud/sitemeta.crud.d.ts.map +1 -0
- package/crud/sitemeta.crud.js +97 -0
- package/crud/term.crud.d.ts +85 -0
- package/crud/term.crud.d.ts.map +1 -0
- package/crud/term.crud.js +285 -0
- package/crud/user-self-registration.crud.d.ts +57 -0
- package/crud/user-self-registration.crud.d.ts.map +1 -0
- package/crud/user-self-registration.crud.js +173 -0
- package/crud/user.crud.d.ts +147 -0
- package/crud/user.crud.d.ts.map +1 -0
- package/crud/user.crud.js +626 -0
- package/database.d.ts +18 -0
- package/database.d.ts.map +1 -0
- package/database.js +80 -0
- package/decorators/async-init.d.ts +2 -0
- package/decorators/async-init.d.ts.map +1 -0
- package/decorators/async-init.js +7 -0
- package/decorators/component.d.ts +12 -0
- package/decorators/component.d.ts.map +1 -0
- package/decorators/component.js +47 -0
- package/decorators/hooks.d.ts +5 -0
- package/decorators/hooks.d.ts.map +1 -0
- package/decorators/hooks.js +30 -0
- package/defaults/extensions.d.ts +4 -0
- package/defaults/extensions.d.ts.map +1 -0
- package/defaults/extensions.js +34 -0
- package/defaults/index.d.ts +11 -0
- package/defaults/index.d.ts.map +1 -0
- package/defaults/index.js +49 -0
- package/defaults/options.d.ts +6 -0
- package/defaults/options.d.ts.map +1 -0
- package/defaults/options.js +267 -0
- package/defaults/post-status.d.ts +10 -0
- package/defaults/post-status.d.ts.map +1 -0
- package/defaults/post-status.js +83 -0
- package/defaults/post-types.d.ts +4 -0
- package/defaults/post-types.d.ts.map +1 -0
- package/defaults/post-types.js +72 -0
- package/defaults/roles.d.ts +31 -0
- package/defaults/roles.d.ts.map +1 -0
- package/defaults/roles.js +213 -0
- package/defaults/seeder.d.ts +34 -0
- package/defaults/seeder.d.ts.map +1 -0
- package/defaults/seeder.js +201 -0
- package/defaults/sitemeta.d.ts +2 -0
- package/defaults/sitemeta.d.ts.map +1 -0
- package/defaults/sitemeta.js +38 -0
- package/defaults/subdirectory-reserved-names.d.ts +2 -0
- package/defaults/subdirectory-reserved-names.d.ts.map +1 -0
- package/defaults/subdirectory-reserved-names.js +16 -0
- package/defaults/taxonomies.d.ts +5 -0
- package/defaults/taxonomies.d.ts.map +1 -0
- package/defaults/taxonomies.js +57 -0
- package/defaults/timezone.d.ts +2 -0
- package/defaults/timezone.d.ts.map +1 -0
- package/defaults/timezone.js +353 -0
- package/package.json +51 -0
- package/query-builder/alias.d.ts +24 -0
- package/query-builder/alias.d.ts.map +1 -0
- package/query-builder/alias.js +64 -0
- package/query-builder/blogs.query.d.ts +22 -0
- package/query-builder/blogs.query.d.ts.map +1 -0
- package/query-builder/blogs.query.js +85 -0
- package/query-builder/comments.query.d.ts +35 -0
- package/query-builder/comments.query.d.ts.map +1 -0
- package/query-builder/comments.query.js +211 -0
- package/query-builder/common.query.d.ts +18 -0
- package/query-builder/common.query.d.ts.map +1 -0
- package/query-builder/common.query.js +58 -0
- package/query-builder/index.d.ts +12 -0
- package/query-builder/index.d.ts.map +1 -0
- package/query-builder/index.js +27 -0
- package/query-builder/meta.query.d.ts +45 -0
- package/query-builder/meta.query.d.ts.map +1 -0
- package/query-builder/meta.query.js +188 -0
- package/query-builder/options.query.d.ts +19 -0
- package/query-builder/options.query.d.ts.map +1 -0
- package/query-builder/options.query.js +57 -0
- package/query-builder/posts.query.d.ts +30 -0
- package/query-builder/posts.query.d.ts.map +1 -0
- package/query-builder/posts.query.js +208 -0
- package/query-builder/query-builder.d.ts +21 -0
- package/query-builder/query-builder.d.ts.map +1 -0
- package/query-builder/query-builder.js +70 -0
- package/query-builder/query-builders.d.ts +18 -0
- package/query-builder/query-builders.d.ts.map +1 -0
- package/query-builder/query-builders.js +64 -0
- package/query-builder/site.query.d.ts +22 -0
- package/query-builder/site.query.d.ts.map +1 -0
- package/query-builder/site.query.js +85 -0
- package/query-builder/terms.query.d.ts +47 -0
- package/query-builder/terms.query.d.ts.map +1 -0
- package/query-builder/terms.query.js +233 -0
- package/query-builder/users.query.d.ts +37 -0
- package/query-builder/users.query.d.ts.map +1 -0
- package/query-builder/users.query.js +188 -0
- package/schema-builder/proxy.d.ts +10 -0
- package/schema-builder/proxy.d.ts.map +1 -0
- package/schema-builder/proxy.js +19 -0
- package/schema-builder/schema-builder.d.ts +21 -0
- package/schema-builder/schema-builder.d.ts.map +1 -0
- package/schema-builder/schema-builder.js +207 -0
- package/schema-builder/schema.d.ts +20 -0
- package/schema-builder/schema.d.ts.map +1 -0
- package/schema-builder/schema.js +527 -0
- package/transactions/blog.trx.d.ts +37 -0
- package/transactions/blog.trx.d.ts.map +1 -0
- package/transactions/blog.trx.js +296 -0
- package/transactions/comment.trx.d.ts +22 -0
- package/transactions/comment.trx.d.ts.map +1 -0
- package/transactions/comment.trx.js +311 -0
- package/transactions/index.d.ts +15 -0
- package/transactions/index.d.ts.map +1 -0
- package/transactions/index.js +30 -0
- package/transactions/link.trx.d.ts +22 -0
- package/transactions/link.trx.d.ts.map +1 -0
- package/transactions/link.trx.js +208 -0
- package/transactions/meta.trx.d.ts +30 -0
- package/transactions/meta.trx.d.ts.map +1 -0
- package/transactions/meta.trx.js +197 -0
- package/transactions/options.trx.d.ts +31 -0
- package/transactions/options.trx.d.ts.map +1 -0
- package/transactions/options.trx.js +192 -0
- package/transactions/post.trx.d.ts +48 -0
- package/transactions/post.trx.d.ts.map +1 -0
- package/transactions/post.trx.js +906 -0
- package/transactions/registration-log.trx.d.ts +14 -0
- package/transactions/registration-log.trx.d.ts.map +1 -0
- package/transactions/registration-log.trx.js +103 -0
- package/transactions/revision.trx.d.ts +32 -0
- package/transactions/revision.trx.d.ts.map +1 -0
- package/transactions/revision.trx.js +278 -0
- package/transactions/roles.trx.d.ts +20 -0
- package/transactions/roles.trx.d.ts.map +1 -0
- package/transactions/roles.trx.js +144 -0
- package/transactions/seeder.trx.d.ts +43 -0
- package/transactions/seeder.trx.d.ts.map +1 -0
- package/transactions/seeder.trx.js +530 -0
- package/transactions/signup.trx.d.ts +53 -0
- package/transactions/signup.trx.d.ts.map +1 -0
- package/transactions/signup.trx.js +305 -0
- package/transactions/site.trx.d.ts +21 -0
- package/transactions/site.trx.d.ts.map +1 -0
- package/transactions/site.trx.js +167 -0
- package/transactions/term.trx.d.ts +51 -0
- package/transactions/term.trx.d.ts.map +1 -0
- package/transactions/term.trx.js +838 -0
- package/transactions/trx.d.ts +9 -0
- package/transactions/trx.d.ts.map +1 -0
- package/transactions/trx.js +20 -0
- package/transactions/user.trx.d.ts +45 -0
- package/transactions/user.trx.d.ts.map +1 -0
- package/transactions/user.trx.js +535 -0
- package/types/capabilities.d.ts +71 -0
- package/types/common.d.ts +16 -0
- package/types/component.d.ts +3 -0
- package/types/config.d.ts +33 -0
- package/types/crud.d.ts +230 -0
- package/types/database.d.ts +50 -0
- package/types/hooks/actions.d.ts +67 -0
- package/types/hooks/command.d.ts +17 -0
- package/types/hooks/filters.d.ts +86 -0
- package/types/hooks/index.d.ts +11 -0
- package/types/index.d.ts +18 -0
- package/types/logging.d.ts +1 -0
- package/types/meta.d.ts +9 -0
- package/types/options.d.ts +3 -0
- package/types/post.d.ts +54 -0
- package/types/query-builder.d.ts +11 -0
- package/types/role.d.ts +34 -0
- package/types/schema.d.ts +11 -0
- package/types/schema.d.ts.map +1 -0
- package/types/schema.js +2 -0
- package/types/taxonomy.d.ts +29 -0
- package/types/timezone.d.ts +3 -0
- package/types/transactions.d.ts +32 -0
- package/types/user.d.ts +12 -0
- package/types/validating.d.ts +9 -0
- package/types/validating.d.ts.map +1 -0
- package/types/validating.js +2 -0
- package/validators/config.d.ts +948 -0
- package/validators/config.d.ts.map +1 -0
- package/validators/config.js +149 -0
- package/validators/crud.d.ts +571 -0
- package/validators/crud.d.ts.map +1 -0
- package/validators/crud.js +281 -0
- package/validators/database.d.ts +958 -0
- package/validators/database.d.ts.map +1 -0
- package/validators/database.js +245 -0
- package/validators/date.d.ts +4 -0
- package/validators/date.d.ts.map +1 -0
- package/validators/date.js +15 -0
- package/validators/helpers.d.ts +16 -0
- package/validators/helpers.d.ts.map +1 -0
- package/validators/helpers.js +86 -0
- package/validators/index.d.ts +10 -0
- package/validators/index.d.ts.map +1 -0
- package/validators/index.js +48 -0
- package/validators/options.d.ts +303 -0
- package/validators/options.d.ts.map +1 -0
- package/validators/options.js +106 -0
- package/validators/post-status.d.ts +42 -0
- package/validators/post-status.d.ts.map +1 -0
- package/validators/post-status.js +18 -0
- package/validators/query.d.ts +534 -0
- package/validators/query.d.ts.map +1 -0
- package/validators/query.js +110 -0
- package/validators/roles.d.ts +22 -0
- package/validators/roles.d.ts.map +1 -0
- package/validators/roles.js +9 -0
- package/validators/sitemeta.d.ts +105 -0
- package/validators/sitemeta.d.ts.map +1 -0
- package/validators/sitemeta.js +39 -0
- package/validators/transactions/blog.d.ts +225 -0
- package/validators/transactions/blog.d.ts.map +1 -0
- package/validators/transactions/blog.js +63 -0
- package/validators/transactions/comment.d.ts +155 -0
- package/validators/transactions/comment.d.ts.map +1 -0
- package/validators/transactions/comment.js +68 -0
- package/validators/transactions/index.d.ts +11 -0
- package/validators/transactions/index.d.ts.map +1 -0
- package/validators/transactions/index.js +26 -0
- package/validators/transactions/link.d.ts +128 -0
- package/validators/transactions/link.d.ts.map +1 -0
- package/validators/transactions/link.js +60 -0
- package/validators/transactions/meta.d.ts +23 -0
- package/validators/transactions/meta.d.ts.map +1 -0
- package/validators/transactions/meta.js +18 -0
- package/validators/transactions/post.d.ts +234 -0
- package/validators/transactions/post.d.ts.map +1 -0
- package/validators/transactions/post.js +100 -0
- package/validators/transactions/roles.d.ts +18 -0
- package/validators/transactions/roles.d.ts.map +1 -0
- package/validators/transactions/roles.js +13 -0
- package/validators/transactions/signup.d.ts +35 -0
- package/validators/transactions/signup.d.ts.map +1 -0
- package/validators/transactions/signup.js +51 -0
- package/validators/transactions/site.d.ts +36 -0
- package/validators/transactions/site.d.ts.map +1 -0
- package/validators/transactions/site.js +49 -0
- package/validators/transactions/term.d.ts +57 -0
- package/validators/transactions/term.d.ts.map +1 -0
- package/validators/transactions/term.js +44 -0
- package/validators/transactions/user.d.ts +182 -0
- package/validators/transactions/user.d.ts.map +1 -0
- package/validators/transactions/user.js +104 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/validators/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAGH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAalB,CAAC;AAGH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;EAKxB,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCrB,CAAC;AAGH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBlB,CAAC;AAGH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;EAKpB,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAGH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBlB,CAAC;AAGH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAGH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBpB,CAAC;AAGH,eAAO,MAAM,MAAM;;;;;;;;;;;;EAIjB,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAGH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;EAQlB,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAGH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAOzB,CAAC;AAGH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAGH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBlB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBpB,CAAC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wpTables = exports.wpUsers = exports.wpUserMeta = exports.wpTermTaxonomy = exports.wpTermRelationships = exports.wpTerms = exports.wpTermMeta = exports.wpSiteMeta = exports.wpSite = exports.wpSignups = exports.wpRegistrationLog = exports.wpPosts = exports.wpPostMeta = exports.wpOptions = exports.wpLinks = exports.wpComments = exports.wpCommentMeta = exports.wpBlogs = exports.wpBlogMeta = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const date_1 = require("./date");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
//import { undefinedIfEmptyString } from "./helpers";
|
|
8
|
+
// Define the schema for the `wp_blogmeta` table
|
|
9
|
+
exports.wpBlogMeta = zod_1.z.object({
|
|
10
|
+
meta_id: zod_1.z.number().int().nonnegative(),
|
|
11
|
+
blog_id: zod_1.z.number().int().nonnegative().default(0),
|
|
12
|
+
meta_key: zod_1.z.string().trim().max(255).nullable(),
|
|
13
|
+
meta_value: zod_1.z.string().trim().nullable(),
|
|
14
|
+
});
|
|
15
|
+
// Define the schema for the `wp_blogs` table
|
|
16
|
+
exports.wpBlogs = zod_1.z.object({
|
|
17
|
+
blog_id: zod_1.z.number().int().nonnegative(),
|
|
18
|
+
site_id: zod_1.z.number().int().nonnegative().default(0),
|
|
19
|
+
domain: zod_1.z.string().max(200).trim().default(""),
|
|
20
|
+
path: zod_1.z.string().max(100).trim().default("/"),
|
|
21
|
+
registered: date_1.mySQLDate,
|
|
22
|
+
last_updated: date_1.mySQLDate,
|
|
23
|
+
public: zod_1.z.number().max(1).nonnegative().default(1),
|
|
24
|
+
archived: zod_1.z.number().max(1).nonnegative().default(0),
|
|
25
|
+
mature: zod_1.z.number().max(1).nonnegative().default(0),
|
|
26
|
+
spam: zod_1.z.number().max(1).nonnegative().default(0),
|
|
27
|
+
deleted: zod_1.z.number().max(1).nonnegative().default(0),
|
|
28
|
+
lang_id: zod_1.z.number().int().default(0),
|
|
29
|
+
});
|
|
30
|
+
// Define the schema for the `wp_commentmeta` table
|
|
31
|
+
exports.wpCommentMeta = zod_1.z.object({
|
|
32
|
+
meta_id: zod_1.z.number().int().nonnegative(),
|
|
33
|
+
comment_id: zod_1.z.number().int().nonnegative().default(0),
|
|
34
|
+
meta_key: zod_1.z.string().max(255).trim().nullable(),
|
|
35
|
+
meta_value: zod_1.z.string().trim().nullable(),
|
|
36
|
+
});
|
|
37
|
+
// Define the schema for the `wp_comments` table
|
|
38
|
+
exports.wpComments = zod_1.z.object({
|
|
39
|
+
comment_ID: zod_1.z.number().int().nonnegative(),
|
|
40
|
+
comment_post_ID: zod_1.z.number().int().nonnegative().default(0),
|
|
41
|
+
comment_author: zod_1.z.string().trim().max(245).default(""),
|
|
42
|
+
// comment_author: z.union([
|
|
43
|
+
// z.string().max(245).trim().transform(undefinedIfEmptyString),
|
|
44
|
+
// z.string().max(0).optional(),
|
|
45
|
+
// ]),
|
|
46
|
+
comment_author_email: zod_1.z.union([
|
|
47
|
+
zod_1.z.string().max(100).email().trim(), //.transform(undefinedIfEmptyString),
|
|
48
|
+
zod_1.z.string().max(0).optional(),
|
|
49
|
+
]),
|
|
50
|
+
comment_author_url: zod_1.z.union([
|
|
51
|
+
zod_1.z.string().url().max(100).trim().default(""),
|
|
52
|
+
zod_1.z.string().max(0).optional(),
|
|
53
|
+
]),
|
|
54
|
+
comment_author_IP: zod_1.z.union([
|
|
55
|
+
zod_1.z.string().trim().max(100).ip().default(""),
|
|
56
|
+
zod_1.z.string().max(0).optional(),
|
|
57
|
+
]),
|
|
58
|
+
comment_date: date_1.mySQLDate,
|
|
59
|
+
comment_date_gmt: date_1.mySQLDate,
|
|
60
|
+
comment_content: zod_1.z.string().trim().max(65525).default(""),
|
|
61
|
+
comment_karma: zod_1.z.number().int().default(0),
|
|
62
|
+
comment_approved: zod_1.z.union([
|
|
63
|
+
zod_1.z.number().max(1).nonnegative().default(1),
|
|
64
|
+
zod_1.z.enum(["0", "1", "spam", "trash", "post-trashed", "approve", "hold"]),
|
|
65
|
+
]),
|
|
66
|
+
comment_agent: zod_1.z.string().max(255).trim().default(""),
|
|
67
|
+
comment_type: zod_1.z.string().max(20).trim().min(1).default("comment"),
|
|
68
|
+
comment_parent: zod_1.z.number().int().nonnegative().default(0),
|
|
69
|
+
user_id: zod_1.z.number().int().nonnegative().default(0),
|
|
70
|
+
});
|
|
71
|
+
// Define the schema for the `wp_links` table
|
|
72
|
+
exports.wpLinks = zod_1.z.object({
|
|
73
|
+
link_id: zod_1.z.number().int().nonnegative(),
|
|
74
|
+
link_url: zod_1.z.string().max(255).url().trim(),
|
|
75
|
+
link_name: zod_1.z.string().max(255).trim(),
|
|
76
|
+
link_image: zod_1.z.string().max(255).trim().default(""),
|
|
77
|
+
link_target: zod_1.z.string().max(25).trim().default(""),
|
|
78
|
+
link_description: zod_1.z.string().max(255).trim().default(""),
|
|
79
|
+
link_visible: zod_1.z.string().max(20).trim().default("Y"),
|
|
80
|
+
link_owner: zod_1.z.number().int().nonnegative().default(1),
|
|
81
|
+
link_rating: zod_1.z.number().int().default(0),
|
|
82
|
+
link_updated: date_1.mySQLDate,
|
|
83
|
+
link_rel: zod_1.z.string().max(255).trim().default(""),
|
|
84
|
+
link_notes: zod_1.z.string().trim().optional().default(""),
|
|
85
|
+
link_rss: zod_1.z.union([
|
|
86
|
+
zod_1.z.string().max(255).url().trim(), //.transform(undefinedIfEmptyString),
|
|
87
|
+
zod_1.z.string().max(0).optional().default(""),
|
|
88
|
+
]),
|
|
89
|
+
});
|
|
90
|
+
// Define the schema for the `wp_options` table
|
|
91
|
+
exports.wpOptions = zod_1.z.object({
|
|
92
|
+
option_id: zod_1.z.number().int().nonnegative(),
|
|
93
|
+
option_name: zod_1.z.string().max(191).trim().default(""),
|
|
94
|
+
option_value: zod_1.z.string().trim(),
|
|
95
|
+
autoload: zod_1.z.string().max(20).trim().default("yes"),
|
|
96
|
+
});
|
|
97
|
+
// Define the schema for the `wp_postmeta` table
|
|
98
|
+
exports.wpPostMeta = zod_1.z.object({
|
|
99
|
+
meta_id: zod_1.z.number().int().nonnegative(),
|
|
100
|
+
post_id: zod_1.z.number().int().nonnegative().default(0),
|
|
101
|
+
meta_key: zod_1.z.string().max(255).trim().nullable(),
|
|
102
|
+
meta_value: zod_1.z.string().trim().nullable(),
|
|
103
|
+
});
|
|
104
|
+
// Define the schema for the `wp_posts` table
|
|
105
|
+
exports.wpPosts = zod_1.z.object({
|
|
106
|
+
ID: zod_1.z.number().int().nonnegative(),
|
|
107
|
+
post_author: zod_1.z.number().int().nonnegative().default(0),
|
|
108
|
+
post_date: date_1.mySQLDate,
|
|
109
|
+
post_date_gmt: date_1.mySQLDate,
|
|
110
|
+
post_content: zod_1.z.string().trim().default(""),
|
|
111
|
+
post_title: zod_1.z.string().max(65535).trim().default(""), // text type max length in MySQL
|
|
112
|
+
post_excerpt: zod_1.z.string().max(65535).trim().default(""), // text type max length in MySQL
|
|
113
|
+
post_status: zod_1.z.string().max(20).trim().default("publish"),
|
|
114
|
+
comment_status: zod_1.z.string().max(20).trim().default("open"),
|
|
115
|
+
ping_status: zod_1.z.string().max(20).trim().default("open"),
|
|
116
|
+
post_password: zod_1.z.string().max(255).trim().default(""),
|
|
117
|
+
post_name: zod_1.z.string().max(200).trim().default(""),
|
|
118
|
+
to_ping: zod_1.z.string().max(65535).trim().default(""), // text type max length in MySQL
|
|
119
|
+
pinged: zod_1.z.string().max(65535).trim().default(""), // text type max length in MySQL
|
|
120
|
+
post_modified: date_1.mySQLDate,
|
|
121
|
+
post_modified_gmt: date_1.mySQLDate,
|
|
122
|
+
post_content_filtered: zod_1.z.string().trim().default(""),
|
|
123
|
+
post_parent: zod_1.z.number().int().nonnegative().default(0),
|
|
124
|
+
guid: zod_1.z.string().max(255).trim().default(""),
|
|
125
|
+
menu_order: zod_1.z.number().int().default(0),
|
|
126
|
+
post_type: zod_1.z.string().max(20).trim().default("post"),
|
|
127
|
+
post_mime_type: zod_1.z.string().max(100).trim().default(""),
|
|
128
|
+
comment_count: zod_1.z.number().int().nonnegative().default(0),
|
|
129
|
+
});
|
|
130
|
+
// Define the schema for the `wp_registration_log` table
|
|
131
|
+
exports.wpRegistrationLog = zod_1.z.object({
|
|
132
|
+
ID: zod_1.z.number().int().nonnegative(),
|
|
133
|
+
email: zod_1.z.string().email().trim(),
|
|
134
|
+
IP: zod_1.z.union([zod_1.z.string().ip().trim(), zod_1.z.string().max(0).optional()]),
|
|
135
|
+
blog_id: zod_1.z.number().int().nonnegative(),
|
|
136
|
+
date_registered: date_1.mySQLDate,
|
|
137
|
+
});
|
|
138
|
+
// Define the schema for the `wp_signups` table
|
|
139
|
+
exports.wpSignups = zod_1.z.object({
|
|
140
|
+
signup_id: zod_1.z.number().int().nonnegative(),
|
|
141
|
+
domain: zod_1.z.string().max(200).trim().default(""),
|
|
142
|
+
path: zod_1.z.string().max(100).trim().default(""),
|
|
143
|
+
title: zod_1.z.string().trim(),
|
|
144
|
+
user_login: zod_1.z.string().max(60).trim().default(""),
|
|
145
|
+
user_email: zod_1.z.string().email().max(100).trim().default(""),
|
|
146
|
+
registered: date_1.mySQLDate,
|
|
147
|
+
activated: date_1.mySQLDate,
|
|
148
|
+
active: zod_1.z.number().max(1).nonnegative().default(0),
|
|
149
|
+
activation_key: zod_1.z.string().max(50).trim().default(""),
|
|
150
|
+
meta: zod_1.z
|
|
151
|
+
.string()
|
|
152
|
+
.trim()
|
|
153
|
+
.nullable()
|
|
154
|
+
.transform((v) => common_1.formatting.primitive(v)),
|
|
155
|
+
});
|
|
156
|
+
// Define the schema for the `wp_site` table
|
|
157
|
+
exports.wpSite = zod_1.z.object({
|
|
158
|
+
id: zod_1.z.number().int().nonnegative(),
|
|
159
|
+
domain: zod_1.z.string().max(200).trim().default(""),
|
|
160
|
+
path: zod_1.z.string().max(100).trim().default(""),
|
|
161
|
+
});
|
|
162
|
+
// Define the schema for the `wp_sitemeta` table
|
|
163
|
+
exports.wpSiteMeta = zod_1.z.object({
|
|
164
|
+
meta_id: zod_1.z.number().int().nonnegative(),
|
|
165
|
+
site_id: zod_1.z.number().int().nonnegative().default(0),
|
|
166
|
+
meta_key: zod_1.z.string().max(255).trim().nullable(),
|
|
167
|
+
meta_value: zod_1.z.string().trim().nullable(),
|
|
168
|
+
});
|
|
169
|
+
// Define the schema for the `wp_termmeta` table
|
|
170
|
+
exports.wpTermMeta = zod_1.z.object({
|
|
171
|
+
meta_id: zod_1.z.number().int().nonnegative(),
|
|
172
|
+
term_id: zod_1.z.number().int().nonnegative().default(0),
|
|
173
|
+
meta_key: zod_1.z.string().max(255).trim().nullable(),
|
|
174
|
+
meta_value: zod_1.z.string().trim().nullable(),
|
|
175
|
+
});
|
|
176
|
+
// Define the schema for the `wp_terms` table
|
|
177
|
+
exports.wpTerms = zod_1.z.object({
|
|
178
|
+
term_id: zod_1.z.number().int().nonnegative(),
|
|
179
|
+
name: zod_1.z.string().max(200).trim(),
|
|
180
|
+
slug: zod_1.z
|
|
181
|
+
.string()
|
|
182
|
+
.max(200)
|
|
183
|
+
.transform((v) => common_1.formatting.slug(v)),
|
|
184
|
+
term_group: zod_1.z.number().default(0),
|
|
185
|
+
});
|
|
186
|
+
// Define the schema for the `wp_term_relationships` table
|
|
187
|
+
exports.wpTermRelationships = zod_1.z.object({
|
|
188
|
+
object_id: zod_1.z.number().int().nonnegative().default(0),
|
|
189
|
+
term_taxonomy_id: zod_1.z.number().int().nonnegative().default(0),
|
|
190
|
+
term_order: zod_1.z.number().int().default(0),
|
|
191
|
+
});
|
|
192
|
+
// Define the schema for the `wp_term_taxonomy` table
|
|
193
|
+
exports.wpTermTaxonomy = zod_1.z.object({
|
|
194
|
+
term_taxonomy_id: zod_1.z.number().int().nonnegative(),
|
|
195
|
+
term_id: zod_1.z.number().int().nonnegative().default(0),
|
|
196
|
+
taxonomy: zod_1.z.string().max(32).trim().default(""),
|
|
197
|
+
description: zod_1.z.string().trim().default(""),
|
|
198
|
+
parent: zod_1.z.number().int().nonnegative().default(0),
|
|
199
|
+
count: zod_1.z.number().int().nonnegative().default(0),
|
|
200
|
+
});
|
|
201
|
+
// Define the schema for the `wp_usermeta` table
|
|
202
|
+
exports.wpUserMeta = zod_1.z.object({
|
|
203
|
+
umeta_id: zod_1.z.number().int().nonnegative(),
|
|
204
|
+
user_id: zod_1.z.number().int().nonnegative().default(0),
|
|
205
|
+
meta_key: zod_1.z.string().max(255).trim().nullable(),
|
|
206
|
+
meta_value: zod_1.z.string().trim().nullable(),
|
|
207
|
+
});
|
|
208
|
+
// Define the schema for the `wp_users` table
|
|
209
|
+
exports.wpUsers = zod_1.z.object({
|
|
210
|
+
ID: zod_1.z.number().int().nonnegative(),
|
|
211
|
+
user_login: zod_1.z.string().max(60).trim().toLowerCase().default(""),
|
|
212
|
+
user_pass: zod_1.z.string().max(255).trim().default(""),
|
|
213
|
+
user_nicename: zod_1.z.string().max(50).trim().default(""),
|
|
214
|
+
user_email: zod_1.z.string().email().max(100).trim().default(""),
|
|
215
|
+
user_url: zod_1.z.union([
|
|
216
|
+
zod_1.z.string().url().max(100).trim().default(""),
|
|
217
|
+
zod_1.z.string().max(0).optional(),
|
|
218
|
+
]),
|
|
219
|
+
user_registered: date_1.mySQLDateWithZeroDefaultDate,
|
|
220
|
+
user_activation_key: zod_1.z.string().max(255).trim().default(""),
|
|
221
|
+
user_status: zod_1.z.number().int().default(0),
|
|
222
|
+
display_name: zod_1.z.string().max(250).trim().default(""),
|
|
223
|
+
spam: zod_1.z.number().max(1).nonnegative().default(0),
|
|
224
|
+
deleted: zod_1.z.number().max(1).nonnegative().default(0),
|
|
225
|
+
});
|
|
226
|
+
exports.wpTables = {
|
|
227
|
+
blogmeta: exports.wpBlogMeta,
|
|
228
|
+
blogs: exports.wpBlogs,
|
|
229
|
+
commentmeta: exports.wpCommentMeta,
|
|
230
|
+
comments: exports.wpComments,
|
|
231
|
+
links: exports.wpLinks,
|
|
232
|
+
options: exports.wpOptions,
|
|
233
|
+
postmeta: exports.wpPostMeta,
|
|
234
|
+
posts: exports.wpPosts,
|
|
235
|
+
registration_log: exports.wpRegistrationLog,
|
|
236
|
+
signups: exports.wpSignups,
|
|
237
|
+
site: exports.wpSite,
|
|
238
|
+
sitemeta: exports.wpSiteMeta,
|
|
239
|
+
termmeta: exports.wpTermMeta,
|
|
240
|
+
term_relationships: exports.wpTermRelationships,
|
|
241
|
+
term_taxonomy: exports.wpTermTaxonomy,
|
|
242
|
+
terms: exports.wpTerms,
|
|
243
|
+
users: exports.wpUsers,
|
|
244
|
+
usermeta: exports.wpUserMeta,
|
|
245
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const mySQLDate: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined, z.ZodEffects<z.ZodUnknown, undefined, unknown>]>;
|
|
3
|
+
export declare const mySQLDateWithZeroDefaultDate: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodUndefined, z.ZodEffects<z.ZodUnknown, undefined, unknown>]>;
|
|
4
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/validators/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,SAAS,yGAIpB,CAAC;AAEH,eAAO,MAAM,4BAA4B,yGAIvC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mySQLDateWithZeroDefaultDate = exports.mySQLDate = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
exports.mySQLDate = zod_1.z.union([
|
|
7
|
+
zod_1.z.string().default(() => common_1.formatting.dateMySQL()),
|
|
8
|
+
zod_1.z.undefined(),
|
|
9
|
+
zod_1.z.unknown().transform(() => undefined),
|
|
10
|
+
]);
|
|
11
|
+
exports.mySQLDateWithZeroDefaultDate = zod_1.z.union([
|
|
12
|
+
zod_1.z.string().default("0000-00-00T00:00:00Z"),
|
|
13
|
+
zod_1.z.undefined(),
|
|
14
|
+
zod_1.z.unknown().transform(() => undefined),
|
|
15
|
+
]);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare function unionOfLiterals<T extends string | number>(constants: readonly T[]): readonly [z.ZodLiteral<T>, z.ZodLiteral<T>, ...z.ZodLiteral<T>[]];
|
|
3
|
+
export declare const undefinedIfEmptyString: (v?: string | null | undefined) => string | undefined;
|
|
4
|
+
export declare const numberWithDefault: (d: number) => z.ZodUnion<[z.ZodDefault<z.ZodNumber>, z.ZodEffects<z.ZodString, number, string>]>;
|
|
5
|
+
export declare const booleanWithDefault: (d: "true" | "false") => z.ZodUnion<[z.ZodEffects<z.ZodBoolean, "false" | "true", boolean>, z.ZodDefault<z.ZodEnum<["true", "false"]>>, z.ZodNumber]>;
|
|
6
|
+
export declare const number: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodString, number, string>]>;
|
|
7
|
+
export declare const numberArr: z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodEffects<z.ZodString, number[], string>]>;
|
|
8
|
+
export declare const stringArr: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodEffects<z.ZodString, string[], string>]>;
|
|
9
|
+
export declare const boolean: z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodEnum<["1", "0", "true", "false"]>, boolean, "false" | "true" | "0" | "1">]>;
|
|
10
|
+
export declare const path: z.ZodEffects<z.ZodString, string, string>;
|
|
11
|
+
export declare const string: z.ZodEffects<z.ZodAny, string, any>;
|
|
12
|
+
export declare const stringZeroOrOne: z.ZodUnion<[z.ZodDefault<z.ZodOptional<z.ZodEnum<["0", "1"]>>>, z.ZodEffects<z.ZodEffects<z.ZodNumber, 0 | 1, number>, string, number>, z.ZodEffects<z.ZodBoolean, "0" | "1", boolean>]>;
|
|
13
|
+
export declare const stringMetaTable: z.ZodEnum<["post", "comment", "blog", "term", "user", "site"]>;
|
|
14
|
+
export declare const userRef: z.ZodEffects<z.ZodString, string | number, string>;
|
|
15
|
+
export declare const blogFlag: z.ZodEnum<["public", "archived", "mature", "spam", "deleted"]>;
|
|
16
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/validators/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACvD,SAAS,EAAE,SAAS,CAAC,EAAE,qEAQxB;AAED,eAAO,MAAM,sBAAsB,GAAI,IAAI,MAAM,GAAG,IAAI,GAAG,SAAS,uBAC/B,CAAC;AAEtC,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,uFAQ1C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,GAAG,OAAO,iIAKlD,CAAC;AAEL,eAAO,MAAM,MAAM,sEAMjB,CAAC;AAEH,eAAO,MAAM,SAAS,4FAGpB,CAAC;AAEH,eAAO,MAAM,SAAS,4FAGpB,CAAC;AAEH,eAAO,MAAM,OAAO,yHAKlB,CAAC;AAEH,eAAO,MAAM,IAAI,2CAKkB,CAAC;AAEpC,eAAO,MAAM,MAAM,qCAAmC,CAAC;AAEvD,eAAO,MAAM,eAAe,0LAQ1B,CAAC;AAEH,eAAO,MAAM,eAAe,gEAO1B,CAAC;AAEH,eAAO,MAAM,OAAO,oDAKlB,CAAC;AAEH,eAAO,MAAM,QAAQ,gEAMnB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blogFlag = exports.userRef = exports.stringMetaTable = exports.stringZeroOrOne = exports.string = exports.path = exports.boolean = exports.stringArr = exports.numberArr = exports.number = exports.booleanWithDefault = exports.numberWithDefault = exports.undefinedIfEmptyString = void 0;
|
|
4
|
+
exports.unionOfLiterals = unionOfLiterals;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
// https://github.com/colinhacks/zod/discussions/2790
|
|
7
|
+
function unionOfLiterals(constants) {
|
|
8
|
+
const literals = constants.map((x) => zod_1.z.literal(x));
|
|
9
|
+
return literals;
|
|
10
|
+
}
|
|
11
|
+
const undefinedIfEmptyString = (v) => !v || 0 >= v.length ? undefined : v;
|
|
12
|
+
exports.undefinedIfEmptyString = undefinedIfEmptyString;
|
|
13
|
+
const numberWithDefault = (d) => {
|
|
14
|
+
return zod_1.z.union([
|
|
15
|
+
zod_1.z.number().nonnegative().default(d),
|
|
16
|
+
zod_1.z
|
|
17
|
+
.string()
|
|
18
|
+
//.refine((v) => /^[0-9]+$/.test(v))
|
|
19
|
+
.transform((v) => parseInt(v)),
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
exports.numberWithDefault = numberWithDefault;
|
|
23
|
+
const booleanWithDefault = (d) => zod_1.z.union([
|
|
24
|
+
zod_1.z.boolean().transform((v) => (v ? "true" : "false")),
|
|
25
|
+
zod_1.z.enum(["true", "false"]).default(d),
|
|
26
|
+
zod_1.z.number().max(1).nonnegative(),
|
|
27
|
+
]);
|
|
28
|
+
exports.booleanWithDefault = booleanWithDefault;
|
|
29
|
+
exports.number = zod_1.z.union([
|
|
30
|
+
zod_1.z.number().nonnegative(),
|
|
31
|
+
zod_1.z
|
|
32
|
+
.string()
|
|
33
|
+
// .refine((v) => /^[0-9]+$/.test(v))
|
|
34
|
+
.transform((v) => parseInt(v)),
|
|
35
|
+
]);
|
|
36
|
+
exports.numberArr = zod_1.z.union([
|
|
37
|
+
zod_1.z.array(zod_1.z.number()),
|
|
38
|
+
zod_1.z.string().transform((v) => v.split(",").map((v) => parseInt(v))),
|
|
39
|
+
]);
|
|
40
|
+
exports.stringArr = zod_1.z.union([
|
|
41
|
+
zod_1.z.array(zod_1.z.string()),
|
|
42
|
+
zod_1.z.string().transform((v) => v.split(",")),
|
|
43
|
+
]);
|
|
44
|
+
exports.boolean = zod_1.z.union([
|
|
45
|
+
zod_1.z.boolean(),
|
|
46
|
+
zod_1.z
|
|
47
|
+
.enum(["1", "0", "true", "false"])
|
|
48
|
+
.transform((v) => v === "1" || v === "true"),
|
|
49
|
+
]);
|
|
50
|
+
exports.path = zod_1.z
|
|
51
|
+
.string()
|
|
52
|
+
.min(1)
|
|
53
|
+
.max(100)
|
|
54
|
+
.trim()
|
|
55
|
+
.refine((v) => v.startsWith("/"));
|
|
56
|
+
exports.string = zod_1.z.any().transform((v) => `${v}`);
|
|
57
|
+
exports.stringZeroOrOne = zod_1.z.union([
|
|
58
|
+
zod_1.z.enum(["0", "1"]).optional().default("0"),
|
|
59
|
+
zod_1.z
|
|
60
|
+
.number()
|
|
61
|
+
.int()
|
|
62
|
+
.refine((value) => value === 0 || value === 1)
|
|
63
|
+
.transform((value) => `${value}`),
|
|
64
|
+
zod_1.z.boolean().transform((value) => (value ? "1" : "0")),
|
|
65
|
+
]);
|
|
66
|
+
exports.stringMetaTable = zod_1.z.enum([
|
|
67
|
+
"post",
|
|
68
|
+
"comment",
|
|
69
|
+
"blog",
|
|
70
|
+
"term",
|
|
71
|
+
"user",
|
|
72
|
+
"site",
|
|
73
|
+
]);
|
|
74
|
+
exports.userRef = zod_1.z.string().transform((val) => {
|
|
75
|
+
if (val.match(/^\d+$/)) {
|
|
76
|
+
return parseInt(val);
|
|
77
|
+
}
|
|
78
|
+
return val;
|
|
79
|
+
});
|
|
80
|
+
exports.blogFlag = zod_1.z.enum([
|
|
81
|
+
"public",
|
|
82
|
+
"archived",
|
|
83
|
+
"mature",
|
|
84
|
+
"spam",
|
|
85
|
+
"deleted",
|
|
86
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as database from "./database";
|
|
2
|
+
export * as roles from "./roles";
|
|
3
|
+
export * as config from "./config";
|
|
4
|
+
export * as trx from "./transactions";
|
|
5
|
+
export * as query from "./query";
|
|
6
|
+
export * as crud from "./crud";
|
|
7
|
+
export * from "./options";
|
|
8
|
+
export * from "./sitemeta";
|
|
9
|
+
export * as helpers from "./helpers";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAE3B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.helpers = exports.crud = exports.query = exports.trx = exports.config = exports.roles = exports.database = void 0;
|
|
40
|
+
exports.database = __importStar(require("./database"));
|
|
41
|
+
exports.roles = __importStar(require("./roles"));
|
|
42
|
+
exports.config = __importStar(require("./config"));
|
|
43
|
+
exports.trx = __importStar(require("./transactions"));
|
|
44
|
+
exports.query = __importStar(require("./query"));
|
|
45
|
+
exports.crud = __importStar(require("./crud"));
|
|
46
|
+
__exportStar(require("./options"), exports);
|
|
47
|
+
__exportStar(require("./sitemeta"), exports);
|
|
48
|
+
exports.helpers = __importStar(require("./helpers"));
|