@h3ravel/database 11.3.1 → 11.4.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/dist/index.cjs +40 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +40 -26
- package/dist/index.js.map +1 -1
- package/package.json +10 -5
package/dist/index.cjs
CHANGED
|
@@ -428,11 +428,10 @@ var MakeCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
428
428
|
table = guessed[0];
|
|
429
429
|
create = !!guessed[1];
|
|
430
430
|
}
|
|
431
|
-
|
|
431
|
+
let stub = await (0, node_fs_promises.readFile)(node_path.default.join(dbPkgPath, this.getStubName("migration", type, {
|
|
432
432
|
table,
|
|
433
433
|
create
|
|
434
|
-
}));
|
|
435
|
-
let stub = await (0, node_fs_promises.readFile)(stubPath, "utf-8");
|
|
434
|
+
})), "utf-8");
|
|
436
435
|
if (table !== null) stub = stub.replace(/DummyTable|{{\s*table\s*}}/g, table);
|
|
437
436
|
__h3ravel_shared.Logger.info("INFO: Creating Migration");
|
|
438
437
|
await this.kernel.ensureDirectoryExists(node_path.default.dirname(path$1));
|
|
@@ -456,8 +455,7 @@ var MakeCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
456
455
|
/** Check if the model already exists */
|
|
457
456
|
if (!force && await __h3ravel_shared.FileSystem.fileExists(path$1)) __h3ravel_shared.Logger.error(`ERORR: ${name} already exists`);
|
|
458
457
|
const dbPkgPath = __h3ravel_shared.FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
|
|
459
|
-
|
|
460
|
-
let stub = await (0, node_fs_promises.readFile)(stubPath, "utf-8");
|
|
458
|
+
let stub = await (0, node_fs_promises.readFile)(node_path.default.join(dbPkgPath, this.getStubName("seeder", type)), "utf-8");
|
|
461
459
|
stub = stub.replace(/{{ name }}/g, name);
|
|
462
460
|
await (0, node_fs_promises.writeFile)(path$1, stub);
|
|
463
461
|
__h3ravel_shared.Logger.info(`INFO: Seeder ${__h3ravel_shared.Logger.log(`[${node_path.default.relative(process.cwd(), path$1)}]`, "bold", false)} created successfully.`);
|
|
@@ -475,8 +473,7 @@ var MakeCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
475
473
|
/** Check if the model already exists */
|
|
476
474
|
if (!force && await __h3ravel_shared.FileSystem.fileExists(path$1)) __h3ravel_shared.Logger.error(`ERORR: ${name} model already exists`);
|
|
477
475
|
const dbPkgPath = __h3ravel_shared.FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
|
|
478
|
-
|
|
479
|
-
let stub = await (0, node_fs_promises.readFile)(stubPath, "utf-8");
|
|
476
|
+
let stub = await (0, node_fs_promises.readFile)(node_path.default.join(dbPkgPath, `dist/stubs/model-${type}.stub`), "utf-8");
|
|
480
477
|
stub = stub.replace(/{{ name }}/g, name);
|
|
481
478
|
await (0, node_fs_promises.writeFile)(path$1, stub);
|
|
482
479
|
__h3ravel_shared.Logger.info(`INFO: Model ${__h3ravel_shared.Logger.log(`[${node_path.default.relative(process.cwd(), path$1)}]`, "bold", false)} created successfully.`);
|
|
@@ -517,15 +514,17 @@ var MigrateCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
517
514
|
* @var string
|
|
518
515
|
*/
|
|
519
516
|
signature = `migrate:
|
|
520
|
-
{fresh : Drop all tables and re-run all migrations.}
|
|
517
|
+
{fresh : Drop all tables and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}
|
|
521
518
|
{install : Create the migration repository.}
|
|
522
|
-
{refresh : Reset and re-run all migrations.}
|
|
519
|
+
{refresh : Reset and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}
|
|
523
520
|
{reset : Rollback all database migrations.}
|
|
524
521
|
{rollback : Rollback the last database migration.}
|
|
525
522
|
{status : Show the status of each migration.}
|
|
526
523
|
{publish : Publish any migration files from installed packages. | {package : The package to publish migrations from}}
|
|
527
|
-
{^--
|
|
528
|
-
{
|
|
524
|
+
{^--c|connection=mysql : The database connection to use : [mysql, sqlite, mariadb, pgsql]}
|
|
525
|
+
{--seed : Seed the database}
|
|
526
|
+
{--seeder : The file name of the root seeder}
|
|
527
|
+
{^--force : Force the operation to run when in production}
|
|
529
528
|
`;
|
|
530
529
|
/**
|
|
531
530
|
* The console command description.
|
|
@@ -537,7 +536,9 @@ var MigrateCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
537
536
|
* Execute the console command.
|
|
538
537
|
*/
|
|
539
538
|
async handle() {
|
|
539
|
+
const force = this.option("force");
|
|
540
540
|
const command = this.dictionary.name ?? this.dictionary.baseCommand;
|
|
541
|
+
if (env("APP_ENV") === "production" && !force) this.error("INFO: Unable to run migration, your app is currently in production.");
|
|
541
542
|
this.connection = Object.entries(arquebusConfig(config("database"))).find(([client]) => client === config("database.default"))?.at(1);
|
|
542
543
|
this.connection.migrations = {
|
|
543
544
|
path: "migrations",
|
|
@@ -560,6 +561,7 @@ var MigrateCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
560
561
|
async migrateRun() {
|
|
561
562
|
try {
|
|
562
563
|
await new __h3ravel_arquebus_migrations.Migrate(this.databasePath).run(this.connection, this.options(), true);
|
|
564
|
+
if (this.option("seed")) await this.runSeeders();
|
|
563
565
|
} catch (e) {
|
|
564
566
|
__h3ravel_shared.Logger.error("ERROR: " + e);
|
|
565
567
|
}
|
|
@@ -570,29 +572,31 @@ var MigrateCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
570
572
|
async migrateFresh() {
|
|
571
573
|
try {
|
|
572
574
|
await new __h3ravel_arquebus_migrations.Migrate(this.databasePath).fresh(this.connection, this.options(), true);
|
|
575
|
+
if (this.option("seed")) await this.runSeeders();
|
|
573
576
|
} catch (e) {
|
|
574
577
|
__h3ravel_shared.Logger.error("ERROR: " + e);
|
|
575
578
|
}
|
|
576
579
|
}
|
|
577
580
|
/**
|
|
578
|
-
*
|
|
581
|
+
* Reset and re-run all migrations.
|
|
579
582
|
*/
|
|
580
|
-
async
|
|
583
|
+
async migrateRefresh() {
|
|
581
584
|
try {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
await migrate.prepareDatabase(migrator);
|
|
585
|
-
__h3ravel_shared.Logger.success("Migration repository installed.");
|
|
585
|
+
await new __h3ravel_arquebus_migrations.Migrate(this.databasePath).refresh(this.connection, this.options(), true);
|
|
586
|
+
if (this.option("seed")) await this.runSeeders();
|
|
586
587
|
} catch (e) {
|
|
587
588
|
__h3ravel_shared.Logger.error("ERROR: " + e);
|
|
588
589
|
}
|
|
589
590
|
}
|
|
590
591
|
/**
|
|
591
|
-
*
|
|
592
|
+
* Create the migration repository.
|
|
592
593
|
*/
|
|
593
|
-
async
|
|
594
|
+
async migrateInstall() {
|
|
594
595
|
try {
|
|
595
|
-
|
|
596
|
+
const migrate = new __h3ravel_arquebus_migrations.Migrate(this.databasePath);
|
|
597
|
+
const { migrator } = await migrate.setupConnection(this.connection);
|
|
598
|
+
await migrate.prepareDatabase(migrator);
|
|
599
|
+
__h3ravel_shared.Logger.success("Migration repository installed.");
|
|
596
600
|
} catch (e) {
|
|
597
601
|
__h3ravel_shared.Logger.error("ERROR: " + e);
|
|
598
602
|
}
|
|
@@ -673,6 +677,15 @@ var MigrateCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
673
677
|
]);
|
|
674
678
|
}
|
|
675
679
|
}
|
|
680
|
+
/**
|
|
681
|
+
* Run database seeders
|
|
682
|
+
*/
|
|
683
|
+
async runSeeders() {
|
|
684
|
+
await new SeedCommand(this.app, this.kernel).setInput({
|
|
685
|
+
class: this.option("seeder", "DatabaseSeeder"),
|
|
686
|
+
force: this.option("force")
|
|
687
|
+
}, [], [], {}, this.program).handle();
|
|
688
|
+
}
|
|
676
689
|
};
|
|
677
690
|
|
|
678
691
|
//#endregion
|
|
@@ -709,11 +722,11 @@ var SeedCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
709
722
|
const file = this.option("class");
|
|
710
723
|
const force = this.option("force");
|
|
711
724
|
const database = this.option("database");
|
|
712
|
-
|
|
713
|
-
if (env("APP_ENV") === "production" && !force)
|
|
725
|
+
this.newLine();
|
|
726
|
+
if (env("APP_ENV") === "production" && !force) this.error("INFO: Unable to run seeders, your app is currently in production.");
|
|
714
727
|
this.connection = database ?? config("database.default");
|
|
715
728
|
this.queryBuilder = DB.instance(this.connection);
|
|
716
|
-
if (!this.connection)
|
|
729
|
+
if (!this.connection) this.error("ERROR: Unknown database connection.");
|
|
717
730
|
let path$1 = node_path.default.join(process.cwd(), file);
|
|
718
731
|
const [f1, f2] = [__h3ravel_shared.FileSystem.resolveFileUp(__h3ravel_support.Str.snake(file), ["js", "ts"], database_path("seeders")), __h3ravel_shared.FileSystem.resolveFileUp(__h3ravel_support.Str.studly(file), ["js", "ts"], database_path("seeders"))];
|
|
719
732
|
if (!f1 && !f2) {
|
|
@@ -724,11 +737,12 @@ var SeedCommand = class extends __h3ravel_core.ConsoleCommand {
|
|
|
724
737
|
/**
|
|
725
738
|
* Now try to find the path knowing it's relative to database_path
|
|
726
739
|
*/
|
|
727
|
-
if (!await __h3ravel_shared.FileSystem.fileExists(path$1))
|
|
740
|
+
if (!await __h3ravel_shared.FileSystem.fileExists(path$1)) this.error(`ERROR: Seeder ${__h3ravel_shared.Logger.log(`[${file}]`, "bold", false)} not found.`);
|
|
728
741
|
} else path$1 = String(f1 ?? f2);
|
|
729
742
|
const { default: seeder } = await import(path$1);
|
|
730
743
|
if (seeder) {
|
|
731
|
-
|
|
744
|
+
this.info("INFO: Seeding database.");
|
|
745
|
+
this.newLine();
|
|
732
746
|
await new seeder(this.app, this).run(this.queryBuilder);
|
|
733
747
|
}
|
|
734
748
|
}
|
|
@@ -824,7 +838,7 @@ var DatabaseServiceProvider = class extends __h3ravel_core.ServiceProvider {
|
|
|
824
838
|
const connection = Object.entries(arquebusConfig(config$1.get("database"))).find(([client]) => client === config$1.get("database.default"))?.at(1);
|
|
825
839
|
if (connection) __h3ravel_arquebus.arquebus.addConnection(connection);
|
|
826
840
|
/** Register Musket Commands */
|
|
827
|
-
this.
|
|
841
|
+
this.registerCommands([
|
|
828
842
|
MigrateCommand,
|
|
829
843
|
MakeCommand,
|
|
830
844
|
SeedCommand
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["e","n","t","r","i","s","u","a","M","m","f","l","$","y","v","g","D","o","d","c","h","ConsoleCommand","path","FileSystem","npath","Logger","Str","stub: string","ConsoleCommand","Migrate","Logger","FileSystem","path","MigrationCreator","Resolver","ConsoleCommand","path","npath","FileSystem","Str","Logger","config","BaseModel","ServiceProvider","config","arquebus","BaseSeeder","app: Application","command?: SeedCommand","Arr","TaskManager"],"sources":["../src/Utils/TableGuesser.ts","../../../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js","../src/Commands/MakeCommand.ts","../src/Commands/MigrateCommand.ts","../src/Commands/SeedCommand.ts","../src/Configuration.ts","../src/Model.ts","../src/Providers/DatabaseServiceProvider.ts","../src/Query/DB.ts","../src/Seeder.ts"],"sourcesContent":["export class TableGuesser {\n static CREATE_PATTERNS = [\n /^create_(\\w+)_table$/,\n /^create_(\\w+)$/\n ]\n static CHANGE_PATTERNS = [\n /.+_(to|from|in)_(\\w+)_table$/,\n /.+_(to|from|in)_(\\w+)$/\n ]\n static guess (migration: string) {\n for (const pattern of TableGuesser.CREATE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[1], true]\n }\n }\n for (const pattern of TableGuesser.CHANGE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[2], false]\n }\n }\n return []\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport { TableGuesser } from '../Utils/TableGuesser'\nimport dayjs from 'dayjs'\nimport npath from 'node:path'\n\nexport class MakeCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {migration : Generates a new database migration class. \n | {--t|table : The table to migrate} \n | {--c|create : The table to be created} \n | {--l|type=ts : The file type to generate} \n } \n {factory : Create a new model factory.\n | {--force : Create the factory even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {seeder : Create a new seeder class.\n | {--force : Create the seeder even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {model : Create a new Eloquent model class. \n | {--api : Indicates if the generated controller should be an API resource controller} \n | {--c|controller : Create a new controller for the model} \n | {--f|factory : Create a new factory for the model} \n | {--m|migration : Create a new migration file for the model} \n | {--r|resource : Indicates if the generated controller should be a resource controller} \n | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model} \n | {--s|seed : Create a new seeder for the model}\n | {--l|type=ts : The file type to generate}\n | {--force : Create the model even if it already exists}\n } \n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n migration: 'makeMigration', // ✓\n factory: 'makeFactory',\n seeder: 'makeSeeder', // ✓\n model: 'makeModel', // ✓\n } as const\n\n console.log('')\n\n await this[methods[command]]()\n }\n\n /**\n * Generate a new database migration class\n */\n protected async makeMigration () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const datePrefix = dayjs().format('YYYY_MM_DD_HHmmss')\n const path = database_path(`migrations/${datePrefix}_${name}.${type}`)\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n\n let create = this.option('create', false)\n let table = this.option('table')\n if (!table && typeof create === 'string') {\n table = create\n create = true\n }\n\n if (!table) {\n const guessed = TableGuesser.guess(name)\n table = guessed[0]\n create = !!guessed[1]\n }\n\n const stubPath = npath.join(dbPkgPath, this.getStubName('migration', type, { table, create }))\n let stub = await readFile(stubPath, 'utf-8')\n\n if (table !== null) {\n stub = stub.replace(/DummyTable|{{\\s*table\\s*}}/g, table)\n }\n\n Logger.info('INFO: Creating Migration')\n\n await this.kernel.ensureDirectoryExists(npath.dirname(path))\n await writeFile(path, stub)\n\n Logger.split('INFO: Migration Created', Logger.log(npath.basename(path), 'gray', false))\n }\n\n /**\n * Create a new model factory\n */\n protected makeFactory () {\n Logger.success('Factory support is not yet available')\n }\n\n /**\n * Create a new seeder class\n */\n protected async makeSeeder () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n const path = database_path(`seeders/${Str.snake(name)}.${type}`)\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName('seeder', type))\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Seeder ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Generate a new Arquebus model class\n */\n protected async makeModel () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = app_path(`Models/${Str.lower(name)}.${type}`)\n\n /** The model is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} model already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, `dist/stubs/model-${type}.stub`)\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Model ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Ge the database migration file name\n * \n * @param table \n * @param create \n * @param type \n * @returns \n */\n getStubName (\n type: 'migration' | 'seeder' | 'model' | 'factory',\n ext: 'ts' | 'js' = 'ts',\n { table, create }: { table?: string, create?: boolean } = {}\n ) {\n let stub: string\n if (type === 'migration') {\n if (!table) {\n stub = `migration-${ext}.stub`\n }\n else if (create) {\n stub = `migration.create-${ext}.stub`\n }\n else {\n stub = `migration.update-${ext}.stub`\n }\n return 'dist/stubs/' + stub\n } else {\n return `dist/stubs/${type}-${ext}.stub`\n }\n }\n}\n","import { FileSystem, Logger, Resolver } from '@h3ravel/shared'\nimport { Migrate, MigrationCreator } from '@h3ravel/arquebus/migrations'\nimport { TBaseConfig, arquebusConfig } from '..'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport path from 'node:path'\n\nexport class MigrateCommand extends ConsoleCommand {\n /**\n * The current database connection\n */\n private connection!: TBaseConfig\n\n /** \n * The base path for all database operations\n */\n private databasePath: string = database_path()\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `migrate:\n {fresh : Drop all tables and re-run all migrations.}\n {install : Create the migration repository.}\n {refresh : Reset and re-run all migrations.}\n {reset : Rollback all database migrations.}\n {rollback : Rollback the last database migration.}\n {status : Show the status of each migration.}\n {publish : Publish any migration files from installed packages. | {package : The package to publish migrations from}}\n {^--s|seed : Seed the database}\n {^--c|connection=mysql : The database connection to use}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Run all pending migrations.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n const command = (this.dictionary.name ?? this.dictionary.baseCommand) as never\n\n this.connection = Object.entries(arquebusConfig(config('database')))\n .find(([client]) => client === config('database.default'))\n ?.at(1)\n\n this.connection.migrations = {\n path: 'migrations',\n table: 'migrations',\n }\n\n const methods = {\n migrate: 'migrateRun',\n fresh: 'migrateFresh',\n install: 'migrateInstall',\n refresh: 'migrateRefresh',\n reset: 'migrateReset',\n rollback: 'migrateRollback',\n status: 'migrateStatus',\n publish: 'migratePublish',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Run all pending migrations.\n */\n protected async migrateRun () {\n try {\n await new Migrate(this.databasePath).run(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Drop all tables and re-run all migrations.\n */\n protected async migrateFresh () {\n try {\n await new Migrate(this.databasePath).fresh(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Create the migration repository.\n */\n protected async migrateInstall () {\n try {\n const migrate = new Migrate(this.databasePath)\n const { migrator } = await migrate.setupConnection(this.connection)\n await migrate.prepareDatabase(migrator)\n\n Logger.success('Migration repository installed.')\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Reset and re-run all migrations.\n */\n protected async migrateRefresh () {\n try {\n await new Migrate(this.databasePath).refresh(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback all database migrations.\n */\n protected async migrateReset () {\n try {\n await new Migrate(this.databasePath).reset(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback the last database migration.\n */\n protected async migrateRollback () {\n try {\n await new Migrate(this.databasePath).rollback(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Show the status of each migration.\n */\n protected async migrateStatus () {\n const migrations = await new Migrate(this.databasePath, undefined, (msg, sts) => {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n ['`musket migrate:install`?', 'grey']\n ], ' ', false)\n\n if (sts) Logger[sts](msg + hint, sts === 'error', true)\n }).status(this.connection, this.options(), true)\n\n try {\n if (migrations.length > 0) {\n Logger.twoColumnDetail('Migration name', 'Batch / Status')\n\n migrations.forEach(migration => {\n const status = migration.ran\n ? Logger.parse([[`[${migration.batch}]`, 'white'], ['Ran', 'green']], ' ', false)\n : Logger.parse([['Pending', 'yellow']], '', false)\n Logger.twoColumnDetail(migration.name, status)\n })\n }\n else {\n Logger.info('No migrations found')\n }\n } catch (e) {\n Logger.error(['ERROR: ' + e, 'Did you run musket migrate:install'])\n }\n }\n\n\n\n /**\n * Publish any migration files from installed packages.\n */\n protected async migratePublish () {\n const name = this.argument('package')\n\n try {\n /** Find the requested package */\n const packagePath = FileSystem.findModulePkg(name) ?? null\n if (!packagePath) throw new Error('Package not found')\n\n /** Get the package,json and instanciate the migration creator */\n const pkgJson = (await import(path.join(packagePath, 'package.json')))\n const creator = new MigrationCreator(path.join(packagePath, pkgJson.migrations ?? 'migrations'))\n\n const info = Logger.parse([\n [' Publishing migrations from', 'white'],\n [`${pkgJson.name}@${pkgJson.version}`, ['italic', 'gray']]\n ], ' ', false)\n\n Logger.info(`INFO: ${info}`)\n\n try {\n /** Publish any existing migrations */\n await creator.publish(this.databasePath, (fileName) => {\n Logger.twoColumnDetail(fileName, Logger.parse([['PUBLISHED', 'green']], '', false))\n })\n } catch {\n Logger.error([`ERROR: ${name} has no publishable migrations.`])\n }\n } catch (e) {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n [`\\`${await Resolver.getPakageInstallCommand(name)}\\``, 'grey']\n ], ' ', false)\n\n const error = Logger.parse([\n ['Package `', 'white'],\n [name, 'grey'],\n ['` not found', 'white']\n ], '', false)\n\n Logger.error(['ERROR: ' + error, hint + '?', String(e)])\n }\n }\n}\n","import { FileSystem, Logger } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { DB } from '..'\nimport type { QueryBuilder } from '@h3ravel/arquebus'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class SeedCommand extends ConsoleCommand {\n /**\n * The current query builder instance\n */\n public queryBuilder!: QueryBuilder\n\n /**\n * The current database connection name\n */\n private connection!: string\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `db:seed\n {--class=DatabaseSeeder : The file name of the root seeder}\n {--d|database? : The database connection to use}\n {--force : Force the operation to run when in production}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Seed the database with records.'\n\n /**\n * Execute the console command.\n */\n public async handle () {\n const file = this.option('class')\n const force = this.option('force')\n const database = this.option('database')\n\n console.log('')\n\n if (env('APP_ENV') === 'production' && !force) {\n Logger.error('INFO: Unable to run seeders, your app is currently in production.')\n }\n\n this.connection = database ?? config('database.default')\n this.queryBuilder = DB.instance(this.connection)\n\n if (!this.connection) {\n Logger.error('ERROR: Unknown database connection.')\n }\n\n let path = npath.join(process.cwd(), file)\n\n const [f1, f2] = [\n FileSystem.resolveFileUp(Str.snake(file), ['js', 'ts'], database_path('seeders')),\n FileSystem.resolveFileUp(Str.studly(file), ['js', 'ts'], database_path('seeders')),\n ]\n\n if (!f1 && !f2) {\n /**\n * Try to find the path assuming it's relative to cwd\n */\n if (!await FileSystem.fileExists(path)) {\n path = database_path(npath.join('seeders', file))\n }\n\n /**\n * Now try to find the path knowing it's relative to database_path\n */\n if (!await FileSystem.fileExists(path)) {\n Logger.error(`ERROR: Seeder ${Logger.log(`[${file}]`, 'bold', false)} not found.`)\n }\n } else {\n path = String(f1 ?? f2)\n }\n\n const { default: seeder } = (await import(path))\n\n if (seeder) {\n Logger.info('INFO: Seeding database.')\n\n await new seeder(this.app, this).run(this.queryBuilder)\n }\n }\n}\n","/// <reference path=\"../../core/src/app.globals.d.ts\" />\nimport { Knex } from 'knex'\n\ntype TFunction = (...args: any[]) => any\n\nexport interface TField {\n type: 'VAR_STRING' | 'BLOB' | 'DATETIME' | 'TIMESTAMP' | 'LONG' | 'JSON'\n length: number\n db: string\n table: string\n name: string\n string: TFunction,\n buffer: TFunction\n geometry: TFunction\n}\n\nexport interface TBaseConfig {\n client: 'mysql' | 'mysql2' | 'sqlite3' | 'oracle' | 'mariadb' | 'pg'\n connection: {\n typeCast?(field: TField, next: TFunction): any\n dateStrings?: boolean\n }\n pool?: {\n afterCreate: (connection: TConfig, callback: (val: any, con: any) => void) => Promise<any>\n } | undefined\n connections?: Record<string, TConfig>\n migrations?: {\n table: string\n path: string\n },\n factories?: {\n path: string\n },\n seeders?: {\n path: string\n },\n models?: {\n path: string\n }\n}\n\nexport type TConfig = TBaseConfig & ({\n client: 'pg'\n connection: Knex.PgConnectionConfig\n} | {\n client: 'oracle'\n connection: Knex.OracleDbConnectionConfig\n} | {\n client: 'mysql2'\n connection: Knex.MySql2ConnectionConfig\n} | {\n client: 'mysql'\n connection: Knex.MySqlConnectionConfig\n} | {\n client: 'sqlite3'\n connection: Knex.Sqlite3ConnectionConfig\n useNullAsDefault?: boolean\n} | {\n client: 'mariadb'\n connection: Knex.MariaSqlConnectionConfig\n useNullAsDefault?: boolean\n})\n\nexport const arquebusConfig = (config: any) => {\n return {\n sqlite: {\n client: config.connections.sqlite.driver,\n connection: <Knex.Sqlite3ConnectionConfig>{\n filename: database_path(config.connections.sqlite.database),\n debug: config.connections.sqlite.debug,\n flags: config.connections.sqlite.flags,\n options: config.connections.sqlite.options,\n expirationChecker: config.connections.sqlite.expirationChecker\n },\n useNullAsDefault: config.connections.sqlite.useNullAsDefault,\n },\n mysql: {\n client: config.connections.mysql.driver,\n connection: <Knex.MySql2ConnectionConfig>{\n host: config.connections.mysql.host ?? 'localhost',\n port: config.connections.mysql.port ?? 3306,\n user: config.connections.mysql.username ?? 'root',\n password: config.connections.mysql.password,\n database: config.connections.mysql.database,\n charset: config.connections.mysql.charset,\n socketPath: config.connections.mysql.unix_socket,\n localAddress: config.connections.mysql.url,\n },\n },\n mariadb: {\n client: config.connections.mariadb.driver,\n connection: <Knex.MariaSqlConnectionConfig>{\n host: config.connections.mariadb.host ?? 'localhost',\n port: config.connections.mariadb.port ?? 3306,\n user: config.connections.mariadb.username ?? 'root',\n password: config.connections.mariadb.password,\n database: config.connections.mariadb.database,\n charset: config.connections.mariadb.charset,\n socketPath: config.connections.mariadb.unix_socket,\n localAddress: config.connections.mariadb.url,\n expirationChecker: config.connections.mariadb.expirationChecker\n },\n },\n pgsql: {\n client: 'pg',\n connection: <Knex.PgConnectionConfig>{\n host: config.connections.pgsql.host ?? 'localhost',\n port: config.connections.pgsql.port ?? 3306,\n user: config.connections.pgsql.username ?? 'root',\n password: config.connections.pgsql.password,\n database: config.connections.pgsql.database,\n charset: config.connections.mysql.charset,\n connectionString: config.connections.pgsql.url,\n expirationChecker: config.connections.pgsql.expirationChecker\n },\n }\n } as unknown as TBaseConfig\n}\n","import { Model as BaseModel } from '@h3ravel/arquebus'\n\nexport class Model<M extends BaseModel = any> extends BaseModel {\n /**\n * Retrieve the model for a bound value.\n * \n * @param {any} value \n * @param {String|null} field \n * @returns \n */\n public resolveRouteBinding (value: any, field: undefined | string | null = null): Promise<M> {\n return this.newQuery().where(field ?? 'ids', value).firstOrFail()! as Promise<M>\n }\n}\n","import { MakeCommand } from '../Commands/MakeCommand'\nimport { MigrateCommand } from '../Commands/MigrateCommand'\nimport { SeedCommand } from '../Commands/SeedCommand'\nimport { ServiceProvider } from '@h3ravel/core'\nimport { arquebus } from '@h3ravel/arquebus'\nimport { arquebusConfig } from '../Configuration'\n\n/**\n * Database connection, ORM, migrations.\n * \n * Register DatabaseManager and QueryBuilder if required.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n */\nexport class DatabaseServiceProvider extends ServiceProvider {\n public static priority = 994\n\n register () {\n const config = this.app.make('config')\n\n const connection = Object.entries(arquebusConfig(config.get('database')))\n .find(([client]) => client === config.get('database.default'))\n ?.at(1)\n\n if (connection) {\n arquebus.addConnection(connection)\n }\n\n /** Register Musket Commands */\n this.commands([MigrateCommand, MakeCommand, SeedCommand])\n }\n}\n","import { IQueryBuilder } from '@h3ravel/arquebus/types'\nimport { arquebus } from '@h3ravel/arquebus'\n\nexport class DB {\n connection?: string\n\n constructor(connection?: string) {\n if (connection) {\n this.connection = connection\n }\n }\n\n /**\n * New instance\n */\n public static table (name: string): IQueryBuilder {\n return new DB().builder().table(name)\n }\n\n /**\n * Builder table instance\n */\n public static instance (connection?: string) {\n return new DB(connection).builder()\n }\n\n /**\n * Builder transaction instance\n */\n public static transaction<C> (callback: (...args: C[]) => any) {\n return new DB().builder().transaction(callback)\n }\n\n private builder () {\n return arquebus.getInstance().connection(this.connection)\n }\n}\n","import { Application } from '@h3ravel/core'\nimport { Arr } from '@h3ravel/support'\nimport { Seeder as BaseSeeder } from '@h3ravel/arquebus'\nimport { SeedCommand } from './Commands/SeedCommand'\nimport { TaskManager } from '@h3ravel/shared'\n\nexport class Seeder extends BaseSeeder {\n /**\n * Seeders that have been called at least one time.\n */\n static called: Seeder[] = []\n\n constructor(public app: Application, public command?: SeedCommand) {\n super()\n }\n\n async run (_conn?: SeedCommand['queryBuilder'], ..._args: any[]) { };\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return this\n */\n public async call (className: typeof Seeder | typeof Seeder[], silent = false, parameters: any[] = []) {\n const classes = Arr.wrap(className)\n\n for (let i = 0; i < classes.length; i++) {\n const instance = this.resolve(classes[i])\n const name = instance.constructor.name\n\n if (silent === false) {\n await TaskManager.advancedTaskRunner(\n [[name, 'RUNNING'], [name, 'DONE']],\n async () => await instance.run(this.command!.queryBuilder, ...parameters)\n )\n } else {\n await instance.run(this.command!.queryBuilder, ...parameters)\n }\n\n Seeder.called.push(instance)\n }\n\n return this\n }\n\n /**\n * Resolve an instance of the given seeder class.\n *\n * @param className\n * \n * @return Seeder\n */\n protected resolve (className: typeof Seeder) {\n const instance = new (className as { new(app: any): Seeder })(this.app)\n\n if (this.command) {\n instance.setCommand(this.command)\n }\n\n return instance\n }\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return void\n */\n public async callWith (className: typeof Seeder | typeof Seeder[], parameters: any[]) {\n await this.call(className, false, parameters)\n }\n\n /**\n * Silently run the given seeder class.\n *\n * @param className\n * @param parameters\n * \n * @return void\n */\n public async callSilent (className: typeof Seeder | typeof Seeder[], parameters: any[] = []) {\n await this.call(className, true, parameters)\n }\n\n /**\n * Set the console command instance.\n *\n * @param command\n * \n * @return this\n */\n public setCommand (command: SeedCommand) {\n this.command = command\n\n return this\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAa,eAAb,MAAa,aAAa;CACtB,OAAO,kBAAkB,CACrB,wBACA,iBACH;CACD,OAAO,kBAAkB,CACrB,gCACA,yBACH;CACD,OAAO,MAAO,WAAmB;AAC7B,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAChD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACA,QAAO,CAAC,QAAQ,IAAI,KAAK;;AAGjC,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAChD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACA,QAAO,CAAC,QAAQ,IAAI,MAAM;;AAGlC,SAAO,EAAE;;;;;;;ACtBjB,EAAC,SAAS,GAAE,GAAE;AAAC,cAAU,OAAO,WAAS,eAAa,OAAO,SAAO,OAAO,UAAQ,GAAG,GAAC,cAAY,OAAO,UAA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BjE,IAAa,SAAb,MAAa,eAAeC,0BAAW;;;;CAInC,OAAO,SAAmB,EAAE;CAE5B,YAAY,AAAOC,KAAkB,AAAOC,SAAuB;AAC/D,SAAO;EADQ;EAAyB;;CAI5C,MAAM,IAAK,OAAqC,GAAG,OAAc;;;;;;;;;;CAWjE,MAAa,KAAM,WAA4C,SAAS,OAAO,aAAoB,EAAE,EAAE;EACnG,MAAM,UAAUC,sBAAI,KAAK,UAAU;AAEnC,OAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACrC,MAAM,WAAW,KAAK,QAAQ,QAAQ,GAAG;GACzC,MAAM,OAAO,SAAS,YAAY;AAElC,OAAI,WAAW,MACX,OAAMC,6BAAY,mBACd,CAAC,CAAC,MAAM,UAAU,EAAE,CAAC,MAAM,OAAO,CAAC,EACnC,YAAY,MAAM,SAAS,IAAI,KAAK,QAAS,cAAc,GAAG,WAAW,CAC5E;OAED,OAAM,SAAS,IAAI,KAAK,QAAS,cAAc,GAAG,WAAW;AAGjE,UAAO,OAAO,KAAK,SAAS;;AAGhC,SAAO;;;;;;;;;CAUX,AAAU,QAAS,WAA0B;EACzC,MAAM,WAAW,IAAK,UAAwC,KAAK,IAAI;AAEvE,MAAI,KAAK,QACL,UAAS,WAAW,KAAK,QAAQ;AAGrC,SAAO;;;;;;;;;;;CAYX,MAAa,SAAU,WAA4C,YAAmB;AAClF,QAAM,KAAK,KAAK,WAAW,OAAO,WAAW;;;;;;;;;;CAWjD,MAAa,WAAY,WAA4C,aAAoB,EAAE,EAAE;AACzF,QAAM,KAAK,KAAK,WAAW,MAAM,WAAW;;;;;;;;;CAUhD,AAAO,WAAY,SAAsB;AACrC,OAAK,UAAU;AAEf,SAAO"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["e","n","t","r","i","s","u","a","M","m","f","l","$","y","v","g","D","o","d","c","h","ConsoleCommand","path","FileSystem","npath","Logger","Str","stub: string","ConsoleCommand","Migrate","Logger","FileSystem","path","MigrationCreator","Resolver","ConsoleCommand","path","npath","FileSystem","Str","Logger","config","BaseModel","ServiceProvider","config","arquebus","BaseSeeder","app: Application","command?: SeedCommand","Arr","TaskManager"],"sources":["../src/Utils/TableGuesser.ts","../../../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js","../src/Commands/MakeCommand.ts","../src/Commands/MigrateCommand.ts","../src/Commands/SeedCommand.ts","../src/Configuration.ts","../src/Model.ts","../src/Providers/DatabaseServiceProvider.ts","../src/Query/DB.ts","../src/Seeder.ts"],"sourcesContent":["export class TableGuesser {\n static CREATE_PATTERNS = [\n /^create_(\\w+)_table$/,\n /^create_(\\w+)$/\n ]\n static CHANGE_PATTERNS = [\n /.+_(to|from|in)_(\\w+)_table$/,\n /.+_(to|from|in)_(\\w+)$/\n ]\n static guess (migration: string) {\n for (const pattern of TableGuesser.CREATE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[1], true]\n }\n }\n for (const pattern of TableGuesser.CHANGE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[2], false]\n }\n }\n return []\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport { TableGuesser } from '../Utils/TableGuesser'\nimport dayjs from 'dayjs'\nimport npath from 'node:path'\n\nexport class MakeCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {migration : Generates a new database migration class. \n | {--t|table : The table to migrate} \n | {--c|create : The table to be created} \n | {--l|type=ts : The file type to generate} \n } \n {factory : Create a new model factory.\n | {--force : Create the factory even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {seeder : Create a new seeder class.\n | {--force : Create the seeder even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {model : Create a new Eloquent model class. \n | {--api : Indicates if the generated controller should be an API resource controller} \n | {--c|controller : Create a new controller for the model} \n | {--f|factory : Create a new factory for the model} \n | {--m|migration : Create a new migration file for the model} \n | {--r|resource : Indicates if the generated controller should be a resource controller} \n | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model} \n | {--s|seed : Create a new seeder for the model}\n | {--l|type=ts : The file type to generate}\n | {--force : Create the model even if it already exists}\n } \n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n migration: 'makeMigration', // ✓\n factory: 'makeFactory',\n seeder: 'makeSeeder', // ✓\n model: 'makeModel', // ✓\n } as const\n\n console.log('')\n\n await this[methods[command]]()\n }\n\n /**\n * Generate a new database migration class\n */\n protected async makeMigration () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const datePrefix = dayjs().format('YYYY_MM_DD_HHmmss')\n const path = database_path(`migrations/${datePrefix}_${name}.${type}`)\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n\n let create = this.option('create', false)\n let table = this.option('table')\n if (!table && typeof create === 'string') {\n table = create\n create = true\n }\n\n if (!table) {\n const guessed = TableGuesser.guess(name)\n table = guessed[0]\n create = !!guessed[1]\n }\n\n const stubPath = npath.join(dbPkgPath, this.getStubName('migration', type, { table, create }))\n let stub = await readFile(stubPath, 'utf-8')\n\n if (table !== null) {\n stub = stub.replace(/DummyTable|{{\\s*table\\s*}}/g, table)\n }\n\n Logger.info('INFO: Creating Migration')\n\n await this.kernel.ensureDirectoryExists(npath.dirname(path))\n await writeFile(path, stub)\n\n Logger.split('INFO: Migration Created', Logger.log(npath.basename(path), 'gray', false))\n }\n\n /**\n * Create a new model factory\n */\n protected makeFactory () {\n Logger.success('Factory support is not yet available')\n }\n\n /**\n * Create a new seeder class\n */\n protected async makeSeeder () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n const path = database_path(`seeders/${Str.snake(name)}.${type}`)\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName('seeder', type))\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Seeder ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Generate a new Arquebus model class\n */\n protected async makeModel () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = app_path(`Models/${Str.lower(name)}.${type}`)\n\n /** The model is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} model already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, `dist/stubs/model-${type}.stub`)\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Model ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Ge the database migration file name\n * \n * @param table \n * @param create \n * @param type \n * @returns \n */\n getStubName (\n type: 'migration' | 'seeder' | 'model' | 'factory',\n ext: 'ts' | 'js' = 'ts',\n { table, create }: { table?: string, create?: boolean } = {}\n ) {\n let stub: string\n if (type === 'migration') {\n if (!table) {\n stub = `migration-${ext}.stub`\n }\n else if (create) {\n stub = `migration.create-${ext}.stub`\n }\n else {\n stub = `migration.update-${ext}.stub`\n }\n return 'dist/stubs/' + stub\n } else {\n return `dist/stubs/${type}-${ext}.stub`\n }\n }\n}\n","import { FileSystem, Logger, Resolver } from '@h3ravel/shared'\nimport { Migrate, MigrationCreator } from '@h3ravel/arquebus/migrations'\nimport { SeedCommand, TBaseConfig, arquebusConfig } from '..'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport path from 'node:path'\n\nexport class MigrateCommand extends ConsoleCommand {\n /**\n * The current database connection\n */\n private connection!: TBaseConfig\n\n /** \n * The base path for all database operations\n */\n private databasePath: string = database_path()\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `migrate:\n {fresh : Drop all tables and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}\n {install : Create the migration repository.}\n {refresh : Reset and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}\n {reset : Rollback all database migrations.}\n {rollback : Rollback the last database migration.}\n {status : Show the status of each migration.}\n {publish : Publish any migration files from installed packages. | {package : The package to publish migrations from}}\n {^--c|connection=mysql : The database connection to use : [mysql, sqlite, mariadb, pgsql]}\n {--seed : Seed the database}\n {--seeder : The file name of the root seeder}\n {^--force : Force the operation to run when in production}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Run all pending migrations.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n const force = this.option('force')\n const command = (this.dictionary.name ?? this.dictionary.baseCommand) as never\n\n if (env('APP_ENV') === 'production' && !force) {\n this.error('INFO: Unable to run migration, your app is currently in production.')\n }\n\n this.connection = Object.entries(arquebusConfig(config('database')))\n .find(([client]) => client === config('database.default'))\n ?.at(1)\n\n this.connection.migrations = {\n path: 'migrations',\n table: 'migrations',\n }\n\n const methods = {\n migrate: 'migrateRun',\n fresh: 'migrateFresh',\n install: 'migrateInstall',\n refresh: 'migrateRefresh',\n reset: 'migrateReset',\n rollback: 'migrateRollback',\n status: 'migrateStatus',\n publish: 'migratePublish',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Run all pending migrations.\n */\n protected async migrateRun () {\n try {\n await new Migrate(this.databasePath).run(this.connection, this.options(), true)\n\n if (this.option('seed')) {\n await this.runSeeders()\n }\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Drop all tables and re-run all migrations.\n */\n protected async migrateFresh () {\n try {\n await new Migrate(this.databasePath).fresh(this.connection, this.options(), true)\n\n if (this.option('seed')) {\n await this.runSeeders()\n }\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Reset and re-run all migrations.\n */\n protected async migrateRefresh () {\n try {\n await new Migrate(this.databasePath).refresh(this.connection, this.options(), true)\n\n if (this.option('seed')) {\n await this.runSeeders()\n }\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Create the migration repository.\n */\n protected async migrateInstall () {\n try {\n const migrate = new Migrate(this.databasePath)\n const { migrator } = await migrate.setupConnection(this.connection)\n await migrate.prepareDatabase(migrator)\n\n Logger.success('Migration repository installed.')\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback all database migrations.\n */\n protected async migrateReset () {\n try {\n await new Migrate(this.databasePath).reset(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback the last database migration.\n */\n protected async migrateRollback () {\n try {\n await new Migrate(this.databasePath).rollback(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Show the status of each migration.\n */\n protected async migrateStatus () {\n const migrations = await new Migrate(this.databasePath, undefined, (msg, sts) => {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n ['`musket migrate:install`?', 'grey']\n ], ' ', false)\n\n if (sts) Logger[sts](msg + hint, sts === 'error', true)\n }).status(this.connection, this.options(), true)\n\n try {\n if (migrations.length > 0) {\n Logger.twoColumnDetail('Migration name', 'Batch / Status')\n\n migrations.forEach(migration => {\n const status = migration.ran\n ? Logger.parse([[`[${migration.batch}]`, 'white'], ['Ran', 'green']], ' ', false)\n : Logger.parse([['Pending', 'yellow']], '', false)\n Logger.twoColumnDetail(migration.name, status)\n })\n }\n else {\n Logger.info('No migrations found')\n }\n } catch (e) {\n Logger.error(['ERROR: ' + e, 'Did you run musket migrate:install'])\n }\n }\n\n\n\n /**\n * Publish any migration files from installed packages.\n */\n protected async migratePublish () {\n const name = this.argument('package')\n\n try {\n /** Find the requested package */\n const packagePath = FileSystem.findModulePkg(name) ?? null\n if (!packagePath) throw new Error('Package not found')\n\n /** Get the package,json and instanciate the migration creator */\n const pkgJson = (await import(path.join(packagePath, 'package.json')))\n const creator = new MigrationCreator(path.join(packagePath, pkgJson.migrations ?? 'migrations'))\n\n const info = Logger.parse([\n [' Publishing migrations from', 'white'],\n [`${pkgJson.name}@${pkgJson.version}`, ['italic', 'gray']]\n ], ' ', false)\n\n Logger.info(`INFO: ${info}`)\n\n try {\n /** Publish any existing migrations */\n await creator.publish(this.databasePath, (fileName) => {\n Logger.twoColumnDetail(fileName, Logger.parse([['PUBLISHED', 'green']], '', false))\n })\n } catch {\n Logger.error([`ERROR: ${name} has no publishable migrations.`])\n }\n } catch (e) {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n [`\\`${await Resolver.getPakageInstallCommand(name)}\\``, 'grey']\n ], ' ', false)\n\n const error = Logger.parse([\n ['Package `', 'white'],\n [name, 'grey'],\n ['` not found', 'white']\n ], '', false)\n\n Logger.error(['ERROR: ' + error, hint + '?', String(e)])\n }\n }\n\n /**\n * Run database seeders\n */\n private async runSeeders () {\n await new SeedCommand(this.app, this.kernel)\n .setInput(\n { class: this.option('seeder', 'DatabaseSeeder'), force: this.option('force') },\n [],\n [],\n {},\n this.program\n )\n .handle()\n }\n}\n","import { FileSystem, Logger } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { DB } from '..'\nimport type { QueryBuilder } from '@h3ravel/arquebus'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class SeedCommand extends ConsoleCommand {\n /**\n * The current query builder instance\n */\n public queryBuilder!: QueryBuilder\n\n /**\n * The current database connection name\n */\n private connection!: string\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `db:seed\n {--class=DatabaseSeeder : The file name of the root seeder}\n {--d|database? : The database connection to use}\n {--force : Force the operation to run when in production}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Seed the database with records.'\n\n /**\n * Execute the console command.\n */\n public async handle () {\n const file = this.option('class')\n const force = this.option('force')\n const database = this.option('database')\n\n this.newLine()\n\n if (env('APP_ENV') === 'production' && !force) {\n this.error('INFO: Unable to run seeders, your app is currently in production.')\n }\n\n this.connection = database ?? config('database.default')\n this.queryBuilder = DB.instance(this.connection)\n\n if (!this.connection) {\n this.error('ERROR: Unknown database connection.')\n }\n\n let path = npath.join(process.cwd(), file)\n\n const [f1, f2] = [\n FileSystem.resolveFileUp(Str.snake(file), ['js', 'ts'], database_path('seeders')),\n FileSystem.resolveFileUp(Str.studly(file), ['js', 'ts'], database_path('seeders')),\n ]\n\n if (!f1 && !f2) {\n /**\n * Try to find the path assuming it's relative to cwd\n */\n if (!await FileSystem.fileExists(path)) {\n path = database_path(npath.join('seeders', file))\n }\n\n /**\n * Now try to find the path knowing it's relative to database_path\n */\n if (!await FileSystem.fileExists(path)) {\n this.error(`ERROR: Seeder ${Logger.log(`[${file}]`, 'bold', false)} not found.`)\n }\n } else {\n path = String(f1 ?? f2)\n }\n\n const { default: seeder } = (await import(path))\n\n if (seeder) {\n this.info('INFO: Seeding database.')\n this.newLine()\n\n await new seeder(this.app, this).run(this.queryBuilder)\n }\n }\n}\n","/// <reference path=\"../../core/src/app.globals.d.ts\" />\nimport { Knex } from 'knex'\n\ntype TFunction = (...args: any[]) => any\n\nexport interface TField {\n type: 'VAR_STRING' | 'BLOB' | 'DATETIME' | 'TIMESTAMP' | 'LONG' | 'JSON'\n length: number\n db: string\n table: string\n name: string\n string: TFunction,\n buffer: TFunction\n geometry: TFunction\n}\n\nexport interface TBaseConfig {\n client: 'mysql' | 'mysql2' | 'sqlite3' | 'oracle' | 'mariadb' | 'pg'\n connection: {\n typeCast?(field: TField, next: TFunction): any\n dateStrings?: boolean\n }\n pool?: {\n afterCreate: (connection: TConfig, callback: (val: any, con: any) => void) => Promise<any>\n } | undefined\n connections?: Record<string, TConfig>\n migrations?: {\n table: string\n path: string\n },\n factories?: {\n path: string\n },\n seeders?: {\n path: string\n },\n models?: {\n path: string\n }\n}\n\nexport type TConfig = TBaseConfig & ({\n client: 'pg'\n connection: Knex.PgConnectionConfig\n} | {\n client: 'oracle'\n connection: Knex.OracleDbConnectionConfig\n} | {\n client: 'mysql2'\n connection: Knex.MySql2ConnectionConfig\n} | {\n client: 'mysql'\n connection: Knex.MySqlConnectionConfig\n} | {\n client: 'sqlite3'\n connection: Knex.Sqlite3ConnectionConfig\n useNullAsDefault?: boolean\n} | {\n client: 'mariadb'\n connection: Knex.MariaSqlConnectionConfig\n useNullAsDefault?: boolean\n})\n\nexport const arquebusConfig = (config: any) => {\n return {\n sqlite: {\n client: config.connections.sqlite.driver,\n connection: <Knex.Sqlite3ConnectionConfig>{\n filename: database_path(config.connections.sqlite.database),\n debug: config.connections.sqlite.debug,\n flags: config.connections.sqlite.flags,\n options: config.connections.sqlite.options,\n expirationChecker: config.connections.sqlite.expirationChecker\n },\n useNullAsDefault: config.connections.sqlite.useNullAsDefault,\n },\n mysql: {\n client: config.connections.mysql.driver,\n connection: <Knex.MySql2ConnectionConfig>{\n host: config.connections.mysql.host ?? 'localhost',\n port: config.connections.mysql.port ?? 3306,\n user: config.connections.mysql.username ?? 'root',\n password: config.connections.mysql.password,\n database: config.connections.mysql.database,\n charset: config.connections.mysql.charset,\n socketPath: config.connections.mysql.unix_socket,\n localAddress: config.connections.mysql.url,\n },\n },\n mariadb: {\n client: config.connections.mariadb.driver,\n connection: <Knex.MariaSqlConnectionConfig>{\n host: config.connections.mariadb.host ?? 'localhost',\n port: config.connections.mariadb.port ?? 3306,\n user: config.connections.mariadb.username ?? 'root',\n password: config.connections.mariadb.password,\n database: config.connections.mariadb.database,\n charset: config.connections.mariadb.charset,\n socketPath: config.connections.mariadb.unix_socket,\n localAddress: config.connections.mariadb.url,\n expirationChecker: config.connections.mariadb.expirationChecker\n },\n },\n pgsql: {\n client: 'pg',\n connection: <Knex.PgConnectionConfig>{\n host: config.connections.pgsql.host ?? 'localhost',\n port: config.connections.pgsql.port ?? 3306,\n user: config.connections.pgsql.username ?? 'root',\n password: config.connections.pgsql.password,\n database: config.connections.pgsql.database,\n charset: config.connections.mysql.charset,\n connectionString: config.connections.pgsql.url,\n expirationChecker: config.connections.pgsql.expirationChecker\n },\n }\n } as unknown as TBaseConfig\n}\n","import { Model as BaseModel } from '@h3ravel/arquebus'\n\nexport class Model<M extends BaseModel = any> extends BaseModel {\n /**\n * Retrieve the model for a bound value.\n * \n * @param {any} value \n * @param {String|null} field \n * @returns \n */\n public resolveRouteBinding (value: any, field: undefined | string | null = null): Promise<M> {\n return this.newQuery().where(field ?? 'ids', value).firstOrFail()! as Promise<M>\n }\n}\n","import { MakeCommand } from '../Commands/MakeCommand'\nimport { MigrateCommand } from '../Commands/MigrateCommand'\nimport { SeedCommand } from '../Commands/SeedCommand'\nimport { ServiceProvider } from '@h3ravel/core'\nimport { arquebus } from '@h3ravel/arquebus'\nimport { arquebusConfig } from '../Configuration'\n\n/**\n * Database connection, ORM, migrations.\n * \n * Register DatabaseManager and QueryBuilder if required.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n */\nexport class DatabaseServiceProvider extends ServiceProvider {\n public static priority = 994\n\n register () {\n const config = this.app.make('config')\n\n const connection = Object.entries(arquebusConfig(config.get('database')))\n .find(([client]) => client === config.get('database.default'))\n ?.at(1)\n\n if (connection) {\n arquebus.addConnection(connection)\n }\n\n /** Register Musket Commands */\n this.registerCommands([MigrateCommand, MakeCommand, SeedCommand])\n }\n}\n","import { IQueryBuilder } from '@h3ravel/arquebus/types'\nimport { arquebus } from '@h3ravel/arquebus'\n\nexport class DB {\n connection?: string\n\n constructor(connection?: string) {\n if (connection) {\n this.connection = connection\n }\n }\n\n /**\n * New instance\n */\n public static table (name: string): IQueryBuilder {\n return new DB().builder().table(name)\n }\n\n /**\n * Builder table instance\n */\n public static instance (connection?: string) {\n return new DB(connection).builder()\n }\n\n /**\n * Builder transaction instance\n */\n public static transaction<C> (callback: (...args: C[]) => any) {\n return new DB().builder().transaction(callback)\n }\n\n private builder () {\n return arquebus.getInstance().connection(this.connection)\n }\n}\n","import { Application } from '@h3ravel/core'\nimport { Arr } from '@h3ravel/support'\nimport { Seeder as BaseSeeder } from '@h3ravel/arquebus'\nimport { SeedCommand } from './Commands/SeedCommand'\nimport { TaskManager } from '@h3ravel/shared'\n\nexport class Seeder extends BaseSeeder {\n /**\n * Seeders that have been called at least one time.\n */\n static called: Seeder[] = []\n\n constructor(public app: Application, public command?: SeedCommand) {\n super()\n }\n\n async run (_conn?: SeedCommand['queryBuilder'], ..._args: any[]) { };\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return this\n */\n public async call (className: typeof Seeder | typeof Seeder[], silent = false, parameters: any[] = []) {\n const classes = Arr.wrap(className)\n\n for (let i = 0; i < classes.length; i++) {\n const instance = this.resolve(classes[i])\n const name = instance.constructor.name\n\n if (silent === false) {\n await TaskManager.advancedTaskRunner(\n [[name, 'RUNNING'], [name, 'DONE']],\n async () => await instance.run(this.command!.queryBuilder, ...parameters)\n )\n } else {\n await instance.run(this.command!.queryBuilder, ...parameters)\n }\n\n Seeder.called.push(instance)\n }\n\n return this\n }\n\n /**\n * Resolve an instance of the given seeder class.\n *\n * @param className\n * \n * @return Seeder\n */\n protected resolve (className: typeof Seeder) {\n const instance = new (className as { new(app: any): Seeder })(this.app)\n\n if (this.command) {\n instance.setCommand(this.command)\n }\n\n return instance\n }\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return void\n */\n public async callWith (className: typeof Seeder | typeof Seeder[], parameters: any[]) {\n await this.call(className, false, parameters)\n }\n\n /**\n * Silently run the given seeder class.\n *\n * @param className\n * @param parameters\n * \n * @return void\n */\n public async callSilent (className: typeof Seeder | typeof Seeder[], parameters: any[] = []) {\n await this.call(className, true, parameters)\n }\n\n /**\n * Set the console command instance.\n *\n * @param command\n * \n * @return this\n */\n public setCommand (command: SeedCommand) {\n this.command = command\n\n return this\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAa,eAAb,MAAa,aAAa;CACtB,OAAO,kBAAkB,CACrB,wBACA,iBACH;CACD,OAAO,kBAAkB,CACrB,gCACA,yBACH;CACD,OAAO,MAAO,WAAmB;AAC7B,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAChD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACA,QAAO,CAAC,QAAQ,IAAI,KAAK;;AAGjC,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAChD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACA,QAAO,CAAC,QAAQ,IAAI,MAAM;;AAGlC,SAAO,EAAE;;;;;;;ACtBjB,EAAC,SAAS,GAAE,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;CAUX,AAAU,QAAS,WAA0B;EACzC,MAAM,WAAW,IAAK,UAAwC,KAAK,IAAI;AAEvE,MAAI,KAAK,QACL,UAAS,WAAW,KAAK,QAAQ;AAGrC,SAAO;;;;;;;;;;;CAYX,MAAa,SAAU,WAA4C,YAAmB;AAClF,QAAM,KAAK,KAAK,WAAW,OAAO,WAAW;;;;;;;;;;CAWjD,MAAa,WAAY,WAA4C,aAAoB,EAAE,EAAE;AACzF,QAAM,KAAK,KAAK,WAAW,MAAM,WAAW;;;;;;;;;CAUhD,AAAO,WAAY,SAAsB;AACrC,OAAK,UAAU;AAEf,SAAO"}
|
package/dist/index.d.cts
CHANGED
|
@@ -88,14 +88,14 @@ declare class MigrateCommand extends ConsoleCommand {
|
|
|
88
88
|
* Drop all tables and re-run all migrations.
|
|
89
89
|
*/
|
|
90
90
|
protected migrateFresh(): Promise<void>;
|
|
91
|
-
/**
|
|
92
|
-
* Create the migration repository.
|
|
93
|
-
*/
|
|
94
|
-
protected migrateInstall(): Promise<void>;
|
|
95
91
|
/**
|
|
96
92
|
* Reset and re-run all migrations.
|
|
97
93
|
*/
|
|
98
94
|
protected migrateRefresh(): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Create the migration repository.
|
|
97
|
+
*/
|
|
98
|
+
protected migrateInstall(): Promise<void>;
|
|
99
99
|
/**
|
|
100
100
|
* Rollback all database migrations.
|
|
101
101
|
*/
|
|
@@ -112,6 +112,10 @@ declare class MigrateCommand extends ConsoleCommand {
|
|
|
112
112
|
* Publish any migration files from installed packages.
|
|
113
113
|
*/
|
|
114
114
|
protected migratePublish(): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Run database seeders
|
|
117
|
+
*/
|
|
118
|
+
private runSeeders;
|
|
115
119
|
}
|
|
116
120
|
//#endregion
|
|
117
121
|
//#region src/Commands/SeedCommand.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -88,14 +88,14 @@ declare class MigrateCommand extends ConsoleCommand {
|
|
|
88
88
|
* Drop all tables and re-run all migrations.
|
|
89
89
|
*/
|
|
90
90
|
protected migrateFresh(): Promise<void>;
|
|
91
|
-
/**
|
|
92
|
-
* Create the migration repository.
|
|
93
|
-
*/
|
|
94
|
-
protected migrateInstall(): Promise<void>;
|
|
95
91
|
/**
|
|
96
92
|
* Reset and re-run all migrations.
|
|
97
93
|
*/
|
|
98
94
|
protected migrateRefresh(): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Create the migration repository.
|
|
97
|
+
*/
|
|
98
|
+
protected migrateInstall(): Promise<void>;
|
|
99
99
|
/**
|
|
100
100
|
* Rollback all database migrations.
|
|
101
101
|
*/
|
|
@@ -112,6 +112,10 @@ declare class MigrateCommand extends ConsoleCommand {
|
|
|
112
112
|
* Publish any migration files from installed packages.
|
|
113
113
|
*/
|
|
114
114
|
protected migratePublish(): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Run database seeders
|
|
117
|
+
*/
|
|
118
|
+
private runSeeders;
|
|
115
119
|
}
|
|
116
120
|
//#endregion
|
|
117
121
|
//#region src/Commands/SeedCommand.d.ts
|
package/dist/index.js
CHANGED
|
@@ -422,11 +422,10 @@ var MakeCommand = class extends ConsoleCommand {
|
|
|
422
422
|
table = guessed[0];
|
|
423
423
|
create = !!guessed[1];
|
|
424
424
|
}
|
|
425
|
-
|
|
425
|
+
let stub = await readFile(npath.join(dbPkgPath, this.getStubName("migration", type, {
|
|
426
426
|
table,
|
|
427
427
|
create
|
|
428
|
-
}));
|
|
429
|
-
let stub = await readFile(stubPath, "utf-8");
|
|
428
|
+
})), "utf-8");
|
|
430
429
|
if (table !== null) stub = stub.replace(/DummyTable|{{\s*table\s*}}/g, table);
|
|
431
430
|
Logger.info("INFO: Creating Migration");
|
|
432
431
|
await this.kernel.ensureDirectoryExists(npath.dirname(path));
|
|
@@ -450,8 +449,7 @@ var MakeCommand = class extends ConsoleCommand {
|
|
|
450
449
|
/** Check if the model already exists */
|
|
451
450
|
if (!force && await FileSystem.fileExists(path)) Logger.error(`ERORR: ${name} already exists`);
|
|
452
451
|
const dbPkgPath = FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
|
|
453
|
-
|
|
454
|
-
let stub = await readFile(stubPath, "utf-8");
|
|
452
|
+
let stub = await readFile(npath.join(dbPkgPath, this.getStubName("seeder", type)), "utf-8");
|
|
455
453
|
stub = stub.replace(/{{ name }}/g, name);
|
|
456
454
|
await writeFile(path, stub);
|
|
457
455
|
Logger.info(`INFO: Seeder ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, "bold", false)} created successfully.`);
|
|
@@ -469,8 +467,7 @@ var MakeCommand = class extends ConsoleCommand {
|
|
|
469
467
|
/** Check if the model already exists */
|
|
470
468
|
if (!force && await FileSystem.fileExists(path)) Logger.error(`ERORR: ${name} model already exists`);
|
|
471
469
|
const dbPkgPath = FileSystem.findModulePkg("@h3ravel/database", this.kernel.cwd) ?? "";
|
|
472
|
-
|
|
473
|
-
let stub = await readFile(stubPath, "utf-8");
|
|
470
|
+
let stub = await readFile(npath.join(dbPkgPath, `dist/stubs/model-${type}.stub`), "utf-8");
|
|
474
471
|
stub = stub.replace(/{{ name }}/g, name);
|
|
475
472
|
await writeFile(path, stub);
|
|
476
473
|
Logger.info(`INFO: Model ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, "bold", false)} created successfully.`);
|
|
@@ -511,15 +508,17 @@ var MigrateCommand = class extends ConsoleCommand {
|
|
|
511
508
|
* @var string
|
|
512
509
|
*/
|
|
513
510
|
signature = `migrate:
|
|
514
|
-
{fresh : Drop all tables and re-run all migrations.}
|
|
511
|
+
{fresh : Drop all tables and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}
|
|
515
512
|
{install : Create the migration repository.}
|
|
516
|
-
{refresh : Reset and re-run all migrations.}
|
|
513
|
+
{refresh : Reset and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}
|
|
517
514
|
{reset : Rollback all database migrations.}
|
|
518
515
|
{rollback : Rollback the last database migration.}
|
|
519
516
|
{status : Show the status of each migration.}
|
|
520
517
|
{publish : Publish any migration files from installed packages. | {package : The package to publish migrations from}}
|
|
521
|
-
{^--
|
|
522
|
-
{
|
|
518
|
+
{^--c|connection=mysql : The database connection to use : [mysql, sqlite, mariadb, pgsql]}
|
|
519
|
+
{--seed : Seed the database}
|
|
520
|
+
{--seeder : The file name of the root seeder}
|
|
521
|
+
{^--force : Force the operation to run when in production}
|
|
523
522
|
`;
|
|
524
523
|
/**
|
|
525
524
|
* The console command description.
|
|
@@ -531,7 +530,9 @@ var MigrateCommand = class extends ConsoleCommand {
|
|
|
531
530
|
* Execute the console command.
|
|
532
531
|
*/
|
|
533
532
|
async handle() {
|
|
533
|
+
const force = this.option("force");
|
|
534
534
|
const command = this.dictionary.name ?? this.dictionary.baseCommand;
|
|
535
|
+
if (env("APP_ENV") === "production" && !force) this.error("INFO: Unable to run migration, your app is currently in production.");
|
|
535
536
|
this.connection = Object.entries(arquebusConfig(config("database"))).find(([client]) => client === config("database.default"))?.at(1);
|
|
536
537
|
this.connection.migrations = {
|
|
537
538
|
path: "migrations",
|
|
@@ -554,6 +555,7 @@ var MigrateCommand = class extends ConsoleCommand {
|
|
|
554
555
|
async migrateRun() {
|
|
555
556
|
try {
|
|
556
557
|
await new Migrate(this.databasePath).run(this.connection, this.options(), true);
|
|
558
|
+
if (this.option("seed")) await this.runSeeders();
|
|
557
559
|
} catch (e) {
|
|
558
560
|
Logger.error("ERROR: " + e);
|
|
559
561
|
}
|
|
@@ -564,29 +566,31 @@ var MigrateCommand = class extends ConsoleCommand {
|
|
|
564
566
|
async migrateFresh() {
|
|
565
567
|
try {
|
|
566
568
|
await new Migrate(this.databasePath).fresh(this.connection, this.options(), true);
|
|
569
|
+
if (this.option("seed")) await this.runSeeders();
|
|
567
570
|
} catch (e) {
|
|
568
571
|
Logger.error("ERROR: " + e);
|
|
569
572
|
}
|
|
570
573
|
}
|
|
571
574
|
/**
|
|
572
|
-
*
|
|
575
|
+
* Reset and re-run all migrations.
|
|
573
576
|
*/
|
|
574
|
-
async
|
|
577
|
+
async migrateRefresh() {
|
|
575
578
|
try {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
await migrate.prepareDatabase(migrator);
|
|
579
|
-
Logger.success("Migration repository installed.");
|
|
579
|
+
await new Migrate(this.databasePath).refresh(this.connection, this.options(), true);
|
|
580
|
+
if (this.option("seed")) await this.runSeeders();
|
|
580
581
|
} catch (e) {
|
|
581
582
|
Logger.error("ERROR: " + e);
|
|
582
583
|
}
|
|
583
584
|
}
|
|
584
585
|
/**
|
|
585
|
-
*
|
|
586
|
+
* Create the migration repository.
|
|
586
587
|
*/
|
|
587
|
-
async
|
|
588
|
+
async migrateInstall() {
|
|
588
589
|
try {
|
|
589
|
-
|
|
590
|
+
const migrate = new Migrate(this.databasePath);
|
|
591
|
+
const { migrator } = await migrate.setupConnection(this.connection);
|
|
592
|
+
await migrate.prepareDatabase(migrator);
|
|
593
|
+
Logger.success("Migration repository installed.");
|
|
590
594
|
} catch (e) {
|
|
591
595
|
Logger.error("ERROR: " + e);
|
|
592
596
|
}
|
|
@@ -667,6 +671,15 @@ var MigrateCommand = class extends ConsoleCommand {
|
|
|
667
671
|
]);
|
|
668
672
|
}
|
|
669
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* Run database seeders
|
|
676
|
+
*/
|
|
677
|
+
async runSeeders() {
|
|
678
|
+
await new SeedCommand(this.app, this.kernel).setInput({
|
|
679
|
+
class: this.option("seeder", "DatabaseSeeder"),
|
|
680
|
+
force: this.option("force")
|
|
681
|
+
}, [], [], {}, this.program).handle();
|
|
682
|
+
}
|
|
670
683
|
};
|
|
671
684
|
|
|
672
685
|
//#endregion
|
|
@@ -703,11 +716,11 @@ var SeedCommand = class extends ConsoleCommand {
|
|
|
703
716
|
const file = this.option("class");
|
|
704
717
|
const force = this.option("force");
|
|
705
718
|
const database = this.option("database");
|
|
706
|
-
|
|
707
|
-
if (env("APP_ENV") === "production" && !force)
|
|
719
|
+
this.newLine();
|
|
720
|
+
if (env("APP_ENV") === "production" && !force) this.error("INFO: Unable to run seeders, your app is currently in production.");
|
|
708
721
|
this.connection = database ?? config("database.default");
|
|
709
722
|
this.queryBuilder = DB.instance(this.connection);
|
|
710
|
-
if (!this.connection)
|
|
723
|
+
if (!this.connection) this.error("ERROR: Unknown database connection.");
|
|
711
724
|
let path = npath.join(process.cwd(), file);
|
|
712
725
|
const [f1, f2] = [FileSystem.resolveFileUp(Str.snake(file), ["js", "ts"], database_path("seeders")), FileSystem.resolveFileUp(Str.studly(file), ["js", "ts"], database_path("seeders"))];
|
|
713
726
|
if (!f1 && !f2) {
|
|
@@ -718,11 +731,12 @@ var SeedCommand = class extends ConsoleCommand {
|
|
|
718
731
|
/**
|
|
719
732
|
* Now try to find the path knowing it's relative to database_path
|
|
720
733
|
*/
|
|
721
|
-
if (!await FileSystem.fileExists(path))
|
|
734
|
+
if (!await FileSystem.fileExists(path)) this.error(`ERROR: Seeder ${Logger.log(`[${file}]`, "bold", false)} not found.`);
|
|
722
735
|
} else path = String(f1 ?? f2);
|
|
723
736
|
const { default: seeder } = await import(path);
|
|
724
737
|
if (seeder) {
|
|
725
|
-
|
|
738
|
+
this.info("INFO: Seeding database.");
|
|
739
|
+
this.newLine();
|
|
726
740
|
await new seeder(this.app, this).run(this.queryBuilder);
|
|
727
741
|
}
|
|
728
742
|
}
|
|
@@ -818,7 +832,7 @@ var DatabaseServiceProvider = class extends ServiceProvider {
|
|
|
818
832
|
const connection = Object.entries(arquebusConfig(config$1.get("database"))).find(([client]) => client === config$1.get("database.default"))?.at(1);
|
|
819
833
|
if (connection) arquebus.addConnection(connection);
|
|
820
834
|
/** Register Musket Commands */
|
|
821
|
-
this.
|
|
835
|
+
this.registerCommands([
|
|
822
836
|
MigrateCommand,
|
|
823
837
|
MakeCommand,
|
|
824
838
|
SeedCommand
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["e","n","t","r","i","s","u","a","M","m","f","l","$","y","v","g","D","o","d","c","h","stub: string","path","config","BaseModel","config","BaseSeeder","app: Application","command?: SeedCommand"],"sources":["../src/Utils/TableGuesser.ts","../../../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js","../src/Commands/MakeCommand.ts","../src/Commands/MigrateCommand.ts","../src/Commands/SeedCommand.ts","../src/Configuration.ts","../src/Model.ts","../src/Providers/DatabaseServiceProvider.ts","../src/Query/DB.ts","../src/Seeder.ts"],"sourcesContent":["export class TableGuesser {\n static CREATE_PATTERNS = [\n /^create_(\\w+)_table$/,\n /^create_(\\w+)$/\n ]\n static CHANGE_PATTERNS = [\n /.+_(to|from|in)_(\\w+)_table$/,\n /.+_(to|from|in)_(\\w+)$/\n ]\n static guess (migration: string) {\n for (const pattern of TableGuesser.CREATE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[1], true]\n }\n }\n for (const pattern of TableGuesser.CHANGE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[2], false]\n }\n }\n return []\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport { TableGuesser } from '../Utils/TableGuesser'\nimport dayjs from 'dayjs'\nimport npath from 'node:path'\n\nexport class MakeCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {migration : Generates a new database migration class. \n | {--t|table : The table to migrate} \n | {--c|create : The table to be created} \n | {--l|type=ts : The file type to generate} \n } \n {factory : Create a new model factory.\n | {--force : Create the factory even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {seeder : Create a new seeder class.\n | {--force : Create the seeder even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {model : Create a new Eloquent model class. \n | {--api : Indicates if the generated controller should be an API resource controller} \n | {--c|controller : Create a new controller for the model} \n | {--f|factory : Create a new factory for the model} \n | {--m|migration : Create a new migration file for the model} \n | {--r|resource : Indicates if the generated controller should be a resource controller} \n | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model} \n | {--s|seed : Create a new seeder for the model}\n | {--l|type=ts : The file type to generate}\n | {--force : Create the model even if it already exists}\n } \n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n migration: 'makeMigration', // ✓\n factory: 'makeFactory',\n seeder: 'makeSeeder', // ✓\n model: 'makeModel', // ✓\n } as const\n\n console.log('')\n\n await this[methods[command]]()\n }\n\n /**\n * Generate a new database migration class\n */\n protected async makeMigration () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const datePrefix = dayjs().format('YYYY_MM_DD_HHmmss')\n const path = database_path(`migrations/${datePrefix}_${name}.${type}`)\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n\n let create = this.option('create', false)\n let table = this.option('table')\n if (!table && typeof create === 'string') {\n table = create\n create = true\n }\n\n if (!table) {\n const guessed = TableGuesser.guess(name)\n table = guessed[0]\n create = !!guessed[1]\n }\n\n const stubPath = npath.join(dbPkgPath, this.getStubName('migration', type, { table, create }))\n let stub = await readFile(stubPath, 'utf-8')\n\n if (table !== null) {\n stub = stub.replace(/DummyTable|{{\\s*table\\s*}}/g, table)\n }\n\n Logger.info('INFO: Creating Migration')\n\n await this.kernel.ensureDirectoryExists(npath.dirname(path))\n await writeFile(path, stub)\n\n Logger.split('INFO: Migration Created', Logger.log(npath.basename(path), 'gray', false))\n }\n\n /**\n * Create a new model factory\n */\n protected makeFactory () {\n Logger.success('Factory support is not yet available')\n }\n\n /**\n * Create a new seeder class\n */\n protected async makeSeeder () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n const path = database_path(`seeders/${Str.snake(name)}.${type}`)\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName('seeder', type))\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Seeder ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Generate a new Arquebus model class\n */\n protected async makeModel () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = app_path(`Models/${Str.lower(name)}.${type}`)\n\n /** The model is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} model already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, `dist/stubs/model-${type}.stub`)\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Model ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Ge the database migration file name\n * \n * @param table \n * @param create \n * @param type \n * @returns \n */\n getStubName (\n type: 'migration' | 'seeder' | 'model' | 'factory',\n ext: 'ts' | 'js' = 'ts',\n { table, create }: { table?: string, create?: boolean } = {}\n ) {\n let stub: string\n if (type === 'migration') {\n if (!table) {\n stub = `migration-${ext}.stub`\n }\n else if (create) {\n stub = `migration.create-${ext}.stub`\n }\n else {\n stub = `migration.update-${ext}.stub`\n }\n return 'dist/stubs/' + stub\n } else {\n return `dist/stubs/${type}-${ext}.stub`\n }\n }\n}\n","import { FileSystem, Logger, Resolver } from '@h3ravel/shared'\nimport { Migrate, MigrationCreator } from '@h3ravel/arquebus/migrations'\nimport { TBaseConfig, arquebusConfig } from '..'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport path from 'node:path'\n\nexport class MigrateCommand extends ConsoleCommand {\n /**\n * The current database connection\n */\n private connection!: TBaseConfig\n\n /** \n * The base path for all database operations\n */\n private databasePath: string = database_path()\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `migrate:\n {fresh : Drop all tables and re-run all migrations.}\n {install : Create the migration repository.}\n {refresh : Reset and re-run all migrations.}\n {reset : Rollback all database migrations.}\n {rollback : Rollback the last database migration.}\n {status : Show the status of each migration.}\n {publish : Publish any migration files from installed packages. | {package : The package to publish migrations from}}\n {^--s|seed : Seed the database}\n {^--c|connection=mysql : The database connection to use}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Run all pending migrations.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n const command = (this.dictionary.name ?? this.dictionary.baseCommand) as never\n\n this.connection = Object.entries(arquebusConfig(config('database')))\n .find(([client]) => client === config('database.default'))\n ?.at(1)\n\n this.connection.migrations = {\n path: 'migrations',\n table: 'migrations',\n }\n\n const methods = {\n migrate: 'migrateRun',\n fresh: 'migrateFresh',\n install: 'migrateInstall',\n refresh: 'migrateRefresh',\n reset: 'migrateReset',\n rollback: 'migrateRollback',\n status: 'migrateStatus',\n publish: 'migratePublish',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Run all pending migrations.\n */\n protected async migrateRun () {\n try {\n await new Migrate(this.databasePath).run(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Drop all tables and re-run all migrations.\n */\n protected async migrateFresh () {\n try {\n await new Migrate(this.databasePath).fresh(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Create the migration repository.\n */\n protected async migrateInstall () {\n try {\n const migrate = new Migrate(this.databasePath)\n const { migrator } = await migrate.setupConnection(this.connection)\n await migrate.prepareDatabase(migrator)\n\n Logger.success('Migration repository installed.')\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Reset and re-run all migrations.\n */\n protected async migrateRefresh () {\n try {\n await new Migrate(this.databasePath).refresh(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback all database migrations.\n */\n protected async migrateReset () {\n try {\n await new Migrate(this.databasePath).reset(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback the last database migration.\n */\n protected async migrateRollback () {\n try {\n await new Migrate(this.databasePath).rollback(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Show the status of each migration.\n */\n protected async migrateStatus () {\n const migrations = await new Migrate(this.databasePath, undefined, (msg, sts) => {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n ['`musket migrate:install`?', 'grey']\n ], ' ', false)\n\n if (sts) Logger[sts](msg + hint, sts === 'error', true)\n }).status(this.connection, this.options(), true)\n\n try {\n if (migrations.length > 0) {\n Logger.twoColumnDetail('Migration name', 'Batch / Status')\n\n migrations.forEach(migration => {\n const status = migration.ran\n ? Logger.parse([[`[${migration.batch}]`, 'white'], ['Ran', 'green']], ' ', false)\n : Logger.parse([['Pending', 'yellow']], '', false)\n Logger.twoColumnDetail(migration.name, status)\n })\n }\n else {\n Logger.info('No migrations found')\n }\n } catch (e) {\n Logger.error(['ERROR: ' + e, 'Did you run musket migrate:install'])\n }\n }\n\n\n\n /**\n * Publish any migration files from installed packages.\n */\n protected async migratePublish () {\n const name = this.argument('package')\n\n try {\n /** Find the requested package */\n const packagePath = FileSystem.findModulePkg(name) ?? null\n if (!packagePath) throw new Error('Package not found')\n\n /** Get the package,json and instanciate the migration creator */\n const pkgJson = (await import(path.join(packagePath, 'package.json')))\n const creator = new MigrationCreator(path.join(packagePath, pkgJson.migrations ?? 'migrations'))\n\n const info = Logger.parse([\n [' Publishing migrations from', 'white'],\n [`${pkgJson.name}@${pkgJson.version}`, ['italic', 'gray']]\n ], ' ', false)\n\n Logger.info(`INFO: ${info}`)\n\n try {\n /** Publish any existing migrations */\n await creator.publish(this.databasePath, (fileName) => {\n Logger.twoColumnDetail(fileName, Logger.parse([['PUBLISHED', 'green']], '', false))\n })\n } catch {\n Logger.error([`ERROR: ${name} has no publishable migrations.`])\n }\n } catch (e) {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n [`\\`${await Resolver.getPakageInstallCommand(name)}\\``, 'grey']\n ], ' ', false)\n\n const error = Logger.parse([\n ['Package `', 'white'],\n [name, 'grey'],\n ['` not found', 'white']\n ], '', false)\n\n Logger.error(['ERROR: ' + error, hint + '?', String(e)])\n }\n }\n}\n","import { FileSystem, Logger } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { DB } from '..'\nimport type { QueryBuilder } from '@h3ravel/arquebus'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class SeedCommand extends ConsoleCommand {\n /**\n * The current query builder instance\n */\n public queryBuilder!: QueryBuilder\n\n /**\n * The current database connection name\n */\n private connection!: string\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `db:seed\n {--class=DatabaseSeeder : The file name of the root seeder}\n {--d|database? : The database connection to use}\n {--force : Force the operation to run when in production}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Seed the database with records.'\n\n /**\n * Execute the console command.\n */\n public async handle () {\n const file = this.option('class')\n const force = this.option('force')\n const database = this.option('database')\n\n console.log('')\n\n if (env('APP_ENV') === 'production' && !force) {\n Logger.error('INFO: Unable to run seeders, your app is currently in production.')\n }\n\n this.connection = database ?? config('database.default')\n this.queryBuilder = DB.instance(this.connection)\n\n if (!this.connection) {\n Logger.error('ERROR: Unknown database connection.')\n }\n\n let path = npath.join(process.cwd(), file)\n\n const [f1, f2] = [\n FileSystem.resolveFileUp(Str.snake(file), ['js', 'ts'], database_path('seeders')),\n FileSystem.resolveFileUp(Str.studly(file), ['js', 'ts'], database_path('seeders')),\n ]\n\n if (!f1 && !f2) {\n /**\n * Try to find the path assuming it's relative to cwd\n */\n if (!await FileSystem.fileExists(path)) {\n path = database_path(npath.join('seeders', file))\n }\n\n /**\n * Now try to find the path knowing it's relative to database_path\n */\n if (!await FileSystem.fileExists(path)) {\n Logger.error(`ERROR: Seeder ${Logger.log(`[${file}]`, 'bold', false)} not found.`)\n }\n } else {\n path = String(f1 ?? f2)\n }\n\n const { default: seeder } = (await import(path))\n\n if (seeder) {\n Logger.info('INFO: Seeding database.')\n\n await new seeder(this.app, this).run(this.queryBuilder)\n }\n }\n}\n","/// <reference path=\"../../core/src/app.globals.d.ts\" />\nimport { Knex } from 'knex'\n\ntype TFunction = (...args: any[]) => any\n\nexport interface TField {\n type: 'VAR_STRING' | 'BLOB' | 'DATETIME' | 'TIMESTAMP' | 'LONG' | 'JSON'\n length: number\n db: string\n table: string\n name: string\n string: TFunction,\n buffer: TFunction\n geometry: TFunction\n}\n\nexport interface TBaseConfig {\n client: 'mysql' | 'mysql2' | 'sqlite3' | 'oracle' | 'mariadb' | 'pg'\n connection: {\n typeCast?(field: TField, next: TFunction): any\n dateStrings?: boolean\n }\n pool?: {\n afterCreate: (connection: TConfig, callback: (val: any, con: any) => void) => Promise<any>\n } | undefined\n connections?: Record<string, TConfig>\n migrations?: {\n table: string\n path: string\n },\n factories?: {\n path: string\n },\n seeders?: {\n path: string\n },\n models?: {\n path: string\n }\n}\n\nexport type TConfig = TBaseConfig & ({\n client: 'pg'\n connection: Knex.PgConnectionConfig\n} | {\n client: 'oracle'\n connection: Knex.OracleDbConnectionConfig\n} | {\n client: 'mysql2'\n connection: Knex.MySql2ConnectionConfig\n} | {\n client: 'mysql'\n connection: Knex.MySqlConnectionConfig\n} | {\n client: 'sqlite3'\n connection: Knex.Sqlite3ConnectionConfig\n useNullAsDefault?: boolean\n} | {\n client: 'mariadb'\n connection: Knex.MariaSqlConnectionConfig\n useNullAsDefault?: boolean\n})\n\nexport const arquebusConfig = (config: any) => {\n return {\n sqlite: {\n client: config.connections.sqlite.driver,\n connection: <Knex.Sqlite3ConnectionConfig>{\n filename: database_path(config.connections.sqlite.database),\n debug: config.connections.sqlite.debug,\n flags: config.connections.sqlite.flags,\n options: config.connections.sqlite.options,\n expirationChecker: config.connections.sqlite.expirationChecker\n },\n useNullAsDefault: config.connections.sqlite.useNullAsDefault,\n },\n mysql: {\n client: config.connections.mysql.driver,\n connection: <Knex.MySql2ConnectionConfig>{\n host: config.connections.mysql.host ?? 'localhost',\n port: config.connections.mysql.port ?? 3306,\n user: config.connections.mysql.username ?? 'root',\n password: config.connections.mysql.password,\n database: config.connections.mysql.database,\n charset: config.connections.mysql.charset,\n socketPath: config.connections.mysql.unix_socket,\n localAddress: config.connections.mysql.url,\n },\n },\n mariadb: {\n client: config.connections.mariadb.driver,\n connection: <Knex.MariaSqlConnectionConfig>{\n host: config.connections.mariadb.host ?? 'localhost',\n port: config.connections.mariadb.port ?? 3306,\n user: config.connections.mariadb.username ?? 'root',\n password: config.connections.mariadb.password,\n database: config.connections.mariadb.database,\n charset: config.connections.mariadb.charset,\n socketPath: config.connections.mariadb.unix_socket,\n localAddress: config.connections.mariadb.url,\n expirationChecker: config.connections.mariadb.expirationChecker\n },\n },\n pgsql: {\n client: 'pg',\n connection: <Knex.PgConnectionConfig>{\n host: config.connections.pgsql.host ?? 'localhost',\n port: config.connections.pgsql.port ?? 3306,\n user: config.connections.pgsql.username ?? 'root',\n password: config.connections.pgsql.password,\n database: config.connections.pgsql.database,\n charset: config.connections.mysql.charset,\n connectionString: config.connections.pgsql.url,\n expirationChecker: config.connections.pgsql.expirationChecker\n },\n }\n } as unknown as TBaseConfig\n}\n","import { Model as BaseModel } from '@h3ravel/arquebus'\n\nexport class Model<M extends BaseModel = any> extends BaseModel {\n /**\n * Retrieve the model for a bound value.\n * \n * @param {any} value \n * @param {String|null} field \n * @returns \n */\n public resolveRouteBinding (value: any, field: undefined | string | null = null): Promise<M> {\n return this.newQuery().where(field ?? 'ids', value).firstOrFail()! as Promise<M>\n }\n}\n","import { MakeCommand } from '../Commands/MakeCommand'\nimport { MigrateCommand } from '../Commands/MigrateCommand'\nimport { SeedCommand } from '../Commands/SeedCommand'\nimport { ServiceProvider } from '@h3ravel/core'\nimport { arquebus } from '@h3ravel/arquebus'\nimport { arquebusConfig } from '../Configuration'\n\n/**\n * Database connection, ORM, migrations.\n * \n * Register DatabaseManager and QueryBuilder if required.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n */\nexport class DatabaseServiceProvider extends ServiceProvider {\n public static priority = 994\n\n register () {\n const config = this.app.make('config')\n\n const connection = Object.entries(arquebusConfig(config.get('database')))\n .find(([client]) => client === config.get('database.default'))\n ?.at(1)\n\n if (connection) {\n arquebus.addConnection(connection)\n }\n\n /** Register Musket Commands */\n this.commands([MigrateCommand, MakeCommand, SeedCommand])\n }\n}\n","import { IQueryBuilder } from '@h3ravel/arquebus/types'\nimport { arquebus } from '@h3ravel/arquebus'\n\nexport class DB {\n connection?: string\n\n constructor(connection?: string) {\n if (connection) {\n this.connection = connection\n }\n }\n\n /**\n * New instance\n */\n public static table (name: string): IQueryBuilder {\n return new DB().builder().table(name)\n }\n\n /**\n * Builder table instance\n */\n public static instance (connection?: string) {\n return new DB(connection).builder()\n }\n\n /**\n * Builder transaction instance\n */\n public static transaction<C> (callback: (...args: C[]) => any) {\n return new DB().builder().transaction(callback)\n }\n\n private builder () {\n return arquebus.getInstance().connection(this.connection)\n }\n}\n","import { Application } from '@h3ravel/core'\nimport { Arr } from '@h3ravel/support'\nimport { Seeder as BaseSeeder } from '@h3ravel/arquebus'\nimport { SeedCommand } from './Commands/SeedCommand'\nimport { TaskManager } from '@h3ravel/shared'\n\nexport class Seeder extends BaseSeeder {\n /**\n * Seeders that have been called at least one time.\n */\n static called: Seeder[] = []\n\n constructor(public app: Application, public command?: SeedCommand) {\n super()\n }\n\n async run (_conn?: SeedCommand['queryBuilder'], ..._args: any[]) { };\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return this\n */\n public async call (className: typeof Seeder | typeof Seeder[], silent = false, parameters: any[] = []) {\n const classes = Arr.wrap(className)\n\n for (let i = 0; i < classes.length; i++) {\n const instance = this.resolve(classes[i])\n const name = instance.constructor.name\n\n if (silent === false) {\n await TaskManager.advancedTaskRunner(\n [[name, 'RUNNING'], [name, 'DONE']],\n async () => await instance.run(this.command!.queryBuilder, ...parameters)\n )\n } else {\n await instance.run(this.command!.queryBuilder, ...parameters)\n }\n\n Seeder.called.push(instance)\n }\n\n return this\n }\n\n /**\n * Resolve an instance of the given seeder class.\n *\n * @param className\n * \n * @return Seeder\n */\n protected resolve (className: typeof Seeder) {\n const instance = new (className as { new(app: any): Seeder })(this.app)\n\n if (this.command) {\n instance.setCommand(this.command)\n }\n\n return instance\n }\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return void\n */\n public async callWith (className: typeof Seeder | typeof Seeder[], parameters: any[]) {\n await this.call(className, false, parameters)\n }\n\n /**\n * Silently run the given seeder class.\n *\n * @param className\n * @param parameters\n * \n * @return void\n */\n public async callSilent (className: typeof Seeder | typeof Seeder[], parameters: any[] = []) {\n await this.call(className, true, parameters)\n }\n\n /**\n * Set the console command instance.\n *\n * @param command\n * \n * @return this\n */\n public setCommand (command: SeedCommand) {\n this.command = command\n\n return this\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAa,eAAb,MAAa,aAAa;CACtB,OAAO,kBAAkB,CACrB,wBACA,iBACH;CACD,OAAO,kBAAkB,CACrB,gCACA,yBACH;CACD,OAAO,MAAO,WAAmB;AAC7B,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAChD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACA,QAAO,CAAC,QAAQ,IAAI,KAAK;;AAGjC,OAAK,MAAM,WAAW,aAAa,iBAAiB;GAChD,MAAM,UAAU,UAAU,MAAM,QAAQ;AACxC,OAAI,QACA,QAAO,CAAC,QAAQ,IAAI,MAAM;;AAGlC,SAAO,EAAE;;;;;;;ACtBjB,EAAC,SAAS,GAAE,GAAE;AAAC,cAAU,OAAO,WAAS,eAAa,OAAO,SAAO,OAAO,UAAQ,GAAG,GAAC,cAAY,OAAO,UAAQ,OAAO,MAAI,OAAO,EAAE,GAAC,CAAC,IAAE,eAAa,OAAO,aAAW,aAAW,KAAG,MAAM,QAAM,GAAG;cAAQ,WAAU;EAAc,IAAI,IAAE,KAAI,IAAE,KAAI,IAAE,MAAK,IAAE,eAAc,IAAE,UAAS,IAAE,UAAS,IAAE,QAAO,IAAE,OAAM,IAAE,QAAO,IAAE,SAAQ,IAAE,WAAU,IAAE,QAAO,IAAE,QAAO,IAAE,gBAAe,IAAE,8FAA6F,IAAE,uFAAsF,IAAE;GAAC,MAAK;GAAK,UAAS,2DAA2D,MAAM,IAAI;GAAC,QAAO,wFAA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S,IAAI,KAAK,QAAS,cAAc,GAAG,WAAW,CAC5E;OAED,OAAM,SAAS,IAAI,KAAK,QAAS,cAAc,GAAG,WAAW;AAGjE,UAAO,OAAO,KAAK,SAAS;;AAGhC,SAAO;;;;;;;;;CAUX,AAAU,QAAS,WAA0B;EACzC,MAAM,WAAW,IAAK,UAAwC,KAAK,IAAI;AAEvE,MAAI,KAAK,QACL,UAAS,WAAW,KAAK,QAAQ;AAGrC,SAAO;;;;;;;;;;;CAYX,MAAa,SAAU,WAA4C,YAAmB;AAClF,QAAM,KAAK,KAAK,WAAW,OAAO,WAAW;;;;;;;;;;CAWjD,MAAa,WAAY,WAA4C,aAAoB,EAAE,EAAE;AACzF,QAAM,KAAK,KAAK,WAAW,MAAM,WAAW;;;;;;;;;CAUhD,AAAO,WAAY,SAAsB;AACrC,OAAK,UAAU;AAEf,SAAO"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["e","n","t","r","i","s","u","a","M","m","f","l","$","y","v","g","D","o","d","c","h","stub: string","path","config","BaseModel","config","BaseSeeder","app: Application","command?: SeedCommand"],"sources":["../src/Utils/TableGuesser.ts","../../../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js","../src/Commands/MakeCommand.ts","../src/Commands/MigrateCommand.ts","../src/Commands/SeedCommand.ts","../src/Configuration.ts","../src/Model.ts","../src/Providers/DatabaseServiceProvider.ts","../src/Query/DB.ts","../src/Seeder.ts"],"sourcesContent":["export class TableGuesser {\n static CREATE_PATTERNS = [\n /^create_(\\w+)_table$/,\n /^create_(\\w+)$/\n ]\n static CHANGE_PATTERNS = [\n /.+_(to|from|in)_(\\w+)_table$/,\n /.+_(to|from|in)_(\\w+)$/\n ]\n static guess (migration: string) {\n for (const pattern of TableGuesser.CREATE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[1], true]\n }\n }\n for (const pattern of TableGuesser.CHANGE_PATTERNS) {\n const matches = migration.match(pattern)\n if (matches) {\n return [matches[2], false]\n }\n }\n return []\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","import { FileSystem, Logger } from '@h3ravel/shared'\nimport { mkdir, readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport { TableGuesser } from '../Utils/TableGuesser'\nimport dayjs from 'dayjs'\nimport npath from 'node:path'\n\nexport class MakeCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#make:\n {migration : Generates a new database migration class. \n | {--t|table : The table to migrate} \n | {--c|create : The table to be created} \n | {--l|type=ts : The file type to generate} \n } \n {factory : Create a new model factory.\n | {--force : Create the factory even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {seeder : Create a new seeder class.\n | {--force : Create the seeder even if it already exists}\n | {--l|type=ts : The file type to generate}\n }\n {model : Create a new Eloquent model class. \n | {--api : Indicates if the generated controller should be an API resource controller} \n | {--c|controller : Create a new controller for the model} \n | {--f|factory : Create a new factory for the model} \n | {--m|migration : Create a new migration file for the model} \n | {--r|resource : Indicates if the generated controller should be a resource controller} \n | {--a|all : Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model} \n | {--s|seed : Create a new seeder for the model}\n | {--l|type=ts : The file type to generate}\n | {--force : Create the model even if it already exists}\n } \n {^name : The name of the [name] to generate}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Generate component classes'\n\n public async handle (this: any) {\n const command = (this.dictionary.baseCommand ?? this.dictionary.name) as never\n\n if (!this.argument('name')) {\n this.program.error('Please provide a valid name for the ' + command)\n }\n\n const methods = {\n migration: 'makeMigration', // ✓\n factory: 'makeFactory',\n seeder: 'makeSeeder', // ✓\n model: 'makeModel', // ✓\n } as const\n\n console.log('')\n\n await this[methods[command]]()\n }\n\n /**\n * Generate a new database migration class\n */\n protected async makeMigration () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const datePrefix = dayjs().format('YYYY_MM_DD_HHmmss')\n const path = database_path(`migrations/${datePrefix}_${name}.${type}`)\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n\n let create = this.option('create', false)\n let table = this.option('table')\n if (!table && typeof create === 'string') {\n table = create\n create = true\n }\n\n if (!table) {\n const guessed = TableGuesser.guess(name)\n table = guessed[0]\n create = !!guessed[1]\n }\n\n const stubPath = npath.join(dbPkgPath, this.getStubName('migration', type, { table, create }))\n let stub = await readFile(stubPath, 'utf-8')\n\n if (table !== null) {\n stub = stub.replace(/DummyTable|{{\\s*table\\s*}}/g, table)\n }\n\n Logger.info('INFO: Creating Migration')\n\n await this.kernel.ensureDirectoryExists(npath.dirname(path))\n await writeFile(path, stub)\n\n Logger.split('INFO: Migration Created', Logger.log(npath.basename(path), 'gray', false))\n }\n\n /**\n * Create a new model factory\n */\n protected makeFactory () {\n Logger.success('Factory support is not yet available')\n }\n\n /**\n * Create a new seeder class\n */\n protected async makeSeeder () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n const path = database_path(`seeders/${Str.snake(name)}.${type}`)\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName('seeder', type))\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Seeder ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Generate a new Arquebus model class\n */\n protected async makeModel () {\n const type = this.option('type', 'ts')\n const name = this.argument('name')\n const force = this.option('force')\n\n const path = app_path(`Models/${Str.lower(name)}.${type}`)\n\n /** The model is scoped to a path make sure to create the associated directories */\n if (name.includes('/')) {\n await mkdir(Str.beforeLast(path, '/'), { recursive: true })\n }\n\n /** Check if the model already exists */\n if (!force && await FileSystem.fileExists(path)) {\n Logger.error(`ERORR: ${name} model already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/database', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, `dist/stubs/model-${type}.stub`)\n\n let stub = await readFile(stubPath, 'utf-8')\n stub = stub.replace(/{{ name }}/g, name)\n\n await writeFile(path, stub)\n\n Logger.info(\n `INFO: Model ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} created successfully.`\n )\n }\n\n /**\n * Ge the database migration file name\n * \n * @param table \n * @param create \n * @param type \n * @returns \n */\n getStubName (\n type: 'migration' | 'seeder' | 'model' | 'factory',\n ext: 'ts' | 'js' = 'ts',\n { table, create }: { table?: string, create?: boolean } = {}\n ) {\n let stub: string\n if (type === 'migration') {\n if (!table) {\n stub = `migration-${ext}.stub`\n }\n else if (create) {\n stub = `migration.create-${ext}.stub`\n }\n else {\n stub = `migration.update-${ext}.stub`\n }\n return 'dist/stubs/' + stub\n } else {\n return `dist/stubs/${type}-${ext}.stub`\n }\n }\n}\n","import { FileSystem, Logger, Resolver } from '@h3ravel/shared'\nimport { Migrate, MigrationCreator } from '@h3ravel/arquebus/migrations'\nimport { SeedCommand, TBaseConfig, arquebusConfig } from '..'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport path from 'node:path'\n\nexport class MigrateCommand extends ConsoleCommand {\n /**\n * The current database connection\n */\n private connection!: TBaseConfig\n\n /** \n * The base path for all database operations\n */\n private databasePath: string = database_path()\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `migrate:\n {fresh : Drop all tables and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}\n {install : Create the migration repository.}\n {refresh : Reset and re-run all migrations. | {--seed : Indicates if the seed task should be re-run} | {--seeder : The file name of the root seeder}}\n {reset : Rollback all database migrations.}\n {rollback : Rollback the last database migration.}\n {status : Show the status of each migration.}\n {publish : Publish any migration files from installed packages. | {package : The package to publish migrations from}}\n {^--c|connection=mysql : The database connection to use : [mysql, sqlite, mariadb, pgsql]}\n {--seed : Seed the database}\n {--seeder : The file name of the root seeder}\n {^--force : Force the operation to run when in production}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Run all pending migrations.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n const force = this.option('force')\n const command = (this.dictionary.name ?? this.dictionary.baseCommand) as never\n\n if (env('APP_ENV') === 'production' && !force) {\n this.error('INFO: Unable to run migration, your app is currently in production.')\n }\n\n this.connection = Object.entries(arquebusConfig(config('database')))\n .find(([client]) => client === config('database.default'))\n ?.at(1)\n\n this.connection.migrations = {\n path: 'migrations',\n table: 'migrations',\n }\n\n const methods = {\n migrate: 'migrateRun',\n fresh: 'migrateFresh',\n install: 'migrateInstall',\n refresh: 'migrateRefresh',\n reset: 'migrateReset',\n rollback: 'migrateRollback',\n status: 'migrateStatus',\n publish: 'migratePublish',\n } as const\n\n await this[methods[command]]()\n }\n\n /**\n * Run all pending migrations.\n */\n protected async migrateRun () {\n try {\n await new Migrate(this.databasePath).run(this.connection, this.options(), true)\n\n if (this.option('seed')) {\n await this.runSeeders()\n }\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Drop all tables and re-run all migrations.\n */\n protected async migrateFresh () {\n try {\n await new Migrate(this.databasePath).fresh(this.connection, this.options(), true)\n\n if (this.option('seed')) {\n await this.runSeeders()\n }\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Reset and re-run all migrations.\n */\n protected async migrateRefresh () {\n try {\n await new Migrate(this.databasePath).refresh(this.connection, this.options(), true)\n\n if (this.option('seed')) {\n await this.runSeeders()\n }\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Create the migration repository.\n */\n protected async migrateInstall () {\n try {\n const migrate = new Migrate(this.databasePath)\n const { migrator } = await migrate.setupConnection(this.connection)\n await migrate.prepareDatabase(migrator)\n\n Logger.success('Migration repository installed.')\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback all database migrations.\n */\n protected async migrateReset () {\n try {\n await new Migrate(this.databasePath).reset(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Rollback the last database migration.\n */\n protected async migrateRollback () {\n try {\n await new Migrate(this.databasePath).rollback(this.connection, this.options(), true)\n } catch (e) {\n Logger.error('ERROR: ' + e)\n }\n }\n\n /**\n * Show the status of each migration.\n */\n protected async migrateStatus () {\n const migrations = await new Migrate(this.databasePath, undefined, (msg, sts) => {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n ['`musket migrate:install`?', 'grey']\n ], ' ', false)\n\n if (sts) Logger[sts](msg + hint, sts === 'error', true)\n }).status(this.connection, this.options(), true)\n\n try {\n if (migrations.length > 0) {\n Logger.twoColumnDetail('Migration name', 'Batch / Status')\n\n migrations.forEach(migration => {\n const status = migration.ran\n ? Logger.parse([[`[${migration.batch}]`, 'white'], ['Ran', 'green']], ' ', false)\n : Logger.parse([['Pending', 'yellow']], '', false)\n Logger.twoColumnDetail(migration.name, status)\n })\n }\n else {\n Logger.info('No migrations found')\n }\n } catch (e) {\n Logger.error(['ERROR: ' + e, 'Did you run musket migrate:install'])\n }\n }\n\n\n\n /**\n * Publish any migration files from installed packages.\n */\n protected async migratePublish () {\n const name = this.argument('package')\n\n try {\n /** Find the requested package */\n const packagePath = FileSystem.findModulePkg(name) ?? null\n if (!packagePath) throw new Error('Package not found')\n\n /** Get the package,json and instanciate the migration creator */\n const pkgJson = (await import(path.join(packagePath, 'package.json')))\n const creator = new MigrationCreator(path.join(packagePath, pkgJson.migrations ?? 'migrations'))\n\n const info = Logger.parse([\n [' Publishing migrations from', 'white'],\n [`${pkgJson.name}@${pkgJson.version}`, ['italic', 'gray']]\n ], ' ', false)\n\n Logger.info(`INFO: ${info}`)\n\n try {\n /** Publish any existing migrations */\n await creator.publish(this.databasePath, (fileName) => {\n Logger.twoColumnDetail(fileName, Logger.parse([['PUBLISHED', 'green']], '', false))\n })\n } catch {\n Logger.error([`ERROR: ${name} has no publishable migrations.`])\n }\n } catch (e) {\n const hint = Logger.parse([\n [' Did you forget to run', 'white'],\n [`\\`${await Resolver.getPakageInstallCommand(name)}\\``, 'grey']\n ], ' ', false)\n\n const error = Logger.parse([\n ['Package `', 'white'],\n [name, 'grey'],\n ['` not found', 'white']\n ], '', false)\n\n Logger.error(['ERROR: ' + error, hint + '?', String(e)])\n }\n }\n\n /**\n * Run database seeders\n */\n private async runSeeders () {\n await new SeedCommand(this.app, this.kernel)\n .setInput(\n { class: this.option('seeder', 'DatabaseSeeder'), force: this.option('force') },\n [],\n [],\n {},\n this.program\n )\n .handle()\n }\n}\n","import { FileSystem, Logger } from '@h3ravel/shared'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { DB } from '..'\nimport type { QueryBuilder } from '@h3ravel/arquebus'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class SeedCommand extends ConsoleCommand {\n /**\n * The current query builder instance\n */\n public queryBuilder!: QueryBuilder\n\n /**\n * The current database connection name\n */\n private connection!: string\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `db:seed\n {--class=DatabaseSeeder : The file name of the root seeder}\n {--d|database? : The database connection to use}\n {--force : Force the operation to run when in production}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Seed the database with records.'\n\n /**\n * Execute the console command.\n */\n public async handle () {\n const file = this.option('class')\n const force = this.option('force')\n const database = this.option('database')\n\n this.newLine()\n\n if (env('APP_ENV') === 'production' && !force) {\n this.error('INFO: Unable to run seeders, your app is currently in production.')\n }\n\n this.connection = database ?? config('database.default')\n this.queryBuilder = DB.instance(this.connection)\n\n if (!this.connection) {\n this.error('ERROR: Unknown database connection.')\n }\n\n let path = npath.join(process.cwd(), file)\n\n const [f1, f2] = [\n FileSystem.resolveFileUp(Str.snake(file), ['js', 'ts'], database_path('seeders')),\n FileSystem.resolveFileUp(Str.studly(file), ['js', 'ts'], database_path('seeders')),\n ]\n\n if (!f1 && !f2) {\n /**\n * Try to find the path assuming it's relative to cwd\n */\n if (!await FileSystem.fileExists(path)) {\n path = database_path(npath.join('seeders', file))\n }\n\n /**\n * Now try to find the path knowing it's relative to database_path\n */\n if (!await FileSystem.fileExists(path)) {\n this.error(`ERROR: Seeder ${Logger.log(`[${file}]`, 'bold', false)} not found.`)\n }\n } else {\n path = String(f1 ?? f2)\n }\n\n const { default: seeder } = (await import(path))\n\n if (seeder) {\n this.info('INFO: Seeding database.')\n this.newLine()\n\n await new seeder(this.app, this).run(this.queryBuilder)\n }\n }\n}\n","/// <reference path=\"../../core/src/app.globals.d.ts\" />\nimport { Knex } from 'knex'\n\ntype TFunction = (...args: any[]) => any\n\nexport interface TField {\n type: 'VAR_STRING' | 'BLOB' | 'DATETIME' | 'TIMESTAMP' | 'LONG' | 'JSON'\n length: number\n db: string\n table: string\n name: string\n string: TFunction,\n buffer: TFunction\n geometry: TFunction\n}\n\nexport interface TBaseConfig {\n client: 'mysql' | 'mysql2' | 'sqlite3' | 'oracle' | 'mariadb' | 'pg'\n connection: {\n typeCast?(field: TField, next: TFunction): any\n dateStrings?: boolean\n }\n pool?: {\n afterCreate: (connection: TConfig, callback: (val: any, con: any) => void) => Promise<any>\n } | undefined\n connections?: Record<string, TConfig>\n migrations?: {\n table: string\n path: string\n },\n factories?: {\n path: string\n },\n seeders?: {\n path: string\n },\n models?: {\n path: string\n }\n}\n\nexport type TConfig = TBaseConfig & ({\n client: 'pg'\n connection: Knex.PgConnectionConfig\n} | {\n client: 'oracle'\n connection: Knex.OracleDbConnectionConfig\n} | {\n client: 'mysql2'\n connection: Knex.MySql2ConnectionConfig\n} | {\n client: 'mysql'\n connection: Knex.MySqlConnectionConfig\n} | {\n client: 'sqlite3'\n connection: Knex.Sqlite3ConnectionConfig\n useNullAsDefault?: boolean\n} | {\n client: 'mariadb'\n connection: Knex.MariaSqlConnectionConfig\n useNullAsDefault?: boolean\n})\n\nexport const arquebusConfig = (config: any) => {\n return {\n sqlite: {\n client: config.connections.sqlite.driver,\n connection: <Knex.Sqlite3ConnectionConfig>{\n filename: database_path(config.connections.sqlite.database),\n debug: config.connections.sqlite.debug,\n flags: config.connections.sqlite.flags,\n options: config.connections.sqlite.options,\n expirationChecker: config.connections.sqlite.expirationChecker\n },\n useNullAsDefault: config.connections.sqlite.useNullAsDefault,\n },\n mysql: {\n client: config.connections.mysql.driver,\n connection: <Knex.MySql2ConnectionConfig>{\n host: config.connections.mysql.host ?? 'localhost',\n port: config.connections.mysql.port ?? 3306,\n user: config.connections.mysql.username ?? 'root',\n password: config.connections.mysql.password,\n database: config.connections.mysql.database,\n charset: config.connections.mysql.charset,\n socketPath: config.connections.mysql.unix_socket,\n localAddress: config.connections.mysql.url,\n },\n },\n mariadb: {\n client: config.connections.mariadb.driver,\n connection: <Knex.MariaSqlConnectionConfig>{\n host: config.connections.mariadb.host ?? 'localhost',\n port: config.connections.mariadb.port ?? 3306,\n user: config.connections.mariadb.username ?? 'root',\n password: config.connections.mariadb.password,\n database: config.connections.mariadb.database,\n charset: config.connections.mariadb.charset,\n socketPath: config.connections.mariadb.unix_socket,\n localAddress: config.connections.mariadb.url,\n expirationChecker: config.connections.mariadb.expirationChecker\n },\n },\n pgsql: {\n client: 'pg',\n connection: <Knex.PgConnectionConfig>{\n host: config.connections.pgsql.host ?? 'localhost',\n port: config.connections.pgsql.port ?? 3306,\n user: config.connections.pgsql.username ?? 'root',\n password: config.connections.pgsql.password,\n database: config.connections.pgsql.database,\n charset: config.connections.mysql.charset,\n connectionString: config.connections.pgsql.url,\n expirationChecker: config.connections.pgsql.expirationChecker\n },\n }\n } as unknown as TBaseConfig\n}\n","import { Model as BaseModel } from '@h3ravel/arquebus'\n\nexport class Model<M extends BaseModel = any> extends BaseModel {\n /**\n * Retrieve the model for a bound value.\n * \n * @param {any} value \n * @param {String|null} field \n * @returns \n */\n public resolveRouteBinding (value: any, field: undefined | string | null = null): Promise<M> {\n return this.newQuery().where(field ?? 'ids', value).firstOrFail()! as Promise<M>\n }\n}\n","import { MakeCommand } from '../Commands/MakeCommand'\nimport { MigrateCommand } from '../Commands/MigrateCommand'\nimport { SeedCommand } from '../Commands/SeedCommand'\nimport { ServiceProvider } from '@h3ravel/core'\nimport { arquebus } from '@h3ravel/arquebus'\nimport { arquebusConfig } from '../Configuration'\n\n/**\n * Database connection, ORM, migrations.\n * \n * Register DatabaseManager and QueryBuilder if required.\n * Set up ORM models and relationships.\n * Register migration and seeder commands.\n * \n */\nexport class DatabaseServiceProvider extends ServiceProvider {\n public static priority = 994\n\n register () {\n const config = this.app.make('config')\n\n const connection = Object.entries(arquebusConfig(config.get('database')))\n .find(([client]) => client === config.get('database.default'))\n ?.at(1)\n\n if (connection) {\n arquebus.addConnection(connection)\n }\n\n /** Register Musket Commands */\n this.registerCommands([MigrateCommand, MakeCommand, SeedCommand])\n }\n}\n","import { IQueryBuilder } from '@h3ravel/arquebus/types'\nimport { arquebus } from '@h3ravel/arquebus'\n\nexport class DB {\n connection?: string\n\n constructor(connection?: string) {\n if (connection) {\n this.connection = connection\n }\n }\n\n /**\n * New instance\n */\n public static table (name: string): IQueryBuilder {\n return new DB().builder().table(name)\n }\n\n /**\n * Builder table instance\n */\n public static instance (connection?: string) {\n return new DB(connection).builder()\n }\n\n /**\n * Builder transaction instance\n */\n public static transaction<C> (callback: (...args: C[]) => any) {\n return new DB().builder().transaction(callback)\n }\n\n private builder () {\n return arquebus.getInstance().connection(this.connection)\n }\n}\n","import { Application } from '@h3ravel/core'\nimport { Arr } from '@h3ravel/support'\nimport { Seeder as BaseSeeder } from '@h3ravel/arquebus'\nimport { SeedCommand } from './Commands/SeedCommand'\nimport { TaskManager } from '@h3ravel/shared'\n\nexport class Seeder extends BaseSeeder {\n /**\n * Seeders that have been called at least one time.\n */\n static called: Seeder[] = []\n\n constructor(public app: Application, public command?: SeedCommand) {\n super()\n }\n\n async run (_conn?: SeedCommand['queryBuilder'], ..._args: any[]) { };\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return this\n */\n public async call (className: typeof Seeder | typeof Seeder[], silent = false, parameters: any[] = []) {\n const classes = Arr.wrap(className)\n\n for (let i = 0; i < classes.length; i++) {\n const instance = this.resolve(classes[i])\n const name = instance.constructor.name\n\n if (silent === false) {\n await TaskManager.advancedTaskRunner(\n [[name, 'RUNNING'], [name, 'DONE']],\n async () => await instance.run(this.command!.queryBuilder, ...parameters)\n )\n } else {\n await instance.run(this.command!.queryBuilder, ...parameters)\n }\n\n Seeder.called.push(instance)\n }\n\n return this\n }\n\n /**\n * Resolve an instance of the given seeder class.\n *\n * @param className\n * \n * @return Seeder\n */\n protected resolve (className: typeof Seeder) {\n const instance = new (className as { new(app: any): Seeder })(this.app)\n\n if (this.command) {\n instance.setCommand(this.command)\n }\n\n return instance\n }\n\n /**\n * Run the given seeder class.\n *\n * @param className\n * @param silent\n * @param parameters\n * \n * @return void\n */\n public async callWith (className: typeof Seeder | typeof Seeder[], parameters: any[]) {\n await this.call(className, false, parameters)\n }\n\n /**\n * Silently run the given seeder class.\n *\n * @param className\n * @param parameters\n * \n * @return void\n */\n public async callSilent (className: typeof Seeder | typeof Seeder[], parameters: any[] = []) {\n await this.call(className, true, parameters)\n }\n\n /**\n * Set the console command instance.\n *\n * @param command\n * \n * @return this\n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K,UAAU;AAEnC,OAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACrC,MAAM,WAAW,KAAK,QAAQ,QAAQ,GAAG;GACzC,MAAM,OAAO,SAAS,YAAY;AAElC,OAAI,WAAW,MACX,OAAM,YAAY,mBACd,CAAC,CAAC,MAAM,UAAU,EAAE,CAAC,MAAM,OAAO,CAAC,EACnC,YAAY,MAAM,SAAS,IAAI,KAAK,QAAS,cAAc,GAAG,WAAW,CAC5E;OAED,OAAM,SAAS,IAAI,KAAK,QAAS,cAAc,GAAG,WAAW;AAGjE,UAAO,OAAO,KAAK,SAAS;;AAGhC,SAAO;;;;;;;;;CAUX,AAAU,QAAS,WAA0B;EACzC,MAAM,WAAW,IAAK,UAAwC,KAAK,IAAI;AAEvE,MAAI,KAAK,QACL,UAAS,WAAW,KAAK,QAAQ;AAGrC,SAAO;;;;;;;;;;;CAYX,MAAa,SAAU,WAA4C,YAAmB;AAClF,QAAM,KAAK,KAAK,WAAW,OAAO,WAAW;;;;;;;;;;CAWjD,MAAa,WAAY,WAA4C,aAAoB,EAAE,EAAE;AACzF,QAAM,KAAK,KAAK,WAAW,MAAM,WAAW;;;;;;;;;CAUhD,AAAO,WAAY,SAAsB;AACrC,OAAK,UAAU;AAEf,SAAO"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h3ravel/database",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"description": "Modeling data and migration system for H3ravel.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"module": "./dist/index.js",
|
|
9
|
+
"h3ravel": {
|
|
10
|
+
"providers": [
|
|
11
|
+
"DatabaseServiceProvider"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
9
14
|
"exports": {
|
|
10
15
|
".": {
|
|
11
16
|
"types": "./dist/index.d.ts",
|
|
@@ -40,10 +45,10 @@
|
|
|
40
45
|
"sqlite3": "^5.1.7"
|
|
41
46
|
},
|
|
42
47
|
"peerDependencies": {
|
|
43
|
-
"@h3ravel/
|
|
44
|
-
"@h3ravel/
|
|
45
|
-
"@h3ravel/
|
|
46
|
-
"@h3ravel/
|
|
48
|
+
"@h3ravel/core": "^1.16.0",
|
|
49
|
+
"@h3ravel/support": "^0.14.1",
|
|
50
|
+
"@h3ravel/filesystem": "^0.4.3",
|
|
51
|
+
"@h3ravel/shared": "^0.22.2"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {
|
|
49
54
|
"typescript": "^5.9.2"
|