@sqb/connect 4.5.4 → 4.5.5

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.
@@ -105,6 +105,8 @@ class Repository extends (0, strict_typed_events_1.TypedEventEmitterClass)(stric
105
105
  });
106
106
  }
107
107
  async _create(values, options) {
108
+ if (!values)
109
+ throw new TypeError('You must provide values');
108
110
  await this._emit('before-create', values, options);
109
111
  const keyValues = await create_command_js_1.CreateCommand.execute({
110
112
  ...options,
@@ -119,6 +121,8 @@ class Repository extends (0, strict_typed_events_1.TypedEventEmitterClass)(stric
119
121
  return result;
120
122
  }
121
123
  async _createOnly(values, options) {
124
+ if (!values)
125
+ throw new TypeError('You must provide values');
122
126
  await this._emit('before-create', values, options);
123
127
  await create_command_js_1.CreateCommand.execute({
124
128
  ...options,
@@ -200,6 +204,8 @@ class Repository extends (0, strict_typed_events_1.TypedEventEmitterClass)(stric
200
204
  return rowsAffected;
201
205
  }
202
206
  async _update(keyValue, values, options) {
207
+ if (!values)
208
+ throw new TypeError('You must provide values');
203
209
  await this._emit('before-update', keyValue, values, options);
204
210
  const keyValues = (0, extract_keyvalues_js_1.extractKeyValues)(this._entity, keyValue, true);
205
211
  const filter = [keyValues];
@@ -221,6 +227,8 @@ class Repository extends (0, strict_typed_events_1.TypedEventEmitterClass)(stric
221
227
  return rowsAffected ? keyValues : undefined;
222
228
  }
223
229
  async _updateAll(values, options) {
230
+ if (!values)
231
+ throw new TypeError('You must provide values');
224
232
  await this._emit('before-update-all', values, options);
225
233
  const rowsAffected = await update_command_js_1.UpdateCommand.execute({
226
234
  ...options,
@@ -102,6 +102,8 @@ export class Repository extends TypedEventEmitterClass(AsyncEventEmitter) {
102
102
  });
103
103
  }
104
104
  async _create(values, options) {
105
+ if (!values)
106
+ throw new TypeError('You must provide values');
105
107
  await this._emit('before-create', values, options);
106
108
  const keyValues = await CreateCommand.execute({
107
109
  ...options,
@@ -116,6 +118,8 @@ export class Repository extends TypedEventEmitterClass(AsyncEventEmitter) {
116
118
  return result;
117
119
  }
118
120
  async _createOnly(values, options) {
121
+ if (!values)
122
+ throw new TypeError('You must provide values');
119
123
  await this._emit('before-create', values, options);
120
124
  await CreateCommand.execute({
121
125
  ...options,
@@ -197,6 +201,8 @@ export class Repository extends TypedEventEmitterClass(AsyncEventEmitter) {
197
201
  return rowsAffected;
198
202
  }
199
203
  async _update(keyValue, values, options) {
204
+ if (!values)
205
+ throw new TypeError('You must provide values');
200
206
  await this._emit('before-update', keyValue, values, options);
201
207
  const keyValues = extractKeyValues(this._entity, keyValue, true);
202
208
  const filter = [keyValues];
@@ -218,6 +224,8 @@ export class Repository extends TypedEventEmitterClass(AsyncEventEmitter) {
218
224
  return rowsAffected ? keyValues : undefined;
219
225
  }
220
226
  async _updateAll(values, options) {
227
+ if (!values)
228
+ throw new TypeError('You must provide values');
221
229
  await this._emit('before-update-all', values, options);
222
230
  const rowsAffected = await UpdateCommand.execute({
223
231
  ...options,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sqb/connect",
3
3
  "description": "Multi-dialect database connection framework written with TypeScript",
4
- "version": "4.5.4",
4
+ "version": "4.5.5",
5
5
  "author": "Panates",
6
6
  "contributors": [
7
7
  "Eray Hanoglu <e.hanoglu@panates.com>",
@@ -46,7 +46,7 @@
46
46
  "@types/lodash": "^4.14.186"
47
47
  },
48
48
  "peerDependencies": {
49
- "@sqb/builder": "^4.5.4"
49
+ "@sqb/builder": "^4.5.5"
50
50
  },
51
51
  "type": "module",
52
52
  "types": "esm/index.d.ts",