@warlock.js/cascade 4.8.1 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/cjs/index.cjs +160 -124
- package/cjs/index.cjs.map +1 -1
- package/esm/context/database-data-source-context.d.mts +1 -1
- package/esm/context/database-data-source-context.d.mts.map +1 -1
- package/esm/context/database-data-source-context.mjs +1 -1
- package/esm/context/database-data-source-context.mjs.map +1 -1
- package/esm/context/database-transaction-context.d.mts +1 -1
- package/esm/context/database-transaction-context.d.mts.map +1 -1
- package/esm/context/database-transaction-context.mjs +1 -1
- package/esm/context/database-transaction-context.mjs.map +1 -1
- package/esm/contracts/database-driver.contract.d.mts +1 -1
- package/esm/contracts/database-driver.contract.d.mts.map +1 -1
- package/esm/contracts/database-id-generator.contract.d.mts +1 -1
- package/esm/contracts/database-id-generator.contract.d.mts.map +1 -1
- package/esm/contracts/database-remover.contract.d.mts +1 -1
- package/esm/contracts/database-remover.contract.d.mts.map +1 -1
- package/esm/contracts/database-restorer.contract.d.mts +1 -1
- package/esm/contracts/database-restorer.contract.d.mts.map +1 -1
- package/esm/contracts/database-writer.contract.d.mts +1 -1
- package/esm/contracts/database-writer.contract.d.mts.map +1 -1
- package/esm/contracts/driver-blueprint.contract.d.mts +1 -1
- package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -1
- package/esm/contracts/migration-driver.contract.d.mts +1 -1
- package/esm/contracts/migration-driver.contract.d.mts.map +1 -1
- package/esm/contracts/query-builder.contract.d.mts +1 -1
- package/esm/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/contracts/sync-adapter.contract.d.mts +1 -1
- package/esm/contracts/sync-adapter.contract.d.mts.map +1 -1
- package/esm/data-source/data-source-registry.d.mts +1 -1
- package/esm/data-source/data-source-registry.d.mts.map +1 -1
- package/esm/data-source/data-source-registry.mjs +1 -1
- package/esm/data-source/data-source-registry.mjs.map +1 -1
- package/esm/data-source/data-source.d.mts +1 -1
- package/esm/data-source/data-source.d.mts.map +1 -1
- package/esm/data-source/data-source.mjs +1 -1
- package/esm/data-source/data-source.mjs.map +1 -1
- package/esm/database-dirty-tracker.d.mts +1 -1
- package/esm/database-dirty-tracker.d.mts.map +1 -1
- package/esm/database-dirty-tracker.mjs +1 -1
- package/esm/database-dirty-tracker.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-blueprint.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-driver.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-driver.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +1 -1
- package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -1
- package/esm/drivers/mongodb/types.d.mts +1 -1
- package/esm/drivers/mongodb/types.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-blueprint.d.mts +1 -1
- package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-blueprint.mjs +1 -1
- package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-dialect.d.mts +1 -1
- package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-dialect.mjs +1 -1
- package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-driver.d.mts +1 -1
- package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-driver.mjs +1 -1
- package/esm/drivers/postgres/postgres-driver.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.d.mts +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.mjs +1 -1
- package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-query-builder.d.mts +1 -1
- package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-query-builder.mjs +1 -1
- package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-query-parser.d.mts +1 -1
- package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-query-parser.mjs +1 -1
- package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-sql-serializer.mjs +1 -1
- package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -1
- package/esm/drivers/postgres/postgres-sync-adapter.d.mts +1 -1
- package/esm/drivers/postgres/postgres-sync-adapter.d.mts.map +1 -1
- package/esm/drivers/postgres/postgres-sync-adapter.mjs +1 -1
- package/esm/drivers/postgres/postgres-sync-adapter.mjs.map +1 -1
- package/esm/drivers/postgres/types.d.mts +1 -1
- package/esm/drivers/postgres/types.d.mts.map +1 -1
- package/esm/drivers/sql/sql-dialect.contract.d.mts +1 -1
- package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -1
- package/esm/drivers/sql/sql-types.d.mts +1 -1
- package/esm/drivers/sql/sql-types.d.mts.map +1 -1
- package/esm/errors/missing-data-source.error.d.mts +1 -1
- package/esm/errors/missing-data-source.error.d.mts.map +1 -1
- package/esm/errors/missing-data-source.error.mjs +1 -1
- package/esm/errors/missing-data-source.error.mjs.map +1 -1
- package/esm/errors/transaction-rollback.error.d.mts +1 -1
- package/esm/errors/transaction-rollback.error.d.mts.map +1 -1
- package/esm/errors/transaction-rollback.error.mjs +1 -1
- package/esm/errors/transaction-rollback.error.mjs.map +1 -1
- package/esm/events/model-events.d.mts +1 -1
- package/esm/events/model-events.d.mts.map +1 -1
- package/esm/events/model-events.mjs +1 -1
- package/esm/events/model-events.mjs.map +1 -1
- package/esm/expressions/aggregate-expressions.d.mts +1 -1
- package/esm/expressions/aggregate-expressions.d.mts.map +1 -1
- package/esm/expressions/aggregate-expressions.mjs +1 -1
- package/esm/expressions/aggregate-expressions.mjs.map +1 -1
- package/esm/expressions/column-expressions.d.mts +1 -1
- package/esm/expressions/column-expressions.d.mts.map +1 -1
- package/esm/expressions/column-expressions.mjs +1 -1
- package/esm/expressions/column-expressions.mjs.map +1 -1
- package/esm/migration/column-builder.d.mts +1 -1
- package/esm/migration/column-builder.d.mts.map +1 -1
- package/esm/migration/column-builder.mjs +1 -1
- package/esm/migration/column-builder.mjs.map +1 -1
- package/esm/migration/column-helpers.d.mts +1 -1
- package/esm/migration/column-helpers.d.mts.map +1 -1
- package/esm/migration/column-helpers.mjs +1 -1
- package/esm/migration/column-helpers.mjs.map +1 -1
- package/esm/migration/foreign-key-builder.d.mts +1 -1
- package/esm/migration/foreign-key-builder.d.mts.map +1 -1
- package/esm/migration/foreign-key-builder.mjs +1 -1
- package/esm/migration/foreign-key-builder.mjs.map +1 -1
- package/esm/migration/migration-runner.d.mts +1 -1
- package/esm/migration/migration-runner.d.mts.map +1 -1
- package/esm/migration/migration-runner.mjs +4 -40
- package/esm/migration/migration-runner.mjs.map +1 -1
- package/esm/migration/migration.d.mts +1 -1
- package/esm/migration/migration.d.mts.map +1 -1
- package/esm/migration/migration.mjs +1 -1
- package/esm/migration/migration.mjs.map +1 -1
- package/esm/migration/parse-created-at.mjs +67 -0
- package/esm/migration/parse-created-at.mjs.map +1 -0
- package/esm/migration/sql-grammar.mjs +16 -6
- package/esm/migration/sql-grammar.mjs.map +1 -1
- package/esm/migration/sql-serializer.d.mts +1 -1
- package/esm/migration/sql-serializer.d.mts.map +1 -1
- package/esm/migration/sql-serializer.mjs +1 -1
- package/esm/migration/sql-serializer.mjs.map +1 -1
- package/esm/migration/types.d.mts +1 -1
- package/esm/migration/types.d.mts.map +1 -1
- package/esm/model/methods/accessor-methods.mjs +1 -1
- package/esm/model/methods/accessor-methods.mjs.map +1 -1
- package/esm/model/methods/delete-methods.mjs +1 -1
- package/esm/model/methods/delete-methods.mjs.map +1 -1
- package/esm/model/methods/dirty-methods.mjs +1 -1
- package/esm/model/methods/dirty-methods.mjs.map +1 -1
- package/esm/model/methods/hydration-methods.mjs +1 -1
- package/esm/model/methods/hydration-methods.mjs.map +1 -1
- package/esm/model/methods/instance-event-methods.mjs +1 -1
- package/esm/model/methods/instance-event-methods.mjs.map +1 -1
- package/esm/model/methods/meta-methods.mjs +1 -1
- package/esm/model/methods/meta-methods.mjs.map +1 -1
- package/esm/model/methods/pivot-methods.mjs +1 -1
- package/esm/model/methods/pivot-methods.mjs.map +1 -1
- package/esm/model/methods/query-methods.mjs +1 -1
- package/esm/model/methods/query-methods.mjs.map +1 -1
- package/esm/model/methods/restore-methods.mjs +1 -1
- package/esm/model/methods/restore-methods.mjs.map +1 -1
- package/esm/model/methods/scope-methods.mjs +1 -1
- package/esm/model/methods/scope-methods.mjs.map +1 -1
- package/esm/model/methods/serialization-methods.mjs +1 -1
- package/esm/model/methods/serialization-methods.mjs.map +1 -1
- package/esm/model/methods/static-event-methods.mjs +1 -1
- package/esm/model/methods/static-event-methods.mjs.map +1 -1
- package/esm/model/methods/write-methods.d.mts +1 -1
- package/esm/model/methods/write-methods.d.mts.map +1 -1
- package/esm/model/methods/write-methods.mjs +1 -1
- package/esm/model/methods/write-methods.mjs.map +1 -1
- package/esm/model/model.d.mts +1 -1
- package/esm/model/model.d.mts.map +1 -1
- package/esm/model/model.mjs +1 -1
- package/esm/model/model.mjs.map +1 -1
- package/esm/model/model.types.d.mts +1 -1
- package/esm/model/model.types.d.mts.map +1 -1
- package/esm/model/register-model.d.mts +1 -1
- package/esm/model/register-model.d.mts.map +1 -1
- package/esm/model/register-model.mjs +1 -1
- package/esm/model/register-model.mjs.map +1 -1
- package/esm/model/relation-decorators.d.mts +1 -1
- package/esm/model/relation-decorators.d.mts.map +1 -1
- package/esm/model/relation-decorators.mjs +1 -1
- package/esm/model/relation-decorators.mjs.map +1 -1
- package/esm/operations/database.d.mts +1 -1
- package/esm/operations/database.d.mts.map +1 -1
- package/esm/operations/database.mjs +1 -1
- package/esm/operations/database.mjs.map +1 -1
- package/esm/operations/migrations.d.mts +1 -1
- package/esm/operations/migrations.d.mts.map +1 -1
- package/esm/operations/migrations.mjs +1 -1
- package/esm/operations/migrations.mjs.map +1 -1
- package/esm/query-builder/query-builder.d.mts +1 -1
- package/esm/query-builder/query-builder.d.mts.map +1 -1
- package/esm/query-builder/query-builder.mjs +1 -1
- package/esm/query-builder/query-builder.mjs.map +1 -1
- package/esm/relations/key-conventions.mjs +1 -1
- package/esm/relations/key-conventions.mjs.map +1 -1
- package/esm/relations/pivot-operations.d.mts +1 -1
- package/esm/relations/pivot-operations.d.mts.map +1 -1
- package/esm/relations/pivot-operations.mjs +1 -1
- package/esm/relations/pivot-operations.mjs.map +1 -1
- package/esm/relations/relation-hydrator.d.mts +1 -1
- package/esm/relations/relation-hydrator.d.mts.map +1 -1
- package/esm/relations/relation-hydrator.mjs +1 -1
- package/esm/relations/relation-hydrator.mjs.map +1 -1
- package/esm/relations/relation-loader.d.mts +1 -1
- package/esm/relations/relation-loader.d.mts.map +1 -1
- package/esm/relations/relation-loader.mjs +1 -1
- package/esm/relations/relation-loader.mjs.map +1 -1
- package/esm/relations/types.d.mts +1 -1
- package/esm/relations/types.d.mts.map +1 -1
- package/esm/remover/database-remover.d.mts +1 -1
- package/esm/remover/database-remover.d.mts.map +1 -1
- package/esm/remover/database-remover.mjs +1 -1
- package/esm/remover/database-remover.mjs.map +1 -1
- package/esm/restorer/database-restorer.d.mts +1 -1
- package/esm/restorer/database-restorer.d.mts.map +1 -1
- package/esm/restorer/database-restorer.mjs +1 -1
- package/esm/restorer/database-restorer.mjs.map +1 -1
- package/esm/sql-database-dirty-tracker.d.mts +1 -1
- package/esm/sql-database-dirty-tracker.d.mts.map +1 -1
- package/esm/sql-database-dirty-tracker.mjs +1 -1
- package/esm/sql-database-dirty-tracker.mjs.map +1 -1
- package/esm/sync/model-events.mjs +1 -1
- package/esm/sync/model-events.mjs.map +1 -1
- package/esm/sync/model-sync-operation.d.mts +1 -1
- package/esm/sync/model-sync-operation.d.mts.map +1 -1
- package/esm/sync/model-sync-operation.mjs +1 -1
- package/esm/sync/model-sync-operation.mjs.map +1 -1
- package/esm/sync/model-sync.d.mts +1 -1
- package/esm/sync/model-sync.d.mts.map +1 -1
- package/esm/sync/model-sync.mjs +1 -1
- package/esm/sync/model-sync.mjs.map +1 -1
- package/esm/sync/sync-context.d.mts +1 -1
- package/esm/sync/sync-context.d.mts.map +1 -1
- package/esm/sync/sync-context.mjs +1 -1
- package/esm/sync/sync-context.mjs.map +1 -1
- package/esm/sync/sync-manager.d.mts +1 -1
- package/esm/sync/sync-manager.d.mts.map +1 -1
- package/esm/sync/sync-manager.mjs +1 -1
- package/esm/sync/sync-manager.mjs.map +1 -1
- package/esm/sync/types.d.mts +1 -1
- package/esm/sync/types.d.mts.map +1 -1
- package/esm/types.d.mts +1 -1
- package/esm/types.d.mts.map +1 -1
- package/esm/utils/connect-to-database.d.mts +1 -1
- package/esm/utils/connect-to-database.d.mts.map +1 -1
- package/esm/utils/connect-to-database.mjs +1 -1
- package/esm/utils/connect-to-database.mjs.map +1 -1
- package/esm/utils/database-writer.utils.d.mts +1 -1
- package/esm/utils/database-writer.utils.d.mts.map +1 -1
- package/esm/utils/database-writer.utils.mjs +1 -1
- package/esm/utils/database-writer.utils.mjs.map +1 -1
- package/esm/utils/define-model.d.mts +1 -1
- package/esm/utils/define-model.d.mts.map +1 -1
- package/esm/utils/define-model.mjs +1 -1
- package/esm/utils/define-model.mjs.map +1 -1
- package/esm/utils/is-valid-date-value.mjs +1 -1
- package/esm/utils/is-valid-date-value.mjs.map +1 -1
- package/esm/utils/once-connected.d.mts +1 -1
- package/esm/utils/once-connected.d.mts.map +1 -1
- package/esm/utils/once-connected.mjs +1 -1
- package/esm/utils/once-connected.mjs.map +1 -1
- package/esm/validation/database-seal-plugins.mjs +1 -1
- package/esm/validation/database-seal-plugins.mjs.map +1 -1
- package/esm/validation/database-writer-validation-error.d.mts +1 -1
- package/esm/validation/database-writer-validation-error.d.mts.map +1 -1
- package/esm/validation/database-writer-validation-error.mjs +1 -1
- package/esm/validation/database-writer-validation-error.mjs.map +1 -1
- package/esm/validation/mutators/embed-mutator.mjs +1 -1
- package/esm/validation/mutators/embed-mutator.mjs.map +1 -1
- package/esm/validation/plugins/database-rules-plugin.d.mts +1 -1
- package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -1
- package/esm/validation/plugins/database-rules-plugin.mjs +1 -1
- package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -1
- package/esm/validation/plugins/embed-validator-plugin.d.mts +1 -1
- package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -1
- package/esm/validation/plugins/embed-validator-plugin.mjs +1 -1
- package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -1
- package/esm/validation/rules/database-model-rule.mjs +1 -1
- package/esm/validation/rules/database-model-rule.mjs.map +1 -1
- package/esm/validation/rules/exists-rule.mjs +1 -1
- package/esm/validation/rules/exists-rule.mjs.map +1 -1
- package/esm/validation/rules/unique-rule.mjs +1 -1
- package/esm/validation/rules/unique-rule.mjs.map +1 -1
- package/esm/validation/transformers/embed-model-transformer.mjs +1 -1
- package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -1
- package/esm/validation/types.d.mts +1 -1
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validators/embed-validator.d.mts +1 -1
- package/esm/validation/validators/embed-validator.d.mts.map +1 -1
- package/esm/validation/validators/embed-validator.mjs +1 -1
- package/esm/validation/validators/embed-validator.mjs.map +1 -1
- package/esm/writer/database-writer.d.mts +1 -1
- package/esm/writer/database-writer.d.mts.map +1 -1
- package/esm/writer/database-writer.mjs +1 -1
- package/esm/writer/database-writer.mjs.map +1 -1
- package/llms-full.txt +14 -0
- package/package.json +4 -4
- package/skills/write-migration/SKILL.md +14 -0
package/cjs/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@ fs = __toESM(fs, 1);
|
|
|
40
40
|
let path = require("path");
|
|
41
41
|
path = __toESM(path, 1);
|
|
42
42
|
|
|
43
|
-
//#region
|
|
43
|
+
//#region ../cascade/src/context/database-data-source-context.ts
|
|
44
44
|
/**
|
|
45
45
|
* Database DataSource Context
|
|
46
46
|
*
|
|
@@ -71,7 +71,7 @@ const databaseDataSourceContext = new DatabaseDataSourceContext();
|
|
|
71
71
|
_warlock_js_context.contextManager.register("db.datasource", databaseDataSourceContext);
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
|
-
//#region
|
|
74
|
+
//#region ../cascade/src/context/database-transaction-context.ts
|
|
75
75
|
/**
|
|
76
76
|
* Database Transaction Context
|
|
77
77
|
*
|
|
@@ -114,7 +114,7 @@ const databaseTransactionContext = new DatabaseTransactionContext();
|
|
|
114
114
|
_warlock_js_context.contextManager.register("db.transaction", databaseTransactionContext);
|
|
115
115
|
|
|
116
116
|
//#endregion
|
|
117
|
-
//#region
|
|
117
|
+
//#region ../cascade/src/data-source/data-source.ts
|
|
118
118
|
/**
|
|
119
119
|
* Wrapper that couples a driver with its metadata.
|
|
120
120
|
*
|
|
@@ -221,7 +221,7 @@ var DataSource = class {
|
|
|
221
221
|
};
|
|
222
222
|
|
|
223
223
|
//#endregion
|
|
224
|
-
//#region
|
|
224
|
+
//#region ../cascade/src/errors/missing-data-source.error.ts
|
|
225
225
|
/**
|
|
226
226
|
* Error thrown when a requested data source is not found in the registry.
|
|
227
227
|
*
|
|
@@ -250,7 +250,7 @@ var MissingDataSourceError = class MissingDataSourceError extends Error {
|
|
|
250
250
|
};
|
|
251
251
|
|
|
252
252
|
//#endregion
|
|
253
|
-
//#region
|
|
253
|
+
//#region ../cascade/src/data-source/data-source-registry.ts
|
|
254
254
|
/** Maintains registry of named data sources. */
|
|
255
255
|
var DataSourceRegistry = class {
|
|
256
256
|
sources = /* @__PURE__ */ new Map();
|
|
@@ -385,7 +385,7 @@ var DataSourceRegistry = class {
|
|
|
385
385
|
const dataSourceRegistry = new DataSourceRegistry();
|
|
386
386
|
|
|
387
387
|
//#endregion
|
|
388
|
-
//#region
|
|
388
|
+
//#region ../cascade/src/errors/transaction-rollback.error.ts
|
|
389
389
|
/**
|
|
390
390
|
* Error thrown when a transaction is explicitly rolled back via ctx.rollback().
|
|
391
391
|
*
|
|
@@ -412,7 +412,7 @@ var TransactionRollbackError = class TransactionRollbackError extends Error {
|
|
|
412
412
|
};
|
|
413
413
|
|
|
414
414
|
//#endregion
|
|
415
|
-
//#region
|
|
415
|
+
//#region ../cascade/src/database-dirty-tracker.ts
|
|
416
416
|
function canBeFlatten(object) {
|
|
417
417
|
return (0, _mongez_supportive_is.isPlainObject)(object);
|
|
418
418
|
}
|
|
@@ -763,7 +763,7 @@ var DatabaseDirtyTracker = class {
|
|
|
763
763
|
};
|
|
764
764
|
|
|
765
765
|
//#endregion
|
|
766
|
-
//#region
|
|
766
|
+
//#region ../cascade/src/events/model-events.ts
|
|
767
767
|
/**
|
|
768
768
|
* Light-weight async event emitter used to power model lifecycle hooks.
|
|
769
769
|
*
|
|
@@ -1015,7 +1015,7 @@ var ModelEvents = class {
|
|
|
1015
1015
|
const globalModelEvents = new ModelEvents();
|
|
1016
1016
|
|
|
1017
1017
|
//#endregion
|
|
1018
|
-
//#region
|
|
1018
|
+
//#region ../cascade/src/model/relation-decorators.ts
|
|
1019
1019
|
/**
|
|
1020
1020
|
* @fileoverview TC39 Stage 3 class field decorators for declaring model
|
|
1021
1021
|
* relations directly on the field.
|
|
@@ -1202,7 +1202,7 @@ const HasMany = makeRelationDecorator("hasMany");
|
|
|
1202
1202
|
const BelongsToMany = makeRelationDecorator("belongsToMany");
|
|
1203
1203
|
|
|
1204
1204
|
//#endregion
|
|
1205
|
-
//#region
|
|
1205
|
+
//#region ../cascade/src/model/register-model.ts
|
|
1206
1206
|
/**
|
|
1207
1207
|
* Global model registry that maps model class names to their constructors.
|
|
1208
1208
|
* This allows for string-based model references to avoid circular dependencies.
|
|
@@ -1372,7 +1372,7 @@ function verifyRegisteredRelations() {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
|
|
1374
1374
|
//#endregion
|
|
1375
|
-
//#region
|
|
1375
|
+
//#region ../cascade/src/relations/key-conventions.ts
|
|
1376
1376
|
/**
|
|
1377
1377
|
* @fileoverview Foreign-key naming conventions for relation defaults.
|
|
1378
1378
|
*
|
|
@@ -1487,7 +1487,7 @@ function inferPivotTable(selfModelName, relatedModelName, options) {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
|
|
1489
1489
|
//#endregion
|
|
1490
|
-
//#region
|
|
1490
|
+
//#region ../cascade/src/relations/relation-loader.ts
|
|
1491
1491
|
/**
|
|
1492
1492
|
* @fileoverview Core relation loading logic for the Cascade ORM.
|
|
1493
1493
|
*
|
|
@@ -1897,7 +1897,7 @@ var RelationLoader = class RelationLoader {
|
|
|
1897
1897
|
};
|
|
1898
1898
|
|
|
1899
1899
|
//#endregion
|
|
1900
|
-
//#region
|
|
1900
|
+
//#region ../cascade/src/sync/model-events.ts
|
|
1901
1901
|
/**
|
|
1902
1902
|
* Event name prefix for all model sync events.
|
|
1903
1903
|
*/
|
|
@@ -1941,7 +1941,7 @@ function getModelDeletedEvent(modelClass) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
|
|
1943
1943
|
//#endregion
|
|
1944
|
-
//#region
|
|
1944
|
+
//#region ../cascade/src/sync/sync-context.ts
|
|
1945
1945
|
/**
|
|
1946
1946
|
* Default maximum sync depth.
|
|
1947
1947
|
* Prevents infinite sync chains.
|
|
@@ -2034,7 +2034,7 @@ var SyncContextManager = class {
|
|
|
2034
2034
|
};
|
|
2035
2035
|
|
|
2036
2036
|
//#endregion
|
|
2037
|
-
//#region
|
|
2037
|
+
//#region ../cascade/src/sync/sync-manager.ts
|
|
2038
2038
|
/**
|
|
2039
2039
|
* Manages sync operations across models with multi-level support.
|
|
2040
2040
|
*/
|
|
@@ -2626,7 +2626,7 @@ var SyncManager = class {
|
|
|
2626
2626
|
};
|
|
2627
2627
|
|
|
2628
2628
|
//#endregion
|
|
2629
|
-
//#region
|
|
2629
|
+
//#region ../cascade/src/sync/model-sync-operation.ts
|
|
2630
2630
|
/**
|
|
2631
2631
|
* Model sync operation class.
|
|
2632
2632
|
*
|
|
@@ -2876,7 +2876,7 @@ var ModelSyncOperation = class {
|
|
|
2876
2876
|
};
|
|
2877
2877
|
|
|
2878
2878
|
//#endregion
|
|
2879
|
-
//#region
|
|
2879
|
+
//#region ../cascade/src/sync/model-sync.ts
|
|
2880
2880
|
/**
|
|
2881
2881
|
* ModelSync facade implementation.
|
|
2882
2882
|
*
|
|
@@ -3029,7 +3029,7 @@ var ModelSyncFacade = class {
|
|
|
3029
3029
|
const modelSync = new ModelSyncFacade();
|
|
3030
3030
|
|
|
3031
3031
|
//#endregion
|
|
3032
|
-
//#region
|
|
3032
|
+
//#region ../cascade/src/model/methods/accessor-methods.ts
|
|
3033
3033
|
/**
|
|
3034
3034
|
* Sentinel symbol to distinguish a genuinely missing field from a field
|
|
3035
3035
|
* whose value is `undefined`. Encapsulated here — callers use `hasField()`.
|
|
@@ -3079,7 +3079,7 @@ function getBooleanField(model, key, defaultValue) {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
|
|
3081
3081
|
//#endregion
|
|
3082
|
-
//#region
|
|
3082
|
+
//#region ../cascade/src/remover/database-remover.ts
|
|
3083
3083
|
/**
|
|
3084
3084
|
* Database remover service that orchestrates model deletion.
|
|
3085
3085
|
*
|
|
@@ -3250,7 +3250,7 @@ var DatabaseRemover = class {
|
|
|
3250
3250
|
};
|
|
3251
3251
|
|
|
3252
3252
|
//#endregion
|
|
3253
|
-
//#region
|
|
3253
|
+
//#region ../cascade/src/model/methods/delete-methods.ts
|
|
3254
3254
|
async function destroyModel(model, options) {
|
|
3255
3255
|
return new DatabaseRemover(model).destroy(options);
|
|
3256
3256
|
}
|
|
@@ -3262,7 +3262,7 @@ async function deleteOneRecord(ModelClass, filter) {
|
|
|
3262
3262
|
}
|
|
3263
3263
|
|
|
3264
3264
|
//#endregion
|
|
3265
|
-
//#region
|
|
3265
|
+
//#region ../cascade/src/model/methods/dirty-methods.ts
|
|
3266
3266
|
function checkHasChanges(model) {
|
|
3267
3267
|
return model.dirtyTracker.hasChanges();
|
|
3268
3268
|
}
|
|
@@ -3280,7 +3280,7 @@ function getDirtyColumns(model) {
|
|
|
3280
3280
|
}
|
|
3281
3281
|
|
|
3282
3282
|
//#endregion
|
|
3283
|
-
//#region
|
|
3283
|
+
//#region ../cascade/src/relations/relation-hydrator.ts
|
|
3284
3284
|
/**
|
|
3285
3285
|
* Restores eager-loaded relations from a plain snapshot onto a model instance.
|
|
3286
3286
|
*
|
|
@@ -3328,7 +3328,7 @@ var RelationHydrator = class {
|
|
|
3328
3328
|
};
|
|
3329
3329
|
|
|
3330
3330
|
//#endregion
|
|
3331
|
-
//#region
|
|
3331
|
+
//#region ../cascade/src/model/methods/hydration-methods.ts
|
|
3332
3332
|
function hydrateModel(ModelClass, data) {
|
|
3333
3333
|
const model = new ModelClass(ModelClass.getDriver().deserialize(data));
|
|
3334
3334
|
model.isNew = false;
|
|
@@ -3375,7 +3375,7 @@ function replaceModelData(model, data) {
|
|
|
3375
3375
|
}
|
|
3376
3376
|
|
|
3377
3377
|
//#endregion
|
|
3378
|
-
//#region
|
|
3378
|
+
//#region ../cascade/src/model/methods/instance-event-methods.ts
|
|
3379
3379
|
async function emitModelEvent(model, event, context) {
|
|
3380
3380
|
const ctor = model.constructor;
|
|
3381
3381
|
await model.events.emit(event, model, context);
|
|
@@ -3393,7 +3393,7 @@ function offModelEvent(model, event, listener) {
|
|
|
3393
3393
|
}
|
|
3394
3394
|
|
|
3395
3395
|
//#endregion
|
|
3396
|
-
//#region
|
|
3396
|
+
//#region ../cascade/src/validation/database-writer-validation-error.ts
|
|
3397
3397
|
/**
|
|
3398
3398
|
* Error thrown when model validation fails during database write operations.
|
|
3399
3399
|
*
|
|
@@ -3542,7 +3542,7 @@ var DatabaseWriterValidationError = class DatabaseWriterValidationError extends
|
|
|
3542
3542
|
};
|
|
3543
3543
|
|
|
3544
3544
|
//#endregion
|
|
3545
|
-
//#region
|
|
3545
|
+
//#region ../cascade/src/validation/rules/exists-rule.ts
|
|
3546
3546
|
/**
|
|
3547
3547
|
* Validates that a record exists in the database for the given column/value.
|
|
3548
3548
|
*
|
|
@@ -3566,7 +3566,7 @@ const existsRule = {
|
|
|
3566
3566
|
};
|
|
3567
3567
|
|
|
3568
3568
|
//#endregion
|
|
3569
|
-
//#region
|
|
3569
|
+
//#region ../cascade/src/validation/rules/unique-rule.ts
|
|
3570
3570
|
/**
|
|
3571
3571
|
* Validates that a value is unique against a database column.
|
|
3572
3572
|
*
|
|
@@ -3603,7 +3603,7 @@ const uniqueRule = {
|
|
|
3603
3603
|
};
|
|
3604
3604
|
|
|
3605
3605
|
//#endregion
|
|
3606
|
-
//#region
|
|
3606
|
+
//#region ../cascade/src/validation/plugins/database-rules-plugin.ts
|
|
3607
3607
|
/**
|
|
3608
3608
|
* Cascade's database-rules plugin for Seal.
|
|
3609
3609
|
*/
|
|
@@ -3640,7 +3640,7 @@ const databaseRulesPlugin = {
|
|
|
3640
3640
|
};
|
|
3641
3641
|
|
|
3642
3642
|
//#endregion
|
|
3643
|
-
//#region
|
|
3643
|
+
//#region ../cascade/src/validation/mutators/embed-mutator.ts
|
|
3644
3644
|
const databaseModelMutator = async (value, context) => {
|
|
3645
3645
|
let { model: ModelClass } = context?.options || {};
|
|
3646
3646
|
if (typeof ModelClass === "string") ModelClass = getModelFromRegistry(ModelClass);
|
|
@@ -3661,7 +3661,7 @@ const databaseModelsMutator = async (value, context) => {
|
|
|
3661
3661
|
};
|
|
3662
3662
|
|
|
3663
3663
|
//#endregion
|
|
3664
|
-
//#region
|
|
3664
|
+
//#region ../cascade/src/validation/rules/database-model-rule.ts
|
|
3665
3665
|
const databaseModelRule = {
|
|
3666
3666
|
name: "databaseModel",
|
|
3667
3667
|
defaultErrorMessage: "The :input must be a valid :model model",
|
|
@@ -3687,7 +3687,7 @@ const databaseModelsRule = {
|
|
|
3687
3687
|
};
|
|
3688
3688
|
|
|
3689
3689
|
//#endregion
|
|
3690
|
-
//#region
|
|
3690
|
+
//#region ../cascade/src/validation/transformers/embed-model-transformer.ts
|
|
3691
3691
|
const databaseModelTransformer = (value, context) => {
|
|
3692
3692
|
const embed = context.options.embed ?? "embedData";
|
|
3693
3693
|
if (value instanceof Model === false && !Array.isArray(value)) return value;
|
|
@@ -3700,7 +3700,7 @@ const databaseModelTransformer = (value, context) => {
|
|
|
3700
3700
|
};
|
|
3701
3701
|
|
|
3702
3702
|
//#endregion
|
|
3703
|
-
//#region
|
|
3703
|
+
//#region ../cascade/src/validation/validators/embed-validator.ts
|
|
3704
3704
|
var EmbedModelValidator = class extends _warlock_js_seal.BaseValidator {
|
|
3705
3705
|
/**
|
|
3706
3706
|
* Check if value is a string type
|
|
@@ -3734,7 +3734,7 @@ var EmbedModelValidator = class extends _warlock_js_seal.BaseValidator {
|
|
|
3734
3734
|
};
|
|
3735
3735
|
|
|
3736
3736
|
//#endregion
|
|
3737
|
-
//#region
|
|
3737
|
+
//#region ../cascade/src/validation/plugins/embed-validator-plugin.ts
|
|
3738
3738
|
/**
|
|
3739
3739
|
* File validation plugin for Seal
|
|
3740
3740
|
*/
|
|
@@ -3749,12 +3749,12 @@ const embedValidator = {
|
|
|
3749
3749
|
};
|
|
3750
3750
|
|
|
3751
3751
|
//#endregion
|
|
3752
|
-
//#region
|
|
3752
|
+
//#region ../cascade/src/validation/database-seal-plugins.ts
|
|
3753
3753
|
(0, _warlock_js_seal.registerPlugin)(embedValidator);
|
|
3754
3754
|
(0, _warlock_js_seal.registerPlugin)(databaseRulesPlugin);
|
|
3755
3755
|
|
|
3756
3756
|
//#endregion
|
|
3757
|
-
//#region
|
|
3757
|
+
//#region ../cascade/src/writer/database-writer.ts
|
|
3758
3758
|
/**
|
|
3759
3759
|
* Database writer service that orchestrates model persistence.
|
|
3760
3760
|
*
|
|
@@ -4065,7 +4065,7 @@ var DatabaseWriter = class {
|
|
|
4065
4065
|
};
|
|
4066
4066
|
|
|
4067
4067
|
//#endregion
|
|
4068
|
-
//#region
|
|
4068
|
+
//#region ../cascade/src/model/methods/meta-methods.ts
|
|
4069
4069
|
function applyDefaultsToModel(ModelClass, defaults) {
|
|
4070
4070
|
if (defaults.autoGenerateId !== void 0 && ModelClass.autoGenerateId === void 0) ModelClass.autoGenerateId = defaults.autoGenerateId;
|
|
4071
4071
|
if (defaults.initialId !== void 0 && ModelClass.initialId === void 0) ModelClass.initialId = defaults.initialId;
|
|
@@ -4097,7 +4097,7 @@ async function performAtomicDecrement(model, field, amount = 1) {
|
|
|
4097
4097
|
}
|
|
4098
4098
|
|
|
4099
4099
|
//#endregion
|
|
4100
|
-
//#region
|
|
4100
|
+
//#region ../cascade/src/relations/pivot-operations.ts
|
|
4101
4101
|
/**
|
|
4102
4102
|
* Manages pivot table operations for many-to-many relationships.
|
|
4103
4103
|
*
|
|
@@ -4324,7 +4324,7 @@ function createPivotOperations(model, relationName) {
|
|
|
4324
4324
|
}
|
|
4325
4325
|
|
|
4326
4326
|
//#endregion
|
|
4327
|
-
//#region
|
|
4327
|
+
//#region ../cascade/src/model/methods/pivot-methods.ts
|
|
4328
4328
|
/**
|
|
4329
4329
|
* Get the pivot-operations handle for a `belongsToMany` relation.
|
|
4330
4330
|
*
|
|
@@ -4368,7 +4368,7 @@ async function detachPivotRelation(model, relation, ids) {
|
|
|
4368
4368
|
}
|
|
4369
4369
|
|
|
4370
4370
|
//#endregion
|
|
4371
|
-
//#region
|
|
4371
|
+
//#region ../cascade/src/model/methods/query-methods.ts
|
|
4372
4372
|
function buildQuery(ModelClass, BaseModel) {
|
|
4373
4373
|
const queryBuilder = ModelClass.newQueryBuilder();
|
|
4374
4374
|
queryBuilder.pendingGlobalScopes = new Map([...BaseModel.globalScopes, ...ModelClass.globalScopes]);
|
|
@@ -4485,7 +4485,7 @@ function resolveDataSource(ModelClass) {
|
|
|
4485
4485
|
}
|
|
4486
4486
|
|
|
4487
4487
|
//#endregion
|
|
4488
|
-
//#region
|
|
4488
|
+
//#region ../cascade/src/restorer/database-restorer.ts
|
|
4489
4489
|
/**
|
|
4490
4490
|
* Database restorer service that orchestrates model restoration.
|
|
4491
4491
|
*
|
|
@@ -4799,7 +4799,7 @@ var DatabaseRestorer = class {
|
|
|
4799
4799
|
};
|
|
4800
4800
|
|
|
4801
4801
|
//#endregion
|
|
4802
|
-
//#region
|
|
4802
|
+
//#region ../cascade/src/model/methods/restore-methods.ts
|
|
4803
4803
|
async function restoreRecord(ModelClass, id, options) {
|
|
4804
4804
|
const result = await new DatabaseRestorer(ModelClass).restore(id, options);
|
|
4805
4805
|
if (!result.restoredRecord) throw new Error(`Failed to restore ${ModelClass.name} with ${ModelClass.primaryKey} ${id}: no record returned.`);
|
|
@@ -4811,7 +4811,7 @@ async function restoreAllRecords(ModelClass, options) {
|
|
|
4811
4811
|
}
|
|
4812
4812
|
|
|
4813
4813
|
//#endregion
|
|
4814
|
-
//#region
|
|
4814
|
+
//#region ../cascade/src/model/methods/scope-methods.ts
|
|
4815
4815
|
/**
|
|
4816
4816
|
* Give the model class its OWN scope map before mutating.
|
|
4817
4817
|
*
|
|
@@ -4843,7 +4843,7 @@ function removeLocalModelScope(ModelClass, name) {
|
|
|
4843
4843
|
}
|
|
4844
4844
|
|
|
4845
4845
|
//#endregion
|
|
4846
|
-
//#region
|
|
4846
|
+
//#region ../cascade/src/model/methods/serialization-methods.ts
|
|
4847
4847
|
function modelToJSON(model) {
|
|
4848
4848
|
const ModelClass = model.self();
|
|
4849
4849
|
const resource = ModelClass.resource;
|
|
@@ -4861,7 +4861,7 @@ function modelToJSON(model) {
|
|
|
4861
4861
|
}
|
|
4862
4862
|
|
|
4863
4863
|
//#endregion
|
|
4864
|
-
//#region
|
|
4864
|
+
//#region ../cascade/src/model/methods/static-event-methods.ts
|
|
4865
4865
|
/**
|
|
4866
4866
|
* Isolated event emitter registry — one ModelEvents instance per model constructor.
|
|
4867
4867
|
* Encapsulated here so no other module needs to know it exists.
|
|
@@ -4893,7 +4893,7 @@ function getGlobalEvents() {
|
|
|
4893
4893
|
}
|
|
4894
4894
|
|
|
4895
4895
|
//#endregion
|
|
4896
|
-
//#region
|
|
4896
|
+
//#region ../cascade/src/model/methods/write-methods.ts
|
|
4897
4897
|
/**
|
|
4898
4898
|
* Default number of rows processed per chunk by {@link createManyRecords}.
|
|
4899
4899
|
*
|
|
@@ -5119,7 +5119,7 @@ async function upsertRecord(ModelClass, filter, data, options) {
|
|
|
5119
5119
|
}
|
|
5120
5120
|
|
|
5121
5121
|
//#endregion
|
|
5122
|
-
//#region
|
|
5122
|
+
//#region ../cascade/src/model/model.ts
|
|
5123
5123
|
/**
|
|
5124
5124
|
* Base class that powers all Cascade models.
|
|
5125
5125
|
*
|
|
@@ -6929,7 +6929,7 @@ var Model = class Model {
|
|
|
6929
6929
|
};
|
|
6930
6930
|
|
|
6931
6931
|
//#endregion
|
|
6932
|
-
//#region
|
|
6932
|
+
//#region ../cascade/src/expressions/aggregate-expressions.ts
|
|
6933
6933
|
/**
|
|
6934
6934
|
* Checks if a value is an abstract aggregate expression.
|
|
6935
6935
|
*/
|
|
@@ -7232,7 +7232,7 @@ const $agg = {
|
|
|
7232
7232
|
};
|
|
7233
7233
|
|
|
7234
7234
|
//#endregion
|
|
7235
|
-
//#region
|
|
7235
|
+
//#region ../cascade/src/expressions/column-expressions.ts
|
|
7236
7236
|
/**
|
|
7237
7237
|
* Type guard: is `value` one of the typed column-expression nodes?
|
|
7238
7238
|
*
|
|
@@ -7382,7 +7382,7 @@ const $expr = {
|
|
|
7382
7382
|
};
|
|
7383
7383
|
|
|
7384
7384
|
//#endregion
|
|
7385
|
-
//#region
|
|
7385
|
+
//#region ../cascade/src/utils/is-valid-date-value.ts
|
|
7386
7386
|
const isoRegex = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/;
|
|
7387
7387
|
/**
|
|
7388
7388
|
* Check if the given value is a valid date value
|
|
@@ -7402,7 +7402,7 @@ function isValidDateValue(value) {
|
|
|
7402
7402
|
}
|
|
7403
7403
|
|
|
7404
7404
|
//#endregion
|
|
7405
|
-
//#region
|
|
7405
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-blueprint.ts
|
|
7406
7406
|
var MongoDBBlueprint = class {
|
|
7407
7407
|
database;
|
|
7408
7408
|
/**
|
|
@@ -7452,7 +7452,7 @@ var MongoDBBlueprint = class {
|
|
|
7452
7452
|
};
|
|
7453
7453
|
|
|
7454
7454
|
//#endregion
|
|
7455
|
-
//#region
|
|
7455
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-id-generator.ts
|
|
7456
7456
|
/** Number of times a reservation retries after a duplicate-key (E11000) error. */
|
|
7457
7457
|
const MAX_RESERVE_ATTEMPTS = 3;
|
|
7458
7458
|
/** MongoDB duplicate-key error code. */
|
|
@@ -7685,7 +7685,7 @@ var MongoIdGenerator = class {
|
|
|
7685
7685
|
};
|
|
7686
7686
|
|
|
7687
7687
|
//#endregion
|
|
7688
|
-
//#region
|
|
7688
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-migration-driver.ts
|
|
7689
7689
|
/**
|
|
7690
7690
|
* MongoDB-specific migration driver implementation.
|
|
7691
7691
|
*
|
|
@@ -8215,7 +8215,7 @@ var MongoMigrationDriver = class {
|
|
|
8215
8215
|
};
|
|
8216
8216
|
|
|
8217
8217
|
//#endregion
|
|
8218
|
-
//#region
|
|
8218
|
+
//#region ../cascade/src/query-builder/query-builder.ts
|
|
8219
8219
|
/**
|
|
8220
8220
|
* Pure, driver-agnostic query builder.
|
|
8221
8221
|
*
|
|
@@ -9329,7 +9329,7 @@ var QueryBuilder = class QueryBuilder {
|
|
|
9329
9329
|
};
|
|
9330
9330
|
|
|
9331
9331
|
//#endregion
|
|
9332
|
-
//#region
|
|
9332
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-query-operations.ts
|
|
9333
9333
|
/**
|
|
9334
9334
|
* Helper class for constructing MongoDB aggregation pipeline operations.
|
|
9335
9335
|
*
|
|
@@ -9602,7 +9602,7 @@ var MongoQueryOperations = class {
|
|
|
9602
9602
|
};
|
|
9603
9603
|
|
|
9604
9604
|
//#endregion
|
|
9605
|
-
//#region
|
|
9605
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-query-parser.ts
|
|
9606
9606
|
/**
|
|
9607
9607
|
* Parses query builder operations into MongoDB aggregation pipeline.
|
|
9608
9608
|
*
|
|
@@ -10673,7 +10673,7 @@ var MongoQueryParser = class {
|
|
|
10673
10673
|
};
|
|
10674
10674
|
|
|
10675
10675
|
//#endregion
|
|
10676
|
-
//#region
|
|
10676
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-query-builder.ts
|
|
10677
10677
|
/**
|
|
10678
10678
|
* MongoDB-specific query builder implementation using aggregation pipeline.
|
|
10679
10679
|
*/
|
|
@@ -12547,7 +12547,7 @@ var MongoQueryBuilder = class MongoQueryBuilder extends QueryBuilder {
|
|
|
12547
12547
|
};
|
|
12548
12548
|
|
|
12549
12549
|
//#endregion
|
|
12550
|
-
//#region
|
|
12550
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-sync-adapter.ts
|
|
12551
12551
|
/**
|
|
12552
12552
|
* MongoDB implementation of the sync adapter.
|
|
12553
12553
|
* Handles array updates using positional operators and arrayFilters.
|
|
@@ -12663,7 +12663,7 @@ var MongoSyncAdapter = class {
|
|
|
12663
12663
|
};
|
|
12664
12664
|
|
|
12665
12665
|
//#endregion
|
|
12666
|
-
//#region
|
|
12666
|
+
//#region ../cascade/src/drivers/mongodb/mongodb-driver.ts
|
|
12667
12667
|
const DEFAULT_TRANSACTION_OPTIONS = {
|
|
12668
12668
|
readPreference: "primary",
|
|
12669
12669
|
readConcern: { level: "local" },
|
|
@@ -13369,7 +13369,7 @@ var MongoDbDriver = class {
|
|
|
13369
13369
|
};
|
|
13370
13370
|
|
|
13371
13371
|
//#endregion
|
|
13372
|
-
//#region
|
|
13372
|
+
//#region ../cascade/src/drivers/postgres/postgres-blueprint.ts
|
|
13373
13373
|
/**
|
|
13374
13374
|
* PostgreSQL Blueprint.
|
|
13375
13375
|
*
|
|
@@ -13472,7 +13472,7 @@ var PostgresBlueprint = class {
|
|
|
13472
13472
|
};
|
|
13473
13473
|
|
|
13474
13474
|
//#endregion
|
|
13475
|
-
//#region
|
|
13475
|
+
//#region ../cascade/src/drivers/postgres/postgres-dialect.ts
|
|
13476
13476
|
/**
|
|
13477
13477
|
* PostgreSQL-specific SQL dialect implementation.
|
|
13478
13478
|
*
|
|
@@ -13750,7 +13750,7 @@ var PostgresDialect = class {
|
|
|
13750
13750
|
};
|
|
13751
13751
|
|
|
13752
13752
|
//#endregion
|
|
13753
|
-
//#region
|
|
13753
|
+
//#region ../cascade/src/sql-database-dirty-tracker.ts
|
|
13754
13754
|
/**
|
|
13755
13755
|
* A dirty tracker designed for SQL databases where nested objects shouldn't be flattened.
|
|
13756
13756
|
* Since SQL drivers (like Postgres) replace the entire JSON column when updated,
|
|
@@ -13766,7 +13766,7 @@ var SqlDatabaseDirtyTracker = class extends DatabaseDirtyTracker {
|
|
|
13766
13766
|
};
|
|
13767
13767
|
|
|
13768
13768
|
//#endregion
|
|
13769
|
-
//#region
|
|
13769
|
+
//#region ../cascade/src/drivers/postgres/postgres-migration-driver.ts
|
|
13770
13770
|
/**
|
|
13771
13771
|
* PostgreSQL Migration Driver
|
|
13772
13772
|
*
|
|
@@ -14522,7 +14522,7 @@ var PostgresMigrationDriver = class {
|
|
|
14522
14522
|
};
|
|
14523
14523
|
|
|
14524
14524
|
//#endregion
|
|
14525
|
-
//#region
|
|
14525
|
+
//#region ../cascade/src/drivers/postgres/postgres-query-parser.ts
|
|
14526
14526
|
/**
|
|
14527
14527
|
* PostgreSQL Query Parser.
|
|
14528
14528
|
*
|
|
@@ -15344,7 +15344,7 @@ var PostgresQueryParser = class PostgresQueryParser {
|
|
|
15344
15344
|
};
|
|
15345
15345
|
|
|
15346
15346
|
//#endregion
|
|
15347
|
-
//#region
|
|
15347
|
+
//#region ../cascade/src/drivers/postgres/postgres-query-builder.ts
|
|
15348
15348
|
/**
|
|
15349
15349
|
* Cast an Op[] to PostgresParserOperation[] — the shapes are compatible since
|
|
15350
15350
|
* both have `type: string` and `data: Record<string, unknown>`.
|
|
@@ -16523,7 +16523,7 @@ var PostgresQueryBuilder = class PostgresQueryBuilder extends QueryBuilder {
|
|
|
16523
16523
|
};
|
|
16524
16524
|
|
|
16525
16525
|
//#endregion
|
|
16526
|
-
//#region
|
|
16526
|
+
//#region ../cascade/src/migration/sql-serializer.ts
|
|
16527
16527
|
/**
|
|
16528
16528
|
* Converts PendingOperation objects to SQL strings for a specific dialect.
|
|
16529
16529
|
*/
|
|
@@ -16547,7 +16547,7 @@ var SQLSerializer = class {
|
|
|
16547
16547
|
};
|
|
16548
16548
|
|
|
16549
16549
|
//#endregion
|
|
16550
|
-
//#region
|
|
16550
|
+
//#region ../cascade/src/drivers/postgres/postgres-sql-serializer.ts
|
|
16551
16551
|
/**
|
|
16552
16552
|
* PostgreSQL-specific SQL serializer.
|
|
16553
16553
|
*
|
|
@@ -16814,7 +16814,7 @@ var PostgresSQLSerializer = class extends SQLSerializer {
|
|
|
16814
16814
|
};
|
|
16815
16815
|
|
|
16816
16816
|
//#endregion
|
|
16817
|
-
//#region
|
|
16817
|
+
//#region ../cascade/src/drivers/postgres/postgres-sync-adapter.ts
|
|
16818
16818
|
/**
|
|
16819
16819
|
* PostgreSQL Sync Adapter.
|
|
16820
16820
|
*
|
|
@@ -16974,7 +16974,7 @@ var PostgresSyncAdapter = class {
|
|
|
16974
16974
|
};
|
|
16975
16975
|
|
|
16976
16976
|
//#endregion
|
|
16977
|
-
//#region
|
|
16977
|
+
//#region ../cascade/src/drivers/postgres/postgres-driver.ts
|
|
16978
16978
|
/**
|
|
16979
16979
|
* PostgreSQL Driver
|
|
16980
16980
|
*
|
|
@@ -17981,7 +17981,7 @@ var PostgresDriver = class {
|
|
|
17981
17981
|
};
|
|
17982
17982
|
|
|
17983
17983
|
//#endregion
|
|
17984
|
-
//#region
|
|
17984
|
+
//#region ../cascade/src/utils/connect-to-database.ts
|
|
17985
17985
|
/**
|
|
17986
17986
|
* Connect to a database and register the data source.
|
|
17987
17987
|
*
|
|
@@ -18103,7 +18103,7 @@ async function transaction(fn, options) {
|
|
|
18103
18103
|
}
|
|
18104
18104
|
|
|
18105
18105
|
//#endregion
|
|
18106
|
-
//#region
|
|
18106
|
+
//#region ../cascade/src/utils/database-writer.utils.ts
|
|
18107
18107
|
/**
|
|
18108
18108
|
* Transfer value before saving it into the database
|
|
18109
18109
|
*/
|
|
@@ -18126,7 +18126,7 @@ function useModelTransformer(callback) {
|
|
|
18126
18126
|
}
|
|
18127
18127
|
|
|
18128
18128
|
//#endregion
|
|
18129
|
-
//#region
|
|
18129
|
+
//#region ../cascade/src/utils/define-model.ts
|
|
18130
18130
|
/**
|
|
18131
18131
|
* Define a model with a clean, concise API.
|
|
18132
18132
|
*
|
|
@@ -18226,7 +18226,7 @@ function defineModel(options) {
|
|
|
18226
18226
|
}
|
|
18227
18227
|
|
|
18228
18228
|
//#endregion
|
|
18229
|
-
//#region
|
|
18229
|
+
//#region ../cascade/src/utils/once-connected.ts
|
|
18230
18230
|
/**
|
|
18231
18231
|
* Execute a callback once the driver is connected.
|
|
18232
18232
|
*
|
|
@@ -18425,7 +18425,7 @@ function onceDisconnected(dataSourceOrNameOrCallback, callback) {
|
|
|
18425
18425
|
}
|
|
18426
18426
|
|
|
18427
18427
|
//#endregion
|
|
18428
|
-
//#region
|
|
18428
|
+
//#region ../cascade/src/migration/column-builder.ts
|
|
18429
18429
|
/**
|
|
18430
18430
|
* Fluent builder for defining column properties.
|
|
18431
18431
|
*
|
|
@@ -18955,7 +18955,7 @@ var ColumnBuilder = class {
|
|
|
18955
18955
|
};
|
|
18956
18956
|
|
|
18957
18957
|
//#endregion
|
|
18958
|
-
//#region
|
|
18958
|
+
//#region ../cascade/src/migration/foreign-key-builder.ts
|
|
18959
18959
|
/**
|
|
18960
18960
|
* Fluent builder for foreign key constraints.
|
|
18961
18961
|
*
|
|
@@ -19079,7 +19079,7 @@ var ForeignKeyBuilder = class {
|
|
|
19079
19079
|
};
|
|
19080
19080
|
|
|
19081
19081
|
//#endregion
|
|
19082
|
-
//#region
|
|
19082
|
+
//#region ../cascade/src/migration/column-helpers.ts
|
|
19083
19083
|
/**
|
|
19084
19084
|
* A no-op migration sink used by standalone column helpers.
|
|
19085
19085
|
*
|
|
@@ -19451,7 +19451,7 @@ function arrayJson() {
|
|
|
19451
19451
|
}
|
|
19452
19452
|
|
|
19453
19453
|
//#endregion
|
|
19454
|
-
//#region
|
|
19454
|
+
//#region ../cascade/src/migration/migration.ts
|
|
19455
19455
|
/**
|
|
19456
19456
|
* Base class for all database migrations.
|
|
19457
19457
|
*
|
|
@@ -21566,7 +21566,72 @@ Migration.alter = function alterMigration(model, schema, options = {}) {
|
|
|
21566
21566
|
Migration.__declarativeFactoriesAttached = true;
|
|
21567
21567
|
|
|
21568
21568
|
//#endregion
|
|
21569
|
-
//#region
|
|
21569
|
+
//#region ../cascade/src/migration/parse-created-at.ts
|
|
21570
|
+
/**
|
|
21571
|
+
* Parse a migration's `createdAt` stamp into a `Date`.
|
|
21572
|
+
*
|
|
21573
|
+
* Migration filenames generated by the framework carry a
|
|
21574
|
+
* `MM-DD-YYYY_HH-MM-SS` prefix, which **`new Date()` cannot parse** — it
|
|
21575
|
+
* returns `Invalid Date`. Anything ordering migrations by timestamp must come
|
|
21576
|
+
* through here; using the native constructor silently yields `NaN` and
|
|
21577
|
+
* degrades the sort into whatever its tiebreaker is.
|
|
21578
|
+
*
|
|
21579
|
+
* Supports `MM-DD-YYYY_HH-MM-SS` and `DD-MM-YYYY_HH-MM-SS`, telling them apart
|
|
21580
|
+
* by whether the first field exceeds 12 (a month cannot), and falls back to
|
|
21581
|
+
* native parsing for ISO strings.
|
|
21582
|
+
*
|
|
21583
|
+
* @returns the parsed date, or `undefined` when the stamp is unusable.
|
|
21584
|
+
*/
|
|
21585
|
+
function parseCreatedAt(createdAt) {
|
|
21586
|
+
const match = createdAt.match(/^(\d{2})-(\d{2})-(\d{4})_(\d{2})-(\d{2})-(\d{2})$/);
|
|
21587
|
+
if (match) {
|
|
21588
|
+
const [, first, second, year, hour, minute, second_time] = match;
|
|
21589
|
+
const firstNum = parseInt(first);
|
|
21590
|
+
const secondNum = parseInt(second);
|
|
21591
|
+
let month, day;
|
|
21592
|
+
if (firstNum > 12) {
|
|
21593
|
+
day = firstNum;
|
|
21594
|
+
month = secondNum;
|
|
21595
|
+
} else if (secondNum > 12) {
|
|
21596
|
+
month = firstNum;
|
|
21597
|
+
day = secondNum;
|
|
21598
|
+
} else {
|
|
21599
|
+
month = firstNum;
|
|
21600
|
+
day = secondNum;
|
|
21601
|
+
}
|
|
21602
|
+
const date = new Date(parseInt(year), month - 1, day, parseInt(hour), parseInt(minute), parseInt(second_time));
|
|
21603
|
+
if (isNaN(date.getTime())) return;
|
|
21604
|
+
return date;
|
|
21605
|
+
}
|
|
21606
|
+
try {
|
|
21607
|
+
const date = new Date(createdAt);
|
|
21608
|
+
return isNaN(date.getTime()) ? void 0 : date;
|
|
21609
|
+
} catch {
|
|
21610
|
+
return;
|
|
21611
|
+
}
|
|
21612
|
+
}
|
|
21613
|
+
/**
|
|
21614
|
+
* Compare two migration timestamps for ordering.
|
|
21615
|
+
*
|
|
21616
|
+
* Shared by every migration comparator so they cannot drift apart: a stamp
|
|
21617
|
+
* that parses always sorts before one that doesn't, and two unparseable
|
|
21618
|
+
* stamps are equal (leaving the caller's own tiebreaker to decide).
|
|
21619
|
+
*
|
|
21620
|
+
* Returns `undefined` when the timestamps do not settle the comparison.
|
|
21621
|
+
*/
|
|
21622
|
+
function compareCreatedAt(a, b) {
|
|
21623
|
+
const dateA = a ? parseCreatedAt(a) : void 0;
|
|
21624
|
+
const dateB = b ? parseCreatedAt(b) : void 0;
|
|
21625
|
+
if (dateA && dateB) {
|
|
21626
|
+
const difference = dateA.getTime() - dateB.getTime();
|
|
21627
|
+
return difference === 0 ? void 0 : difference;
|
|
21628
|
+
}
|
|
21629
|
+
if (dateA) return -1;
|
|
21630
|
+
if (dateB) return 1;
|
|
21631
|
+
}
|
|
21632
|
+
|
|
21633
|
+
//#endregion
|
|
21634
|
+
//#region ../cascade/src/migration/sql-grammar.ts
|
|
21570
21635
|
/**
|
|
21571
21636
|
* Parses and sorts SQL statements globally based on their execution phase,
|
|
21572
21637
|
* and classifies statements by their semantic type.
|
|
@@ -21662,15 +21727,23 @@ var SQLGrammar = class {
|
|
|
21662
21727
|
}
|
|
21663
21728
|
/**
|
|
21664
21729
|
* Sort an array of tagged SQL statements by phase, then creation date, then migration name.
|
|
21730
|
+
*
|
|
21731
|
+
* This is the sort that decides **execution order** — it runs across every
|
|
21732
|
+
* pending migration's statements at once, after the migration list itself
|
|
21733
|
+
* has been ordered, so whatever it decides is final.
|
|
21734
|
+
*
|
|
21735
|
+
* The creation date must go through {@link compareCreatedAt}. Parsing these
|
|
21736
|
+
* stamps with `new Date()` returns `Invalid Date` for the framework's own
|
|
21737
|
+
* `MM-DD-YYYY_HH-MM-SS` filename format, which collapsed every timestamp to
|
|
21738
|
+
* the same value and quietly handed the whole ordering to the alphabetical
|
|
21739
|
+
* tiebreaker below — running, for example, a January 2026 migration before a
|
|
21740
|
+
* December 2025 one.
|
|
21665
21741
|
*/
|
|
21666
21742
|
static sort(statements) {
|
|
21667
21743
|
return statements.slice().sort((a, b) => {
|
|
21668
21744
|
if (a.phase !== b.phase) return a.phase - b.phase;
|
|
21669
|
-
|
|
21670
|
-
|
|
21671
|
-
if (isNaN(dateA)) dateA = 0;
|
|
21672
|
-
if (isNaN(dateB)) dateB = 0;
|
|
21673
|
-
if (dateA !== dateB) return dateA - dateB;
|
|
21745
|
+
const byCreatedAt = compareCreatedAt(a.createdAt, b.createdAt);
|
|
21746
|
+
if (byCreatedAt !== void 0) return byCreatedAt;
|
|
21674
21747
|
const nameA = a.migrationName || "";
|
|
21675
21748
|
const nameB = b.migrationName || "";
|
|
21676
21749
|
return nameA.localeCompare(nameB);
|
|
@@ -21679,41 +21752,7 @@ var SQLGrammar = class {
|
|
|
21679
21752
|
};
|
|
21680
21753
|
|
|
21681
21754
|
//#endregion
|
|
21682
|
-
//#region
|
|
21683
|
-
/**
|
|
21684
|
-
* Parse createdAt timestamp from custom format to Date.
|
|
21685
|
-
* Supports both: MM-DD-YYYY_HH-MM-SS and DD-MM-YYYY_HH-MM-SS
|
|
21686
|
-
* Intelligently detects format by checking if first value > 12 (must be day)
|
|
21687
|
-
* Falls back to standard Date parsing for ISO strings.
|
|
21688
|
-
*/
|
|
21689
|
-
function parseCreatedAt(createdAt) {
|
|
21690
|
-
const match = createdAt.match(/^(\d{2})-(\d{2})-(\d{4})_(\d{2})-(\d{2})-(\d{2})$/);
|
|
21691
|
-
if (match) {
|
|
21692
|
-
const [, first, second, year, hour, minute, second_time] = match;
|
|
21693
|
-
const firstNum = parseInt(first);
|
|
21694
|
-
const secondNum = parseInt(second);
|
|
21695
|
-
let month, day;
|
|
21696
|
-
if (firstNum > 12) {
|
|
21697
|
-
day = firstNum;
|
|
21698
|
-
month = secondNum;
|
|
21699
|
-
} else if (secondNum > 12) {
|
|
21700
|
-
month = firstNum;
|
|
21701
|
-
day = secondNum;
|
|
21702
|
-
} else {
|
|
21703
|
-
month = firstNum;
|
|
21704
|
-
day = secondNum;
|
|
21705
|
-
}
|
|
21706
|
-
const date = new Date(parseInt(year), month - 1, day, parseInt(hour), parseInt(minute), parseInt(second_time));
|
|
21707
|
-
if (isNaN(date.getTime())) return;
|
|
21708
|
-
return date;
|
|
21709
|
-
}
|
|
21710
|
-
try {
|
|
21711
|
-
const date = new Date(createdAt);
|
|
21712
|
-
return isNaN(date.getTime()) ? void 0 : date;
|
|
21713
|
-
} catch {
|
|
21714
|
-
return;
|
|
21715
|
-
}
|
|
21716
|
-
}
|
|
21755
|
+
//#region ../cascade/src/migration/migration-runner.ts
|
|
21717
21756
|
/**
|
|
21718
21757
|
* Comparator for sorting migration classes.
|
|
21719
21758
|
*
|
|
@@ -21722,11 +21761,8 @@ function parseCreatedAt(createdAt) {
|
|
|
21722
21761
|
* 2. Alphabetical by migration name (last resort)
|
|
21723
21762
|
*/
|
|
21724
21763
|
function sortMigrations(a, b) {
|
|
21725
|
-
const
|
|
21726
|
-
|
|
21727
|
-
if (aDate && bDate) return aDate.getTime() - bDate.getTime();
|
|
21728
|
-
if (aDate) return -1;
|
|
21729
|
-
if (bDate) return 1;
|
|
21764
|
+
const byCreatedAt = compareCreatedAt(a.createdAt, b.createdAt);
|
|
21765
|
+
if (byCreatedAt !== void 0) return byCreatedAt;
|
|
21730
21766
|
return a.migrationName.localeCompare(b.migrationName);
|
|
21731
21767
|
}
|
|
21732
21768
|
/**
|
|
@@ -22354,7 +22390,7 @@ var MigrationRunner = class {
|
|
|
22354
22390
|
const migrationRunner = new MigrationRunner();
|
|
22355
22391
|
|
|
22356
22392
|
//#endregion
|
|
22357
|
-
//#region
|
|
22393
|
+
//#region ../cascade/src/operations/database.ts
|
|
22358
22394
|
/**
|
|
22359
22395
|
* Create a database on the configured data source. Returns `created: false`
|
|
22360
22396
|
* when the database already exists — drivers are responsible for the
|
|
@@ -22390,7 +22426,7 @@ async function dropAllTables(options = {}) {
|
|
|
22390
22426
|
}
|
|
22391
22427
|
|
|
22392
22428
|
//#endregion
|
|
22393
|
-
//#region
|
|
22429
|
+
//#region ../cascade/src/operations/migrations.ts
|
|
22394
22430
|
/**
|
|
22395
22431
|
* Run every pending migration registered on the migration runner.
|
|
22396
22432
|
*
|