@h3ravel/arquebus 0.6.17 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/index.cjs CHANGED
@@ -2564,7 +2564,8 @@ const HasRelations = (Model$1) => {
2564
2564
  return data;
2565
2565
  }
2566
2566
  guessBelongsToRelation() {
2567
- const functionName = (/* @__PURE__ */ new Error()).stack.split("\n")[2].split(" ")[5];
2567
+ var _e$stack;
2568
+ const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
2568
2569
  return getRelationName(functionName);
2569
2570
  }
2570
2571
  joiningTable(related, instance = null) {
@@ -2573,21 +2574,21 @@ const HasRelations = (Model$1) => {
2573
2574
  joiningTableSegment() {
2574
2575
  return snakeCase(this.constructor.name);
2575
2576
  }
2576
- hasOne(related, foreignKey = null, localKey = null) {
2577
+ hasOne(related, foreignKey, localKey) {
2577
2578
  const query = related.query();
2578
2579
  const instance = new related();
2579
2580
  foreignKey = foreignKey || this.getForeignKey();
2580
2581
  localKey = localKey || this.getKeyName();
2581
2582
  return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
2582
2583
  }
2583
- hasMany(related, foreignKey = null, localKey = null) {
2584
+ hasMany(related, foreignKey, localKey) {
2584
2585
  const query = related.query();
2585
2586
  const instance = new related();
2586
2587
  foreignKey = foreignKey || this.getForeignKey();
2587
2588
  localKey = localKey || this.getKeyName();
2588
2589
  return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
2589
2590
  }
2590
- belongsTo(related, foreignKey = null, ownerKey = null, relation = null) {
2591
+ belongsTo(related, foreignKey, ownerKey, relation) {
2591
2592
  const query = related.query();
2592
2593
  const instance = new related();
2593
2594
  foreignKey = foreignKey || instance.getForeignKey();
@@ -2595,7 +2596,7 @@ const HasRelations = (Model$1) => {
2595
2596
  relation = relation || this.guessBelongsToRelation();
2596
2597
  return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
2597
2598
  }
2598
- belongsToMany(related, table = null, foreignPivotKey = null, relatedPivotKey = null, parentKey = null, relatedKey = null) {
2599
+ belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
2599
2600
  const query = related.query();
2600
2601
  const instance = new related();
2601
2602
  table = table || this.joiningTable(related, instance);
@@ -2605,14 +2606,14 @@ const HasRelations = (Model$1) => {
2605
2606
  relatedKey = relatedKey || instance.getKeyName();
2606
2607
  return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
2607
2608
  }
2608
- hasOneThrough(related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {
2609
+ hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
2609
2610
  through = new through();
2610
2611
  const query = related.query();
2611
2612
  firstKey = firstKey || this.getForeignKey();
2612
2613
  secondKey = secondKey || through.getForeignKey();
2613
2614
  return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
2614
2615
  }
2615
- hasManyThrough(related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {
2616
+ hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
2616
2617
  through = new through();
2617
2618
  const query = related.query();
2618
2619
  firstKey = firstKey || this.getForeignKey();
@@ -5489,7 +5490,7 @@ var MigrationCreator = class {
5489
5490
 
5490
5491
  //#endregion
5491
5492
  //#region package.json
5492
- var version = "0.6.17";
5493
+ var version = "0.7.0";
5493
5494
 
5494
5495
  //#endregion
5495
5496
  //#region src/cli/cli.ts
package/bin/index.js CHANGED
@@ -2538,7 +2538,8 @@ const HasRelations = (Model$1) => {
2538
2538
  return data;
2539
2539
  }
2540
2540
  guessBelongsToRelation() {
2541
- const functionName = (/* @__PURE__ */ new Error()).stack.split("\n")[2].split(" ")[5];
2541
+ var _e$stack;
2542
+ const functionName = (((_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2]) ?? "").split(" ")[5];
2542
2543
  return getRelationName(functionName);
2543
2544
  }
2544
2545
  joiningTable(related, instance = null) {
@@ -2547,21 +2548,21 @@ const HasRelations = (Model$1) => {
2547
2548
  joiningTableSegment() {
2548
2549
  return snakeCase(this.constructor.name);
2549
2550
  }
2550
- hasOne(related, foreignKey = null, localKey = null) {
2551
+ hasOne(related, foreignKey, localKey) {
2551
2552
  const query = related.query();
2552
2553
  const instance = new related();
2553
2554
  foreignKey = foreignKey || this.getForeignKey();
2554
2555
  localKey = localKey || this.getKeyName();
2555
2556
  return new has_one_default(query, this, instance.getTable() + "." + foreignKey, localKey);
2556
2557
  }
2557
- hasMany(related, foreignKey = null, localKey = null) {
2558
+ hasMany(related, foreignKey, localKey) {
2558
2559
  const query = related.query();
2559
2560
  const instance = new related();
2560
2561
  foreignKey = foreignKey || this.getForeignKey();
2561
2562
  localKey = localKey || this.getKeyName();
2562
2563
  return new has_many_default(query, this, instance.getTable() + "." + foreignKey, localKey);
2563
2564
  }
2564
- belongsTo(related, foreignKey = null, ownerKey = null, relation = null) {
2565
+ belongsTo(related, foreignKey, ownerKey, relation) {
2565
2566
  const query = related.query();
2566
2567
  const instance = new related();
2567
2568
  foreignKey = foreignKey || instance.getForeignKey();
@@ -2569,7 +2570,7 @@ const HasRelations = (Model$1) => {
2569
2570
  relation = relation || this.guessBelongsToRelation();
2570
2571
  return new belongs_to_default(query, this, foreignKey, ownerKey, relation);
2571
2572
  }
2572
- belongsToMany(related, table = null, foreignPivotKey = null, relatedPivotKey = null, parentKey = null, relatedKey = null) {
2573
+ belongsToMany(related, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
2573
2574
  const query = related.query();
2574
2575
  const instance = new related();
2575
2576
  table = table || this.joiningTable(related, instance);
@@ -2579,14 +2580,14 @@ const HasRelations = (Model$1) => {
2579
2580
  relatedKey = relatedKey || instance.getKeyName();
2580
2581
  return new belongs_to_many_default(query, this, table, foreignPivotKey, relatedPivotKey, parentKey, relatedKey);
2581
2582
  }
2582
- hasOneThrough(related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {
2583
+ hasOneThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
2583
2584
  through = new through();
2584
2585
  const query = related.query();
2585
2586
  firstKey = firstKey || this.getForeignKey();
2586
2587
  secondKey = secondKey || through.getForeignKey();
2587
2588
  return new has_one_through_default(query, this, through, firstKey, secondKey, localKey || this.getKeyName(), secondLocalKey || through.getKeyName());
2588
2589
  }
2589
- hasManyThrough(related, through, firstKey = null, secondKey = null, localKey = null, secondLocalKey = null) {
2590
+ hasManyThrough(related, through, firstKey, secondKey, localKey, secondLocalKey) {
2590
2591
  through = new through();
2591
2592
  const query = related.query();
2592
2593
  firstKey = firstKey || this.getForeignKey();
@@ -5463,7 +5464,7 @@ var MigrationCreator = class {
5463
5464
 
5464
5465
  //#endregion
5465
5466
  //#region package.json
5466
- var version = "0.6.17";
5467
+ var version = "0.7.0";
5467
5468
 
5468
5469
  //#endregion
5469
5470
  //#region src/cli/cli.ts
@@ -0,0 +1,15 @@
1
+ import "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __defProp = Object.defineProperty;
5
+ var __export = (all) => {
6
+ let target = {};
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ return target;
12
+ };
13
+
14
+ //#endregion
15
+ export { __export as t };