@warlock.js/cascade 4.0.174 → 4.1.1
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/README.md +6 -5
- package/bin/cascadejs +3 -0
- package/esm/cli/commands/migrate-export-sql.mjs +48 -0
- package/esm/cli/commands/migrate-export-sql.mjs.map +1 -0
- package/esm/cli/commands/migrate-list.mjs +26 -0
- package/esm/cli/commands/migrate-list.mjs.map +1 -0
- package/esm/cli/commands/migrate-rollback.mjs +50 -0
- package/esm/cli/commands/migrate-rollback.mjs.map +1 -0
- package/esm/cli/commands/migrate.mjs +65 -0
- package/esm/cli/commands/migrate.mjs.map +1 -0
- package/esm/cli/connection-from-env.mjs +181 -0
- package/esm/cli/connection-from-env.mjs.map +1 -0
- package/esm/cli/index.mjs +31 -0
- package/esm/cli/index.mjs.map +1 -0
- package/esm/cli/load-migrations.mjs +78 -0
- package/esm/cli/load-migrations.mjs.map +1 -0
- package/esm/cli/printers.mjs +57 -0
- package/esm/cli/printers.mjs.map +1 -0
- package/esm/cli/setup-logger.mjs +30 -0
- package/esm/cli/setup-logger.mjs.map +1 -0
- package/esm/cli/with-cli-connection.mjs +39 -0
- package/esm/cli/with-cli-connection.mjs.map +1 -0
- package/esm/cli.d.mts +1 -0
- package/esm/cli.mjs +26 -0
- package/esm/cli.mjs.map +1 -0
- package/esm/context/database-data-source-context.d.mts +32 -0
- package/esm/context/database-data-source-context.d.mts.map +1 -0
- package/esm/context/database-data-source-context.mjs +35 -0
- package/esm/context/database-data-source-context.mjs.map +1 -0
- package/esm/context/database-transaction-context.d.mts +38 -0
- package/esm/context/database-transaction-context.d.mts.map +1 -0
- package/esm/context/database-transaction-context.mjs +47 -0
- package/esm/context/database-transaction-context.mjs.map +1 -0
- package/esm/contracts/database-driver.contract.d.mts +443 -0
- package/esm/contracts/database-driver.contract.d.mts.map +1 -0
- package/esm/contracts/database-id-generator.contract.d.mts +109 -0
- package/esm/contracts/database-id-generator.contract.d.mts.map +1 -0
- package/esm/contracts/database-remover.contract.d.mts +108 -0
- package/esm/contracts/database-remover.contract.d.mts.map +1 -0
- package/esm/contracts/database-restorer.contract.d.mts +145 -0
- package/esm/contracts/database-restorer.contract.d.mts.map +1 -0
- package/esm/contracts/database-writer.contract.d.mts +123 -0
- package/esm/contracts/database-writer.contract.d.mts.map +1 -0
- package/esm/contracts/driver-blueprint.contract.d.mts +52 -0
- package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -0
- package/esm/contracts/index.d.mts +9 -0
- package/esm/contracts/migration-driver.contract.d.mts +476 -0
- package/esm/contracts/migration-driver.contract.d.mts.map +1 -0
- package/esm/contracts/query-builder.contract.d.mts +1663 -0
- package/esm/contracts/query-builder.contract.d.mts.map +1 -0
- package/esm/contracts/sync-adapter.contract.d.mts +49 -0
- package/esm/contracts/sync-adapter.contract.d.mts.map +1 -0
- package/esm/data-source/data-source-registry.d.mts +111 -0
- package/esm/data-source/data-source-registry.d.mts.map +1 -0
- package/esm/data-source/data-source-registry.mjs +142 -0
- package/esm/data-source/data-source-registry.mjs.map +1 -0
- package/esm/data-source/data-source.d.mts +160 -0
- package/esm/data-source/data-source.d.mts.map +1 -0
- package/esm/data-source/data-source.mjs +87 -0
- package/esm/data-source/data-source.mjs.map +1 -0
- package/esm/database-dirty-tracker.d.mts +254 -0
- package/esm/database-dirty-tracker.d.mts.map +1 -0
- package/esm/database-dirty-tracker.mjs +356 -0
- package/esm/database-dirty-tracker.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-blueprint.mjs +54 -0
- package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-driver.d.mts +334 -0
- package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-driver.mjs +716 -0
- package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts +120 -0
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-id-generator.mjs +141 -0
- package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +322 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs +531 -0
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1117 -0
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-builder.mjs +1828 -0
- package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts +230 -0
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-operations.mjs +275 -0
- package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts +263 -0
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-query-parser.mjs +965 -0
- package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +78 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +118 -0
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -0
- package/esm/drivers/mongodb/types.d.mts +43 -0
- package/esm/drivers/mongodb/types.d.mts.map +1 -0
- package/esm/drivers/postgres/index.d.mts +8 -0
- package/esm/drivers/postgres/index.mjs +9 -0
- package/esm/drivers/postgres/postgres-blueprint.d.mts +60 -0
- package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-blueprint.mjs +105 -0
- package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-dialect.d.mts +144 -0
- package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-dialect.mjs +227 -0
- package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-driver.d.mts +424 -0
- package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-driver.mjs +845 -0
- package/esm/drivers/postgres/postgres-driver.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-migration-driver.d.mts +393 -0
- package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-migration-driver.mjs +760 -0
- package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-query-builder.d.mts +399 -0
- package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-query-builder.mjs +1105 -0
- package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-query-parser.d.mts +351 -0
- package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-query-parser.mjs +796 -0
- package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-sql-serializer.mjs +260 -0
- package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -0
- package/esm/drivers/postgres/postgres-sync-adapter.d.mts +79 -0
- package/esm/drivers/postgres/postgres-sync-adapter.d.mts.map +1 -0
- package/esm/drivers/postgres/postgres-sync-adapter.mjs +162 -0
- package/esm/drivers/postgres/postgres-sync-adapter.mjs.map +1 -0
- package/esm/drivers/postgres/types.d.mts +105 -0
- package/esm/drivers/postgres/types.d.mts.map +1 -0
- package/esm/drivers/sql/sql-dialect.contract.d.mts +221 -0
- package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -0
- package/esm/drivers/sql/sql-types.d.mts +150 -0
- package/esm/drivers/sql/sql-types.d.mts.map +1 -0
- package/esm/errors/missing-data-source.error.d.mts +25 -0
- package/esm/errors/missing-data-source.error.d.mts.map +1 -0
- package/esm/errors/missing-data-source.error.mjs +31 -0
- package/esm/errors/missing-data-source.error.mjs.map +1 -0
- package/esm/errors/transaction-rollback.error.d.mts +23 -0
- package/esm/errors/transaction-rollback.error.d.mts.map +1 -0
- package/esm/errors/transaction-rollback.error.mjs +29 -0
- package/esm/errors/transaction-rollback.error.mjs.map +1 -0
- package/esm/events/model-events.d.mts +234 -0
- package/esm/events/model-events.d.mts.map +1 -0
- package/esm/events/model-events.mjs +254 -0
- package/esm/events/model-events.mjs.map +1 -0
- package/esm/expressions/aggregate-expressions.d.mts +224 -0
- package/esm/expressions/aggregate-expressions.d.mts.map +1 -0
- package/esm/expressions/aggregate-expressions.mjs +232 -0
- package/esm/expressions/aggregate-expressions.mjs.map +1 -0
- package/esm/index.d.mts +67 -0
- package/esm/index.mjs +53 -0
- package/esm/migration/column-builder.d.mts +420 -0
- package/esm/migration/column-builder.d.mts.map +1 -0
- package/esm/migration/column-builder.mjs +532 -0
- package/esm/migration/column-builder.mjs.map +1 -0
- package/esm/migration/column-helpers.d.mts +280 -0
- package/esm/migration/column-helpers.d.mts.map +1 -0
- package/esm/migration/column-helpers.mjs +376 -0
- package/esm/migration/column-helpers.mjs.map +1 -0
- package/esm/migration/foreign-key-builder.d.mts +106 -0
- package/esm/migration/foreign-key-builder.d.mts.map +1 -0
- package/esm/migration/foreign-key-builder.mjs +126 -0
- package/esm/migration/foreign-key-builder.mjs.map +1 -0
- package/esm/migration/index.d.mts +6 -0
- package/esm/migration/index.mjs +7 -0
- package/esm/migration/migration-runner.d.mts +279 -0
- package/esm/migration/migration-runner.d.mts.map +1 -0
- package/esm/migration/migration-runner.mjs +662 -0
- package/esm/migration/migration-runner.mjs.map +1 -0
- package/esm/migration/migration.d.mts +2035 -0
- package/esm/migration/migration.d.mts.map +1 -0
- package/esm/migration/migration.mjs +2083 -0
- package/esm/migration/migration.mjs.map +1 -0
- package/esm/migration/sql-grammar.mjs +115 -0
- package/esm/migration/sql-grammar.mjs.map +1 -0
- package/esm/migration/sql-serializer.d.mts +26 -0
- package/esm/migration/sql-serializer.d.mts.map +1 -0
- package/esm/migration/sql-serializer.mjs +26 -0
- package/esm/migration/sql-serializer.mjs.map +1 -0
- package/esm/migration/types.d.mts +136 -0
- package/esm/migration/types.d.mts.map +1 -0
- package/esm/model/methods/accessor-methods.mjs +54 -0
- package/esm/model/methods/accessor-methods.mjs.map +1 -0
- package/esm/model/methods/delete-methods.mjs +16 -0
- package/esm/model/methods/delete-methods.mjs.map +1 -0
- package/esm/model/methods/dirty-methods.mjs +20 -0
- package/esm/model/methods/dirty-methods.mjs.map +1 -0
- package/esm/model/methods/hydration-methods.mjs +51 -0
- package/esm/model/methods/hydration-methods.mjs.map +1 -0
- package/esm/model/methods/instance-event-methods.mjs +22 -0
- package/esm/model/methods/instance-event-methods.mjs.map +1 -0
- package/esm/model/methods/meta-methods.mjs +36 -0
- package/esm/model/methods/meta-methods.mjs.map +1 -0
- package/esm/model/methods/pivot-methods.mjs +48 -0
- package/esm/model/methods/pivot-methods.mjs.map +1 -0
- package/esm/model/methods/query-methods.mjs +121 -0
- package/esm/model/methods/query-methods.mjs.map +1 -0
- package/esm/model/methods/restore-methods.mjs +16 -0
- package/esm/model/methods/restore-methods.mjs.map +1 -0
- package/esm/model/methods/scope-methods.mjs +20 -0
- package/esm/model/methods/scope-methods.mjs.map +1 -0
- package/esm/model/methods/serialization-methods.mjs +20 -0
- package/esm/model/methods/serialization-methods.mjs.map +1 -0
- package/esm/model/methods/static-event-methods.mjs +37 -0
- package/esm/model/methods/static-event-methods.mjs.map +1 -0
- package/esm/model/methods/write-methods.mjs +69 -0
- package/esm/model/methods/write-methods.mjs.map +1 -0
- package/esm/model/model.d.mts +1778 -0
- package/esm/model/model.d.mts.map +1 -0
- package/esm/model/model.mjs +1762 -0
- package/esm/model/model.mjs.map +1 -0
- package/esm/model/model.types.d.mts +47 -0
- package/esm/model/model.types.d.mts.map +1 -0
- package/esm/model/register-model.d.mts +140 -0
- package/esm/model/register-model.d.mts.map +1 -0
- package/esm/model/register-model.mjs +175 -0
- package/esm/model/register-model.mjs.map +1 -0
- package/esm/model/relation-decorators.d.mts +88 -0
- package/esm/model/relation-decorators.d.mts.map +1 -0
- package/esm/model/relation-decorators.mjs +191 -0
- package/esm/model/relation-decorators.mjs.map +1 -0
- package/esm/operations/database.d.mts +46 -0
- package/esm/operations/database.d.mts.map +1 -0
- package/esm/operations/database.mjs +40 -0
- package/esm/operations/database.mjs.map +1 -0
- package/esm/operations/index.d.mts +2 -0
- package/esm/operations/index.mjs +4 -0
- package/esm/operations/migrations.d.mts +71 -0
- package/esm/operations/migrations.d.mts.map +1 -0
- package/esm/operations/migrations.mjs +70 -0
- package/esm/operations/migrations.mjs.map +1 -0
- package/esm/query-builder/query-builder.d.mts +564 -0
- package/esm/query-builder/query-builder.d.mts.map +1 -0
- package/esm/query-builder/query-builder.mjs +1097 -0
- package/esm/query-builder/query-builder.mjs.map +1 -0
- package/esm/relations/index.d.mts +4 -0
- package/esm/relations/index.mjs +5 -0
- package/esm/relations/key-conventions.mjs +119 -0
- package/esm/relations/key-conventions.mjs.map +1 -0
- package/esm/relations/pivot-operations.d.mts +155 -0
- package/esm/relations/pivot-operations.d.mts.map +1 -0
- package/esm/relations/pivot-operations.mjs +232 -0
- package/esm/relations/pivot-operations.mjs.map +1 -0
- package/esm/relations/relation-hydrator.d.mts +55 -0
- package/esm/relations/relation-hydrator.d.mts.map +1 -0
- package/esm/relations/relation-hydrator.mjs +52 -0
- package/esm/relations/relation-hydrator.mjs.map +1 -0
- package/esm/relations/relation-loader.d.mts +190 -0
- package/esm/relations/relation-loader.d.mts.map +1 -0
- package/esm/relations/relation-loader.mjs +416 -0
- package/esm/relations/relation-loader.mjs.map +1 -0
- package/esm/relations/types.d.mts +317 -0
- package/esm/relations/types.d.mts.map +1 -0
- package/esm/remover/database-remover.d.mts +104 -0
- package/esm/remover/database-remover.d.mts.map +1 -0
- package/esm/remover/database-remover.mjs +174 -0
- package/esm/remover/database-remover.mjs.map +1 -0
- package/esm/restorer/database-restorer.d.mts +135 -0
- package/esm/restorer/database-restorer.d.mts.map +1 -0
- package/esm/restorer/database-restorer.mjs +316 -0
- package/esm/restorer/database-restorer.mjs.map +1 -0
- package/esm/sql-database-dirty-tracker.d.mts +17 -0
- package/esm/sql-database-dirty-tracker.d.mts.map +1 -0
- package/esm/sql-database-dirty-tracker.mjs +20 -0
- package/esm/sql-database-dirty-tracker.mjs.map +1 -0
- package/esm/sync/model-events.mjs +46 -0
- package/esm/sync/model-events.mjs.map +1 -0
- package/esm/sync/model-sync-operation.d.mts +159 -0
- package/esm/sync/model-sync-operation.d.mts.map +1 -0
- package/esm/sync/model-sync-operation.mjs +257 -0
- package/esm/sync/model-sync-operation.mjs.map +1 -0
- package/esm/sync/model-sync.d.mts +126 -0
- package/esm/sync/model-sync.d.mts.map +1 -0
- package/esm/sync/model-sync.mjs +157 -0
- package/esm/sync/model-sync.mjs.map +1 -0
- package/esm/sync/sync-context.d.mts +69 -0
- package/esm/sync/sync-context.d.mts.map +1 -0
- package/esm/sync/sync-context.mjs +95 -0
- package/esm/sync/sync-context.mjs.map +1 -0
- package/esm/sync/sync-manager.d.mts +213 -0
- package/esm/sync/sync-manager.d.mts.map +1 -0
- package/esm/sync/sync-manager.mjs +597 -0
- package/esm/sync/sync-manager.mjs.map +1 -0
- package/esm/sync/types.d.mts +215 -0
- package/esm/sync/types.d.mts.map +1 -0
- package/esm/types.d.mts +423 -0
- package/esm/types.d.mts.map +1 -0
- package/esm/utils/connect-to-database.d.mts +328 -0
- package/esm/utils/connect-to-database.d.mts.map +1 -0
- package/esm/utils/connect-to-database.mjs +130 -0
- package/esm/utils/connect-to-database.mjs.map +1 -0
- package/esm/utils/database-writer.utils.d.mts +18 -0
- package/esm/utils/database-writer.utils.d.mts.map +1 -0
- package/esm/utils/database-writer.utils.mjs +25 -0
- package/esm/utils/database-writer.utils.mjs.map +1 -0
- package/esm/utils/define-model.d.mts +185 -0
- package/esm/utils/define-model.d.mts.map +1 -0
- package/esm/utils/define-model.mjs +105 -0
- package/esm/utils/define-model.mjs.map +1 -0
- package/esm/utils/is-valid-date-value.mjs +22 -0
- package/esm/utils/is-valid-date-value.mjs.map +1 -0
- package/esm/utils/once-connected.d.mts +150 -0
- package/esm/utils/once-connected.d.mts.map +1 -0
- package/esm/utils/once-connected.mjs +203 -0
- package/esm/utils/once-connected.mjs.map +1 -0
- package/esm/validation/database-seal-plugins.d.mts +1 -0
- package/esm/validation/database-seal-plugins.mjs +11 -0
- package/esm/validation/database-seal-plugins.mjs.map +1 -0
- package/esm/validation/database-writer-validation-error.d.mts +101 -0
- package/esm/validation/database-writer-validation-error.d.mts.map +1 -0
- package/esm/validation/database-writer-validation-error.mjs +153 -0
- package/esm/validation/database-writer-validation-error.mjs.map +1 -0
- package/esm/validation/index.d.mts +2 -0
- package/esm/validation/index.mjs +4 -0
- package/esm/validation/mutators/embed-mutator.mjs +26 -0
- package/esm/validation/mutators/embed-mutator.mjs.map +1 -0
- package/esm/validation/plugins/database-rules-plugin.d.mts +28 -0
- package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -0
- package/esm/validation/plugins/database-rules-plugin.mjs +43 -0
- package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.d.mts +17 -0
- package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -0
- package/esm/validation/plugins/embed-validator-plugin.mjs +20 -0
- package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -0
- package/esm/validation/rules/database-model-rule.mjs +32 -0
- package/esm/validation/rules/database-model-rule.mjs.map +1 -0
- package/esm/validation/rules/exists-rule.mjs +29 -0
- package/esm/validation/rules/exists-rule.mjs.map +1 -0
- package/esm/validation/rules/unique-rule.mjs +43 -0
- package/esm/validation/rules/unique-rule.mjs.map +1 -0
- package/esm/validation/transformers/embed-model-transformer.mjs +17 -0
- package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -0
- package/esm/validation/types.d.mts +43 -0
- package/esm/validation/types.d.mts.map +1 -0
- package/esm/validation/validators/embed-validator.d.mts +25 -0
- package/esm/validation/validators/embed-validator.d.mts.map +1 -0
- package/esm/validation/validators/embed-validator.mjs +42 -0
- package/esm/validation/validators/embed-validator.mjs.map +1 -0
- package/esm/writer/database-writer.d.mts +178 -0
- package/esm/writer/database-writer.d.mts.map +1 -0
- package/esm/writer/database-writer.mjs +317 -0
- package/esm/writer/database-writer.mjs.map +1 -0
- package/llms-full.txt +2027 -0
- package/llms.txt +23 -0
- package/package.json +60 -51
- package/skills/README.md +65 -0
- package/skills/aggregate-data/SKILL.md +102 -0
- package/skills/cascade-basics/SKILL.md +93 -0
- package/skills/configure-delete-strategy/SKILL.md +126 -0
- package/skills/define-model/SKILL.md +170 -0
- package/skills/define-relations/SKILL.md +171 -0
- package/skills/manage-data-sources/SKILL.md +140 -0
- package/skills/manage-transactions/SKILL.md +118 -0
- package/skills/paginate-results/SKILL.md +122 -0
- package/skills/perform-atomic-ops/SKILL.md +98 -0
- package/skills/query-data/SKILL.md +168 -0
- package/skills/run-cascade-cli/SKILL.md +125 -0
- package/skills/search-by-vector/SKILL.md +127 -0
- package/skills/subscribe-to-model-events/SKILL.md +148 -0
- package/skills/track-changes/SKILL.md +109 -0
- package/skills/write-migration/SKILL.md +144 -0
- package/cjs/context/database-data-source-context.d.ts +0 -29
- package/cjs/context/database-data-source-context.d.ts.map +0 -1
- package/cjs/context/database-data-source-context.js +0 -28
- package/cjs/context/database-data-source-context.js.map +0 -1
- package/cjs/context/database-transaction-context.d.ts +0 -35
- package/cjs/context/database-transaction-context.d.ts.map +0 -1
- package/cjs/context/database-transaction-context.js +0 -40
- package/cjs/context/database-transaction-context.js.map +0 -1
- package/cjs/contracts/database-driver.contract.d.ts +0 -450
- package/cjs/contracts/database-driver.contract.d.ts.map +0 -1
- package/cjs/contracts/database-id-generator.contract.d.ts +0 -109
- package/cjs/contracts/database-id-generator.contract.d.ts.map +0 -1
- package/cjs/contracts/database-remover.contract.d.ts +0 -104
- package/cjs/contracts/database-remover.contract.d.ts.map +0 -1
- package/cjs/contracts/database-restorer.contract.d.ts +0 -143
- package/cjs/contracts/database-restorer.contract.d.ts.map +0 -1
- package/cjs/contracts/database-writer.contract.d.ts +0 -119
- package/cjs/contracts/database-writer.contract.d.ts.map +0 -1
- package/cjs/contracts/driver-blueprint.contract.d.ts +0 -49
- package/cjs/contracts/driver-blueprint.contract.d.ts.map +0 -1
- package/cjs/contracts/index.d.ts +0 -10
- package/cjs/contracts/index.d.ts.map +0 -1
- package/cjs/contracts/migration-driver.contract.d.ts +0 -522
- package/cjs/contracts/migration-driver.contract.d.ts.map +0 -1
- package/cjs/contracts/query-builder.contract.d.ts +0 -1609
- package/cjs/contracts/query-builder.contract.d.ts.map +0 -1
- package/cjs/contracts/sync-adapter.contract.d.ts +0 -58
- package/cjs/contracts/sync-adapter.contract.d.ts.map +0 -1
- package/cjs/data-source/data-source-registry.d.ts +0 -108
- package/cjs/data-source/data-source-registry.d.ts.map +0 -1
- package/cjs/data-source/data-source-registry.js +0 -145
- package/cjs/data-source/data-source-registry.js.map +0 -1
- package/cjs/data-source/data-source.d.ts +0 -147
- package/cjs/data-source/data-source.d.ts.map +0 -1
- package/cjs/data-source/data-source.js +0 -83
- package/cjs/data-source/data-source.js.map +0 -1
- package/cjs/database-dirty-tracker.d.ts +0 -252
- package/cjs/database-dirty-tracker.d.ts.map +0 -1
- package/cjs/database-dirty-tracker.js +0 -386
- package/cjs/database-dirty-tracker.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
- package/cjs/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-blueprint.js +0 -51
- package/cjs/drivers/mongodb/mongodb-blueprint.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-driver.d.ts +0 -325
- package/cjs/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-driver.js +0 -845
- package/cjs/drivers/mongodb/mongodb-driver.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
- package/cjs/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-id-generator.js +0 -149
- package/cjs/drivers/mongodb/mongodb-id-generator.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
- package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-migration-driver.js +0 -666
- package/cjs/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
- package/cjs/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-builder.js +0 -1988
- package/cjs/drivers/mongodb/mongodb-query-builder.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
- package/cjs/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-operations.js +0 -270
- package/cjs/drivers/mongodb/mongodb-query-operations.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
- package/cjs/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-query-parser.js +0 -1351
- package/cjs/drivers/mongodb/mongodb-query-parser.js.map +0 -1
- package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
- package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
- package/cjs/drivers/mongodb/mongodb-sync-adapter.js +0 -146
- package/cjs/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
- package/cjs/drivers/mongodb/types.d.ts +0 -43
- package/cjs/drivers/mongodb/types.d.ts.map +0 -1
- package/cjs/drivers/postgres/index.d.ts +0 -16
- package/cjs/drivers/postgres/index.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-blueprint.d.ts +0 -64
- package/cjs/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-blueprint.js +0 -121
- package/cjs/drivers/postgres/postgres-blueprint.js.map +0 -1
- package/cjs/drivers/postgres/postgres-dialect.d.ts +0 -136
- package/cjs/drivers/postgres/postgres-dialect.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-dialect.js +0 -268
- package/cjs/drivers/postgres/postgres-dialect.js.map +0 -1
- package/cjs/drivers/postgres/postgres-driver.d.ts +0 -432
- package/cjs/drivers/postgres/postgres-driver.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-driver.js +0 -1008
- package/cjs/drivers/postgres/postgres-driver.js.map +0 -1
- package/cjs/drivers/postgres/postgres-migration-driver.d.ts +0 -397
- package/cjs/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-migration-driver.js +0 -900
- package/cjs/drivers/postgres/postgres-migration-driver.js.map +0 -1
- package/cjs/drivers/postgres/postgres-query-builder.d.ts +0 -254
- package/cjs/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-query-builder.js +0 -933
- package/cjs/drivers/postgres/postgres-query-builder.js.map +0 -1
- package/cjs/drivers/postgres/postgres-query-parser.d.ts +0 -328
- package/cjs/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-query-parser.js +0 -868
- package/cjs/drivers/postgres/postgres-query-parser.js.map +0 -1
- package/cjs/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
- package/cjs/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-sql-serializer.js +0 -400
- package/cjs/drivers/postgres/postgres-sql-serializer.js.map +0 -1
- package/cjs/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
- package/cjs/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
- package/cjs/drivers/postgres/postgres-sync-adapter.js +0 -204
- package/cjs/drivers/postgres/postgres-sync-adapter.js.map +0 -1
- package/cjs/drivers/postgres/types.d.ts +0 -144
- package/cjs/drivers/postgres/types.d.ts.map +0 -1
- package/cjs/drivers/sql/index.d.ts +0 -10
- package/cjs/drivers/sql/index.d.ts.map +0 -1
- package/cjs/drivers/sql/sql-dialect.contract.d.ts +0 -204
- package/cjs/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
- package/cjs/drivers/sql/sql-types.d.ts +0 -202
- package/cjs/drivers/sql/sql-types.d.ts.map +0 -1
- package/cjs/errors/missing-data-source.error.d.ts +0 -22
- package/cjs/errors/missing-data-source.error.d.ts.map +0 -1
- package/cjs/errors/missing-data-source.error.js +0 -29
- package/cjs/errors/missing-data-source.error.js.map +0 -1
- package/cjs/errors/transaction-rollback.error.d.ts +0 -20
- package/cjs/errors/transaction-rollback.error.d.ts.map +0 -1
- package/cjs/errors/transaction-rollback.error.js +0 -27
- package/cjs/errors/transaction-rollback.error.js.map +0 -1
- package/cjs/events/model-events.d.ts +0 -231
- package/cjs/events/model-events.d.ts.map +0 -1
- package/cjs/events/model-events.js +0 -259
- package/cjs/events/model-events.js.map +0 -1
- package/cjs/expressions/aggregate-expressions.d.ts +0 -215
- package/cjs/expressions/aggregate-expressions.d.ts.map +0 -1
- package/cjs/expressions/aggregate-expressions.js +0 -221
- package/cjs/expressions/aggregate-expressions.js.map +0 -1
- package/cjs/expressions/index.d.ts +0 -2
- package/cjs/expressions/index.d.ts.map +0 -1
- package/cjs/index.d.ts +0 -45
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/migration/column-builder.d.ts +0 -417
- package/cjs/migration/column-builder.d.ts.map +0 -1
- package/cjs/migration/column-builder.js +0 -586
- package/cjs/migration/column-builder.js.map +0 -1
- package/cjs/migration/column-helpers.d.ts +0 -275
- package/cjs/migration/column-helpers.d.ts.map +0 -1
- package/cjs/migration/column-helpers.js +0 -389
- package/cjs/migration/column-helpers.js.map +0 -1
- package/cjs/migration/foreign-key-builder.d.ts +0 -103
- package/cjs/migration/foreign-key-builder.d.ts.map +0 -1
- package/cjs/migration/foreign-key-builder.js +0 -121
- package/cjs/migration/foreign-key-builder.js.map +0 -1
- package/cjs/migration/index.d.ts +0 -7
- package/cjs/migration/index.d.ts.map +0 -1
- package/cjs/migration/migration-runner.d.ts +0 -278
- package/cjs/migration/migration-runner.d.ts.map +0 -1
- package/cjs/migration/migration-runner.js +0 -815
- package/cjs/migration/migration-runner.js.map +0 -1
- package/cjs/migration/migration.d.ts +0 -1988
- package/cjs/migration/migration.d.ts.map +0 -1
- package/cjs/migration/migration.js +0 -2162
- package/cjs/migration/migration.js.map +0 -1
- package/cjs/migration/sql-grammar.d.ts +0 -61
- package/cjs/migration/sql-grammar.d.ts.map +0 -1
- package/cjs/migration/sql-grammar.js +0 -164
- package/cjs/migration/sql-grammar.js.map +0 -1
- package/cjs/migration/sql-serializer.d.ts +0 -22
- package/cjs/migration/sql-serializer.d.ts.map +0 -1
- package/cjs/migration/sql-serializer.js +0 -26
- package/cjs/migration/sql-serializer.js.map +0 -1
- package/cjs/migration/types.d.ts +0 -155
- package/cjs/migration/types.d.ts.map +0 -1
- package/cjs/model/methods/accessor-methods.d.ts +0 -13
- package/cjs/model/methods/accessor-methods.d.ts.map +0 -1
- package/cjs/model/methods/accessor-methods.js +0 -51
- package/cjs/model/methods/accessor-methods.js.map +0 -1
- package/cjs/model/methods/delete-methods.d.ts +0 -10
- package/cjs/model/methods/delete-methods.d.ts.map +0 -1
- package/cjs/model/methods/delete-methods.js +0 -10
- package/cjs/model/methods/delete-methods.js.map +0 -1
- package/cjs/model/methods/dirty-methods.d.ts +0 -10
- package/cjs/model/methods/dirty-methods.d.ts.map +0 -1
- package/cjs/model/methods/dirty-methods.js +0 -15
- package/cjs/model/methods/dirty-methods.js.map +0 -1
- package/cjs/model/methods/hydration-methods.d.ts +0 -10
- package/cjs/model/methods/hydration-methods.d.ts.map +0 -1
- package/cjs/model/methods/hydration-methods.js +0 -57
- package/cjs/model/methods/hydration-methods.js.map +0 -1
- package/cjs/model/methods/instance-event-methods.d.ts +0 -7
- package/cjs/model/methods/instance-event-methods.d.ts.map +0 -1
- package/cjs/model/methods/instance-event-methods.js +0 -15
- package/cjs/model/methods/instance-event-methods.js.map +0 -1
- package/cjs/model/methods/meta-methods.d.ts +0 -7
- package/cjs/model/methods/meta-methods.d.ts.map +0 -1
- package/cjs/model/methods/meta-methods.js +0 -78
- package/cjs/model/methods/meta-methods.js.map +0 -1
- package/cjs/model/methods/query-methods.d.ts +0 -24
- package/cjs/model/methods/query-methods.d.ts.map +0 -1
- package/cjs/model/methods/query-methods.js +0 -164
- package/cjs/model/methods/query-methods.js.map +0 -1
- package/cjs/model/methods/restore-methods.d.ts +0 -10
- package/cjs/model/methods/restore-methods.d.ts.map +0 -1
- package/cjs/model/methods/restore-methods.js +0 -13
- package/cjs/model/methods/restore-methods.js.map +0 -1
- package/cjs/model/methods/scope-methods.d.ts +0 -7
- package/cjs/model/methods/scope-methods.d.ts.map +0 -1
- package/cjs/model/methods/scope-methods.js +0 -15
- package/cjs/model/methods/scope-methods.js.map +0 -1
- package/cjs/model/methods/serialization-methods.d.ts +0 -3
- package/cjs/model/methods/serialization-methods.d.ts.map +0 -1
- package/cjs/model/methods/serialization-methods.js +0 -27
- package/cjs/model/methods/serialization-methods.js.map +0 -1
- package/cjs/model/methods/static-event-methods.d.ts +0 -9
- package/cjs/model/methods/static-event-methods.d.ts.map +0 -1
- package/cjs/model/methods/static-event-methods.js +0 -29
- package/cjs/model/methods/static-event-methods.js.map +0 -1
- package/cjs/model/methods/write-methods.d.ts +0 -10
- package/cjs/model/methods/write-methods.d.ts.map +0 -1
- package/cjs/model/methods/write-methods.js +0 -52
- package/cjs/model/methods/write-methods.js.map +0 -1
- package/cjs/model/model.d.ts +0 -1647
- package/cjs/model/model.d.ts.map +0 -1
- package/cjs/model/model.js +0 -1657
- package/cjs/model/model.js.map +0 -1
- package/cjs/model/model.types.d.ts +0 -44
- package/cjs/model/model.types.d.ts.map +0 -1
- package/cjs/model/register-model.d.ts +0 -81
- package/cjs/model/register-model.d.ts.map +0 -1
- package/cjs/model/register-model.js +0 -94
- package/cjs/model/register-model.js.map +0 -1
- package/cjs/query-builder/query-builder.d.ts +0 -556
- package/cjs/query-builder/query-builder.d.ts.map +0 -1
- package/cjs/query-builder/query-builder.js +0 -1070
- package/cjs/query-builder/query-builder.js.map +0 -1
- package/cjs/relations/helpers.d.ts +0 -156
- package/cjs/relations/helpers.d.ts.map +0 -1
- package/cjs/relations/helpers.js +0 -202
- package/cjs/relations/helpers.js.map +0 -1
- package/cjs/relations/index.d.ts +0 -35
- package/cjs/relations/index.d.ts.map +0 -1
- package/cjs/relations/pivot-operations.d.ts +0 -160
- package/cjs/relations/pivot-operations.d.ts.map +0 -1
- package/cjs/relations/pivot-operations.js +0 -293
- package/cjs/relations/pivot-operations.js.map +0 -1
- package/cjs/relations/relation-hydrator.d.ts +0 -68
- package/cjs/relations/relation-hydrator.d.ts.map +0 -1
- package/cjs/relations/relation-hydrator.js +0 -81
- package/cjs/relations/relation-hydrator.js.map +0 -1
- package/cjs/relations/relation-loader.d.ts +0 -194
- package/cjs/relations/relation-loader.d.ts.map +0 -1
- package/cjs/relations/relation-loader.js +0 -466
- package/cjs/relations/relation-loader.js.map +0 -1
- package/cjs/relations/types.d.ts +0 -306
- package/cjs/relations/types.d.ts.map +0 -1
- package/cjs/remover/database-remover.d.ts +0 -100
- package/cjs/remover/database-remover.d.ts.map +0 -1
- package/cjs/remover/database-remover.js +0 -214
- package/cjs/remover/database-remover.js.map +0 -1
- package/cjs/restorer/database-restorer.d.ts +0 -131
- package/cjs/restorer/database-restorer.d.ts.map +0 -1
- package/cjs/restorer/database-restorer.js +0 -434
- package/cjs/restorer/database-restorer.js.map +0 -1
- package/cjs/sql-database-dirty-tracker.d.ts +0 -13
- package/cjs/sql-database-dirty-tracker.d.ts.map +0 -1
- package/cjs/sql-database-dirty-tracker.js +0 -14
- package/cjs/sql-database-dirty-tracker.js.map +0 -1
- package/cjs/sync/index.d.ts +0 -12
- package/cjs/sync/index.d.ts.map +0 -1
- package/cjs/sync/model-events.d.ts +0 -62
- package/cjs/sync/model-events.d.ts.map +0 -1
- package/cjs/sync/model-events.js +0 -49
- package/cjs/sync/model-events.js.map +0 -1
- package/cjs/sync/model-sync-operation.d.ts +0 -163
- package/cjs/sync/model-sync-operation.d.ts.map +0 -1
- package/cjs/sync/model-sync-operation.js +0 -292
- package/cjs/sync/model-sync-operation.js.map +0 -1
- package/cjs/sync/model-sync.d.ts +0 -130
- package/cjs/sync/model-sync.d.ts.map +0 -1
- package/cjs/sync/model-sync.js +0 -178
- package/cjs/sync/model-sync.js.map +0 -1
- package/cjs/sync/sync-context.d.ts +0 -70
- package/cjs/sync/sync-context.d.ts.map +0 -1
- package/cjs/sync/sync-context.js +0 -101
- package/cjs/sync/sync-context.js.map +0 -1
- package/cjs/sync/sync-manager.d.ts +0 -213
- package/cjs/sync/sync-manager.d.ts.map +0 -1
- package/cjs/sync/sync-manager.js +0 -689
- package/cjs/sync/sync-manager.js.map +0 -1
- package/cjs/sync/types.d.ts +0 -289
- package/cjs/sync/types.d.ts.map +0 -1
- package/cjs/test-migrations/test-enhanced-features.migration.d.ts +0 -15
- package/cjs/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
- package/cjs/types.d.ts +0 -371
- package/cjs/types.d.ts.map +0 -1
- package/cjs/utils/connect-to-database.d.ts +0 -307
- package/cjs/utils/connect-to-database.d.ts.map +0 -1
- package/cjs/utils/connect-to-database.js +0 -130
- package/cjs/utils/connect-to-database.js.map +0 -1
- package/cjs/utils/database-writer.utils.d.ts +0 -15
- package/cjs/utils/database-writer.utils.d.ts.map +0 -1
- package/cjs/utils/database-writer.utils.js +0 -14
- package/cjs/utils/database-writer.utils.js.map +0 -1
- package/cjs/utils/define-model.js +0 -100
- package/cjs/utils/define-model.js.map +0 -1
- package/cjs/utils/is-valid-date-value.d.ts +0 -5
- package/cjs/utils/is-valid-date-value.d.ts.map +0 -1
- package/cjs/utils/is-valid-date-value.js +0 -25
- package/cjs/utils/is-valid-date-value.js.map +0 -1
- package/cjs/utils/once-connected.d.ts +0 -146
- package/cjs/utils/once-connected.d.ts.map +0 -1
- package/cjs/utils/once-connected.js +0 -251
- package/cjs/utils/once-connected.js.map +0 -1
- package/cjs/validation/database-seal-plugins.d.ts +0 -12
- package/cjs/validation/database-seal-plugins.d.ts.map +0 -1
- package/cjs/validation/database-seal-plugins.js +0 -1
- package/cjs/validation/database-seal-plugins.js.map +0 -1
- package/cjs/validation/database-writer-validation-error.d.ts +0 -97
- package/cjs/validation/database-writer-validation-error.d.ts.map +0 -1
- package/cjs/validation/database-writer-validation-error.js +0 -160
- package/cjs/validation/database-writer-validation-error.js.map +0 -1
- package/cjs/validation/index.d.ts +0 -3
- package/cjs/validation/index.d.ts.map +0 -1
- package/cjs/validation/mutators/embed-mutator.d.ts +0 -9
- package/cjs/validation/mutators/embed-mutator.d.ts.map +0 -1
- package/cjs/validation/mutators/embed-mutator.js +0 -33
- package/cjs/validation/mutators/embed-mutator.js.map +0 -1
- package/cjs/validation/plugins/embed-validator-plugin.d.ts +0 -24
- package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
- package/cjs/validation/plugins/embed-validator-plugin.js +0 -18
- package/cjs/validation/plugins/embed-validator-plugin.js.map +0 -1
- package/cjs/validation/rules/database-model-rule.d.ts +0 -7
- package/cjs/validation/rules/database-model-rule.d.ts.map +0 -1
- package/cjs/validation/rules/database-model-rule.js +0 -27
- package/cjs/validation/rules/database-model-rule.js.map +0 -1
- package/cjs/validation/transformers/embed-model-transformer.d.ts +0 -3
- package/cjs/validation/transformers/embed-model-transformer.d.ts.map +0 -1
- package/cjs/validation/transformers/embed-model-transformer.js +0 -18
- package/cjs/validation/transformers/embed-model-transformer.js.map +0 -1
- package/cjs/validation/validators/embed-validator.d.ts +0 -21
- package/cjs/validation/validators/embed-validator.d.ts.map +0 -1
- package/cjs/validation/validators/embed-validator.js +0 -43
- package/cjs/validation/validators/embed-validator.js.map +0 -1
- package/cjs/writer/database-writer.d.ts +0 -174
- package/cjs/writer/database-writer.d.ts.map +0 -1
- package/cjs/writer/database-writer.js +0 -400
- package/cjs/writer/database-writer.js.map +0 -1
- package/esm/context/database-data-source-context.d.ts +0 -29
- package/esm/context/database-data-source-context.d.ts.map +0 -1
- package/esm/context/database-data-source-context.js +0 -28
- package/esm/context/database-data-source-context.js.map +0 -1
- package/esm/context/database-transaction-context.d.ts +0 -35
- package/esm/context/database-transaction-context.d.ts.map +0 -1
- package/esm/context/database-transaction-context.js +0 -40
- package/esm/context/database-transaction-context.js.map +0 -1
- package/esm/contracts/database-driver.contract.d.ts +0 -450
- package/esm/contracts/database-driver.contract.d.ts.map +0 -1
- package/esm/contracts/database-id-generator.contract.d.ts +0 -109
- package/esm/contracts/database-id-generator.contract.d.ts.map +0 -1
- package/esm/contracts/database-remover.contract.d.ts +0 -104
- package/esm/contracts/database-remover.contract.d.ts.map +0 -1
- package/esm/contracts/database-restorer.contract.d.ts +0 -143
- package/esm/contracts/database-restorer.contract.d.ts.map +0 -1
- package/esm/contracts/database-writer.contract.d.ts +0 -119
- package/esm/contracts/database-writer.contract.d.ts.map +0 -1
- package/esm/contracts/driver-blueprint.contract.d.ts +0 -49
- package/esm/contracts/driver-blueprint.contract.d.ts.map +0 -1
- package/esm/contracts/index.d.ts +0 -10
- package/esm/contracts/index.d.ts.map +0 -1
- package/esm/contracts/migration-driver.contract.d.ts +0 -522
- package/esm/contracts/migration-driver.contract.d.ts.map +0 -1
- package/esm/contracts/query-builder.contract.d.ts +0 -1609
- package/esm/contracts/query-builder.contract.d.ts.map +0 -1
- package/esm/contracts/sync-adapter.contract.d.ts +0 -58
- package/esm/contracts/sync-adapter.contract.d.ts.map +0 -1
- package/esm/data-source/data-source-registry.d.ts +0 -108
- package/esm/data-source/data-source-registry.d.ts.map +0 -1
- package/esm/data-source/data-source-registry.js +0 -145
- package/esm/data-source/data-source-registry.js.map +0 -1
- package/esm/data-source/data-source.d.ts +0 -147
- package/esm/data-source/data-source.d.ts.map +0 -1
- package/esm/data-source/data-source.js +0 -83
- package/esm/data-source/data-source.js.map +0 -1
- package/esm/database-dirty-tracker.d.ts +0 -252
- package/esm/database-dirty-tracker.d.ts.map +0 -1
- package/esm/database-dirty-tracker.js +0 -386
- package/esm/database-dirty-tracker.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
- package/esm/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-blueprint.js +0 -51
- package/esm/drivers/mongodb/mongodb-blueprint.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-driver.d.ts +0 -325
- package/esm/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-driver.js +0 -845
- package/esm/drivers/mongodb/mongodb-driver.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
- package/esm/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-id-generator.js +0 -149
- package/esm/drivers/mongodb/mongodb-id-generator.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
- package/esm/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.js +0 -666
- package/esm/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
- package/esm/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-builder.js +0 -1988
- package/esm/drivers/mongodb/mongodb-query-builder.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
- package/esm/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-operations.js +0 -270
- package/esm/drivers/mongodb/mongodb-query-operations.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
- package/esm/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-query-parser.js +0 -1351
- package/esm/drivers/mongodb/mongodb-query-parser.js.map +0 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.js +0 -146
- package/esm/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
- package/esm/drivers/mongodb/types.d.ts +0 -43
- package/esm/drivers/mongodb/types.d.ts.map +0 -1
- package/esm/drivers/postgres/index.d.ts +0 -16
- package/esm/drivers/postgres/index.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-blueprint.d.ts +0 -64
- package/esm/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-blueprint.js +0 -121
- package/esm/drivers/postgres/postgres-blueprint.js.map +0 -1
- package/esm/drivers/postgres/postgres-dialect.d.ts +0 -136
- package/esm/drivers/postgres/postgres-dialect.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-dialect.js +0 -268
- package/esm/drivers/postgres/postgres-dialect.js.map +0 -1
- package/esm/drivers/postgres/postgres-driver.d.ts +0 -432
- package/esm/drivers/postgres/postgres-driver.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-driver.js +0 -1008
- package/esm/drivers/postgres/postgres-driver.js.map +0 -1
- package/esm/drivers/postgres/postgres-migration-driver.d.ts +0 -397
- package/esm/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-migration-driver.js +0 -900
- package/esm/drivers/postgres/postgres-migration-driver.js.map +0 -1
- package/esm/drivers/postgres/postgres-query-builder.d.ts +0 -254
- package/esm/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-query-builder.js +0 -933
- package/esm/drivers/postgres/postgres-query-builder.js.map +0 -1
- package/esm/drivers/postgres/postgres-query-parser.d.ts +0 -328
- package/esm/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-query-parser.js +0 -868
- package/esm/drivers/postgres/postgres-query-parser.js.map +0 -1
- package/esm/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
- package/esm/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-sql-serializer.js +0 -400
- package/esm/drivers/postgres/postgres-sql-serializer.js.map +0 -1
- package/esm/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
- package/esm/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
- package/esm/drivers/postgres/postgres-sync-adapter.js +0 -204
- package/esm/drivers/postgres/postgres-sync-adapter.js.map +0 -1
- package/esm/drivers/postgres/types.d.ts +0 -144
- package/esm/drivers/postgres/types.d.ts.map +0 -1
- package/esm/drivers/sql/index.d.ts +0 -10
- package/esm/drivers/sql/index.d.ts.map +0 -1
- package/esm/drivers/sql/sql-dialect.contract.d.ts +0 -204
- package/esm/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
- package/esm/drivers/sql/sql-types.d.ts +0 -202
- package/esm/drivers/sql/sql-types.d.ts.map +0 -1
- package/esm/errors/missing-data-source.error.d.ts +0 -22
- package/esm/errors/missing-data-source.error.d.ts.map +0 -1
- package/esm/errors/missing-data-source.error.js +0 -29
- package/esm/errors/missing-data-source.error.js.map +0 -1
- package/esm/errors/transaction-rollback.error.d.ts +0 -20
- package/esm/errors/transaction-rollback.error.d.ts.map +0 -1
- package/esm/errors/transaction-rollback.error.js +0 -27
- package/esm/errors/transaction-rollback.error.js.map +0 -1
- package/esm/events/model-events.d.ts +0 -231
- package/esm/events/model-events.d.ts.map +0 -1
- package/esm/events/model-events.js +0 -259
- package/esm/events/model-events.js.map +0 -1
- package/esm/expressions/aggregate-expressions.d.ts +0 -215
- package/esm/expressions/aggregate-expressions.d.ts.map +0 -1
- package/esm/expressions/aggregate-expressions.js +0 -221
- package/esm/expressions/aggregate-expressions.js.map +0 -1
- package/esm/expressions/index.d.ts +0 -2
- package/esm/expressions/index.d.ts.map +0 -1
- package/esm/index.d.ts +0 -45
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -1
- package/esm/index.js.map +0 -1
- package/esm/migration/column-builder.d.ts +0 -417
- package/esm/migration/column-builder.d.ts.map +0 -1
- package/esm/migration/column-builder.js +0 -586
- package/esm/migration/column-builder.js.map +0 -1
- package/esm/migration/column-helpers.d.ts +0 -275
- package/esm/migration/column-helpers.d.ts.map +0 -1
- package/esm/migration/column-helpers.js +0 -389
- package/esm/migration/column-helpers.js.map +0 -1
- package/esm/migration/foreign-key-builder.d.ts +0 -103
- package/esm/migration/foreign-key-builder.d.ts.map +0 -1
- package/esm/migration/foreign-key-builder.js +0 -121
- package/esm/migration/foreign-key-builder.js.map +0 -1
- package/esm/migration/index.d.ts +0 -7
- package/esm/migration/index.d.ts.map +0 -1
- package/esm/migration/migration-runner.d.ts +0 -278
- package/esm/migration/migration-runner.d.ts.map +0 -1
- package/esm/migration/migration-runner.js +0 -815
- package/esm/migration/migration-runner.js.map +0 -1
- package/esm/migration/migration.d.ts +0 -1988
- package/esm/migration/migration.d.ts.map +0 -1
- package/esm/migration/migration.js +0 -2162
- package/esm/migration/migration.js.map +0 -1
- package/esm/migration/sql-grammar.d.ts +0 -61
- package/esm/migration/sql-grammar.d.ts.map +0 -1
- package/esm/migration/sql-grammar.js +0 -164
- package/esm/migration/sql-grammar.js.map +0 -1
- package/esm/migration/sql-serializer.d.ts +0 -22
- package/esm/migration/sql-serializer.d.ts.map +0 -1
- package/esm/migration/sql-serializer.js +0 -26
- package/esm/migration/sql-serializer.js.map +0 -1
- package/esm/migration/types.d.ts +0 -155
- package/esm/migration/types.d.ts.map +0 -1
- package/esm/model/methods/accessor-methods.d.ts +0 -13
- package/esm/model/methods/accessor-methods.d.ts.map +0 -1
- package/esm/model/methods/accessor-methods.js +0 -51
- package/esm/model/methods/accessor-methods.js.map +0 -1
- package/esm/model/methods/delete-methods.d.ts +0 -10
- package/esm/model/methods/delete-methods.d.ts.map +0 -1
- package/esm/model/methods/delete-methods.js +0 -10
- package/esm/model/methods/delete-methods.js.map +0 -1
- package/esm/model/methods/dirty-methods.d.ts +0 -10
- package/esm/model/methods/dirty-methods.d.ts.map +0 -1
- package/esm/model/methods/dirty-methods.js +0 -15
- package/esm/model/methods/dirty-methods.js.map +0 -1
- package/esm/model/methods/hydration-methods.d.ts +0 -10
- package/esm/model/methods/hydration-methods.d.ts.map +0 -1
- package/esm/model/methods/hydration-methods.js +0 -57
- package/esm/model/methods/hydration-methods.js.map +0 -1
- package/esm/model/methods/instance-event-methods.d.ts +0 -7
- package/esm/model/methods/instance-event-methods.d.ts.map +0 -1
- package/esm/model/methods/instance-event-methods.js +0 -15
- package/esm/model/methods/instance-event-methods.js.map +0 -1
- package/esm/model/methods/meta-methods.d.ts +0 -7
- package/esm/model/methods/meta-methods.d.ts.map +0 -1
- package/esm/model/methods/meta-methods.js +0 -78
- package/esm/model/methods/meta-methods.js.map +0 -1
- package/esm/model/methods/query-methods.d.ts +0 -24
- package/esm/model/methods/query-methods.d.ts.map +0 -1
- package/esm/model/methods/query-methods.js +0 -164
- package/esm/model/methods/query-methods.js.map +0 -1
- package/esm/model/methods/restore-methods.d.ts +0 -10
- package/esm/model/methods/restore-methods.d.ts.map +0 -1
- package/esm/model/methods/restore-methods.js +0 -13
- package/esm/model/methods/restore-methods.js.map +0 -1
- package/esm/model/methods/scope-methods.d.ts +0 -7
- package/esm/model/methods/scope-methods.d.ts.map +0 -1
- package/esm/model/methods/scope-methods.js +0 -15
- package/esm/model/methods/scope-methods.js.map +0 -1
- package/esm/model/methods/serialization-methods.d.ts +0 -3
- package/esm/model/methods/serialization-methods.d.ts.map +0 -1
- package/esm/model/methods/serialization-methods.js +0 -27
- package/esm/model/methods/serialization-methods.js.map +0 -1
- package/esm/model/methods/static-event-methods.d.ts +0 -9
- package/esm/model/methods/static-event-methods.d.ts.map +0 -1
- package/esm/model/methods/static-event-methods.js +0 -29
- package/esm/model/methods/static-event-methods.js.map +0 -1
- package/esm/model/methods/write-methods.d.ts +0 -10
- package/esm/model/methods/write-methods.d.ts.map +0 -1
- package/esm/model/methods/write-methods.js +0 -52
- package/esm/model/methods/write-methods.js.map +0 -1
- package/esm/model/model.d.ts +0 -1647
- package/esm/model/model.d.ts.map +0 -1
- package/esm/model/model.js +0 -1657
- package/esm/model/model.js.map +0 -1
- package/esm/model/model.types.d.ts +0 -44
- package/esm/model/model.types.d.ts.map +0 -1
- package/esm/model/register-model.d.ts +0 -81
- package/esm/model/register-model.d.ts.map +0 -1
- package/esm/model/register-model.js +0 -94
- package/esm/model/register-model.js.map +0 -1
- package/esm/query-builder/query-builder.d.ts +0 -556
- package/esm/query-builder/query-builder.d.ts.map +0 -1
- package/esm/query-builder/query-builder.js +0 -1070
- package/esm/query-builder/query-builder.js.map +0 -1
- package/esm/relations/helpers.d.ts +0 -156
- package/esm/relations/helpers.d.ts.map +0 -1
- package/esm/relations/helpers.js +0 -202
- package/esm/relations/helpers.js.map +0 -1
- package/esm/relations/index.d.ts +0 -35
- package/esm/relations/index.d.ts.map +0 -1
- package/esm/relations/pivot-operations.d.ts +0 -160
- package/esm/relations/pivot-operations.d.ts.map +0 -1
- package/esm/relations/pivot-operations.js +0 -293
- package/esm/relations/pivot-operations.js.map +0 -1
- package/esm/relations/relation-hydrator.d.ts +0 -68
- package/esm/relations/relation-hydrator.d.ts.map +0 -1
- package/esm/relations/relation-hydrator.js +0 -81
- package/esm/relations/relation-hydrator.js.map +0 -1
- package/esm/relations/relation-loader.d.ts +0 -194
- package/esm/relations/relation-loader.d.ts.map +0 -1
- package/esm/relations/relation-loader.js +0 -466
- package/esm/relations/relation-loader.js.map +0 -1
- package/esm/relations/types.d.ts +0 -306
- package/esm/relations/types.d.ts.map +0 -1
- package/esm/remover/database-remover.d.ts +0 -100
- package/esm/remover/database-remover.d.ts.map +0 -1
- package/esm/remover/database-remover.js +0 -214
- package/esm/remover/database-remover.js.map +0 -1
- package/esm/restorer/database-restorer.d.ts +0 -131
- package/esm/restorer/database-restorer.d.ts.map +0 -1
- package/esm/restorer/database-restorer.js +0 -434
- package/esm/restorer/database-restorer.js.map +0 -1
- package/esm/sql-database-dirty-tracker.d.ts +0 -13
- package/esm/sql-database-dirty-tracker.d.ts.map +0 -1
- package/esm/sql-database-dirty-tracker.js +0 -14
- package/esm/sql-database-dirty-tracker.js.map +0 -1
- package/esm/sync/index.d.ts +0 -12
- package/esm/sync/index.d.ts.map +0 -1
- package/esm/sync/model-events.d.ts +0 -62
- package/esm/sync/model-events.d.ts.map +0 -1
- package/esm/sync/model-events.js +0 -49
- package/esm/sync/model-events.js.map +0 -1
- package/esm/sync/model-sync-operation.d.ts +0 -163
- package/esm/sync/model-sync-operation.d.ts.map +0 -1
- package/esm/sync/model-sync-operation.js +0 -292
- package/esm/sync/model-sync-operation.js.map +0 -1
- package/esm/sync/model-sync.d.ts +0 -130
- package/esm/sync/model-sync.d.ts.map +0 -1
- package/esm/sync/model-sync.js +0 -178
- package/esm/sync/model-sync.js.map +0 -1
- package/esm/sync/sync-context.d.ts +0 -70
- package/esm/sync/sync-context.d.ts.map +0 -1
- package/esm/sync/sync-context.js +0 -101
- package/esm/sync/sync-context.js.map +0 -1
- package/esm/sync/sync-manager.d.ts +0 -213
- package/esm/sync/sync-manager.d.ts.map +0 -1
- package/esm/sync/sync-manager.js +0 -689
- package/esm/sync/sync-manager.js.map +0 -1
- package/esm/sync/types.d.ts +0 -289
- package/esm/sync/types.d.ts.map +0 -1
- package/esm/test-migrations/test-enhanced-features.migration.d.ts +0 -15
- package/esm/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
- package/esm/types.d.ts +0 -371
- package/esm/types.d.ts.map +0 -1
- package/esm/utils/connect-to-database.d.ts +0 -307
- package/esm/utils/connect-to-database.d.ts.map +0 -1
- package/esm/utils/connect-to-database.js +0 -130
- package/esm/utils/connect-to-database.js.map +0 -1
- package/esm/utils/database-writer.utils.d.ts +0 -15
- package/esm/utils/database-writer.utils.d.ts.map +0 -1
- package/esm/utils/database-writer.utils.js +0 -14
- package/esm/utils/database-writer.utils.js.map +0 -1
- package/esm/utils/define-model.js +0 -100
- package/esm/utils/define-model.js.map +0 -1
- package/esm/utils/is-valid-date-value.d.ts +0 -5
- package/esm/utils/is-valid-date-value.d.ts.map +0 -1
- package/esm/utils/is-valid-date-value.js +0 -25
- package/esm/utils/is-valid-date-value.js.map +0 -1
- package/esm/utils/once-connected.d.ts +0 -146
- package/esm/utils/once-connected.d.ts.map +0 -1
- package/esm/utils/once-connected.js +0 -251
- package/esm/utils/once-connected.js.map +0 -1
- package/esm/validation/database-seal-plugins.d.ts +0 -12
- package/esm/validation/database-seal-plugins.d.ts.map +0 -1
- package/esm/validation/database-seal-plugins.js +0 -1
- package/esm/validation/database-seal-plugins.js.map +0 -1
- package/esm/validation/database-writer-validation-error.d.ts +0 -97
- package/esm/validation/database-writer-validation-error.d.ts.map +0 -1
- package/esm/validation/database-writer-validation-error.js +0 -160
- package/esm/validation/database-writer-validation-error.js.map +0 -1
- package/esm/validation/index.d.ts +0 -3
- package/esm/validation/index.d.ts.map +0 -1
- package/esm/validation/mutators/embed-mutator.d.ts +0 -9
- package/esm/validation/mutators/embed-mutator.d.ts.map +0 -1
- package/esm/validation/mutators/embed-mutator.js +0 -33
- package/esm/validation/mutators/embed-mutator.js.map +0 -1
- package/esm/validation/plugins/embed-validator-plugin.d.ts +0 -24
- package/esm/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
- package/esm/validation/plugins/embed-validator-plugin.js +0 -18
- package/esm/validation/plugins/embed-validator-plugin.js.map +0 -1
- package/esm/validation/rules/database-model-rule.d.ts +0 -7
- package/esm/validation/rules/database-model-rule.d.ts.map +0 -1
- package/esm/validation/rules/database-model-rule.js +0 -27
- package/esm/validation/rules/database-model-rule.js.map +0 -1
- package/esm/validation/transformers/embed-model-transformer.d.ts +0 -3
- package/esm/validation/transformers/embed-model-transformer.d.ts.map +0 -1
- package/esm/validation/transformers/embed-model-transformer.js +0 -18
- package/esm/validation/transformers/embed-model-transformer.js.map +0 -1
- package/esm/validation/validators/embed-validator.d.ts +0 -21
- package/esm/validation/validators/embed-validator.d.ts.map +0 -1
- package/esm/validation/validators/embed-validator.js +0 -43
- package/esm/validation/validators/embed-validator.js.map +0 -1
- package/esm/writer/database-writer.d.ts +0 -174
- package/esm/writer/database-writer.d.ts.map +0 -1
- package/esm/writer/database-writer.js +0 -400
- package/esm/writer/database-writer.js.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { ChildModel } from "../model/model.types.mjs";
|
|
2
|
+
import { Model } from "../model/model.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../@warlock.js/cascade/src/sync/types.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Context information for a sync operation.
|
|
7
|
+
* Tracks the source, target, chain, and results of a sync operation.
|
|
8
|
+
*/
|
|
9
|
+
type SyncContext = {
|
|
10
|
+
/** Source model name (e.g., "Category") */sourceModel: string; /** Source model primary key value */
|
|
11
|
+
sourceId: string | number; /** Current depth in the sync chain (1, 2, 3...) */
|
|
12
|
+
currentDepth: number; /** Chain of model names in the sync path (e.g., ["Category", "Product"]) */
|
|
13
|
+
syncChain: string[]; /** Target model name being synced to */
|
|
14
|
+
targetModel: string; /** Filter to identify documents to update in target */
|
|
15
|
+
filter: Record<string, unknown>; /** Update operations to apply to matched documents */
|
|
16
|
+
update: Record<string, unknown>; /** Number of documents affected by this sync operation */
|
|
17
|
+
affectedCount: number; /** Timestamp when the sync operation was executed */
|
|
18
|
+
timestamp: Date;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Result of a sync operation.
|
|
22
|
+
* Contains success status, counts, and error details.
|
|
23
|
+
*/
|
|
24
|
+
type SyncResult = {
|
|
25
|
+
/** Whether the overall sync operation succeeded */success: boolean; /** Total number of sync instructions attempted */
|
|
26
|
+
attempted: number; /** Number of sync instructions that succeeded */
|
|
27
|
+
succeeded: number; /** Number of sync instructions that failed */
|
|
28
|
+
failed: number; /** Detailed error information for failed operations */
|
|
29
|
+
errors: Array<{
|
|
30
|
+
instruction: SyncInstruction;
|
|
31
|
+
error: Error;
|
|
32
|
+
}>; /** Maximum depth reached in the sync chain */
|
|
33
|
+
depthReached: number; /** All sync contexts created during the operation */
|
|
34
|
+
contexts: SyncContext[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A single sync instruction to be executed.
|
|
38
|
+
* Contains all information needed to perform a sync update.
|
|
39
|
+
*/
|
|
40
|
+
type SyncInstruction = {
|
|
41
|
+
/** Target table/collection name */targetTable: string; /** Target model name */
|
|
42
|
+
targetModel: string; /** Filter to identify documents to update */
|
|
43
|
+
filter: Record<string, unknown>; /** Update operations to apply */
|
|
44
|
+
update: Record<string, unknown>; /** Current depth in the sync chain */
|
|
45
|
+
depth: number; /** Chain of model names leading to this instruction */
|
|
46
|
+
chain: string[]; /** Source model name */
|
|
47
|
+
sourceModel: string; /** Source model ID */
|
|
48
|
+
sourceId: string | number; /** Whether this is an array update (requires positional operator) */
|
|
49
|
+
isArrayUpdate?: boolean; /** Array field path for positional updates */
|
|
50
|
+
arrayField?: string; /** Identifier field for array matching */
|
|
51
|
+
identifierField?: string; /** Identifier value for array matching */
|
|
52
|
+
identifierValue?: string | number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Configuration for a single sync relationship.
|
|
56
|
+
*/
|
|
57
|
+
type SyncConfig = {
|
|
58
|
+
/** Target field path in the target model (e.g., "category" or "products") */targetField: string; /** Whether this is a many relationship (array of embedded documents) */
|
|
59
|
+
isMany: boolean; /** Method name to call on source model to get embedded data */
|
|
60
|
+
embedKey: string; /** Field name to use as identifier in array matching (for isMany) */
|
|
61
|
+
identifierField: string; /** Maximum sync depth allowed from this relationship */
|
|
62
|
+
maxSyncDepth: number; /** Whether to prevent circular sync chains */
|
|
63
|
+
preventCircularSync: boolean; /** Fields to watch for changes (empty = all fields) */
|
|
64
|
+
watchFields: string[]; /** Whether to unset the field when source is deleted */
|
|
65
|
+
unsetOnDelete: boolean; /** Target model class (for chaining) */
|
|
66
|
+
targetModelClass: ChildModel<Model>;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Options for building sync instructions.
|
|
70
|
+
*/
|
|
71
|
+
type SyncInstructionOptions = {
|
|
72
|
+
/** Current depth in the sync chain */currentDepth: number; /** Chain of model names leading to this point */
|
|
73
|
+
syncChain: string[]; /** Maximum allowed depth for this sync operation */
|
|
74
|
+
maxDepth: number; /** Whether to prevent circular references */
|
|
75
|
+
preventCircular: boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Standard embed proeprties names.
|
|
79
|
+
*/
|
|
80
|
+
type EmbedKey = "embedData" | "embedParent" | "embedMinimal";
|
|
81
|
+
/**
|
|
82
|
+
* Event payload for sync events.
|
|
83
|
+
*/
|
|
84
|
+
type SyncEventPayload = {
|
|
85
|
+
/** Source model name */sourceModel: string; /** Source model ID */
|
|
86
|
+
sourceId: string | number; /** Target model name */
|
|
87
|
+
targetModel: string; /** Filter used to identify target documents */
|
|
88
|
+
filter: Record<string, unknown>; /** Update operations applied */
|
|
89
|
+
update: Record<string, unknown>; /** Number of documents affected */
|
|
90
|
+
affectedCount: number; /** Current depth in sync chain */
|
|
91
|
+
depth: number; /** Sync chain path */
|
|
92
|
+
chain: string[];
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Configuration for a model sync operation.
|
|
96
|
+
*
|
|
97
|
+
* Holds all settings for how a source model syncs to a target model.
|
|
98
|
+
*/
|
|
99
|
+
type ModelSyncConfig = {
|
|
100
|
+
/** Source model class that triggers sync on changes */readonly sourceModel: ChildModel<Model>; /** Target model class that receives synced data */
|
|
101
|
+
readonly targetModel: ChildModel<Model>; /** Field path in target model where data is embedded */
|
|
102
|
+
readonly targetField: string; /** Whether this syncs to an array field (true) or single field (false) */
|
|
103
|
+
readonly isMany: boolean; /** Method name on source model to get embedded data */
|
|
104
|
+
embedKey: string | string[]; /** Field name used as identifier when syncing to arrays */
|
|
105
|
+
identifierField: string; /** Maximum depth for chained sync operations */
|
|
106
|
+
maxSyncDepth: number; /** Fields to watch - sync only triggers when these change (empty = all) */
|
|
107
|
+
watchFields: string[]; /** Whether to unset the target field when source is deleted */
|
|
108
|
+
unsetOnDelete: boolean; /** Whether to delete target documents when source is deleted */
|
|
109
|
+
removeOnDelete: boolean;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Contract for a model sync operation instance.
|
|
113
|
+
*
|
|
114
|
+
* Provides fluent configuration methods and lifecycle management.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* Category.sync(Product, "category")
|
|
119
|
+
* .embed("embedMinimal")
|
|
120
|
+
* .watchFields(["name", "slug"])
|
|
121
|
+
* .unsetOnDelete();
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
interface ModelSyncOperationContract {
|
|
125
|
+
/**
|
|
126
|
+
* Set the embed method to call on source model.
|
|
127
|
+
*
|
|
128
|
+
* @param method - Method name (e.g., "embedData", "embedMinimal") or an array of strings
|
|
129
|
+
* @returns This operation for chaining
|
|
130
|
+
*/
|
|
131
|
+
embed(method: string | string[]): this;
|
|
132
|
+
/**
|
|
133
|
+
* Set the identifier field for array matching.
|
|
134
|
+
* Required when syncing to array fields (syncMany).
|
|
135
|
+
*
|
|
136
|
+
* @param field - Field name used as identifier (default: "id")
|
|
137
|
+
* @returns This operation for chaining
|
|
138
|
+
*/
|
|
139
|
+
identifyBy(field: string): this;
|
|
140
|
+
/**
|
|
141
|
+
* Set the maximum sync depth for chained operations.
|
|
142
|
+
*
|
|
143
|
+
* @param depth - Maximum depth (default: 3)
|
|
144
|
+
* @returns This operation for chaining
|
|
145
|
+
*/
|
|
146
|
+
maxDepth(depth: number): this;
|
|
147
|
+
/**
|
|
148
|
+
* Set which fields to watch for changes.
|
|
149
|
+
* Sync only triggers when these fields change.
|
|
150
|
+
*
|
|
151
|
+
* @param fields - Array of field names to watch (empty = all)
|
|
152
|
+
* @returns This operation for chaining
|
|
153
|
+
*/
|
|
154
|
+
watchFields(fields: string[]): this;
|
|
155
|
+
/**
|
|
156
|
+
* Unset the target field when source is deleted.
|
|
157
|
+
*
|
|
158
|
+
* @returns This operation for chaining
|
|
159
|
+
*/
|
|
160
|
+
unsetOnDelete(): this;
|
|
161
|
+
/**
|
|
162
|
+
* Delete target documents when source is deleted.
|
|
163
|
+
*
|
|
164
|
+
* @returns This operation for chaining
|
|
165
|
+
*/
|
|
166
|
+
removeOnDelete(): this;
|
|
167
|
+
/**
|
|
168
|
+
* Unsubscribe from all events and cleanup.
|
|
169
|
+
* Called automatically when using modelSync.register().
|
|
170
|
+
*/
|
|
171
|
+
unsubscribe(): void;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Contract for the modelSync facade.
|
|
175
|
+
*
|
|
176
|
+
* Provides methods to create and manage sync operations.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* export const cleanup = modelSync.register(() => {
|
|
181
|
+
* Category.sync(Product, "category");
|
|
182
|
+
* Tag.syncMany(Post, "tags").identifyBy("id");
|
|
183
|
+
* });
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
interface ModelSyncContract {
|
|
187
|
+
/**
|
|
188
|
+
* Create a sync operation for a single embedded document.
|
|
189
|
+
*
|
|
190
|
+
* @param source - Source model class that triggers sync
|
|
191
|
+
* @param target - Target model class that receives data
|
|
192
|
+
* @param field - Field path in target model
|
|
193
|
+
* @returns Sync operation for chaining configuration
|
|
194
|
+
*/
|
|
195
|
+
sync(source: ChildModel<Model>, target: ChildModel<Model>, field: string): ModelSyncOperationContract;
|
|
196
|
+
/**
|
|
197
|
+
* Create a sync operation for an array of embedded documents.
|
|
198
|
+
*
|
|
199
|
+
* @param source - Source model class that triggers sync
|
|
200
|
+
* @param target - Target model class that receives data
|
|
201
|
+
* @param field - Array field path in target model
|
|
202
|
+
* @returns Sync operation for chaining configuration
|
|
203
|
+
*/
|
|
204
|
+
syncMany(source: ChildModel<Model>, target: ChildModel<Model>, field: string): ModelSyncOperationContract;
|
|
205
|
+
/**
|
|
206
|
+
* Register sync operations with automatic cleanup.
|
|
207
|
+
*
|
|
208
|
+
* @param callback - Function that registers sync operations
|
|
209
|
+
* @returns Cleanup function that unsubscribes all registered operations
|
|
210
|
+
*/
|
|
211
|
+
register(callback: () => void): () => void;
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
export { EmbedKey, ModelSyncConfig, ModelSyncContract, ModelSyncOperationContract, SyncConfig, SyncContext, SyncEventPayload, SyncInstruction, SyncInstructionOptions, SyncResult };
|
|
215
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../@warlock.js/cascade/src/sync/types.ts"],"mappings":";;;;;;;;KAYY,WAAA;EA0BK,2CAxBf,WAAA,UAGA;EAAA,QAAA,mBAMA;EAHA,YAAA,UASA;EANA,SAAA,YASA;EANA,WAAA,UASA;EANA,MAAA,EAAQ,MAAA,mBASG;EANX,MAAA,EAAQ,MAAA,mBAMO;EAHf,aAAA,UAUoB;EAPpB,SAAA,EAAW,IAAA;AAAA;;;;;KAOD,UAAA;EAEV,mDAAA,OAAA,WAMA;EAHA,SAAA,UASA;EANA,SAAA,UAMgB;EAHhB,MAAA,UAG8C;EAA9C,MAAA,EAAQ,KAAA;IAAQ,WAAA,EAAa,eAAA;IAAiB,KAAA,EAAO,KAAA;EAAA,IAMhC;EAHrB,YAAA,UAUU;EAPV,QAAA,EAAU,WAAA;AAAA;;;;;KAOA,eAAA;EAWV,mCATA,WAAA,UAYA;EATA,WAAA,UAeA;EAZA,MAAA,EAAQ,MAAA,mBAkBR;EAfA,MAAA,EAAQ,MAAM,mBAqBd;EAlBA,KAAA,UAqBe;EAlBf,KAAA,YAwBU;EArBV,WAAA;EAGA,QAAA,mBAoBA;EAjBA,aAAA,YAuBA;EApBA,UAAA,WA0BA;EAvBA,eAAA,WA6BA;EA1BA,eAAA;AAAA;;;;KAMU,UAAA;EAgCA,6EA9BV,WAAA;EAGA,MAAA,WA6BA;EA1BA,QAAA,UAgCA;EA7BA,eAAA,UAgCe;EA7Bf,YAAA,UAuDU;EApDV,mBAAA;EAGA,WAAA,YAiDkB;EA9ClB,aAAA,WAmD0B;EAhD1B,gBAAA,EAAkB,UAAU,CAAC,KAAA;AAAA;;;;KAMnB,sBAAA;EAqDF,sCAnDR,YAAA,UAsDQ;EAnDR,SAAA,YAyDA;EAtDA,QAAA,UAyDK;EAtDL,eAAA;AAAA;;;;KA0BU,QAAA;;;;KAKA,gBAAA;EAgEI,wBA9Dd,WAAA,UA8EyC;EA3EzC,QAAA,mBA2EyC;EAxEzC,WAAA,UA+EM;EA5EN,MAAA,EAAQ,MAAA,mBAqFG;EAlFX,MAAA,EAAQ,MAAM,mBA0FL;EAvFT,aAAA,UAgGY;EA7FZ,KAAA,UA2GA;EAxGA,KAAA;AAAA;AA8GW;AAgBb;;;;AAhBa,KAlGD,eAAA;EA6HW,gEA3HZ,WAAA,EAAa,UAAA,CAAW,KAAA,GA6H9B;EAAA,SA1HM,WAAA,EAAa,UAAA,CAAW,KAAA,GAqIvB;EAAA,SAlID,WAAA,UAmIC;EAAA,SAhID,MAAA,WAkIoB;EA/H7B,QAAA,qBA6GA;EA1GA,eAAA,UA2GqB;EAxGrB,YAAA,UAyGU;EAtGV,WAAA,YAsGE;EAnGF,aAAA,WAqGG;EAlGH,cAAA;AAAA;;;;;;;;;;;AAwH6B;;;UAxGd,0BAAA;;;;;;;EAOf,KAAA,CAAM,MAAA;;;;;;;;EASN,UAAA,CAAW,KAAA;;;;;;;EAQX,QAAA,CAAS,KAAA;;;;;;;;EAST,WAAA,CAAY,MAAA;;;;;;EAOZ,aAAA;;;;;;EAOA,cAAA;;;;;EAMA,WAAA;AAAA;;;;;;;;;;;;;;UAgBe,iBAAA;;;;;;;;;EASf,IAAA,CACE,MAAA,EAAQ,UAAA,CAAW,KAAA,GACnB,MAAA,EAAQ,UAAA,CAAW,KAAA,GACnB,KAAA,WACC,0BAAA;;;;;;;;;EAUH,QAAA,CACE,MAAA,EAAQ,UAAA,CAAW,KAAA,GACnB,MAAA,EAAQ,UAAA,CAAW,KAAA,GACnB,KAAA,WACC,0BAAA;;;;;;;EAQH,QAAA,CAAS,QAAA;AAAA"}
|
package/esm/types.d.mts
ADDED
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
//#region ../../@warlock.js/cascade/src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Strict mode configuration for handling unknown fields during validation.
|
|
4
|
+
*
|
|
5
|
+
* Controls how the model behaves when encountering fields not defined in the schema.
|
|
6
|
+
*
|
|
7
|
+
* - `"strip"` - Remove unknown fields silently (default, recommended for APIs)
|
|
8
|
+
* - `"fail"` - Throw validation error on unknown fields (strict validation)
|
|
9
|
+
* - `"allow"` - Allow unknown fields to pass through (permissive)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { Model, type StrictMode } from "@warlock.js/cascade";
|
|
14
|
+
*
|
|
15
|
+
* class User extends Model {
|
|
16
|
+
* public static strictMode: StrictMode = "fail";
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
type StrictMode = "strip" | "fail" | "allow";
|
|
21
|
+
/**
|
|
22
|
+
* Delete strategy for model destruction.
|
|
23
|
+
*
|
|
24
|
+
* Controls how models are deleted from the database:
|
|
25
|
+
*
|
|
26
|
+
* - `"trash"` - Moves document to a trash/recycle bin collection, then deletes
|
|
27
|
+
* - `"permanent"` - Actually deletes the document from the database (hard delete)
|
|
28
|
+
* - `"soft"` - Sets a `deletedAt` timestamp instead of deleting (soft delete)
|
|
29
|
+
*
|
|
30
|
+
* Priority order (highest to lowest):
|
|
31
|
+
* 1. destroy() method options
|
|
32
|
+
* 2. Model static property (deleteStrategy)
|
|
33
|
+
* 3. Data source default configuration
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* class User extends Model {
|
|
38
|
+
* public static deleteStrategy: DeleteStrategy = "soft";
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* // Override at call time
|
|
42
|
+
* await user.destroy({ strategy: "permanent" });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
type DeleteStrategy = "trash" | "permanent" | "soft";
|
|
46
|
+
/**
|
|
47
|
+
* Naming convention for database column names.
|
|
48
|
+
*
|
|
49
|
+
* Different databases have different naming conventions:
|
|
50
|
+
* - `"camelCase"` - MongoDB standard (createdAt, updatedAt, deletedAt)
|
|
51
|
+
* - `"snake_case"` - PostgreSQL/MySQL standard (created_at, updated_at, deleted_at)
|
|
52
|
+
*
|
|
53
|
+
* This affects default column names for timestamps and other system columns.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* // PostgreSQL driver defaults
|
|
58
|
+
* namingConvention: "snake_case"
|
|
59
|
+
* // Results in: created_at, updated_at, deleted_at
|
|
60
|
+
*
|
|
61
|
+
* // MongoDB driver defaults
|
|
62
|
+
* namingConvention: "camelCase"
|
|
63
|
+
* // Results in: createdAt, updatedAt, deletedAt
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
type NamingConvention = "camelCase" | "snake_case";
|
|
67
|
+
/**
|
|
68
|
+
* Unified model default configuration.
|
|
69
|
+
*
|
|
70
|
+
* These settings define default behaviors for models. The configuration
|
|
71
|
+
* follows a 4-tier hierarchy (highest to lowest precedence):
|
|
72
|
+
*
|
|
73
|
+
* 1. Model static property (explicit override)
|
|
74
|
+
* 2. Database config modelDefaults
|
|
75
|
+
* 3. Driver defaults (SQL vs NoSQL conventions)
|
|
76
|
+
* 4. Framework defaults (fallback values)
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* // PostgreSQL driver provides defaults:
|
|
81
|
+
* const postgresDefaults: ModelDefaults = {
|
|
82
|
+
* namingConvention: "snake_case",
|
|
83
|
+
* createdAtColumn: "created_at",
|
|
84
|
+
* updatedAtColumn: "updated_at",
|
|
85
|
+
* deletedAtColumn: "deleted_at",
|
|
86
|
+
* timestamps: true,
|
|
87
|
+
* autoGenerateId: false, // SQL handles this
|
|
88
|
+
* };
|
|
89
|
+
*
|
|
90
|
+
* // Override in database config:
|
|
91
|
+
* {
|
|
92
|
+
* modelDefaults: {
|
|
93
|
+
* randomIncrement: true,
|
|
94
|
+
* initialId: 1000,
|
|
95
|
+
* deleteStrategy: "soft",
|
|
96
|
+
* }
|
|
97
|
+
* }
|
|
98
|
+
*
|
|
99
|
+
* // Override in specific model:
|
|
100
|
+
* class User extends Model {
|
|
101
|
+
* public static createdAtColumn = "creation_date"; // Highest priority
|
|
102
|
+
* public static updatedAtColumn = false; // Disable updatedAt
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
type ModelDefaults = {
|
|
107
|
+
/**
|
|
108
|
+
* Auto-generate incremental `id` field on insert (NoSQL only).
|
|
109
|
+
*
|
|
110
|
+
* When enabled, the ID generator creates a sequential integer ID
|
|
111
|
+
* separate from the database's native ID (_id for MongoDB).
|
|
112
|
+
*
|
|
113
|
+
* **Note:** SQL databases use native AUTO_INCREMENT and don't need this.
|
|
114
|
+
*
|
|
115
|
+
* @default true (MongoDB), false (PostgreSQL)
|
|
116
|
+
*/
|
|
117
|
+
autoGenerateId?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Initial ID value for the first record.
|
|
120
|
+
*
|
|
121
|
+
* @default 1
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* initialId: 1000 // Start from 1000
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
initialId?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Randomly generate the initial ID.
|
|
131
|
+
*
|
|
132
|
+
* Can be:
|
|
133
|
+
* - `true`: Generate random ID between 10000-499999
|
|
134
|
+
* - Function: Custom random ID generator
|
|
135
|
+
* - `false`: Use `initialId` or default to 1
|
|
136
|
+
*
|
|
137
|
+
* @default false
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* randomInitialId: true // Random 10000-499999
|
|
142
|
+
* randomInitialId: () => Math.floor(Math.random() * 1000000)
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
randomInitialId?: boolean | (() => number);
|
|
146
|
+
/**
|
|
147
|
+
* Amount to increment ID by for each new record.
|
|
148
|
+
*
|
|
149
|
+
* @default 1
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* incrementIdBy: 5 // Increment by 5
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
incrementIdBy?: number;
|
|
157
|
+
/**
|
|
158
|
+
* Randomly generate the increment amount.
|
|
159
|
+
*
|
|
160
|
+
* Can be:
|
|
161
|
+
* - `true`: Generate random increment between 1-10
|
|
162
|
+
* - Function: Custom random increment generator
|
|
163
|
+
* - `false`: Use `incrementIdBy` or default to 1
|
|
164
|
+
*
|
|
165
|
+
* @default false
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* randomIncrement: true // Random 1-10
|
|
170
|
+
* randomIncrement: () => Math.floor(Math.random() * 100)
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
randomIncrement?: boolean | (() => number);
|
|
174
|
+
/**
|
|
175
|
+
* Enable/disable automatic timestamp management.
|
|
176
|
+
*
|
|
177
|
+
* When enabled, createdAt and updatedAt are automatically managed.
|
|
178
|
+
* When disabled, no timestamps are added.
|
|
179
|
+
*
|
|
180
|
+
* @default true
|
|
181
|
+
*/
|
|
182
|
+
timestamps?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Column name for creation timestamp.
|
|
185
|
+
*
|
|
186
|
+
* Set to `false` to disable createdAt entirely.
|
|
187
|
+
*
|
|
188
|
+
* @default "createdAt" (MongoDB), "created_at" (PostgreSQL)
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* createdAtColumn: "creation_date"
|
|
193
|
+
* createdAtColumn: false // Disable
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
createdAtColumn?: string | false;
|
|
197
|
+
/**
|
|
198
|
+
* Column name for update timestamp.
|
|
199
|
+
*
|
|
200
|
+
* Set to `false` to disable updatedAt entirely.
|
|
201
|
+
*
|
|
202
|
+
* @default "updatedAt" (MongoDB), "updated_at" (PostgreSQL)
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* updatedAtColumn: "last_modified"
|
|
207
|
+
* updatedAtColumn: false // Disable
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
updatedAtColumn?: string | false;
|
|
211
|
+
/**
|
|
212
|
+
* Delete strategy for this model.
|
|
213
|
+
*
|
|
214
|
+
* Controls how models are deleted:
|
|
215
|
+
* - `"trash"` - Moves to trash collection, then deletes
|
|
216
|
+
* - `"permanent"` - Direct deletion (hard delete)
|
|
217
|
+
* - `"soft"` - Sets deletedAt timestamp (soft delete)
|
|
218
|
+
*
|
|
219
|
+
* @default "permanent"
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* deleteStrategy: "soft"
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
deleteStrategy?: DeleteStrategy;
|
|
227
|
+
/**
|
|
228
|
+
* Column name for soft delete timestamp.
|
|
229
|
+
*
|
|
230
|
+
* Used when delete strategy is "soft".
|
|
231
|
+
* Set to `false` to use a different mechanism.
|
|
232
|
+
*
|
|
233
|
+
* @default "deletedAt" (MongoDB), "deleted_at" (PostgreSQL)
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```typescript
|
|
237
|
+
* deletedAtColumn: "archived_at"
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
deletedAtColumn?: string | false;
|
|
241
|
+
/**
|
|
242
|
+
* Trash table/collection name override.
|
|
243
|
+
*
|
|
244
|
+
* Can be:
|
|
245
|
+
* - String: Fixed name for all models
|
|
246
|
+
* - Function: Generate trash table name based on model table
|
|
247
|
+
* - `undefined`: Use default pattern `{table}Trash`
|
|
248
|
+
*
|
|
249
|
+
* Used when delete strategy is "trash".
|
|
250
|
+
*
|
|
251
|
+
* @default undefined (uses {table}Trash pattern)
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* trashTable: "RecycleBin" // All models use same trash
|
|
256
|
+
* trashTable: (table) => `archive_${table}` // Dynamic naming
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
trashTable?: string | ((tableName: string) => string);
|
|
260
|
+
/**
|
|
261
|
+
* Strict mode behavior for unknown fields.
|
|
262
|
+
*
|
|
263
|
+
* - `"strip"`: Remove unknown fields silently (default)
|
|
264
|
+
* - `"fail"`: Throw validation error on unknown fields
|
|
265
|
+
* - `"allow"`: Allow unknown fields to pass through
|
|
266
|
+
*
|
|
267
|
+
* @default "strip"
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```typescript
|
|
271
|
+
* strictMode: "fail" // Strict validation
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
strictMode?: StrictMode;
|
|
275
|
+
/**
|
|
276
|
+
* Naming convention for database column names.
|
|
277
|
+
*
|
|
278
|
+
* Affects default names for timestamps and other system columns.
|
|
279
|
+
*
|
|
280
|
+
* @default "camelCase" (MongoDB), "snake_case" (PostgreSQL)
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* namingConvention: "snake_case"
|
|
285
|
+
* // Results in: created_at, updated_at, deleted_at
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
namingConvention?: NamingConvention;
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* UUID generation strategy for primary keys.
|
|
292
|
+
*
|
|
293
|
+
* Each driver maps this to its native expression:
|
|
294
|
+
* - `"v4"`: PG → `gen_random_uuid()` (PG 13+), MySQL → `UUID()`
|
|
295
|
+
* - `"v7"`: PG → `uuid_generate_v7()` (PG 18+)
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* // In database config
|
|
300
|
+
* migrationDefaults: {
|
|
301
|
+
* uuidStrategy: "v7", // Use UUID v7 (PG 18+)
|
|
302
|
+
* }
|
|
303
|
+
* ```
|
|
304
|
+
*/
|
|
305
|
+
type UuidStrategy = "v4" | "v7";
|
|
306
|
+
/**
|
|
307
|
+
* Migration-level defaults configurable per data source.
|
|
308
|
+
*
|
|
309
|
+
* These settings affect DDL operations (schema changes) and are
|
|
310
|
+
* separate from runtime model behavior (`ModelDefaults`).
|
|
311
|
+
*
|
|
312
|
+
* The configuration follows a 3-tier hierarchy (highest to lowest):
|
|
313
|
+
* 1. Inline migration call (explicit `.default("...")`)
|
|
314
|
+
* 2. DataSource `migrationDefaults` (this type)
|
|
315
|
+
* 3. Driver migration defaults (e.g., PG defaults to v4)
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* // Use UUID v7 for all migrations on this data source
|
|
320
|
+
* migrationDefaults: {
|
|
321
|
+
* uuidStrategy: "v7",
|
|
322
|
+
* }
|
|
323
|
+
*
|
|
324
|
+
* // Use a custom UUID extension
|
|
325
|
+
* migrationDefaults: {
|
|
326
|
+
* uuidExpression: "uuid_generate_v1mc()",
|
|
327
|
+
* }
|
|
328
|
+
* ```
|
|
329
|
+
*/
|
|
330
|
+
type MigrationDefaults = {
|
|
331
|
+
/**
|
|
332
|
+
* UUID generation strategy for `primaryUuid()` migration shortcut.
|
|
333
|
+
* Each driver maps this to its native SQL/expression.
|
|
334
|
+
*
|
|
335
|
+
* @default "v4"
|
|
336
|
+
*/
|
|
337
|
+
uuidStrategy?: UuidStrategy;
|
|
338
|
+
/**
|
|
339
|
+
* Raw SQL/expression override for UUID generation.
|
|
340
|
+
* Takes precedence over `uuidStrategy` when set.
|
|
341
|
+
*
|
|
342
|
+
* Use for custom extensions (e.g., `uuid-ossp`, `pgcrypto`)
|
|
343
|
+
* or non-standard UUID generation functions.
|
|
344
|
+
*
|
|
345
|
+
* @example "uuid_generate_v1mc()"
|
|
346
|
+
*/
|
|
347
|
+
uuidExpression?: string;
|
|
348
|
+
/**
|
|
349
|
+
* Default primary key type for `Migration.create()`.
|
|
350
|
+
*
|
|
351
|
+
* Controls which primary key column is automatically added when using
|
|
352
|
+
* the declarative `Migration.create()` factory. Individual migrations
|
|
353
|
+
* can still override this by passing `{ primaryKey: false }` in options.
|
|
354
|
+
*
|
|
355
|
+
* - `"uuid"` — UUID primary key via `primaryUuid()` (default for PostgreSQL)
|
|
356
|
+
* - `"int"` — Auto-increment integer via `id()`
|
|
357
|
+
* - `"bigInt"` — Big auto-increment integer via `bigId()`
|
|
358
|
+
*
|
|
359
|
+
* @default "int"
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```typescript
|
|
363
|
+
* // src/config/database.ts
|
|
364
|
+
* migrationOptions: {
|
|
365
|
+
* uuidStrategy: "v7",
|
|
366
|
+
* primaryKey: "uuid",
|
|
367
|
+
* }
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
primaryKey?: "uuid" | "int" | "bigInt";
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Defaults for relation conventions — controls how `@BelongsTo` /
|
|
374
|
+
* `@HasOne` / `@HasMany` / `@BelongsToMany` infer foreign-key columns
|
|
375
|
+
* and pivot-table names when none are explicitly configured.
|
|
376
|
+
*
|
|
377
|
+
* **Note on column casing.** Foreign-key column casing follows
|
|
378
|
+
* `modelOptions.namingConvention` (snake_case vs camelCase) and is NOT
|
|
379
|
+
* a separate knob — exposing one here would let users desync FK casing
|
|
380
|
+
* from the actual column casing produced by migrations, which always
|
|
381
|
+
* silently breaks queries.
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```typescript
|
|
385
|
+
* // src/config/database.ts
|
|
386
|
+
* relationOptions: {
|
|
387
|
+
* foreignKeySuffix: "_id", // default
|
|
388
|
+
* pivotTableNamingOrder: "alphabetical", // default — `post_tag`
|
|
389
|
+
* }
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
type RelationDefaults = {
|
|
393
|
+
/**
|
|
394
|
+
* Suffix appended to the inferred relation name to form the foreign-key
|
|
395
|
+
* column name.
|
|
396
|
+
*
|
|
397
|
+
* Examples (suffix = `"_id"`):
|
|
398
|
+
* - `@BelongsTo("Organization") organization` → `organization_id`
|
|
399
|
+
* - `@HasMany("Post") posts` on `User` → `user_id` on the `posts` table
|
|
400
|
+
*
|
|
401
|
+
* @default "_id"
|
|
402
|
+
*/
|
|
403
|
+
foreignKeySuffix?: string;
|
|
404
|
+
/**
|
|
405
|
+
* Ordering rule used to derive the default pivot-table name for
|
|
406
|
+
* `@BelongsToMany` relations when no explicit `pivot` is given.
|
|
407
|
+
*
|
|
408
|
+
* - `"alphabetical"` — snake names sorted alphabetically (Laravel/Rails
|
|
409
|
+
* default). `Post` + `Tag` → `post_tag`. Same result regardless of
|
|
410
|
+
* which side declares the relation.
|
|
411
|
+
* - `"owner_first"` — owner's snake name first, related's snake name
|
|
412
|
+
* second. `Post` declares `@BelongsToMany("Tag")` → `post_tag`;
|
|
413
|
+
* `Tag` declares `@BelongsToMany("Post")` → `tag_post`. Less safe
|
|
414
|
+
* when both sides declare the relation (the names disagree); only
|
|
415
|
+
* pick this if you've standardised on one-side-declares.
|
|
416
|
+
*
|
|
417
|
+
* @default "alphabetical"
|
|
418
|
+
*/
|
|
419
|
+
pivotTableNamingOrder?: "alphabetical" | "owner_first";
|
|
420
|
+
};
|
|
421
|
+
//#endregion
|
|
422
|
+
export { DeleteStrategy, MigrationDefaults, ModelDefaults, NamingConvention, RelationDefaults, StrictMode, UuidStrategy };
|
|
423
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../@warlock.js/cascade/src/types.ts"],"mappings":";;AAkBA;;;;AAAsB;AA0BtB;;;;AAA0B;AAsB1B;;;;AAA4B;AAyC5B;;KAzFY,UAAA;;;;;;;;;;;;;;;;;;;;;;;;AA+SyB;KArRzB,cAAA;;;;AA2SY;AA0BxB;;;;;;;;;AA0CY;AAuBZ;;;;AA4BuB;;KA5YX,gBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyCA,aAAA;;;;;;;;;;;EAeV,cAAA;;;;;;;;;;;EAYA,SAAA;;;;;;;;;;;;;;;;;EAkBA,eAAA;;;;;;;;;;;EAYA,aAAA;;;;;;;;;;;;;;;;;EAkBA,eAAA;;;;;;;;;EAcA,UAAA;;;;;;;;;;;;;;EAeA,eAAA;;;;;;;;;;;;;;EAeA,eAAA;;;;;;;;;;;;;;;;EAqBA,cAAA,GAAiB,cAAA;;;;;;;;;;;;;;EAejB,eAAA;;;;;;;;;;;;;;;;;;;EAoBA,UAAA,cAAwB,SAAA;;;;;;;;;;;;;;;EAoBxB,UAAA,GAAa,UAAA;;;;;;;;;;;;;;EAmBb,gBAAA,GAAmB,gBAAA;AAAA;;;;;;;;;;;;;;;;KAsBT,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;KA0BA,iBAAA;;;;;;;EAOV,YAAA,GAAe,YAAY;;;;;;;;;;EAW3B,cAAA;;;;;;;;;;;;;;;;;;;;;;;EAwBA,UAAA;AAAA;;;;;;;;;;;;;;;;;;;;;KAuBU,gBAAA;;;;;;;;;;;EAWV,gBAAA;;;;;;;;;;;;;;;;EAiBA,qBAAqB;AAAA"}
|