remult 3.3.0-next.1 → 3.3.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.
@@ -354,7 +354,7 @@ var KnexEntityDataProvider = /** @class */ (function () {
354
354
  });
355
355
  });
356
356
  };
357
- KnexEntityDataProvider.prototype.update = function (id, data) {
357
+ KnexEntityDataProvider.prototype.update = function (id, data, options) {
358
358
  return tslib_1.__awaiter(this, void 0, void 0, function () {
359
359
  var e, f, updateObject, _a, _b, x, v, key, e_4_1, where;
360
360
  var e_4, _c;
@@ -407,6 +407,8 @@ var KnexEntityDataProvider = /** @class */ (function () {
407
407
  .where(function (b) { return where.forEach(function (w) { return w(b); }); })];
408
408
  case 12:
409
409
  _d.sent();
410
+ if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
411
+ return [2 /*return*/, undefined];
410
412
  return [2 /*return*/, (0, sql_database_js_1.getRowAfterUpdate)(this.entity, this, data, id, 'update')];
411
413
  }
412
414
  });
@@ -435,7 +437,7 @@ var KnexEntityDataProvider = /** @class */ (function () {
435
437
  });
436
438
  });
437
439
  };
438
- KnexEntityDataProvider.prototype.insert = function (data) {
440
+ KnexEntityDataProvider.prototype.insert = function (data, options) {
439
441
  return tslib_1.__awaiter(this, void 0, void 0, function () {
440
442
  var e, insertObject, _a, _b, x, v, key, e_5_1, insert, newId_1, result, result;
441
443
  var e_5, _c;
@@ -493,16 +495,22 @@ var KnexEntityDataProvider = /** @class */ (function () {
493
495
  result = _d.sent();
494
496
  newId_1 = result[0][this.entity.idMetadata.field.dbName];
495
497
  _d.label = 14;
496
- case 14: return [2 /*return*/, this.find({
497
- where: new filter_interfaces_js_1.Filter(function (x) {
498
- return x.isEqualTo(_this.entity.idMetadata.field, newId_1);
499
- }),
500
- }).then(function (y) { return y[0]; })];
498
+ case 14:
499
+ if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
500
+ return [2 /*return*/, undefined];
501
+ return [2 /*return*/, this.find({
502
+ where: new filter_interfaces_js_1.Filter(function (x) {
503
+ return x.isEqualTo(_this.entity.idMetadata.field, newId_1);
504
+ }),
505
+ }).then(function (y) { return y[0]; })];
501
506
  case 15: return [4 /*yield*/, insert];
502
507
  case 16:
503
508
  _d.sent();
504
509
  _d.label = 17;
505
- case 17: return [2 /*return*/, (0, sql_database_js_1.getRowAfterUpdate)(this.entity, this, data, undefined, 'insert')];
510
+ case 17:
511
+ if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
512
+ return [2 /*return*/, undefined];
513
+ return [2 /*return*/, (0, sql_database_js_1.getRowAfterUpdate)(this.entity, this, data, undefined, 'insert')];
506
514
  }
507
515
  });
508
516
  });
package/remult-mongo.js CHANGED
@@ -476,7 +476,7 @@ var MongoEntityDataProvider = /** @class */ (function () {
476
476
  });
477
477
  });
478
478
  };
479
- MongoEntityDataProvider.prototype.update = function (id, data) {
479
+ MongoEntityDataProvider.prototype.update = function (id, data, options) {
480
480
  return tslib_1.__awaiter(this, void 0, void 0, function () {
481
481
  var _a, collection, e, f, newR, keys, _b, _c, f_1, r, _d, _e;
482
482
  var e_11, _f;
@@ -514,6 +514,8 @@ var MongoEntityDataProvider = /** @class */ (function () {
514
514
  { session: this.session }])];
515
515
  case 3:
516
516
  r = _g.sent();
517
+ if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
518
+ return [2 /*return*/, undefined];
517
519
  return [2 /*return*/, (0, sql_database_js_1.getRowAfterUpdate)(this.entity, this, data, id, 'update')];
518
520
  }
519
521
  });
@@ -541,7 +543,7 @@ var MongoEntityDataProvider = /** @class */ (function () {
541
543
  });
542
544
  });
543
545
  };
544
- MongoEntityDataProvider.prototype.insert = function (data) {
546
+ MongoEntityDataProvider.prototype.insert = function (data, options) {
545
547
  return tslib_1.__awaiter(this, void 0, void 0, function () {
546
548
  var _a, collection, e, r, _b, _c, _d;
547
549
  return tslib_1.__generator(this, function (_e) {
@@ -556,6 +558,8 @@ var MongoEntityDataProvider = /** @class */ (function () {
556
558
  }])];
557
559
  case 3:
558
560
  r = _e.sent();
561
+ if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
562
+ return [2 /*return*/, undefined];
559
563
  _d = this.translateFromDb;
560
564
  return [4 /*yield*/, collection.findOne({ _id: r.insertedId }, { session: this.session })];
561
565
  case 4: return [4 /*yield*/, _d.apply(this, [_e.sent(), e])];