@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/common/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.hierarchy = void 0;
|
|
40
|
+
__exportStar(require("./config/define-wp.config."), exports);
|
|
41
|
+
__exportStar(require("./async-constructor"), exports);
|
|
42
|
+
__exportStar(require("./php-serialize"), exports);
|
|
43
|
+
__exportStar(require("./date"), exports);
|
|
44
|
+
__exportStar(require("./formatting"), exports);
|
|
45
|
+
__exportStar(require("./password"), exports);
|
|
46
|
+
__exportStar(require("./validating"), exports);
|
|
47
|
+
__exportStar(require("./config"), exports);
|
|
48
|
+
exports.hierarchy = __importStar(require("./hierarchy"));
|
|
49
|
+
__exportStar(require("./define-hooks"), exports);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const hashPassword: (plainText: string) => string;
|
|
2
|
+
export declare const checkPassword: (plainText: string, storedHash: string) => boolean;
|
|
3
|
+
export declare const generatePassword: (length?: number, specialChars?: boolean, extraSpecialChars?: boolean) => string;
|
|
4
|
+
//# sourceMappingURL=password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../src/common/password.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,WAG7C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,EAAE,YAAY,MAAM,YAGlE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,SAAQ,MAAW,EACnB,eAAc,OAAc,EAC5B,oBAAmB,OAAe,KACjC,MAmBF,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
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.generatePassword = exports.checkPassword = exports.hashPassword = void 0;
|
|
37
|
+
const crypto = __importStar(require("crypto"));
|
|
38
|
+
const hashPassword = (plainText) => {
|
|
39
|
+
const passwordHash = new PasswordHash(8, true);
|
|
40
|
+
return passwordHash.hashPassword(plainText);
|
|
41
|
+
};
|
|
42
|
+
exports.hashPassword = hashPassword;
|
|
43
|
+
const checkPassword = (plainText, storedHash) => {
|
|
44
|
+
const passwordHash = new PasswordHash(8, true);
|
|
45
|
+
return passwordHash.checkPassword(plainText, storedHash);
|
|
46
|
+
};
|
|
47
|
+
exports.checkPassword = checkPassword;
|
|
48
|
+
const generatePassword = (length = 12, specialChars = true, extraSpecialChars = false) => {
|
|
49
|
+
let chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
50
|
+
if (specialChars) {
|
|
51
|
+
chars += "!@#$%^&*()";
|
|
52
|
+
}
|
|
53
|
+
if (extraSpecialChars) {
|
|
54
|
+
chars += "-_ []{}<>~`+=,.;:/?|";
|
|
55
|
+
}
|
|
56
|
+
let password = "";
|
|
57
|
+
for (let i = 0; i < length; i++) {
|
|
58
|
+
password += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
59
|
+
}
|
|
60
|
+
return password;
|
|
61
|
+
};
|
|
62
|
+
exports.generatePassword = generatePassword;
|
|
63
|
+
const CRYPT_BLOWFISH = 1;
|
|
64
|
+
class PasswordHash {
|
|
65
|
+
itoa64;
|
|
66
|
+
iterationCountLog2;
|
|
67
|
+
portableHashes;
|
|
68
|
+
randomState;
|
|
69
|
+
constructor(iterationCountLog2, portableHashes) {
|
|
70
|
+
this.itoa64 =
|
|
71
|
+
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
72
|
+
if (iterationCountLog2 < 4 || iterationCountLog2 > 31) {
|
|
73
|
+
iterationCountLog2 = 8;
|
|
74
|
+
}
|
|
75
|
+
this.iterationCountLog2 = iterationCountLog2;
|
|
76
|
+
this.portableHashes = portableHashes;
|
|
77
|
+
this.randomState = Date.now().toString();
|
|
78
|
+
if (typeof process !== "undefined" && typeof process.pid !== "undefined") {
|
|
79
|
+
this.randomState += process.pid.toString();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
getRandomBytes(count) {
|
|
83
|
+
let output = "";
|
|
84
|
+
try {
|
|
85
|
+
const randomBytes = crypto.randomBytes(count);
|
|
86
|
+
output = randomBytes.toString("hex");
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
for (let i = 0; i < count; i += 16) {
|
|
90
|
+
this.randomState = crypto
|
|
91
|
+
.createHash("md5")
|
|
92
|
+
.update(this.randomState + Math.random())
|
|
93
|
+
.digest("binary");
|
|
94
|
+
output += crypto
|
|
95
|
+
.createHash("md5")
|
|
96
|
+
.update(this.randomState, "binary")
|
|
97
|
+
.digest("binary");
|
|
98
|
+
}
|
|
99
|
+
output = output.substring(0, count);
|
|
100
|
+
}
|
|
101
|
+
return output;
|
|
102
|
+
}
|
|
103
|
+
encode64(input, count) {
|
|
104
|
+
let output = "";
|
|
105
|
+
let i = 0;
|
|
106
|
+
do {
|
|
107
|
+
let value = input.charCodeAt(i++);
|
|
108
|
+
output += this.itoa64[value & 0x3f];
|
|
109
|
+
if (i < count) {
|
|
110
|
+
value |= input.charCodeAt(i) << 8;
|
|
111
|
+
}
|
|
112
|
+
output += this.itoa64[(value >> 6) & 0x3f];
|
|
113
|
+
if (i++ >= count) {
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
if (i < count) {
|
|
117
|
+
value |= input.charCodeAt(i) << 16;
|
|
118
|
+
}
|
|
119
|
+
output += this.itoa64[(value >> 12) & 0x3f];
|
|
120
|
+
if (i++ >= count) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
output += this.itoa64[(value >> 18) & 0x3f];
|
|
124
|
+
} while (i < count);
|
|
125
|
+
return output;
|
|
126
|
+
}
|
|
127
|
+
genSaltPrivate(input) {
|
|
128
|
+
let output = "$P$";
|
|
129
|
+
output +=
|
|
130
|
+
this.itoa64[Math.min(this.iterationCountLog2 +
|
|
131
|
+
(parseInt(process.versions.node, 10) >= 5 ? 5 : 3), 30)];
|
|
132
|
+
output += this.encode64(input, 6);
|
|
133
|
+
return output;
|
|
134
|
+
}
|
|
135
|
+
cryptPrivate(password, setting) {
|
|
136
|
+
let output = "*0";
|
|
137
|
+
if (setting.substring(0, 2) === output) {
|
|
138
|
+
output = "*1";
|
|
139
|
+
}
|
|
140
|
+
const id = setting.substring(0, 3);
|
|
141
|
+
if (id !== "$P$" && id !== "$H$") {
|
|
142
|
+
return output;
|
|
143
|
+
}
|
|
144
|
+
const countLog2 = this.itoa64.indexOf(setting[3]);
|
|
145
|
+
if (countLog2 < 7 || countLog2 > 30) {
|
|
146
|
+
return output;
|
|
147
|
+
}
|
|
148
|
+
let count = 1 << countLog2;
|
|
149
|
+
const salt = setting.substring(4, 12);
|
|
150
|
+
if (salt.length !== 8) {
|
|
151
|
+
return output;
|
|
152
|
+
}
|
|
153
|
+
let hash = crypto
|
|
154
|
+
.createHash("md5")
|
|
155
|
+
.update(salt + password, "binary")
|
|
156
|
+
.digest("binary");
|
|
157
|
+
do {
|
|
158
|
+
hash = crypto
|
|
159
|
+
.createHash("md5")
|
|
160
|
+
.update(hash + password, "binary")
|
|
161
|
+
.digest("binary");
|
|
162
|
+
} while (--count);
|
|
163
|
+
output = setting.substring(0, 12) + this.encode64(hash, 16);
|
|
164
|
+
return output;
|
|
165
|
+
}
|
|
166
|
+
genSaltBlowfish(input) {
|
|
167
|
+
const itoa64 = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
168
|
+
let output = "$2a$";
|
|
169
|
+
output += String.fromCharCode(parseInt("0", 10) + Math.floor(this.iterationCountLog2 / 10));
|
|
170
|
+
output += String.fromCharCode(parseInt("0", 10) + (this.iterationCountLog2 % 10));
|
|
171
|
+
output += "$";
|
|
172
|
+
let i = 0;
|
|
173
|
+
do {
|
|
174
|
+
const c1 = input.charCodeAt(i++);
|
|
175
|
+
output += itoa64[c1 >> 2];
|
|
176
|
+
const c2 = input.charCodeAt(i++);
|
|
177
|
+
output += itoa64[((c1 & 0x03) << 4) | (c2 >> 4)];
|
|
178
|
+
if (i >= 16) {
|
|
179
|
+
output += itoa64[c2 & 0x0f];
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
const c3 = input.charCodeAt(i++);
|
|
183
|
+
output += itoa64[((c2 & 0x0f) << 2) | (c3 >> 6)];
|
|
184
|
+
output += itoa64[c3 & 0x3f];
|
|
185
|
+
// eslint-disable-next-line no-constant-condition
|
|
186
|
+
} while (true);
|
|
187
|
+
return output;
|
|
188
|
+
}
|
|
189
|
+
hashPassword(password) {
|
|
190
|
+
if (password.length > 4096) {
|
|
191
|
+
return "*";
|
|
192
|
+
}
|
|
193
|
+
let random = "";
|
|
194
|
+
if (CRYPT_BLOWFISH === 1 && !this.portableHashes) {
|
|
195
|
+
random = this.getRandomBytes(16);
|
|
196
|
+
const hash = this.cryptPrivate(password, this.genSaltBlowfish(random));
|
|
197
|
+
if (hash.length === 60) {
|
|
198
|
+
return hash;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (random.length < 6) {
|
|
202
|
+
random = this.getRandomBytes(6);
|
|
203
|
+
}
|
|
204
|
+
const hash = this.cryptPrivate(password, this.genSaltPrivate(random));
|
|
205
|
+
if (hash.length === 34) {
|
|
206
|
+
return hash;
|
|
207
|
+
}
|
|
208
|
+
return "*";
|
|
209
|
+
}
|
|
210
|
+
checkPassword(password, storedHash) {
|
|
211
|
+
if (password.length > 4096) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
let hash = this.cryptPrivate(password, storedHash);
|
|
215
|
+
if (hash[0] === "*") {
|
|
216
|
+
hash = crypto
|
|
217
|
+
.createHash("md5")
|
|
218
|
+
.update(password, "binary")
|
|
219
|
+
.digest("binary");
|
|
220
|
+
hash = this.cryptPrivate(password, storedHash);
|
|
221
|
+
}
|
|
222
|
+
return hash === storedHash;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"php-serialize.d.ts","sourceRoot":"","sources":["../../src/common/php-serialize.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,MAAM,GAAG,WAAoB,CAAC;AAE3D,eAAO,MAAM,cAAc,GAAI,CAAC,GAAG,GAAG,EAAE,MAAM,GAAG,EAAE,kBAAe,MAOjE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.phpUnserialize = exports.phpSerialize = void 0;
|
|
4
|
+
const php_serialize_1 = require("php-serialize");
|
|
5
|
+
const phpSerialize = (data) => (0, php_serialize_1.serialize)(data);
|
|
6
|
+
exports.phpSerialize = phpSerialize;
|
|
7
|
+
const phpUnserialize = (data, failSafe = true) => {
|
|
8
|
+
try {
|
|
9
|
+
return (0, php_serialize_1.unserialize)(data);
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
if (failSafe)
|
|
13
|
+
return data;
|
|
14
|
+
throw e;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.phpUnserialize = phpUnserialize;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as types from "../types";
|
|
2
|
+
export declare namespace validating {
|
|
3
|
+
const fieldSafe: <T extends types.validating.Tables, V>(table: T, field: types.validating.Field<T>, value: V) => V | undefined;
|
|
4
|
+
const field: <T extends types.validating.Tables, V>(table: T, field: types.validating.Field<T>, value: V) => Exclude<V, undefined>;
|
|
5
|
+
const execAny: <T extends types.validating.Parser>(func: T, v: any) => types.validating.ParserReturnType<T>;
|
|
6
|
+
const exec: <T extends types.validating.Parser>(func: T, v: types.validating.ParserReturnType<T>) => types.validating.ParserReturnType<T>;
|
|
7
|
+
const execSafeAny: <T extends types.validating.Parser>(func: T, v: any) => types.validating.ParserReturnType<T> | undefined;
|
|
8
|
+
const execSafe: <T extends types.validating.Parser>(func: T, v: types.validating.ParserReturnType<T>) => types.validating.ParserReturnType<T> | undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=validating.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validating.d.ts","sourceRoot":"","sources":["../../src/common/validating.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAGvC,yBAAiB,UAAU,CAAC;IACnB,MAAM,SAAS,GAAI,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAC5D,OAAO,CAAC,EACR,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAChC,OAAO,CAAC,kBAUT,CAAC;IAEK,MAAM,KAAK,GAAI,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EACxD,OAAO,CAAC,EACR,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAChC,OAAO,CAAC,KAIH,OAAO,CAAC,CAAC,EAAE,SAAS,CAC1B,CAAC;IAEK,MAAM,OAAO,GAAI,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,MAAM,EACvD,MAAM,CAAC,EACP,GAAG,GAAG,KACL,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAErC,CAAC;IAEK,MAAM,IAAI,GAAI,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,MAAM,EACpD,MAAM,CAAC,EACP,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,KACtC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAErC,CAAC;IAEK,MAAM,WAAW,GAAI,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,MAAM,EAC3D,MAAM,CAAC,EACP,GAAG,GAAG,KACL,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAEzC,CAAC;IAEK,MAAM,QAAQ,GAAI,CAAC,SAAS,KAAK,CAAC,UAAU,CAAC,MAAM,EACxD,MAAM,CAAC,EACP,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,KACtC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAWzC,CAAC;CACH"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.validating = void 0;
|
|
37
|
+
const val = __importStar(require("../validators"));
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
39
|
+
var validating;
|
|
40
|
+
(function (validating) {
|
|
41
|
+
validating.fieldSafe = (table, field, value) => {
|
|
42
|
+
const result = val.database.wpTables[table].shape[field].safeParse(value);
|
|
43
|
+
return result.success ? result.data : undefined;
|
|
44
|
+
};
|
|
45
|
+
validating.field = (table, field, value) => {
|
|
46
|
+
return val.database.wpTables[table].shape[field].parse(value);
|
|
47
|
+
};
|
|
48
|
+
validating.execAny = (func, v) => {
|
|
49
|
+
return validating.exec(func, v);
|
|
50
|
+
};
|
|
51
|
+
validating.exec = (func, v) => {
|
|
52
|
+
return func.parse(v);
|
|
53
|
+
};
|
|
54
|
+
validating.execSafeAny = (func, v) => {
|
|
55
|
+
return validating.execSafe(func, v);
|
|
56
|
+
};
|
|
57
|
+
validating.execSafe = (func, v) => {
|
|
58
|
+
const result = func.safeParse(v);
|
|
59
|
+
// if (!result.success) {
|
|
60
|
+
// console.log(`BEFORE`, v, `AFTER`, result);
|
|
61
|
+
// console.info((result as any).error);
|
|
62
|
+
// }
|
|
63
|
+
return result.success ? result.data : undefined;
|
|
64
|
+
};
|
|
65
|
+
})(validating || (exports.validating = validating = {}));
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type * as types from "./types";
|
|
2
|
+
export declare class Config {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(config: types.Config);
|
|
5
|
+
isMultiSite(): boolean;
|
|
6
|
+
isSsl(): boolean;
|
|
7
|
+
isSubdomainInstall(): boolean;
|
|
8
|
+
get config(): {
|
|
9
|
+
options: {
|
|
10
|
+
protected: string[];
|
|
11
|
+
defaults: string[];
|
|
12
|
+
};
|
|
13
|
+
posts: {
|
|
14
|
+
types: Record<string, {
|
|
15
|
+
public: boolean;
|
|
16
|
+
supports: string[];
|
|
17
|
+
_builtin: boolean;
|
|
18
|
+
capabilityType: string | [string, string];
|
|
19
|
+
mapMetaCap: boolean;
|
|
20
|
+
deleteWithUser: boolean;
|
|
21
|
+
publiclyQueryable: boolean;
|
|
22
|
+
hierarchical?: boolean | undefined;
|
|
23
|
+
capabilities?: Record<string, string> | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
typeNames: string[] | "attachment" | "page" | "post" | "revision";
|
|
26
|
+
statusNames: string[] | "inherit" | "private" | "pending" | "publish" | "future" | "draft" | "trash" | "auto-draft" | "request-pending" | "request-confirmed" | "request-failed" | "request-completed";
|
|
27
|
+
statuses: Record<string, {
|
|
28
|
+
label: string;
|
|
29
|
+
internal?: boolean | undefined;
|
|
30
|
+
private?: boolean | undefined;
|
|
31
|
+
public?: boolean | undefined;
|
|
32
|
+
_builtin?: boolean | undefined;
|
|
33
|
+
protected?: boolean | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
constants: {
|
|
37
|
+
ALLOW_UNFILTERED_UPLOADS: boolean;
|
|
38
|
+
DISALLOW_UNFILTERED_HTML: boolean;
|
|
39
|
+
DISALLOW_FILE_EDIT: boolean;
|
|
40
|
+
LINK_USE_SSL: boolean;
|
|
41
|
+
TRASHED_SUFFIX_TO_POST_NAME_FOR_POST: "__trashed";
|
|
42
|
+
ALLOW_FILESYSTEM_OPERATIONS: boolean;
|
|
43
|
+
WP_DEFAULT_THEME: string;
|
|
44
|
+
WP_DB_VERSION: number;
|
|
45
|
+
WPLANG: string;
|
|
46
|
+
EMPTY_TRASH_DAYS: number;
|
|
47
|
+
MEDIA_TRASH: boolean;
|
|
48
|
+
WP_POST_REVISIONS: number;
|
|
49
|
+
WP_LOG_LEVEL: "error" | "debug" | "info" | "warn";
|
|
50
|
+
};
|
|
51
|
+
extensions: {
|
|
52
|
+
audio: string[];
|
|
53
|
+
video: string[];
|
|
54
|
+
misc: string[];
|
|
55
|
+
};
|
|
56
|
+
timezoneOffset: string;
|
|
57
|
+
staticAssetsPath: string;
|
|
58
|
+
multisite: {
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
defaultBlogId: number;
|
|
61
|
+
defaultSiteId: number;
|
|
62
|
+
defaultSitemetaKeys: string[];
|
|
63
|
+
subdomainInstall: boolean;
|
|
64
|
+
subdirectoryReservedNames: string[];
|
|
65
|
+
vhost: "no" | "yes";
|
|
66
|
+
uploadBlogsDir: string;
|
|
67
|
+
};
|
|
68
|
+
tableCharset: string;
|
|
69
|
+
tableCollate: string;
|
|
70
|
+
tablePrefix: string;
|
|
71
|
+
database: {
|
|
72
|
+
client: string;
|
|
73
|
+
connection: {
|
|
74
|
+
port: number;
|
|
75
|
+
charset: string;
|
|
76
|
+
host?: string | undefined;
|
|
77
|
+
user?: string | undefined;
|
|
78
|
+
database?: string | undefined;
|
|
79
|
+
password?: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
taxonomy: {
|
|
83
|
+
names: string[] | "category" | "post_tag" | "post_format" | "link_category";
|
|
84
|
+
settings: Record<string, {
|
|
85
|
+
objectType: string;
|
|
86
|
+
hierarchical: boolean;
|
|
87
|
+
_builtin: boolean;
|
|
88
|
+
showUi: boolean;
|
|
89
|
+
capabilities?: Partial<Record<"manage_terms" | "edit_terms" | "delete_terms" | "assign_terms", string>> | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
};
|
|
92
|
+
roles: Record<string, {
|
|
93
|
+
name: string;
|
|
94
|
+
capabilities: string[];
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
set(config: types.DeepPartial<types.Config>): void;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=config.d.ts.map
|
package/config.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAGtC,qBACa,MAAM;;gBAGL,MAAM,EAAE,KAAK,CAAC,MAAM;IAIhC,WAAW;IAIX,KAAK;IAKL,kBAAkB;IAOlB,IAAI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAET;IAED,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;CAG5C"}
|
package/config.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.Config = void 0;
|
|
46
|
+
const scope_1 = require("./constants/scope");
|
|
47
|
+
const component_1 = require("./decorators/component");
|
|
48
|
+
const val = __importStar(require("./validators"));
|
|
49
|
+
let Config = class Config {
|
|
50
|
+
#config;
|
|
51
|
+
constructor(config) {
|
|
52
|
+
this.#config = structuredClone(config); //Application.config);
|
|
53
|
+
}
|
|
54
|
+
isMultiSite() {
|
|
55
|
+
return this.#config.multisite?.enabled ?? false;
|
|
56
|
+
}
|
|
57
|
+
isSsl() {
|
|
58
|
+
return this.#config.constants.LINK_USE_SSL ?? true;
|
|
59
|
+
}
|
|
60
|
+
// is_subdomain_install
|
|
61
|
+
isSubdomainInstall() {
|
|
62
|
+
return (this.#config.multisite.subdomainInstall ||
|
|
63
|
+
"yes" === this.#config.multisite.vhost);
|
|
64
|
+
}
|
|
65
|
+
get config() {
|
|
66
|
+
return this.#config;
|
|
67
|
+
}
|
|
68
|
+
set(config) {
|
|
69
|
+
this.#config = val.config.config.parse({ ...this.#config, ...config });
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.Config = Config;
|
|
73
|
+
exports.Config = Config = __decorate([
|
|
74
|
+
(0, component_1.component)({ scope: scope_1.Scope.Singleton }),
|
|
75
|
+
__metadata("design:paramtypes", [Object])
|
|
76
|
+
], Config);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-init.d.ts","sourceRoot":"","sources":["../../src/constants/async-init.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,wCACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/constants/component.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,uCACL,CAAC;AAEvC,eAAO,MAAM,wCAAwC,iDACL,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REFLECT_METADATA_KEY_COMPONENT_ARGUMENTS = exports.REFLECT_METADATA_KEY_COMPONENT = void 0;
|
|
4
|
+
exports.REFLECT_METADATA_KEY_COMPONENT = "__REFLECT_METADATA_KEY_COMPONENT__";
|
|
5
|
+
exports.REFLECT_METADATA_KEY_COMPONENT_ARGUMENTS = "__REFLECT_METADATA_KEY_COMPONENT_ARGUMENTS__";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/constants/database.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,8CAId,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TABLE_NAMES = void 0;
|
|
4
|
+
const default_database_tables_1 = require("./default-database-tables");
|
|
5
|
+
exports.TABLE_NAMES = [
|
|
6
|
+
...default_database_tables_1.DEFAULT_DATABASE_TABLES.blog,
|
|
7
|
+
...default_database_tables_1.DEFAULT_DATABASE_TABLES.global,
|
|
8
|
+
...default_database_tables_1.DEFAULT_DATABASE_TABLES.ms_global,
|
|
9
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-database-tables.d.ts","sourceRoot":"","sources":["../../src/constants/default-database-tables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,uBAAuB;UAY7B,KAAK,CAAC,UAAU,EAAE;YACU,KAAK,CAAC,UAAU,EAAE;eAQ9C,KAAK,CAAC,UAAU,EAAE;CACxB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_DATABASE_TABLES = void 0;
|
|
4
|
+
exports.DEFAULT_DATABASE_TABLES = {
|
|
5
|
+
blog: [
|
|
6
|
+
"posts",
|
|
7
|
+
"comments",
|
|
8
|
+
"links",
|
|
9
|
+
"options",
|
|
10
|
+
"postmeta",
|
|
11
|
+
"terms",
|
|
12
|
+
"term_taxonomy",
|
|
13
|
+
"term_relationships",
|
|
14
|
+
"termmeta",
|
|
15
|
+
"commentmeta",
|
|
16
|
+
],
|
|
17
|
+
global: ["users", "usermeta"],
|
|
18
|
+
ms_global: [
|
|
19
|
+
"blogs",
|
|
20
|
+
"blogmeta",
|
|
21
|
+
"signups",
|
|
22
|
+
"site",
|
|
23
|
+
"sitemeta",
|
|
24
|
+
"registration_log",
|
|
25
|
+
],
|
|
26
|
+
};
|