@alpha.consultings/eloquent-orm.js 1.0.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/CHANGELOG.md +73 -0
- package/README.md +215 -0
- package/dist/Model.d.ts +2 -0
- package/dist/Model.d.ts.map +1 -0
- package/dist/Model.js +7 -0
- package/dist/Model.js.map +1 -0
- package/dist/cli/commands/cacheClear.d.ts +2 -0
- package/dist/cli/commands/cacheClear.d.ts.map +1 -0
- package/dist/cli/commands/cacheClear.js +69 -0
- package/dist/cli/commands/cacheClear.js.map +1 -0
- package/dist/cli/commands/cacheStats.d.ts +2 -0
- package/dist/cli/commands/cacheStats.d.ts.map +1 -0
- package/dist/cli/commands/cacheStats.js +55 -0
- package/dist/cli/commands/cacheStats.js.map +1 -0
- package/dist/cli/commands/dbSeed.d.ts +16 -0
- package/dist/cli/commands/dbSeed.d.ts.map +1 -0
- package/dist/cli/commands/dbSeed.js +201 -0
- package/dist/cli/commands/dbSeed.js.map +1 -0
- package/dist/cli/commands/dbSeedBootstrapPrecheck.d.ts +3 -0
- package/dist/cli/commands/dbSeedBootstrapPrecheck.d.ts.map +1 -0
- package/dist/cli/commands/dbSeedBootstrapPrecheck.js +8 -0
- package/dist/cli/commands/dbSeedBootstrapPrecheck.js.map +1 -0
- package/dist/cli/commands/dbSeedFresh.d.ts +14 -0
- package/dist/cli/commands/dbSeedFresh.d.ts.map +1 -0
- package/dist/cli/commands/dbSeedFresh.js +81 -0
- package/dist/cli/commands/dbSeedFresh.js.map +1 -0
- package/dist/cli/commands/demoScenario.d.ts +9 -0
- package/dist/cli/commands/demoScenario.d.ts.map +1 -0
- package/dist/cli/commands/demoScenario.js +185 -0
- package/dist/cli/commands/demoScenario.js.map +1 -0
- package/dist/cli/commands/factoryStatus.d.ts +9 -0
- package/dist/cli/commands/factoryStatus.d.ts.map +1 -0
- package/dist/cli/commands/factoryStatus.js +103 -0
- package/dist/cli/commands/factoryStatus.js.map +1 -0
- package/dist/cli/commands/makeController.d.ts +11 -0
- package/dist/cli/commands/makeController.d.ts.map +1 -0
- package/dist/cli/commands/makeController.js +61 -0
- package/dist/cli/commands/makeController.js.map +1 -0
- package/dist/cli/commands/makeFactory.d.ts +14 -0
- package/dist/cli/commands/makeFactory.d.ts.map +1 -0
- package/dist/cli/commands/makeFactory.js +183 -0
- package/dist/cli/commands/makeFactory.js.map +1 -0
- package/dist/cli/commands/makeMigration.d.ts +18 -0
- package/dist/cli/commands/makeMigration.d.ts.map +1 -0
- package/dist/cli/commands/makeMigration.js +496 -0
- package/dist/cli/commands/makeMigration.js.map +1 -0
- package/dist/cli/commands/makeModel.d.ts +20 -0
- package/dist/cli/commands/makeModel.d.ts.map +1 -0
- package/dist/cli/commands/makeModel.js +360 -0
- package/dist/cli/commands/makeModel.js.map +1 -0
- package/dist/cli/commands/makeRegistry.d.ts +7 -0
- package/dist/cli/commands/makeRegistry.d.ts.map +1 -0
- package/dist/cli/commands/makeRegistry.js +88 -0
- package/dist/cli/commands/makeRegistry.js.map +1 -0
- package/dist/cli/commands/makeScenario.d.ts +12 -0
- package/dist/cli/commands/makeScenario.d.ts.map +1 -0
- package/dist/cli/commands/makeScenario.js +639 -0
- package/dist/cli/commands/makeScenario.js.map +1 -0
- package/dist/cli/commands/makeSeed.d.ts +11 -0
- package/dist/cli/commands/makeSeed.d.ts.map +1 -0
- package/dist/cli/commands/makeSeed.js +47 -0
- package/dist/cli/commands/makeSeed.js.map +1 -0
- package/dist/cli/commands/makeService.d.ts +5 -0
- package/dist/cli/commands/makeService.d.ts.map +1 -0
- package/dist/cli/commands/makeService.js +31 -0
- package/dist/cli/commands/makeService.js.map +1 -0
- package/dist/cli/commands/migrateFresh.d.ts +14 -0
- package/dist/cli/commands/migrateFresh.d.ts.map +1 -0
- package/dist/cli/commands/migrateFresh.js +150 -0
- package/dist/cli/commands/migrateFresh.js.map +1 -0
- package/dist/cli/commands/migrateReset.d.ts +12 -0
- package/dist/cli/commands/migrateReset.d.ts.map +1 -0
- package/dist/cli/commands/migrateReset.js +28 -0
- package/dist/cli/commands/migrateReset.js.map +1 -0
- package/dist/cli/commands/migrateRollback.d.ts +10 -0
- package/dist/cli/commands/migrateRollback.d.ts.map +1 -0
- package/dist/cli/commands/migrateRollback.js +303 -0
- package/dist/cli/commands/migrateRollback.js.map +1 -0
- package/dist/cli/commands/migrateRun.d.ts +10 -0
- package/dist/cli/commands/migrateRun.d.ts.map +1 -0
- package/dist/cli/commands/migrateRun.js +301 -0
- package/dist/cli/commands/migrateRun.js.map +1 -0
- package/dist/cli/commands/migrateStatus.d.ts +8 -0
- package/dist/cli/commands/migrateStatus.d.ts.map +1 -0
- package/dist/cli/commands/migrateStatus.js +118 -0
- package/dist/cli/commands/migrateStatus.js.map +1 -0
- package/dist/cli/eloquent.d.ts +18 -0
- package/dist/cli/eloquent.d.ts.map +1 -0
- package/dist/cli/eloquent.js +187 -0
- package/dist/cli/eloquent.js.map +1 -0
- package/dist/cli/utils/ArtifactCompatibility.d.ts +10 -0
- package/dist/cli/utils/ArtifactCompatibility.d.ts.map +1 -0
- package/dist/cli/utils/ArtifactCompatibility.js +60 -0
- package/dist/cli/utils/ArtifactCompatibility.js.map +1 -0
- package/dist/cli/utils/ArtifactRoutingReport.d.ts +10 -0
- package/dist/cli/utils/ArtifactRoutingReport.d.ts.map +1 -0
- package/dist/cli/utils/ArtifactRoutingReport.js +25 -0
- package/dist/cli/utils/ArtifactRoutingReport.js.map +1 -0
- package/dist/cli/utils/ArtifactStorage.d.ts +10 -0
- package/dist/cli/utils/ArtifactStorage.d.ts.map +1 -0
- package/dist/cli/utils/ArtifactStorage.js +193 -0
- package/dist/cli/utils/ArtifactStorage.js.map +1 -0
- package/dist/cli/utils/AuditTrail.d.ts +25 -0
- package/dist/cli/utils/AuditTrail.d.ts.map +1 -0
- package/dist/cli/utils/AuditTrail.js +74 -0
- package/dist/cli/utils/AuditTrail.js.map +1 -0
- package/dist/cli/utils/CliActionRuntime.d.ts +5 -0
- package/dist/cli/utils/CliActionRuntime.d.ts.map +1 -0
- package/dist/cli/utils/CliActionRuntime.js +22 -0
- package/dist/cli/utils/CliActionRuntime.js.map +1 -0
- package/dist/cli/utils/CliBootstrapSupport.d.ts +13 -0
- package/dist/cli/utils/CliBootstrapSupport.d.ts.map +1 -0
- package/dist/cli/utils/CliBootstrapSupport.js +55 -0
- package/dist/cli/utils/CliBootstrapSupport.js.map +1 -0
- package/dist/cli/utils/CliCommandCatalog.d.ts +6 -0
- package/dist/cli/utils/CliCommandCatalog.d.ts.map +1 -0
- package/dist/cli/utils/CliCommandCatalog.js +78 -0
- package/dist/cli/utils/CliCommandCatalog.js.map +1 -0
- package/dist/cli/utils/CliCommandTargets.d.ts +8 -0
- package/dist/cli/utils/CliCommandTargets.d.ts.map +1 -0
- package/dist/cli/utils/CliCommandTargets.js +19 -0
- package/dist/cli/utils/CliCommandTargets.js.map +1 -0
- package/dist/cli/utils/CliMakeArtifactCommandRegistration.d.ts +3 -0
- package/dist/cli/utils/CliMakeArtifactCommandRegistration.d.ts.map +1 -0
- package/dist/cli/utils/CliMakeArtifactCommandRegistration.js +94 -0
- package/dist/cli/utils/CliMakeArtifactCommandRegistration.js.map +1 -0
- package/dist/cli/utils/CliMigrationCommandRegistration.d.ts +3 -0
- package/dist/cli/utils/CliMigrationCommandRegistration.d.ts.map +1 -0
- package/dist/cli/utils/CliMigrationCommandRegistration.js +195 -0
- package/dist/cli/utils/CliMigrationCommandRegistration.js.map +1 -0
- package/dist/cli/utils/CliPresentation.d.ts +2 -0
- package/dist/cli/utils/CliPresentation.d.ts.map +1 -0
- package/dist/cli/utils/CliPresentation.js +13 -0
- package/dist/cli/utils/CliPresentation.js.map +1 -0
- package/dist/cli/utils/CliProductionGuards.d.ts +11 -0
- package/dist/cli/utils/CliProductionGuards.d.ts.map +1 -0
- package/dist/cli/utils/CliProductionGuards.js +34 -0
- package/dist/cli/utils/CliProductionGuards.js.map +1 -0
- package/dist/cli/utils/CliScaffoldCommandRegistration.d.ts +3 -0
- package/dist/cli/utils/CliScaffoldCommandRegistration.d.ts.map +1 -0
- package/dist/cli/utils/CliScaffoldCommandRegistration.js +89 -0
- package/dist/cli/utils/CliScaffoldCommandRegistration.js.map +1 -0
- package/dist/cli/utils/CliSeedScenarioCommandRegistration.d.ts +3 -0
- package/dist/cli/utils/CliSeedScenarioCommandRegistration.d.ts.map +1 -0
- package/dist/cli/utils/CliSeedScenarioCommandRegistration.js +123 -0
- package/dist/cli/utils/CliSeedScenarioCommandRegistration.js.map +1 -0
- package/dist/cli/utils/CliSupportCommandRegistration.d.ts +3 -0
- package/dist/cli/utils/CliSupportCommandRegistration.d.ts.map +1 -0
- package/dist/cli/utils/CliSupportCommandRegistration.js +44 -0
- package/dist/cli/utils/CliSupportCommandRegistration.js.map +1 -0
- package/dist/cli/utils/ConsoleSilencer.d.ts +6 -0
- package/dist/cli/utils/ConsoleSilencer.d.ts.map +1 -0
- package/dist/cli/utils/ConsoleSilencer.js +25 -0
- package/dist/cli/utils/ConsoleSilencer.js.map +1 -0
- package/dist/cli/utils/ImportResolver.d.ts +16 -0
- package/dist/cli/utils/ImportResolver.d.ts.map +1 -0
- package/dist/cli/utils/ImportResolver.js +57 -0
- package/dist/cli/utils/ImportResolver.js.map +1 -0
- package/dist/cli/utils/ModelIntrospector.d.ts +33 -0
- package/dist/cli/utils/ModelIntrospector.d.ts.map +1 -0
- package/dist/cli/utils/ModelIntrospector.js +76 -0
- package/dist/cli/utils/ModelIntrospector.js.map +1 -0
- package/dist/cli/utils/PathMap.d.ts +58 -0
- package/dist/cli/utils/PathMap.d.ts.map +1 -0
- package/dist/cli/utils/PathMap.js +132 -0
- package/dist/cli/utils/PathMap.js.map +1 -0
- package/dist/cli/utils/ProductionSafety.d.ts +25 -0
- package/dist/cli/utils/ProductionSafety.d.ts.map +1 -0
- package/dist/cli/utils/ProductionSafety.js +61 -0
- package/dist/cli/utils/ProductionSafety.js.map +1 -0
- package/dist/cli/utils/ScaffoldGeneratorSupport.d.ts +16 -0
- package/dist/cli/utils/ScaffoldGeneratorSupport.d.ts.map +1 -0
- package/dist/cli/utils/ScaffoldGeneratorSupport.js +66 -0
- package/dist/cli/utils/ScaffoldGeneratorSupport.js.map +1 -0
- package/dist/cli/utils/ScenarioMorphAliasRouting.d.ts +14 -0
- package/dist/cli/utils/ScenarioMorphAliasRouting.d.ts.map +1 -0
- package/dist/cli/utils/ScenarioMorphAliasRouting.js +62 -0
- package/dist/cli/utils/ScenarioMorphAliasRouting.js.map +1 -0
- package/dist/cli/utils/SeedBootstrapPrecheck.d.ts +20 -0
- package/dist/cli/utils/SeedBootstrapPrecheck.d.ts.map +1 -0
- package/dist/cli/utils/SeedBootstrapPrecheck.js +133 -0
- package/dist/cli/utils/SeedBootstrapPrecheck.js.map +1 -0
- package/dist/cli/utils/StructuredLogger.d.ts +11 -0
- package/dist/cli/utils/StructuredLogger.d.ts.map +1 -0
- package/dist/cli/utils/StructuredLogger.js +53 -0
- package/dist/cli/utils/StructuredLogger.js.map +1 -0
- package/dist/cli/utils/TemplateEngine.d.ts +30 -0
- package/dist/cli/utils/TemplateEngine.d.ts.map +1 -0
- package/dist/cli/utils/TemplateEngine.js +165 -0
- package/dist/cli/utils/TemplateEngine.js.map +1 -0
- package/dist/cli/utils/factories/Factory.d.ts +61 -0
- package/dist/cli/utils/factories/Factory.d.ts.map +1 -0
- package/dist/cli/utils/factories/Factory.js +140 -0
- package/dist/cli/utils/factories/Factory.js.map +1 -0
- package/dist/cli/utils/factories/FactoryDisplay.d.ts +6 -0
- package/dist/cli/utils/factories/FactoryDisplay.d.ts.map +1 -0
- package/dist/cli/utils/factories/FactoryDisplay.js +26 -0
- package/dist/cli/utils/factories/FactoryDisplay.js.map +1 -0
- package/dist/cli/utils/factories/FactoryGraph.d.ts +6 -0
- package/dist/cli/utils/factories/FactoryGraph.d.ts.map +1 -0
- package/dist/cli/utils/factories/FactoryGraph.js +72 -0
- package/dist/cli/utils/factories/FactoryGraph.js.map +1 -0
- package/dist/cli/utils/factories/FactoryLoader.d.ts +16 -0
- package/dist/cli/utils/factories/FactoryLoader.d.ts.map +1 -0
- package/dist/cli/utils/factories/FactoryLoader.js +35 -0
- package/dist/cli/utils/factories/FactoryLoader.js.map +1 -0
- package/dist/cli/utils/factories/FactoryRegistry.d.ts +16 -0
- package/dist/cli/utils/factories/FactoryRegistry.d.ts.map +1 -0
- package/dist/cli/utils/factories/FactoryRegistry.js +87 -0
- package/dist/cli/utils/factories/FactoryRegistry.js.map +1 -0
- package/dist/cli/utils/fileWriter.d.ts +7 -0
- package/dist/cli/utils/fileWriter.d.ts.map +1 -0
- package/dist/cli/utils/fileWriter.js +61 -0
- package/dist/cli/utils/fileWriter.js.map +1 -0
- package/dist/cli/utils/migrations/MigrationLockStrategy.d.ts +21 -0
- package/dist/cli/utils/migrations/MigrationLockStrategy.d.ts.map +1 -0
- package/dist/cli/utils/migrations/MigrationLockStrategy.js +129 -0
- package/dist/cli/utils/migrations/MigrationLockStrategy.js.map +1 -0
- package/dist/cli/utils/migrations/MigrationTracker.d.ts +25 -0
- package/dist/cli/utils/migrations/MigrationTracker.d.ts.map +1 -0
- package/dist/cli/utils/migrations/MigrationTracker.js +279 -0
- package/dist/cli/utils/migrations/MigrationTracker.js.map +1 -0
- package/dist/cli/utils/migrations/MongoMigrationTracker.d.ts +18 -0
- package/dist/cli/utils/migrations/MongoMigrationTracker.d.ts.map +1 -0
- package/dist/cli/utils/migrations/MongoMigrationTracker.js +276 -0
- package/dist/cli/utils/migrations/MongoMigrationTracker.js.map +1 -0
- package/dist/cli/utils/resolveConnectionFlags.d.ts +14 -0
- package/dist/cli/utils/resolveConnectionFlags.d.ts.map +1 -0
- package/dist/cli/utils/resolveConnectionFlags.js +42 -0
- package/dist/cli/utils/resolveConnectionFlags.js.map +1 -0
- package/dist/cli/utils/resolveSqlConnectionFlags.d.ts +9 -0
- package/dist/cli/utils/resolveSqlConnectionFlags.d.ts.map +1 -0
- package/dist/cli/utils/resolveSqlConnectionFlags.js +23 -0
- package/dist/cli/utils/resolveSqlConnectionFlags.js.map +1 -0
- package/dist/cli/utils/typescript/BaseCommand.d.ts +15 -0
- package/dist/cli/utils/typescript/BaseCommand.d.ts.map +1 -0
- package/dist/cli/utils/typescript/BaseCommand.js +36 -0
- package/dist/cli/utils/typescript/BaseCommand.js.map +1 -0
- package/dist/cli/utils/typescript/RuntimeDetector.d.ts +16 -0
- package/dist/cli/utils/typescript/RuntimeDetector.d.ts.map +1 -0
- package/dist/cli/utils/typescript/RuntimeDetector.js +45 -0
- package/dist/cli/utils/typescript/RuntimeDetector.js.map +1 -0
- package/dist/cli/utils/typescript/TypeScriptCompiler.d.ts +25 -0
- package/dist/cli/utils/typescript/TypeScriptCompiler.d.ts.map +1 -0
- package/dist/cli/utils/typescript/TypeScriptCompiler.js +109 -0
- package/dist/cli/utils/typescript/TypeScriptCompiler.js.map +1 -0
- package/dist/cli/utils/typescript/tsRuntime.d.ts +12 -0
- package/dist/cli/utils/typescript/tsRuntime.d.ts.map +1 -0
- package/dist/cli/utils/typescript/tsRuntime.js +189 -0
- package/dist/cli/utils/typescript/tsRuntime.js.map +1 -0
- package/dist/config/database.d.ts +58 -0
- package/dist/config/database.d.ts.map +1 -0
- package/dist/config/database.js +106 -0
- package/dist/config/database.js.map +1 -0
- package/dist/config/dbRoleEnv.d.ts +31 -0
- package/dist/config/dbRoleEnv.d.ts.map +1 -0
- package/dist/config/dbRoleEnv.js +171 -0
- package/dist/config/dbRoleEnv.js.map +1 -0
- package/dist/core/cache/CacheAnalytics.d.ts +47 -0
- package/dist/core/cache/CacheAnalytics.d.ts.map +1 -0
- package/dist/core/cache/CacheAnalytics.js +113 -0
- package/dist/core/cache/CacheAnalytics.js.map +1 -0
- package/dist/core/cache/CacheDriver.d.ts +19 -0
- package/dist/core/cache/CacheDriver.d.ts.map +1 -0
- package/dist/core/cache/CacheDriver.js +8 -0
- package/dist/core/cache/CacheDriver.js.map +1 -0
- package/dist/core/cache/CacheFallbackManager.d.ts +35 -0
- package/dist/core/cache/CacheFallbackManager.d.ts.map +1 -0
- package/dist/core/cache/CacheFallbackManager.js +118 -0
- package/dist/core/cache/CacheFallbackManager.js.map +1 -0
- package/dist/core/cache/CacheManager.d.ts +11 -0
- package/dist/core/cache/CacheManager.d.ts.map +1 -0
- package/dist/core/cache/CacheManager.js +27 -0
- package/dist/core/cache/CacheManager.js.map +1 -0
- package/dist/core/cache/CacheRegistry.d.ts +49 -0
- package/dist/core/cache/CacheRegistry.d.ts.map +1 -0
- package/dist/core/cache/CacheRegistry.js +117 -0
- package/dist/core/cache/CacheRegistry.js.map +1 -0
- package/dist/core/cache/drivers/FileCacheDriver.d.ts +11 -0
- package/dist/core/cache/drivers/FileCacheDriver.d.ts.map +1 -0
- package/dist/core/cache/drivers/FileCacheDriver.js +54 -0
- package/dist/core/cache/drivers/FileCacheDriver.js.map +1 -0
- package/dist/core/cache/drivers/MemcachedCacheDriver.d.ts +15 -0
- package/dist/core/cache/drivers/MemcachedCacheDriver.d.ts.map +1 -0
- package/dist/core/cache/drivers/MemcachedCacheDriver.js +60 -0
- package/dist/core/cache/drivers/MemcachedCacheDriver.js.map +1 -0
- package/dist/core/cache/drivers/MemoryCacheDriver.d.ts +9 -0
- package/dist/core/cache/drivers/MemoryCacheDriver.d.ts.map +1 -0
- package/dist/core/cache/drivers/MemoryCacheDriver.js +33 -0
- package/dist/core/cache/drivers/MemoryCacheDriver.js.map +1 -0
- package/dist/core/cache/setupCache.d.ts +2 -0
- package/dist/core/cache/setupCache.d.ts.map +1 -0
- package/dist/core/cache/setupCache.js +38 -0
- package/dist/core/cache/setupCache.js.map +1 -0
- package/dist/core/connection/BetterSqliteConnection.d.ts +23 -0
- package/dist/core/connection/BetterSqliteConnection.d.ts.map +1 -0
- package/dist/core/connection/BetterSqliteConnection.js +33 -0
- package/dist/core/connection/BetterSqliteConnection.js.map +1 -0
- package/dist/core/connection/ConnectionFactory.d.ts +18 -0
- package/dist/core/connection/ConnectionFactory.d.ts.map +1 -0
- package/dist/core/connection/ConnectionFactory.js +111 -0
- package/dist/core/connection/ConnectionFactory.js.map +1 -0
- package/dist/core/connection/DatabaseConnection.d.ts +49 -0
- package/dist/core/connection/DatabaseConnection.d.ts.map +1 -0
- package/dist/core/connection/DatabaseConnection.js +120 -0
- package/dist/core/connection/DatabaseConnection.js.map +1 -0
- package/dist/core/connection/DriverAdapter.d.ts +23 -0
- package/dist/core/connection/DriverAdapter.d.ts.map +1 -0
- package/dist/core/connection/DriverAdapter.js +145 -0
- package/dist/core/connection/DriverAdapter.js.map +1 -0
- package/dist/core/connection/resolveConnectionName.d.ts +17 -0
- package/dist/core/connection/resolveConnectionName.d.ts.map +1 -0
- package/dist/core/connection/resolveConnectionName.js +47 -0
- package/dist/core/connection/resolveConnectionName.js.map +1 -0
- package/dist/core/model/BaseModel.d.ts +247 -0
- package/dist/core/model/BaseModel.d.ts.map +1 -0
- package/dist/core/model/BaseModel.js +165 -0
- package/dist/core/model/BaseModel.js.map +1 -0
- package/dist/core/model/BaseModelSafeFinderStatics.d.ts +33 -0
- package/dist/core/model/BaseModelSafeFinderStatics.d.ts.map +1 -0
- package/dist/core/model/BaseModelSafeFinderStatics.js +87 -0
- package/dist/core/model/BaseModelSafeFinderStatics.js.map +1 -0
- package/dist/core/model/CoreModel.d.ts +134 -0
- package/dist/core/model/CoreModel.d.ts.map +1 -0
- package/dist/core/model/CoreModel.js +541 -0
- package/dist/core/model/CoreModel.js.map +1 -0
- package/dist/core/model/CoreModelPersistenceState.d.ts +36 -0
- package/dist/core/model/CoreModelPersistenceState.d.ts.map +1 -0
- package/dist/core/model/CoreModelPersistenceState.js +141 -0
- package/dist/core/model/CoreModelPersistenceState.js.map +1 -0
- package/dist/core/model/CoreModelSafeFinderSupport.d.ts +5 -0
- package/dist/core/model/CoreModelSafeFinderSupport.d.ts.map +1 -0
- package/dist/core/model/CoreModelSafeFinderSupport.js +15 -0
- package/dist/core/model/CoreModelSafeFinderSupport.js.map +1 -0
- package/dist/core/model/CoreModelValidationEvents.d.ts +24 -0
- package/dist/core/model/CoreModelValidationEvents.d.ts.map +1 -0
- package/dist/core/model/CoreModelValidationEvents.js +45 -0
- package/dist/core/model/CoreModelValidationEvents.js.map +1 -0
- package/dist/core/model/SafeFinder.d.ts +46 -0
- package/dist/core/model/SafeFinder.d.ts.map +1 -0
- package/dist/core/model/SafeFinder.js +223 -0
- package/dist/core/model/SafeFinder.js.map +1 -0
- package/dist/core/orm/Relation.d.ts +47 -0
- package/dist/core/orm/Relation.d.ts.map +1 -0
- package/dist/core/orm/Relation.js +62 -0
- package/dist/core/orm/Relation.js.map +1 -0
- package/dist/core/orm/mixins/CastsMixin.d.ts +18 -0
- package/dist/core/orm/mixins/CastsMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/CastsMixin.js +125 -0
- package/dist/core/orm/mixins/CastsMixin.js.map +1 -0
- package/dist/core/orm/mixins/EagerLoadingMixin.d.ts +19 -0
- package/dist/core/orm/mixins/EagerLoadingMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/EagerLoadingMixin.js +137 -0
- package/dist/core/orm/mixins/EagerLoadingMixin.js.map +1 -0
- package/dist/core/orm/mixins/HooksMixin.d.ts +16 -0
- package/dist/core/orm/mixins/HooksMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/HooksMixin.js +95 -0
- package/dist/core/orm/mixins/HooksMixin.js.map +1 -0
- package/dist/core/orm/mixins/MorphRegistry.d.ts +47 -0
- package/dist/core/orm/mixins/MorphRegistry.d.ts.map +1 -0
- package/dist/core/orm/mixins/MorphRegistry.js +67 -0
- package/dist/core/orm/mixins/MorphRegistry.js.map +1 -0
- package/dist/core/orm/mixins/MorphableMixin.d.ts +29 -0
- package/dist/core/orm/mixins/MorphableMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/MorphableMixin.js +93 -0
- package/dist/core/orm/mixins/MorphableMixin.js.map +1 -0
- package/dist/core/orm/mixins/PivotHelperMixin.d.ts +26 -0
- package/dist/core/orm/mixins/PivotHelperMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/PivotHelperMixin.js +102 -0
- package/dist/core/orm/mixins/PivotHelperMixin.js.map +1 -0
- package/dist/core/orm/mixins/QueryCacheMixin.d.ts +23 -0
- package/dist/core/orm/mixins/QueryCacheMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/QueryCacheMixin.js +172 -0
- package/dist/core/orm/mixins/QueryCacheMixin.js.map +1 -0
- package/dist/core/orm/mixins/ScopeMixin.d.ts +20 -0
- package/dist/core/orm/mixins/ScopeMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/ScopeMixin.js +72 -0
- package/dist/core/orm/mixins/ScopeMixin.js.map +1 -0
- package/dist/core/orm/mixins/SerializeMixin.d.ts +44 -0
- package/dist/core/orm/mixins/SerializeMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/SerializeMixin.js +80 -0
- package/dist/core/orm/mixins/SerializeMixin.js.map +1 -0
- package/dist/core/orm/mixins/SoftDeletesMixin.d.ts +22 -0
- package/dist/core/orm/mixins/SoftDeletesMixin.d.ts.map +1 -0
- package/dist/core/orm/mixins/SoftDeletesMixin.js +146 -0
- package/dist/core/orm/mixins/SoftDeletesMixin.js.map +1 -0
- package/dist/core/orm/mixins/utils/BaseMethodResolver.d.ts +8 -0
- package/dist/core/orm/mixins/utils/BaseMethodResolver.d.ts.map +1 -0
- package/dist/core/orm/mixins/utils/BaseMethodResolver.js +26 -0
- package/dist/core/orm/mixins/utils/BaseMethodResolver.js.map +1 -0
- package/dist/core/orm/mixins/utils/HookStore.d.ts +26 -0
- package/dist/core/orm/mixins/utils/HookStore.d.ts.map +1 -0
- package/dist/core/orm/mixins/utils/HookStore.js +78 -0
- package/dist/core/orm/mixins/utils/HookStore.js.map +1 -0
- package/dist/core/orm/mixins/utils/ModelRegistry.d.ts +33 -0
- package/dist/core/orm/mixins/utils/ModelRegistry.d.ts.map +1 -0
- package/dist/core/orm/mixins/utils/ModelRegistry.js +87 -0
- package/dist/core/orm/mixins/utils/ModelRegistry.js.map +1 -0
- package/dist/core/orm/mixins/utils/modelRegistration.d.ts +9 -0
- package/dist/core/orm/mixins/utils/modelRegistration.d.ts.map +1 -0
- package/dist/core/orm/mixins/utils/modelRegistration.js +26 -0
- package/dist/core/orm/mixins/utils/modelRegistration.js.map +1 -0
- package/dist/core/orm/relations/BelongsTo.d.ts +6 -0
- package/dist/core/orm/relations/BelongsTo.d.ts.map +1 -0
- package/dist/core/orm/relations/BelongsTo.js +70 -0
- package/dist/core/orm/relations/BelongsTo.js.map +1 -0
- package/dist/core/orm/relations/BelongsToMany.d.ts +14 -0
- package/dist/core/orm/relations/BelongsToMany.d.ts.map +1 -0
- package/dist/core/orm/relations/BelongsToMany.js +245 -0
- package/dist/core/orm/relations/BelongsToMany.js.map +1 -0
- package/dist/core/orm/relations/HasMany.d.ts +6 -0
- package/dist/core/orm/relations/HasMany.d.ts.map +1 -0
- package/dist/core/orm/relations/HasMany.js +75 -0
- package/dist/core/orm/relations/HasMany.js.map +1 -0
- package/dist/core/orm/relations/HasOne.d.ts +6 -0
- package/dist/core/orm/relations/HasOne.d.ts.map +1 -0
- package/dist/core/orm/relations/HasOne.js +71 -0
- package/dist/core/orm/relations/HasOne.js.map +1 -0
- package/dist/core/orm/relations/MorphMany.d.ts +9 -0
- package/dist/core/orm/relations/MorphMany.d.ts.map +1 -0
- package/dist/core/orm/relations/MorphMany.js +107 -0
- package/dist/core/orm/relations/MorphMany.js.map +1 -0
- package/dist/core/orm/relations/MorphOne.d.ts +9 -0
- package/dist/core/orm/relations/MorphOne.d.ts.map +1 -0
- package/dist/core/orm/relations/MorphOne.js +101 -0
- package/dist/core/orm/relations/MorphOne.js.map +1 -0
- package/dist/core/orm/relations/MorphTo.d.ts +9 -0
- package/dist/core/orm/relations/MorphTo.d.ts.map +1 -0
- package/dist/core/orm/relations/MorphTo.js +85 -0
- package/dist/core/orm/relations/MorphTo.js.map +1 -0
- package/dist/core/schema/SQLDialect.d.ts +22 -0
- package/dist/core/schema/SQLDialect.d.ts.map +1 -0
- package/dist/core/schema/SQLDialect.js +38 -0
- package/dist/core/schema/SQLDialect.js.map +1 -0
- package/dist/core/schema/SchemaBlueprint.d.ts +61 -0
- package/dist/core/schema/SchemaBlueprint.d.ts.map +1 -0
- package/dist/core/schema/SchemaBlueprint.js +62 -0
- package/dist/core/schema/SchemaBlueprint.js.map +1 -0
- package/dist/core/schema/SchemaBuilder.d.ts +29 -0
- package/dist/core/schema/SchemaBuilder.d.ts.map +1 -0
- package/dist/core/schema/SchemaBuilder.js +661 -0
- package/dist/core/schema/SchemaBuilder.js.map +1 -0
- package/dist/core/schema/SchemaValidator.d.ts +23 -0
- package/dist/core/schema/SchemaValidator.d.ts.map +1 -0
- package/dist/core/schema/SchemaValidator.js +75 -0
- package/dist/core/schema/SchemaValidator.js.map +1 -0
- package/dist/core/security/AbstractSecurity.d.ts +24 -0
- package/dist/core/security/AbstractSecurity.d.ts.map +1 -0
- package/dist/core/security/AbstractSecurity.js +58 -0
- package/dist/core/security/AbstractSecurity.js.map +1 -0
- package/dist/core/security/EnvKeySecurity.d.ts +11 -0
- package/dist/core/security/EnvKeySecurity.d.ts.map +1 -0
- package/dist/core/security/EnvKeySecurity.js +46 -0
- package/dist/core/security/EnvKeySecurity.js.map +1 -0
- package/dist/core/security/NoSecurity.d.ts +10 -0
- package/dist/core/security/NoSecurity.d.ts.map +1 -0
- package/dist/core/security/NoSecurity.js +18 -0
- package/dist/core/security/NoSecurity.js.map +1 -0
- package/dist/core/security/SecretRedactor.d.ts +4 -0
- package/dist/core/security/SecretRedactor.d.ts.map +1 -0
- package/dist/core/security/SecretRedactor.js +60 -0
- package/dist/core/security/SecretRedactor.js.map +1 -0
- package/dist/core/security/SecurityContract.d.ts +13 -0
- package/dist/core/security/SecurityContract.d.ts.map +1 -0
- package/dist/core/security/SecurityContract.js +3 -0
- package/dist/core/security/SecurityContract.js.map +1 -0
- package/dist/core/security/SecurityFactory.d.ts +9 -0
- package/dist/core/security/SecurityFactory.d.ts.map +1 -0
- package/dist/core/security/SecurityFactory.js +29 -0
- package/dist/core/security/SecurityFactory.js.map +1 -0
- package/dist/core/security/index.d.ts +6 -0
- package/dist/core/security/index.d.ts.map +1 -0
- package/dist/core/security/index.js +22 -0
- package/dist/core/security/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/package.json +104 -0
- package/src/cli/templates/controller.tpl +80 -0
- package/src/cli/templates/factory.tpl +14 -0
- package/src/cli/templates/migration.tpl +36 -0
- package/src/cli/templates/model-registry.tpl +16 -0
- package/src/cli/templates/model.tpl +95 -0
- package/src/cli/templates/pivot-factory.tpl +85 -0
- package/src/cli/templates/seed.tpl +20 -0
- package/src/cli/templates/service.tpl +40 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isModelRegistryStrictMode = exports.setModelRegistryStrictMode = exports.isModelRegistered = exports.registerModels = exports.setupCache = exports.CacheManager = exports.SchemaBuilder = exports.SchemaValidator = exports.validateSchema = exports.mixin = exports.relation = exports.validate = exports.column = exports.CoreModel = exports.Factory = exports.PivotHelperMixin = exports.MorphRegistry = exports.MongoModel = exports.SqlModel = exports.Model = exports.BaseModel = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Public package entrypoint.
|
|
6
|
+
* Only exports from this file are semver-tracked and supported for consumers.
|
|
7
|
+
* Deep imports into internal `dist/core/*`, `dist/cli/*`, or `src/*` paths are private.
|
|
8
|
+
*/
|
|
9
|
+
var BaseModel_1 = require("./core/model/BaseModel");
|
|
10
|
+
Object.defineProperty(exports, "BaseModel", { enumerable: true, get: function () { return BaseModel_1.BaseModel; } });
|
|
11
|
+
Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return BaseModel_1.Model; } });
|
|
12
|
+
Object.defineProperty(exports, "SqlModel", { enumerable: true, get: function () { return BaseModel_1.SqlModel; } });
|
|
13
|
+
Object.defineProperty(exports, "MongoModel", { enumerable: true, get: function () { return BaseModel_1.MongoModel; } });
|
|
14
|
+
Object.defineProperty(exports, "MorphRegistry", { enumerable: true, get: function () { return BaseModel_1.MorphRegistry; } });
|
|
15
|
+
var PivotHelperMixin_1 = require("./core/orm/mixins/PivotHelperMixin");
|
|
16
|
+
Object.defineProperty(exports, "PivotHelperMixin", { enumerable: true, get: function () { return PivotHelperMixin_1.PivotHelperMixin; } });
|
|
17
|
+
var Factory_1 = require("./cli/utils/factories/Factory");
|
|
18
|
+
Object.defineProperty(exports, "Factory", { enumerable: true, get: function () { return Factory_1.Factory; } });
|
|
19
|
+
var CoreModel_1 = require("./core/model/CoreModel");
|
|
20
|
+
Object.defineProperty(exports, "CoreModel", { enumerable: true, get: function () { return CoreModel_1.CoreModel; } });
|
|
21
|
+
var SchemaBlueprint_1 = require("./core/schema/SchemaBlueprint");
|
|
22
|
+
Object.defineProperty(exports, "column", { enumerable: true, get: function () { return SchemaBlueprint_1.column; } });
|
|
23
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return SchemaBlueprint_1.validate; } });
|
|
24
|
+
Object.defineProperty(exports, "relation", { enumerable: true, get: function () { return SchemaBlueprint_1.relation; } });
|
|
25
|
+
Object.defineProperty(exports, "mixin", { enumerable: true, get: function () { return SchemaBlueprint_1.mixin; } });
|
|
26
|
+
Object.defineProperty(exports, "validateSchema", { enumerable: true, get: function () { return SchemaBlueprint_1.validateSchema; } });
|
|
27
|
+
var SchemaValidator_1 = require("./core/schema/SchemaValidator");
|
|
28
|
+
Object.defineProperty(exports, "SchemaValidator", { enumerable: true, get: function () { return SchemaValidator_1.SchemaValidator; } });
|
|
29
|
+
var SchemaBuilder_1 = require("./core/schema/SchemaBuilder");
|
|
30
|
+
Object.defineProperty(exports, "SchemaBuilder", { enumerable: true, get: function () { return SchemaBuilder_1.SchemaBuilder; } });
|
|
31
|
+
var CacheManager_1 = require("./core/cache/CacheManager");
|
|
32
|
+
Object.defineProperty(exports, "CacheManager", { enumerable: true, get: function () { return CacheManager_1.CacheManager; } });
|
|
33
|
+
var setupCache_1 = require("./core/cache/setupCache");
|
|
34
|
+
Object.defineProperty(exports, "setupCache", { enumerable: true, get: function () { return setupCache_1.setupCache; } });
|
|
35
|
+
var modelRegistration_1 = require("./core/orm/mixins/utils/modelRegistration");
|
|
36
|
+
Object.defineProperty(exports, "registerModels", { enumerable: true, get: function () { return modelRegistration_1.registerModels; } });
|
|
37
|
+
Object.defineProperty(exports, "isModelRegistered", { enumerable: true, get: function () { return modelRegistration_1.isModelRegistered; } });
|
|
38
|
+
Object.defineProperty(exports, "setModelRegistryStrictMode", { enumerable: true, get: function () { return modelRegistration_1.setModelRegistryStrictMode; } });
|
|
39
|
+
Object.defineProperty(exports, "isModelRegistryStrictMode", { enumerable: true, get: function () { return modelRegistration_1.isModelRegistryStrictMode; } });
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAWgC;AAV9B,sGAAA,SAAS,OAAA;AACT,kGAAA,KAAK,OAAA;AACL,qGAAA,QAAQ,OAAA;AACR,uGAAA,UAAU,OAAA;AACV,0GAAA,aAAa,OAAA;AAQf,uEAAsE;AAA7D,oHAAA,gBAAgB,OAAA;AACzB,yDAKuC;AAJrC,kGAAA,OAAO,OAAA;AAMT,oDAGgC;AAF9B,sGAAA,SAAS,OAAA;AAIX,iEAgBuC;AAfrC,yGAAA,MAAM,OAAA;AACN,2GAAA,QAAQ,OAAA;AACR,2GAAA,QAAQ,OAAA;AACR,wGAAA,KAAK,OAAA;AACL,iHAAA,cAAc,OAAA;AAahB,iEAOuC;AANrC,kHAAA,eAAe,OAAA;AAQjB,6DAAoF;AAA3E,8GAAA,aAAa,OAAA;AAEtB,0DAAyD;AAAhD,4GAAA,YAAY,OAAA;AACrB,sDAAqD;AAA5C,wGAAA,UAAU,OAAA;AAEnB,+EAMmD;AALjD,mHAAA,cAAc,OAAA;AACd,sHAAA,iBAAiB,OAAA;AACjB,+HAAA,0BAA0B,OAAA;AAC1B,8HAAA,yBAAyB,OAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alpha.consultings/eloquent-orm.js",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A Laravel Eloquent-inspired ORM Multi Driver SQL & NoSQL and Cache System and Artisan CLI like for Node.js Lovers",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": "20.x"
|
|
10
|
+
},
|
|
11
|
+
"docsSupportMatrix": {
|
|
12
|
+
"memcachedServer": "1.6+"
|
|
13
|
+
},
|
|
14
|
+
"type": "commonjs",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "MEKHERBECHE Fares",
|
|
17
|
+
"github": "https://github.com/MetalDz"
|
|
18
|
+
},
|
|
19
|
+
"main": "dist/index.js",
|
|
20
|
+
"types": "dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./Model": {
|
|
28
|
+
"types": "./dist/Model.d.ts",
|
|
29
|
+
"require": "./dist/Model.js",
|
|
30
|
+
"default": "./dist/Model.js"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"bin": {
|
|
35
|
+
"eloquent": "./dist/cli/eloquent.js"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"src/cli/templates/**/*",
|
|
40
|
+
"README.md",
|
|
41
|
+
"CHANGELOG.md"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"docs:sync-package-metadata": "node scripts/sync-package-metadata.cjs",
|
|
45
|
+
"docs:sync-supported": "node scripts/sync-supported-versions.cjs",
|
|
46
|
+
"docs:sync-config": "node scripts/sync-mintlify-configs.cjs",
|
|
47
|
+
"clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
48
|
+
"build": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run clean && tsc -p tsconfig.build.json",
|
|
49
|
+
"typecheck": "tsc -p . --noEmit --skipLibCheck",
|
|
50
|
+
"docs:dev": "npm run docs:sync-package-metadata && npm run docs:sync-config && node scripts/run-mintlify.cjs dev",
|
|
51
|
+
"docs:build": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run docs:sync-config && node scripts/run-mintlify.cjs validate",
|
|
52
|
+
"docs:validate": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run docs:sync-config && node scripts/run-mintlify.cjs validate",
|
|
53
|
+
"docs:lint": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run docs:sync-config && node scripts/run-mintlify.cjs broken-links",
|
|
54
|
+
"test": "jest --runInBand",
|
|
55
|
+
"test:coverage": "jest --runInBand --coverage",
|
|
56
|
+
"test:mysql-smoke": "jest --runInBand --runTestsByPath src/lab_test/cli.integration.scenario.lifecycle.test.ts src/lab_test/cli.integration.make-migration.targeting.test.ts src/lab_test/cli.integration.migrate.targeting.test.ts src/lab_test/cli.integration.seed-and-demo.targeting.test.ts src/lab_test/cli.integration.factory-status.targeting.test.ts src/lab_test/migration.tracker.logic.test.ts src/lab_test/cache.commands.logic.test.ts",
|
|
57
|
+
"coverage:misses": "npm run test:coverage && node scripts/coverage-misses.cjs",
|
|
58
|
+
"test:critical": "jest --runInBand src/lab_test/cli.integration.scenario.lifecycle.test.ts src/lab_test/cli.integration.make-migration.targeting.test.ts src/lab_test/cli.integration.migrate.targeting.test.ts src/lab_test/cli.integration.seed-and-demo.targeting.test.ts src/lab_test/cli.integration.factory-status.targeting.test.ts src/lab_test/migration.tracker.logic.test.ts src/lab_test/cache.commands.logic.test.ts",
|
|
59
|
+
"test:pack-smoke": "node scripts/pack-smoke.js",
|
|
60
|
+
"test:pack-smoke:docker": "docker compose -f docker-compose.coverage-debug.yml run --rm pack-smoke",
|
|
61
|
+
"dev": "ts-node src/index.ts",
|
|
62
|
+
"cli": "ts-node bin/eloquent.ts",
|
|
63
|
+
"release": "npm run docs:sync-package-metadata && npm run docs:sync-supported && semantic-release"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@faker-js/faker": "^10.1.0",
|
|
67
|
+
"better-sqlite3": "12.2.0",
|
|
68
|
+
"chalk": "^5.6.2",
|
|
69
|
+
"commander": "^12.1.0",
|
|
70
|
+
"dotenv": "^17.2.3",
|
|
71
|
+
"figlet": "^1.9.3",
|
|
72
|
+
"memcached": "^2.2.2",
|
|
73
|
+
"mongodb": "^6.20.0",
|
|
74
|
+
"mysql2": "^3.15.2",
|
|
75
|
+
"pg": "^8.16.3",
|
|
76
|
+
"ts-node": "^10.9.2",
|
|
77
|
+
"typescript": "^5.9.3"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@eslint/js": "^9.38.0",
|
|
81
|
+
"@mintlify/cli": "^4.0.1049",
|
|
82
|
+
"@mintlify/validation": "^0.1.640",
|
|
83
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
84
|
+
"@semantic-release/commit-analyzer": "^12.0.0",
|
|
85
|
+
"@semantic-release/git": "^10.0.1",
|
|
86
|
+
"@semantic-release/github": "^10.0.4",
|
|
87
|
+
"@semantic-release/npm": "^12.0.2",
|
|
88
|
+
"@semantic-release/release-notes-generator": "^13.0.0",
|
|
89
|
+
"@types/express": "^5.0.0",
|
|
90
|
+
"@types/figlet": "^1.7.0",
|
|
91
|
+
"@types/jest": "^30.0.0",
|
|
92
|
+
"@types/memcached": "^2.2.10",
|
|
93
|
+
"@types/node": "^22.18.12",
|
|
94
|
+
"@types/pg": "^8.15.5",
|
|
95
|
+
"eslint": "^9.38.0",
|
|
96
|
+
"express": "^5.1.0",
|
|
97
|
+
"jest": "^30.2.0",
|
|
98
|
+
"semantic-release": "^24.2.9",
|
|
99
|
+
"ts-jest": "^29.4.5",
|
|
100
|
+
"tsx": "^4.20.6",
|
|
101
|
+
"typescript-eslint": "^8.46.1",
|
|
102
|
+
"vitest": "^4.0.7"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Request, Response } from "express";
|
|
2
|
+
import { {{PascalCase}}Service } from "{{serviceImportPath}}";
|
|
3
|
+
|
|
4
|
+
export class {{PascalCase}}Controller {
|
|
5
|
+
private service = new {{PascalCase}}Service();
|
|
6
|
+
|
|
7
|
+
// GET /{{camelCase}}
|
|
8
|
+
async index(req: Request, res: Response): Promise<void> {
|
|
9
|
+
try {
|
|
10
|
+
const data = await this.service.all();
|
|
11
|
+
res.json(data);
|
|
12
|
+
} catch (err) {
|
|
13
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
14
|
+
res.status(500).json({ error: message });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// GET /{{camelCase}}/:id
|
|
19
|
+
async show(req: Request, res: Response): Promise<void> {
|
|
20
|
+
try {
|
|
21
|
+
const id = req.params?.id as unknown as string | number | undefined;
|
|
22
|
+
const item = id ? await this.service.find(id) : null;
|
|
23
|
+
if (!item) {
|
|
24
|
+
res.status(404).json({ message: "{{PascalCase}} not found" });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
res.json(item);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
30
|
+
res.status(500).json({ error: message });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// POST /{{camelCase}}
|
|
35
|
+
async store(req: Request, res: Response): Promise<void> {
|
|
36
|
+
try {
|
|
37
|
+
const payload = req.body as Record<string, unknown>;
|
|
38
|
+
const created = await this.service.create(payload);
|
|
39
|
+
res.status(201).json(created);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
42
|
+
res.status(400).json({ error: message });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// PUT /{{camelCase}}/:id
|
|
47
|
+
async update(req: Request, res: Response): Promise<void> {
|
|
48
|
+
try {
|
|
49
|
+
const id = req.params?.id as unknown as string | number | undefined;
|
|
50
|
+
if (id === undefined) {
|
|
51
|
+
res.status(400).json({ error: "Missing id" });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const payload = req.body as Record<string, unknown>;
|
|
55
|
+
await this.service.update(id, payload);
|
|
56
|
+
res.json({ message: "{{PascalCase}} updated successfully" });
|
|
57
|
+
} catch (err) {
|
|
58
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
59
|
+
res.status(400).json({ error: message });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// DELETE /{{camelCase}}/:id
|
|
64
|
+
async destroy(req: Request, res: Response): Promise<void> {
|
|
65
|
+
try {
|
|
66
|
+
const id = req.params?.id as unknown as string | number | undefined;
|
|
67
|
+
if (id === undefined) {
|
|
68
|
+
res.status(400).json({ error: "Missing id" });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
await this.service.delete(id);
|
|
72
|
+
res.json({ message: "{{PascalCase}} deleted successfully" });
|
|
73
|
+
} catch (err) {
|
|
74
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
75
|
+
res.status(400).json({ error: message });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
{{softDeleteBlock}}
|
|
80
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Factory } from "{{packageImportPath}}";
|
|
2
|
+
import { {{ModelName}} } from "../../models/{{ModelName}}";
|
|
3
|
+
|
|
4
|
+
export class {{FactoryName}} extends Factory<{{ModelName}}> {
|
|
5
|
+
model = {{ModelName}};
|
|
6
|
+
|
|
7
|
+
definition(index = 0): Partial<{{ModelName}}> {
|
|
8
|
+
return {
|
|
9
|
+
{{#each fields}}
|
|
10
|
+
{{name}}: this.faker.{{fakerPath}},
|
|
11
|
+
{{/each}}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: {{name}}
|
|
3
|
+
* Generated by EloquentJS Artisan v2.0
|
|
4
|
+
* Date: {{date}}
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export async function up(db: DatabaseConnection) {
|
|
8
|
+
interface TableBuilder {
|
|
9
|
+
increments(column: string): this;
|
|
10
|
+
primary(): this;
|
|
11
|
+
string(column: string): this;
|
|
12
|
+
unique?(): this;
|
|
13
|
+
timestamp?(column: string): this;
|
|
14
|
+
timestamps?(useTz?: boolean, defaultNow?: boolean): this;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
await db.schema.createTable<TableBuilder>("{{tableName}}", (table) => {
|
|
18
|
+
table.increments("id").primary();
|
|
19
|
+
table.string("name");
|
|
20
|
+
// Add more columns here.
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function down(db: DatabaseConnection) {
|
|
25
|
+
await db.schema.dropTableIfExists("{{tableName}}");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface SchemaBuilder {
|
|
29
|
+
createTable<T>(name: string, callback: (table: T) => void): Promise<void>;
|
|
30
|
+
dropTableIfExists(name: string): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface DatabaseConnection {
|
|
34
|
+
schema: SchemaBuilder;
|
|
35
|
+
fn: { now(): string | Date };
|
|
36
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registerModels, type RegisterModelsOptions } from "{{packageImportPath}}";
|
|
2
|
+
{{#each models}}
|
|
3
|
+
import { {{name}} } from "{{importPath}}";
|
|
4
|
+
{{/each}}
|
|
5
|
+
|
|
6
|
+
export const {{modelsConstName}} = [
|
|
7
|
+
{{#each models}}
|
|
8
|
+
{{name}},
|
|
9
|
+
{{/each}}
|
|
10
|
+
] as const;
|
|
11
|
+
|
|
12
|
+
export function {{functionName}}(
|
|
13
|
+
options: RegisterModelsOptions = {},
|
|
14
|
+
): void {
|
|
15
|
+
registerModels([...{{modelsConstName}}], options);
|
|
16
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { {{modelBaseClass}}, ModelInstance } from "{{coreImportPath}}";
|
|
2
|
+
import { column, validate } from "{{schemaImportPath}}";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* {{ModelName}} model
|
|
6
|
+
* Auto-generated by EloquentJS ORM.
|
|
7
|
+
* Table: {{tableName}}
|
|
8
|
+
* Connection: {{connectionDescription}}
|
|
9
|
+
*/
|
|
10
|
+
type {{ModelName}}Attrs = {
|
|
11
|
+
{{attrsTypeBody}}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class {{ModelName}} extends {{modelBaseClass}}<{{ModelName}}Attrs> {
|
|
15
|
+
static tableName = "{{tableName}}";
|
|
16
|
+
static connectionName = {{connectionExpression}};
|
|
17
|
+
|
|
18
|
+
// Used by morphTo/morphMany relations.
|
|
19
|
+
static morphAlias = "{{tableName}}";
|
|
20
|
+
|
|
21
|
+
static schema = {
|
|
22
|
+
id: column("increments", undefined, { primary: true }),
|
|
23
|
+
name: validate(column("string", 255), { required: true, min: 3 }),
|
|
24
|
+
created_at: column("timestamp"),
|
|
25
|
+
updated_at: column("timestamp"),
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* RELATIONS EXAMPLES (uncomment and adapt):
|
|
29
|
+
* user: { kind: "relation", relation: "belongsTo", model: "User", options: { foreignKey: "user_id" } },
|
|
30
|
+
* image: { kind: "relation", relation: "morphOne", model: "Image", options: { morphName: "imageable" } },
|
|
31
|
+
* comments: { kind: "relation", relation: "morphMany", model: "Comment", options: { morphName: "commentable" } },
|
|
32
|
+
* commentable: { kind: "relation", relation: "morphTo", options: { morphName: "commentable" } },
|
|
33
|
+
*/
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* OPTIONAL MIXINS (uncomment as needed):
|
|
38
|
+
* static timestamps = true;
|
|
39
|
+
* static softDeletes = true;
|
|
40
|
+
* static cacheEnabled = true;
|
|
41
|
+
*
|
|
42
|
+
* INSTANCE PERSISTENCE EXAMPLES
|
|
43
|
+
* -------------------------------------------------
|
|
44
|
+
* const model = new {{ModelName}}();
|
|
45
|
+
* model.fill({ name: "Example" });
|
|
46
|
+
* await model.save();
|
|
47
|
+
* model.update({ name: "Example 2" });
|
|
48
|
+
* await model.save();
|
|
49
|
+
* await model.patch({ name: "Example 3" });
|
|
50
|
+
* -------------------------------------------------
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
static validationHooks = {
|
|
54
|
+
beforeValidate: async (data: Record<string, unknown>) => {
|
|
55
|
+
console.log("[beforeValidate] {{ModelName}}", data);
|
|
56
|
+
},
|
|
57
|
+
afterValidate: async (data: Record<string, unknown>) => {
|
|
58
|
+
console.log("[afterValidate] {{ModelName}}", data);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
static customRules = {
|
|
63
|
+
isUnique: async (_value: unknown) => {
|
|
64
|
+
// Example: add uniqueness logic here.
|
|
65
|
+
return true;
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
static modelEvents = {
|
|
70
|
+
beforeCreate: async (data: Record<string, unknown>) => {
|
|
71
|
+
console.log("[beforeCreate] {{ModelName}}", data);
|
|
72
|
+
},
|
|
73
|
+
afterCreate: async (record: Record<string, unknown> | null) => {
|
|
74
|
+
console.log("[afterCreate] {{ModelName}} created:", record);
|
|
75
|
+
},
|
|
76
|
+
beforeUpdate: async (data: Record<string, unknown>) => {
|
|
77
|
+
console.log("[beforeUpdate] {{ModelName}}", data);
|
|
78
|
+
},
|
|
79
|
+
afterUpdate: async (data: Record<string, unknown>) => {
|
|
80
|
+
console.log("[afterUpdate] {{ModelName}} updated:", data);
|
|
81
|
+
},
|
|
82
|
+
beforeDelete: async (id: number | string) => {
|
|
83
|
+
console.log("[beforeDelete] {{ModelName}}", id);
|
|
84
|
+
},
|
|
85
|
+
afterDelete: async (id: number | string) => {
|
|
86
|
+
console.log("[afterDelete] {{ModelName}}", id);
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
constructor() {
|
|
91
|
+
super("{{tableName}}", {{connectionExpression}});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface {{ModelName}} extends ModelInstance<{{ModelName}}Attrs> {}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { BaseModel, Factory, PivotHelperMixin } from "{{packageImportPath}}";
|
|
2
|
+
|
|
3
|
+
class PivotModelBase extends BaseModel {}
|
|
4
|
+
const PivotModel = PivotHelperMixin(PivotModelBase);
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Auto-generated pivot factory for many-to-many operations.
|
|
8
|
+
* Table: {{pivotTable}}
|
|
9
|
+
*/
|
|
10
|
+
export class {{PivotFactoryName}} extends Factory<BaseModel> {
|
|
11
|
+
readonly model = PivotModel;
|
|
12
|
+
|
|
13
|
+
definition(): Partial<Record<string, unknown>> {
|
|
14
|
+
return {
|
|
15
|
+
{{foreignKey}}: null,
|
|
16
|
+
{{relatedKey}}: null,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async createPivot(
|
|
21
|
+
foreignId: string | number,
|
|
22
|
+
relatedIds: Iterable<string | number>,
|
|
23
|
+
extraPivotAttrs?: Record<string, unknown>
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
type PivotInstanceLike = {
|
|
26
|
+
attach?: (
|
|
27
|
+
pivotTable: string,
|
|
28
|
+
foreignKey: string,
|
|
29
|
+
relatedKey: string,
|
|
30
|
+
foreignId: string | number,
|
|
31
|
+
relatedIds: Array<string | number>,
|
|
32
|
+
extra?: Record<string, unknown>
|
|
33
|
+
) => Promise<void>;
|
|
34
|
+
attachMany?: (entries: Array<Record<string, unknown>>) => Promise<void>;
|
|
35
|
+
withTransaction?: <R>(fn: () => Promise<R>) => Promise<R>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const PivotCtor = this.model as unknown as new () => PivotInstanceLike;
|
|
39
|
+
const pivotInstance = new PivotCtor();
|
|
40
|
+
const relatedArray = Array.from(relatedIds);
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
if (typeof pivotInstance.attachMany === "function") {
|
|
44
|
+
const entries = relatedArray.map((rid) => ({
|
|
45
|
+
["{{foreignKey}}"]: foreignId,
|
|
46
|
+
["{{relatedKey}}"]: rid,
|
|
47
|
+
...(extraPivotAttrs ?? {}),
|
|
48
|
+
}));
|
|
49
|
+
await pivotInstance.attachMany(entries);
|
|
50
|
+
} else if (typeof pivotInstance.attach === "function") {
|
|
51
|
+
const attach = pivotInstance.attach.bind(pivotInstance);
|
|
52
|
+
if (typeof pivotInstance.withTransaction === "function") {
|
|
53
|
+
await pivotInstance.withTransaction(async () => {
|
|
54
|
+
await attach(
|
|
55
|
+
"{{pivotTable}}",
|
|
56
|
+
"{{foreignKey}}",
|
|
57
|
+
"{{relatedKey}}",
|
|
58
|
+
foreignId,
|
|
59
|
+
relatedArray,
|
|
60
|
+
extraPivotAttrs
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
await attach(
|
|
65
|
+
"{{pivotTable}}",
|
|
66
|
+
"{{foreignKey}}",
|
|
67
|
+
"{{relatedKey}}",
|
|
68
|
+
foreignId,
|
|
69
|
+
relatedArray,
|
|
70
|
+
extraPivotAttrs
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
throw new Error("PivotHelperMixin does not expose attach/attachMany API.");
|
|
75
|
+
}
|
|
76
|
+
} catch (err) {
|
|
77
|
+
// eslint-disable-next-line no-console
|
|
78
|
+
console.error(
|
|
79
|
+
`[pivot-factory] Failed to attach pivot rows for ${foreignId} -> ${relatedArray}:`,
|
|
80
|
+
err
|
|
81
|
+
);
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated seeder
|
|
3
|
+
* Seeder: {{SeederName}}
|
|
4
|
+
* Linked model: {{ModelName}}
|
|
5
|
+
* Created at: {{Timestamp}}
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { {{FactoryName}} } from "../factories/{{FactoryName}}";
|
|
9
|
+
|
|
10
|
+
export async function {{SeederName}}() {
|
|
11
|
+
console.log("Running seeder: {{SeederName}}");
|
|
12
|
+
|
|
13
|
+
const factory = new {{FactoryName}}();
|
|
14
|
+
|
|
15
|
+
await factory.createMany({{Count}}, (instance, i) => {
|
|
16
|
+
console.log(`Created #${i + 1}:`, instance);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
console.log("Seeding completed for {{ModelName}}");
|
|
20
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { {{ModelName}} } from "{{modelImportPath}}";
|
|
2
|
+
|
|
3
|
+
export class {{ModelName}}Service {
|
|
4
|
+
async all() {
|
|
5
|
+
return new {{ModelName}}().all();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
async find(id: number | string) {
|
|
9
|
+
return {{ModelName}}.find(id);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async create(data: Record<string, unknown>) {
|
|
13
|
+
return {{ModelName}}.create(data);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async createMany(rows: Record<string, unknown>[]) {
|
|
17
|
+
return {{ModelName}}.createMany(rows);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async update(id: number | string, data: Record<string, unknown>) {
|
|
21
|
+
const model = await {{ModelName}}.find(id);
|
|
22
|
+
if (!model) return null;
|
|
23
|
+
|
|
24
|
+
model.update(data);
|
|
25
|
+
await model.save();
|
|
26
|
+
return model;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async delete(id: number | string) {
|
|
30
|
+
return {{ModelName}}.deleteById(id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async restore(id: number | string) {
|
|
34
|
+
return {{ModelName}}.restoreById(id);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async updateMany(ids: Array<number | string>, data: Record<string, unknown>) {
|
|
38
|
+
return {{ModelName}}.updateMany(ids, data);
|
|
39
|
+
}
|
|
40
|
+
}
|