@warlock.js/cascade 4.0.48 → 4.0.58
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/cjs/context/database-data-source-context.d.ts +29 -0
- package/cjs/context/database-data-source-context.d.ts.map +1 -0
- package/cjs/context/database-data-source-context.js +28 -0
- package/cjs/context/database-data-source-context.js.map +1 -0
- package/cjs/context/database-transaction-context.d.ts +31 -0
- package/cjs/context/database-transaction-context.d.ts.map +1 -0
- package/cjs/context/database-transaction-context.js +34 -0
- package/cjs/context/database-transaction-context.js.map +1 -0
- package/cjs/contracts/database-driver.contract.d.ts +143 -0
- package/cjs/contracts/database-driver.contract.d.ts.map +1 -0
- package/cjs/contracts/database-id-generator.contract.d.ts +109 -0
- package/cjs/contracts/database-id-generator.contract.d.ts.map +1 -0
- package/cjs/contracts/database-remover.contract.d.ts +104 -0
- package/cjs/contracts/database-remover.contract.d.ts.map +1 -0
- package/cjs/contracts/database-restorer.contract.d.ts +143 -0
- package/cjs/contracts/database-restorer.contract.d.ts.map +1 -0
- package/cjs/contracts/database-writer.contract.d.ts +119 -0
- package/cjs/contracts/database-writer.contract.d.ts.map +1 -0
- package/cjs/contracts/driver-blueprint.contract.d.ts +45 -0
- package/cjs/contracts/driver-blueprint.contract.d.ts.map +1 -0
- package/cjs/contracts/index.d.ts +10 -0
- package/cjs/contracts/index.d.ts.map +1 -0
- package/cjs/contracts/migration-driver.contract.d.ts +365 -0
- package/cjs/contracts/migration-driver.contract.d.ts.map +1 -0
- package/cjs/contracts/query-builder.contract.d.ts +1128 -0
- package/cjs/contracts/query-builder.contract.d.ts.map +1 -0
- package/cjs/contracts/sync-adapter.contract.d.ts +58 -0
- package/cjs/contracts/sync-adapter.contract.d.ts.map +1 -0
- package/cjs/data-source/data-source-registry.d.ts +104 -0
- package/cjs/data-source/data-source-registry.d.ts.map +1 -0
- package/cjs/data-source/data-source-registry.js +138 -0
- package/cjs/data-source/data-source-registry.js.map +1 -0
- package/cjs/data-source/data-source.d.ts +106 -0
- package/cjs/data-source/data-source.d.ts.map +1 -0
- package/cjs/data-source/data-source.js +77 -0
- package/cjs/data-source/data-source.js.map +1 -0
- package/cjs/database-dirty-tracker.d.ts +253 -0
- package/cjs/database-dirty-tracker.d.ts.map +1 -0
- package/cjs/database-dirty-tracker.js +389 -0
- package/cjs/database-dirty-tracker.js.map +1 -0
- package/cjs/drivers/mongo/mongo-id-generator.d.ts +116 -0
- package/cjs/drivers/mongo/mongo-id-generator.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-id-generator.js +149 -0
- package/cjs/drivers/mongo/mongo-id-generator.js.map +1 -0
- package/cjs/drivers/mongo/mongo-migration-driver.d.ts +228 -0
- package/cjs/drivers/mongo/mongo-migration-driver.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-migration-driver.js +524 -0
- package/cjs/drivers/mongo/mongo-migration-driver.js.map +1 -0
- package/cjs/drivers/mongo/mongo-query-builder.d.ts +922 -0
- package/cjs/drivers/mongo/mongo-query-builder.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-query-builder.js +1740 -0
- package/cjs/drivers/mongo/mongo-query-builder.js.map +1 -0
- package/cjs/drivers/mongo/mongo-query-operations.d.ts +226 -0
- package/cjs/drivers/mongo/mongo-query-operations.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-query-operations.js +270 -0
- package/cjs/drivers/mongo/mongo-query-operations.js.map +1 -0
- package/cjs/drivers/mongo/mongo-query-parser.d.ts +262 -0
- package/cjs/drivers/mongo/mongo-query-parser.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-query-parser.js +1351 -0
- package/cjs/drivers/mongo/mongo-query-parser.js.map +1 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.d.ts +79 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.js +146 -0
- package/cjs/drivers/mongo/mongo-sync-adapter.js.map +1 -0
- package/cjs/drivers/mongo/mongodb-blueprint.d.ts +30 -0
- package/cjs/drivers/mongo/mongodb-blueprint.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongodb-blueprint.js +51 -0
- package/cjs/drivers/mongo/mongodb-blueprint.js.map +1 -0
- package/cjs/drivers/mongo/mongodb-driver.d.ts +188 -0
- package/cjs/drivers/mongo/mongodb-driver.d.ts.map +1 -0
- package/cjs/drivers/mongo/mongodb-driver.js +411 -0
- package/cjs/drivers/mongo/mongodb-driver.js.map +1 -0
- package/cjs/drivers/mongo/types.d.ts +43 -0
- package/cjs/drivers/mongo/types.d.ts.map +1 -0
- package/cjs/errors/missing-data-source.error.d.ts +22 -0
- package/cjs/errors/missing-data-source.error.d.ts.map +1 -0
- package/cjs/errors/missing-data-source.error.js +29 -0
- package/cjs/errors/missing-data-source.error.js.map +1 -0
- package/cjs/events/model-events.d.ts +231 -0
- package/cjs/events/model-events.d.ts.map +1 -0
- package/cjs/events/model-events.js +259 -0
- package/cjs/events/model-events.js.map +1 -0
- package/cjs/expressions/aggregate-expressions.d.ts +215 -0
- package/cjs/expressions/aggregate-expressions.d.ts.map +1 -0
- package/cjs/expressions/aggregate-expressions.js +221 -0
- package/cjs/expressions/aggregate-expressions.js.map +1 -0
- package/cjs/expressions/index.d.ts +2 -0
- package/cjs/expressions/index.d.ts.map +1 -0
- package/cjs/index.d.ts +41 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +1 -267
- package/cjs/index.js.map +1 -1
- package/cjs/migration/column-builder.d.ts +167 -0
- package/cjs/migration/column-builder.d.ts.map +1 -0
- package/cjs/migration/column-builder.js +217 -0
- package/cjs/migration/column-builder.js.map +1 -0
- package/cjs/migration/foreign-key-builder.d.ts +110 -0
- package/cjs/migration/foreign-key-builder.d.ts.map +1 -0
- package/cjs/migration/foreign-key-builder.js +129 -0
- package/cjs/migration/foreign-key-builder.js.map +1 -0
- package/cjs/migration/index.d.ts +6 -0
- package/cjs/migration/index.d.ts.map +1 -0
- package/cjs/migration/migration-runner.d.ts +231 -0
- package/cjs/migration/migration-runner.d.ts.map +1 -0
- package/cjs/migration/migration-runner.js +443 -0
- package/cjs/migration/migration-runner.js.map +1 -0
- package/cjs/migration/migration.js +1346 -0
- package/cjs/migration/migration.js.map +1 -0
- package/cjs/migration/types.d.ts +132 -0
- package/cjs/migration/types.d.ts.map +1 -0
- package/cjs/model/model.d.ts +1267 -0
- package/cjs/model/model.d.ts.map +1 -0
- package/cjs/model/model.js +1463 -0
- package/cjs/model/model.js.map +1 -0
- package/cjs/model/register-model.d.ts +80 -0
- package/cjs/model/register-model.d.ts.map +1 -0
- package/cjs/model/register-model.js +91 -0
- package/cjs/model/register-model.js.map +1 -0
- package/cjs/remover/database-remover.d.ts +100 -0
- package/cjs/remover/database-remover.d.ts.map +1 -0
- package/cjs/remover/database-remover.js +209 -0
- package/cjs/remover/database-remover.js.map +1 -0
- package/cjs/restorer/database-restorer.d.ts +131 -0
- package/cjs/restorer/database-restorer.d.ts.map +1 -0
- package/cjs/restorer/database-restorer.js +425 -0
- package/cjs/restorer/database-restorer.js.map +1 -0
- package/cjs/sync/index.d.ts +12 -0
- package/cjs/sync/index.d.ts.map +1 -0
- package/cjs/sync/model-events.d.ts +62 -0
- package/cjs/sync/model-events.d.ts.map +1 -0
- package/cjs/sync/model-events.js +49 -0
- package/cjs/sync/model-events.js.map +1 -0
- package/cjs/sync/model-sync-operation.d.ts +163 -0
- package/cjs/sync/model-sync-operation.d.ts.map +1 -0
- package/cjs/sync/model-sync-operation.js +292 -0
- package/cjs/sync/model-sync-operation.js.map +1 -0
- package/cjs/sync/model-sync.d.ts +130 -0
- package/cjs/sync/model-sync.d.ts.map +1 -0
- package/cjs/sync/model-sync.js +178 -0
- package/cjs/sync/model-sync.js.map +1 -0
- package/cjs/sync/sync-context.d.ts +70 -0
- package/cjs/sync/sync-context.d.ts.map +1 -0
- package/cjs/sync/sync-context.js +101 -0
- package/cjs/sync/sync-context.js.map +1 -0
- package/cjs/sync/sync-manager.d.ts +213 -0
- package/cjs/sync/sync-manager.d.ts.map +1 -0
- package/cjs/sync/sync-manager.js +689 -0
- package/cjs/sync/sync-manager.js.map +1 -0
- package/cjs/sync/types.d.ts +289 -0
- package/cjs/sync/types.d.ts.map +1 -0
- package/cjs/types.d.ts +45 -0
- package/cjs/types.d.ts.map +1 -0
- package/cjs/utils/connect-to-database.d.ts +246 -0
- package/cjs/utils/connect-to-database.d.ts.map +1 -0
- package/cjs/utils/connect-to-database.js +92 -0
- package/cjs/utils/connect-to-database.js.map +1 -0
- package/cjs/utils/database-writer.utils.d.ts +15 -0
- package/cjs/utils/database-writer.utils.d.ts.map +1 -0
- package/cjs/utils/database-writer.utils.js +14 -0
- package/cjs/utils/database-writer.utils.js.map +1 -0
- package/cjs/utils/define-model.js +100 -0
- package/cjs/utils/define-model.js.map +1 -0
- package/cjs/utils/once-connected.d.ts +146 -0
- package/cjs/utils/once-connected.d.ts.map +1 -0
- package/cjs/utils/once-connected.js +252 -0
- package/cjs/utils/once-connected.js.map +1 -0
- package/cjs/validation/database-seal-plugins.d.ts +2 -0
- package/cjs/validation/database-seal-plugins.d.ts.map +1 -0
- package/cjs/validation/database-seal-plugins.js +4 -0
- package/cjs/validation/database-seal-plugins.js.map +1 -0
- package/cjs/validation/database-writer-validation-error.d.ts +97 -0
- package/cjs/validation/database-writer-validation-error.d.ts.map +1 -0
- package/cjs/validation/database-writer-validation-error.js +160 -0
- package/cjs/validation/database-writer-validation-error.js.map +1 -0
- package/cjs/validation/index.d.ts +3 -0
- package/cjs/validation/index.d.ts.map +1 -0
- package/cjs/validation/mutators/embed-mutator.d.ts +9 -0
- package/cjs/validation/mutators/embed-mutator.d.ts.map +1 -0
- package/cjs/validation/mutators/embed-mutator.js +33 -0
- package/cjs/validation/mutators/embed-mutator.js.map +1 -0
- package/cjs/validation/plugins/embed-validator-plugin.d.ts +24 -0
- package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +1 -0
- package/cjs/validation/plugins/embed-validator-plugin.js +18 -0
- package/cjs/validation/plugins/embed-validator-plugin.js.map +1 -0
- package/cjs/validation/rules/database-model-rule.d.ts +7 -0
- package/cjs/validation/rules/database-model-rule.d.ts.map +1 -0
- package/cjs/validation/rules/database-model-rule.js +27 -0
- package/cjs/validation/rules/database-model-rule.js.map +1 -0
- package/cjs/validation/transformers/embed-model-transformer.d.ts +3 -0
- package/cjs/validation/transformers/embed-model-transformer.d.ts.map +1 -0
- package/cjs/validation/transformers/embed-model-transformer.js +18 -0
- package/cjs/validation/transformers/embed-model-transformer.js.map +1 -0
- package/cjs/validation/validators/embed-validator.d.ts +21 -0
- package/cjs/validation/validators/embed-validator.d.ts.map +1 -0
- package/cjs/validation/validators/embed-validator.js +42 -0
- package/cjs/validation/validators/embed-validator.js.map +1 -0
- package/cjs/writer/database-writer.d.ts +181 -0
- package/cjs/writer/database-writer.d.ts.map +1 -0
- package/cjs/writer/database-writer.js +402 -0
- package/cjs/writer/database-writer.js.map +1 -0
- package/esm/context/database-data-source-context.d.ts +29 -0
- package/esm/context/database-data-source-context.d.ts.map +1 -0
- package/esm/context/database-data-source-context.js +28 -0
- package/esm/context/database-data-source-context.js.map +1 -0
- package/esm/context/database-transaction-context.d.ts +31 -0
- package/esm/context/database-transaction-context.d.ts.map +1 -0
- package/esm/context/database-transaction-context.js +34 -0
- package/esm/context/database-transaction-context.js.map +1 -0
- package/esm/contracts/database-driver.contract.d.ts +143 -0
- package/esm/contracts/database-driver.contract.d.ts.map +1 -0
- package/esm/contracts/database-id-generator.contract.d.ts +109 -0
- package/esm/contracts/database-id-generator.contract.d.ts.map +1 -0
- package/esm/contracts/database-remover.contract.d.ts +104 -0
- package/esm/contracts/database-remover.contract.d.ts.map +1 -0
- package/esm/contracts/database-restorer.contract.d.ts +143 -0
- package/esm/contracts/database-restorer.contract.d.ts.map +1 -0
- package/esm/contracts/database-writer.contract.d.ts +119 -0
- package/esm/contracts/database-writer.contract.d.ts.map +1 -0
- package/esm/contracts/driver-blueprint.contract.d.ts +45 -0
- package/esm/contracts/driver-blueprint.contract.d.ts.map +1 -0
- package/esm/contracts/index.d.ts +10 -0
- package/esm/contracts/index.d.ts.map +1 -0
- package/esm/contracts/migration-driver.contract.d.ts +365 -0
- package/esm/contracts/migration-driver.contract.d.ts.map +1 -0
- package/esm/contracts/query-builder.contract.d.ts +1128 -0
- package/esm/contracts/query-builder.contract.d.ts.map +1 -0
- package/esm/contracts/sync-adapter.contract.d.ts +58 -0
- package/esm/contracts/sync-adapter.contract.d.ts.map +1 -0
- package/esm/data-source/data-source-registry.d.ts +104 -0
- package/esm/data-source/data-source-registry.d.ts.map +1 -0
- package/esm/data-source/data-source-registry.js +138 -0
- package/esm/data-source/data-source-registry.js.map +1 -0
- package/esm/data-source/data-source.d.ts +106 -0
- package/esm/data-source/data-source.d.ts.map +1 -0
- package/esm/data-source/data-source.js +77 -0
- package/esm/data-source/data-source.js.map +1 -0
- package/esm/database-dirty-tracker.d.ts +253 -0
- package/esm/database-dirty-tracker.d.ts.map +1 -0
- package/esm/database-dirty-tracker.js +389 -0
- package/esm/database-dirty-tracker.js.map +1 -0
- package/esm/drivers/mongo/mongo-id-generator.d.ts +116 -0
- package/esm/drivers/mongo/mongo-id-generator.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-id-generator.js +149 -0
- package/esm/drivers/mongo/mongo-id-generator.js.map +1 -0
- package/esm/drivers/mongo/mongo-migration-driver.d.ts +228 -0
- package/esm/drivers/mongo/mongo-migration-driver.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-migration-driver.js +524 -0
- package/esm/drivers/mongo/mongo-migration-driver.js.map +1 -0
- package/esm/drivers/mongo/mongo-query-builder.d.ts +922 -0
- package/esm/drivers/mongo/mongo-query-builder.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-query-builder.js +1740 -0
- package/esm/drivers/mongo/mongo-query-builder.js.map +1 -0
- package/esm/drivers/mongo/mongo-query-operations.d.ts +226 -0
- package/esm/drivers/mongo/mongo-query-operations.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-query-operations.js +270 -0
- package/esm/drivers/mongo/mongo-query-operations.js.map +1 -0
- package/esm/drivers/mongo/mongo-query-parser.d.ts +262 -0
- package/esm/drivers/mongo/mongo-query-parser.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-query-parser.js +1351 -0
- package/esm/drivers/mongo/mongo-query-parser.js.map +1 -0
- package/esm/drivers/mongo/mongo-sync-adapter.d.ts +79 -0
- package/esm/drivers/mongo/mongo-sync-adapter.d.ts.map +1 -0
- package/esm/drivers/mongo/mongo-sync-adapter.js +146 -0
- package/esm/drivers/mongo/mongo-sync-adapter.js.map +1 -0
- package/esm/drivers/mongo/mongodb-blueprint.d.ts +30 -0
- package/esm/drivers/mongo/mongodb-blueprint.d.ts.map +1 -0
- package/esm/drivers/mongo/mongodb-blueprint.js +51 -0
- package/esm/drivers/mongo/mongodb-blueprint.js.map +1 -0
- package/esm/drivers/mongo/mongodb-driver.d.ts +188 -0
- package/esm/drivers/mongo/mongodb-driver.d.ts.map +1 -0
- package/esm/drivers/mongo/mongodb-driver.js +411 -0
- package/esm/drivers/mongo/mongodb-driver.js.map +1 -0
- package/esm/drivers/mongo/types.d.ts +43 -0
- package/esm/drivers/mongo/types.d.ts.map +1 -0
- package/esm/errors/missing-data-source.error.d.ts +22 -0
- package/esm/errors/missing-data-source.error.d.ts.map +1 -0
- package/esm/errors/missing-data-source.error.js +29 -0
- package/esm/errors/missing-data-source.error.js.map +1 -0
- package/esm/events/model-events.d.ts +231 -0
- package/esm/events/model-events.d.ts.map +1 -0
- package/esm/events/model-events.js +259 -0
- package/esm/events/model-events.js.map +1 -0
- package/esm/expressions/aggregate-expressions.d.ts +215 -0
- package/esm/expressions/aggregate-expressions.d.ts.map +1 -0
- package/esm/expressions/aggregate-expressions.js +221 -0
- package/esm/expressions/aggregate-expressions.js.map +1 -0
- package/esm/expressions/index.d.ts +2 -0
- package/esm/expressions/index.d.ts.map +1 -0
- package/esm/index.d.ts +41 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +1 -40
- package/esm/index.js.map +1 -1
- package/esm/migration/column-builder.d.ts +167 -0
- package/esm/migration/column-builder.d.ts.map +1 -0
- package/esm/migration/column-builder.js +217 -0
- package/esm/migration/column-builder.js.map +1 -0
- package/esm/migration/foreign-key-builder.d.ts +110 -0
- package/esm/migration/foreign-key-builder.d.ts.map +1 -0
- package/esm/migration/foreign-key-builder.js +129 -0
- package/esm/migration/foreign-key-builder.js.map +1 -0
- package/esm/migration/index.d.ts +6 -0
- package/esm/migration/index.d.ts.map +1 -0
- package/esm/migration/migration-runner.d.ts +231 -0
- package/esm/migration/migration-runner.d.ts.map +1 -0
- package/esm/migration/migration-runner.js +443 -0
- package/esm/migration/migration-runner.js.map +1 -0
- package/esm/migration/migration.js +1346 -0
- package/esm/migration/migration.js.map +1 -0
- package/esm/migration/types.d.ts +132 -0
- package/esm/migration/types.d.ts.map +1 -0
- package/esm/model/model.d.ts +1267 -0
- package/esm/model/model.d.ts.map +1 -0
- package/esm/model/model.js +1463 -0
- package/esm/model/model.js.map +1 -0
- package/esm/model/register-model.d.ts +80 -0
- package/esm/model/register-model.d.ts.map +1 -0
- package/esm/model/register-model.js +91 -0
- package/esm/model/register-model.js.map +1 -0
- package/esm/remover/database-remover.d.ts +100 -0
- package/esm/remover/database-remover.d.ts.map +1 -0
- package/esm/remover/database-remover.js +209 -0
- package/esm/remover/database-remover.js.map +1 -0
- package/esm/restorer/database-restorer.d.ts +131 -0
- package/esm/restorer/database-restorer.d.ts.map +1 -0
- package/esm/restorer/database-restorer.js +425 -0
- package/esm/restorer/database-restorer.js.map +1 -0
- package/esm/sync/index.d.ts +12 -0
- package/esm/sync/index.d.ts.map +1 -0
- package/esm/sync/model-events.d.ts +62 -0
- package/esm/sync/model-events.d.ts.map +1 -0
- package/esm/sync/model-events.js +49 -0
- package/esm/sync/model-events.js.map +1 -0
- package/esm/sync/model-sync-operation.d.ts +163 -0
- package/esm/sync/model-sync-operation.d.ts.map +1 -0
- package/esm/sync/model-sync-operation.js +292 -0
- package/esm/sync/model-sync-operation.js.map +1 -0
- package/esm/sync/model-sync.d.ts +130 -0
- package/esm/sync/model-sync.d.ts.map +1 -0
- package/esm/sync/model-sync.js +178 -0
- package/esm/sync/model-sync.js.map +1 -0
- package/esm/sync/sync-context.d.ts +70 -0
- package/esm/sync/sync-context.d.ts.map +1 -0
- package/esm/sync/sync-context.js +101 -0
- package/esm/sync/sync-context.js.map +1 -0
- package/esm/sync/sync-manager.d.ts +213 -0
- package/esm/sync/sync-manager.d.ts.map +1 -0
- package/esm/sync/sync-manager.js +689 -0
- package/esm/sync/sync-manager.js.map +1 -0
- package/esm/sync/types.d.ts +289 -0
- package/esm/sync/types.d.ts.map +1 -0
- package/esm/types.d.ts +45 -0
- package/esm/types.d.ts.map +1 -0
- package/esm/utils/connect-to-database.d.ts +246 -0
- package/esm/utils/connect-to-database.d.ts.map +1 -0
- package/esm/utils/connect-to-database.js +92 -0
- package/esm/utils/connect-to-database.js.map +1 -0
- package/esm/utils/database-writer.utils.d.ts +15 -0
- package/esm/utils/database-writer.utils.d.ts.map +1 -0
- package/esm/utils/database-writer.utils.js +14 -0
- package/esm/utils/database-writer.utils.js.map +1 -0
- package/esm/utils/define-model.js +100 -0
- package/esm/utils/define-model.js.map +1 -0
- package/esm/utils/once-connected.d.ts +146 -0
- package/esm/utils/once-connected.d.ts.map +1 -0
- package/esm/utils/once-connected.js +252 -0
- package/esm/utils/once-connected.js.map +1 -0
- package/esm/validation/database-seal-plugins.d.ts +2 -0
- package/esm/validation/database-seal-plugins.d.ts.map +1 -0
- package/esm/validation/database-seal-plugins.js +4 -0
- package/esm/validation/database-seal-plugins.js.map +1 -0
- package/esm/validation/database-writer-validation-error.d.ts +97 -0
- package/esm/validation/database-writer-validation-error.d.ts.map +1 -0
- package/esm/validation/database-writer-validation-error.js +160 -0
- package/esm/validation/database-writer-validation-error.js.map +1 -0
- package/esm/validation/index.d.ts +3 -0
- package/esm/validation/index.d.ts.map +1 -0
- package/esm/validation/mutators/embed-mutator.d.ts +9 -0
- package/esm/validation/mutators/embed-mutator.d.ts.map +1 -0
- package/esm/validation/mutators/embed-mutator.js +33 -0
- package/esm/validation/mutators/embed-mutator.js.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.d.ts +24 -0
- package/esm/validation/plugins/embed-validator-plugin.d.ts.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.js +18 -0
- package/esm/validation/plugins/embed-validator-plugin.js.map +1 -0
- package/esm/validation/rules/database-model-rule.d.ts +7 -0
- package/esm/validation/rules/database-model-rule.d.ts.map +1 -0
- package/esm/validation/rules/database-model-rule.js +27 -0
- package/esm/validation/rules/database-model-rule.js.map +1 -0
- package/esm/validation/transformers/embed-model-transformer.d.ts +3 -0
- package/esm/validation/transformers/embed-model-transformer.d.ts.map +1 -0
- package/esm/validation/transformers/embed-model-transformer.js +18 -0
- package/esm/validation/transformers/embed-model-transformer.js.map +1 -0
- package/esm/validation/validators/embed-validator.d.ts +21 -0
- package/esm/validation/validators/embed-validator.d.ts.map +1 -0
- package/esm/validation/validators/embed-validator.js +42 -0
- package/esm/validation/validators/embed-validator.js.map +1 -0
- package/esm/writer/database-writer.d.ts +181 -0
- package/esm/writer/database-writer.d.ts.map +1 -0
- package/esm/writer/database-writer.js +402 -0
- package/esm/writer/database-writer.js.map +1 -0
- package/package.json +61 -52
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import type { Collection } from "mongodb";
|
|
2
|
+
import type { MongoQueryBuilder } from "./mongo-query-builder";
|
|
3
|
+
import type { Operation } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Options for configuring the MongoDB query parser.
|
|
6
|
+
*/
|
|
7
|
+
export type MongoQueryParserOptions = {
|
|
8
|
+
/** The MongoDB collection being queried */
|
|
9
|
+
collection: Collection;
|
|
10
|
+
/** The ordered list of operations to parse */
|
|
11
|
+
operations: Operation[];
|
|
12
|
+
/** Factory method for creating sub-builders (used for callbacks) */
|
|
13
|
+
createSubBuilder: () => MongoQueryBuilder;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Parses query builder operations into MongoDB aggregation pipeline.
|
|
17
|
+
*
|
|
18
|
+
* This parser is responsible for converting the abstract operations collected
|
|
19
|
+
* by the query builder into a concrete MongoDB aggregation pipeline. It handles
|
|
20
|
+
* intelligent grouping of mergeable operations (like multiple where clauses)
|
|
21
|
+
* into single pipeline stages for optimal performance.
|
|
22
|
+
*/
|
|
23
|
+
export declare class MongoQueryParser {
|
|
24
|
+
/**
|
|
25
|
+
* The MongoDB collection being queried.
|
|
26
|
+
*/
|
|
27
|
+
private readonly collection;
|
|
28
|
+
/**
|
|
29
|
+
* The ordered list of operations to parse.
|
|
30
|
+
*/
|
|
31
|
+
private readonly operations;
|
|
32
|
+
/**
|
|
33
|
+
* Factory for creating sub-builders (used when resolving callbacks).
|
|
34
|
+
*/
|
|
35
|
+
private readonly createSubBuilder;
|
|
36
|
+
/**
|
|
37
|
+
* Track group field names for automatic _id renaming.
|
|
38
|
+
* Maps pipeline index to field names.
|
|
39
|
+
*/
|
|
40
|
+
private readonly groupFieldNames;
|
|
41
|
+
/**
|
|
42
|
+
* Create a new MongoDB query parser.
|
|
43
|
+
*
|
|
44
|
+
* @param options - Configuration options for the parser
|
|
45
|
+
*/
|
|
46
|
+
constructor(options: MongoQueryParserOptions);
|
|
47
|
+
/**
|
|
48
|
+
* Parse the operations into a MongoDB aggregation pipeline.
|
|
49
|
+
*
|
|
50
|
+
* This method intelligently groups mergeable operations (e.g., multiple where
|
|
51
|
+
* clauses) into single pipeline stages while maintaining the correct execution
|
|
52
|
+
* order for non-mergeable operations.
|
|
53
|
+
*
|
|
54
|
+
* @returns The MongoDB aggregation pipeline
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const parser = new MongoQueryParser({ collection, operations });
|
|
59
|
+
* const pipeline = parser.parse();
|
|
60
|
+
* // [
|
|
61
|
+
* // { $match: { status: 'active', age: { $gt: 18 } } },
|
|
62
|
+
* // { $sort: { createdAt: -1 } },
|
|
63
|
+
* // { $limit: 10 }
|
|
64
|
+
* // ]
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
parse(): any[];
|
|
68
|
+
/**
|
|
69
|
+
* Track field names for group stages that need _id renaming.
|
|
70
|
+
*/
|
|
71
|
+
private trackGroupFieldNames;
|
|
72
|
+
/**
|
|
73
|
+
* Post-process pipeline to rename _id fields after $group stages.
|
|
74
|
+
*
|
|
75
|
+
* This automatically renames MongoDB's `_id` field to the actual field name(s)
|
|
76
|
+
* used for grouping, making the results more intuitive.
|
|
77
|
+
*
|
|
78
|
+
* @param pipeline - The aggregation pipeline
|
|
79
|
+
* @returns The processed pipeline
|
|
80
|
+
*/
|
|
81
|
+
private postProcessGroupStages;
|
|
82
|
+
/**
|
|
83
|
+
* Convert the parsed pipeline to a pretty-printed string for debugging.
|
|
84
|
+
*
|
|
85
|
+
* This method formats the MongoDB aggregation pipeline in a human-readable
|
|
86
|
+
* way, making it easier to understand and debug complex queries.
|
|
87
|
+
*
|
|
88
|
+
* @returns A formatted string representation of the pipeline
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const parser = new MongoQueryParser({ collection, operations });
|
|
93
|
+
* console.log(parser.toPrettyString());
|
|
94
|
+
* // Output:
|
|
95
|
+
* // MongoDB Aggregation Pipeline:
|
|
96
|
+
* // ════════════════════════════
|
|
97
|
+
* // Stage 1: $match
|
|
98
|
+
* // status: "active"
|
|
99
|
+
* // age: { $gt: 18 }
|
|
100
|
+
* //
|
|
101
|
+
* // Stage 2: $sort
|
|
102
|
+
* // createdAt: -1
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
toPrettyString(): string;
|
|
106
|
+
/**
|
|
107
|
+
* Format stage data with proper indentation.
|
|
108
|
+
*
|
|
109
|
+
* @param data - The stage data to format
|
|
110
|
+
* @param indent - The indentation level
|
|
111
|
+
* @returns Formatted string
|
|
112
|
+
*/
|
|
113
|
+
private formatStageData;
|
|
114
|
+
/**
|
|
115
|
+
* Build a single pipeline stage from a group of operations.
|
|
116
|
+
*
|
|
117
|
+
* @param stage - The pipeline stage type
|
|
118
|
+
* @param operations - The operations to build the stage from
|
|
119
|
+
* @returns The built pipeline stage or null if no stage should be added
|
|
120
|
+
*/
|
|
121
|
+
private buildStage;
|
|
122
|
+
/**
|
|
123
|
+
* Build a $match stage from where operations.
|
|
124
|
+
*
|
|
125
|
+
* Query building strategy:
|
|
126
|
+
* - Top-level where() + orWhere() = Pure OR
|
|
127
|
+
* - Use callbacks for AND + OR grouping
|
|
128
|
+
*
|
|
129
|
+
* @param operations - The where operations
|
|
130
|
+
* @returns The $match stage or null
|
|
131
|
+
*/
|
|
132
|
+
private buildMatchStage;
|
|
133
|
+
private isPureOrCondition;
|
|
134
|
+
/**
|
|
135
|
+
* Build a condition from a callback-based where clause.
|
|
136
|
+
* Creates a sub-builder, executes the callback, and extracts the conditions.
|
|
137
|
+
* If callback has orWhere, all conditions become OR.
|
|
138
|
+
*
|
|
139
|
+
* @param callback - The callback function
|
|
140
|
+
* @returns The built condition or null
|
|
141
|
+
*/
|
|
142
|
+
private buildCallbackCondition;
|
|
143
|
+
/**
|
|
144
|
+
* Build a MongoDB filter condition from a where operation.
|
|
145
|
+
*
|
|
146
|
+
* @param op - The operation to build
|
|
147
|
+
* @returns The MongoDB filter condition
|
|
148
|
+
*/
|
|
149
|
+
private buildWhereCondition;
|
|
150
|
+
/**
|
|
151
|
+
* Build a condition based on the operator.
|
|
152
|
+
*
|
|
153
|
+
* @param field - The field name
|
|
154
|
+
* @param operator - The comparison operator
|
|
155
|
+
* @param value - The value to compare
|
|
156
|
+
* @returns The MongoDB filter condition
|
|
157
|
+
*/
|
|
158
|
+
private buildOperatorCondition;
|
|
159
|
+
/**
|
|
160
|
+
* Get MongoDB operator from comparison operator.
|
|
161
|
+
*
|
|
162
|
+
* @param operator - The comparison operator
|
|
163
|
+
* @returns The MongoDB operator
|
|
164
|
+
*/
|
|
165
|
+
private getMongoOperator;
|
|
166
|
+
private resolveRawExpression;
|
|
167
|
+
private bindRawString;
|
|
168
|
+
private buildColumnComparison;
|
|
169
|
+
private buildBetweenColumnsCondition;
|
|
170
|
+
private wrapColumn;
|
|
171
|
+
private buildDateEqualityCondition;
|
|
172
|
+
private buildDateBeforeCondition;
|
|
173
|
+
private buildDateAfterCondition;
|
|
174
|
+
private buildTimeCondition;
|
|
175
|
+
private buildDatePartCondition;
|
|
176
|
+
private buildJsonContainsCondition;
|
|
177
|
+
private buildJsonDoesntContainCondition;
|
|
178
|
+
private buildJsonContainsKeyCondition;
|
|
179
|
+
private buildJsonLengthCondition;
|
|
180
|
+
private buildJsonTypeCondition;
|
|
181
|
+
private buildArrayLengthCondition;
|
|
182
|
+
private normalizeDateInput;
|
|
183
|
+
private startOfDay;
|
|
184
|
+
private endOfDay;
|
|
185
|
+
private normalizePath;
|
|
186
|
+
private applyProjectionFields;
|
|
187
|
+
/**
|
|
188
|
+
* Apply projection object with aliases and inclusion/exclusion.
|
|
189
|
+
* @param projection - The projection object to modify
|
|
190
|
+
* @param projectionObj - The projection specification
|
|
191
|
+
*/
|
|
192
|
+
private applyProjectionObject;
|
|
193
|
+
private applyRawProjection;
|
|
194
|
+
private resolveProjectionExpression;
|
|
195
|
+
private normalizeFieldReference;
|
|
196
|
+
private buildAggregateProjection;
|
|
197
|
+
private buildExistsProjection;
|
|
198
|
+
private buildArraySizeExpression;
|
|
199
|
+
private buildCaseExpression;
|
|
200
|
+
private buildCondExpression;
|
|
201
|
+
/**
|
|
202
|
+
* Resolve a value as a literal (if it's a plain string) or as an expression.
|
|
203
|
+
* Used for `then`/`default` values in CASE/WHEN expressions.
|
|
204
|
+
*/
|
|
205
|
+
private resolveLiteralOrExpression;
|
|
206
|
+
private inferJsonAlias;
|
|
207
|
+
private buildConcatExpression;
|
|
208
|
+
private buildCoalesceExpression;
|
|
209
|
+
/**
|
|
210
|
+
* Build a $project stage from select operations.
|
|
211
|
+
*
|
|
212
|
+
* @param operations - The select operations
|
|
213
|
+
* @returns The $project stage or null
|
|
214
|
+
*/
|
|
215
|
+
private buildProjectStage;
|
|
216
|
+
/**
|
|
217
|
+
* Build a $sort stage from order operations.
|
|
218
|
+
*
|
|
219
|
+
* @param operations - The order operations
|
|
220
|
+
* @returns The $sort stage or null
|
|
221
|
+
*/
|
|
222
|
+
private buildSortStage;
|
|
223
|
+
/**
|
|
224
|
+
* Build a $group stage from group operations.
|
|
225
|
+
*
|
|
226
|
+
* @param operations - The group operations
|
|
227
|
+
* @returns The $group stage or null
|
|
228
|
+
*/
|
|
229
|
+
private buildGroupStage;
|
|
230
|
+
private buildGroupByStage;
|
|
231
|
+
/**
|
|
232
|
+
* Build a $group stage with aggregates from group operations.
|
|
233
|
+
*
|
|
234
|
+
* @param fields - Fields to group by
|
|
235
|
+
* @param aggregates - Aggregate operations (abstract or raw)
|
|
236
|
+
* @returns The $group stage or null
|
|
237
|
+
*/
|
|
238
|
+
private buildGroupByWithAggregatesStage;
|
|
239
|
+
/**
|
|
240
|
+
* Extract field names from GroupByInput for renaming _id.
|
|
241
|
+
*
|
|
242
|
+
* @param fields - The grouping fields
|
|
243
|
+
* @returns Field name(s) to use for renaming _id
|
|
244
|
+
*/
|
|
245
|
+
private extractGroupFieldNames;
|
|
246
|
+
/**
|
|
247
|
+
* Translate an abstract aggregate expression to MongoDB format.
|
|
248
|
+
*
|
|
249
|
+
* @param expr - Abstract aggregate expression
|
|
250
|
+
* @returns MongoDB aggregation expression
|
|
251
|
+
*/
|
|
252
|
+
private translateAggregateExpression;
|
|
253
|
+
private buildGroupId;
|
|
254
|
+
/**
|
|
255
|
+
* Build a $lookup stage from join operations.
|
|
256
|
+
*
|
|
257
|
+
* @param operations - The join operations
|
|
258
|
+
* @returns The $lookup stage or null
|
|
259
|
+
*/
|
|
260
|
+
private buildLookupStage;
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=mongo-query-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-query-parser.d.ts","sourceRoot":"","sources":["../../../src/drivers/mongo/mongo-query-parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,SAAS,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAC;IACvB,8CAA8C;IAC9C,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,oEAAoE;IACpE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IAEzC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA0B;IAE3D;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwC;IAExE;;;;OAIG;gBACgB,OAAO,EAAE,uBAAuB;IAMnD;;;;;;;;;;;;;;;;;;;OAmBG;IACI,KAAK,IAAI,GAAG,EAAE;IAuDrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;IA8C9B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,cAAc,IAAI,MAAM;IAyB/B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IA6CvB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAyBlB;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;IA8KvB,OAAO,CAAC,iBAAiB;IAUzB;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAwE9B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAyM3B;;;;;;;OAOG;IACH,OAAO,CAAC,sBAAsB;IAmB9B;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,4BAA4B;IAWpC,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,0BAA0B;IAOlC,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,sBAAsB;IAiB9B,OAAO,CAAC,0BAA0B;IAQlC,OAAO,CAAC,+BAA+B;IAMvC,OAAO,CAAC,6BAA6B;IAMrC,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,yBAAyB;IASjC,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,qBAAqB;IAU7B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,2BAA2B;IA0BnC,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,mBAAmB;IAc3B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,uBAAuB;IAgB/B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA+GzB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAqBtB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA+CvB,OAAO,CAAC,iBAAiB;IASzB;;;;;;OAMG;IACH,OAAO,CAAC,+BAA+B;IA2BvC;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAsB9B;;;;;OAKG;IACH,OAAO,CAAC,4BAA4B;IA2DpC,OAAO,CAAC,YAAY;IA0CpB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;CAazB"}
|