@samet-it/be-couchbase-common 1.0.5 → 1.0.7

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.
@@ -165,7 +165,7 @@ let CbAdapterService = class CbAdapterService {
165
165
  this.logger.warn(`${opt.name} => (${err.name})${err.message}`);
166
166
  return;
167
167
  }
168
- this.logger.error(`${opt.name} => (${err.name})${err.message}`, JSON.stringify(err.context));
168
+ this.logger.debug(`${opt.name} => (${err.name})${err.message}`, JSON.stringify(err.context));
169
169
  throw err;
170
170
  }
171
171
  /** {@inheritDoc} */
@@ -250,10 +250,10 @@ let CbAdapterService = class CbAdapterService {
250
250
  const obj = this._cbErrors.get(name);
251
251
  obj.count++;
252
252
  if (obj.known) {
253
- this.logger.error(`!known[${name}] #${op} [${obj.count}]`, err);
253
+ this.logger.debug(`!known[${name}] #${op} [${obj.count}]`, err);
254
254
  }
255
255
  else {
256
- this.logger.warn(`!unknown[${name}] #${op} [${obj.count}]`, err);
256
+ this.logger.debug(`!unknown[${name}] #${op} [${obj.count}]`, err);
257
257
  }
258
258
  }
259
259
  }
@@ -138,8 +138,8 @@ class CbRepo {
138
138
  lines
139
139
  .add(`SELECT meta().id as ${F_URN}`)
140
140
  .add(`FROM ${this.fullPath} a`)
141
- .add(`WHERE (a.${F_TRASH_ID} is missing)`)
142
141
  .add(`USE KEYS ${this.cb.s(urn)}`)
142
+ .add(`WHERE (a.${F_TRASH_ID} IS MISSING)`)
143
143
  .add('LIMIT 1');
144
144
  return ((_a = (yield this.cb.one(this, lines.end(), opt)).row) === null || _a === void 0 ? void 0 : _a._urn) !== undefined;
145
145
  });
@@ -159,8 +159,8 @@ class CbRepo {
159
159
  lines
160
160
  .add(`SELECT a.*`)
161
161
  .add(`FROM ${this.fullPath} a`)
162
- .add(`WHERE (a.${F_TRASH_ID} is missing)`)
163
162
  .add(`USE KEYS ${this.cb.s(urn)}`)
163
+ .add(`WHERE (a.${F_TRASH_ID} IS MISSING)`)
164
164
  .add('LIMIT 1');
165
165
  return (yield this.cb.one(this, lines.end(), opt)).row;
166
166
  });
@@ -191,8 +191,8 @@ class CbRepo {
191
191
  lines
192
192
  .add(`SELECT a.*`)
193
193
  .add(`FROM ${this.fullPath} a`)
194
- .add(`WHERE (a.${F_TRASH_ID} is missing)`)
195
- .add(`USE KEYS [${urnList.map(urn => this.cb.s(urn)).join(',')}]`);
194
+ .add(`USE KEYS [${urnList.map(urn => this.cb.s(urn)).join(',')}]`)
195
+ .add(`WHERE (a.${F_TRASH_ID} IS MISSING)`);
196
196
  return (yield this.cb.more(this, lines.end(), opt)).rows;
197
197
  });
198
198
  }
@@ -222,8 +222,8 @@ class CbRepo {
222
222
  lines
223
223
  .add(`DELETE
224
224
  FROM ${this.fullPath} a`)
225
- .add(`WHERE (a.${F_TRASH_ID} is missing)`)
226
225
  .add(`USE KEYS ${this.cb.s(urn)}`)
226
+ .add(`WHERE (a.${F_TRASH_ID} is missing)`)
227
227
  .add(`RETURNING a.${F_ID}`);
228
228
  return (_a = (yield this.cb.one(this, lines.end(), opt)).row) === null || _a === void 0 ? void 0 : _a.id;
229
229
  });
@@ -296,9 +296,9 @@ class CbRepo {
296
296
  const lines = (0, line_1.cbLine)();
297
297
  lines
298
298
  .add(`UPDATE ${this.fullPath} a`)
299
+ .add(`USE KEYS ${this.cb.s(urn)}`)
299
300
  .add(`SET a.${F_TRASH_ID} = ${this.cb.s(opt.trashId)}`)
300
- .add(`WHERE (a.${F_TRASH_ID} is missing)`)
301
- .add(`USE KEYS ${this.cb.s(urn)}`);
301
+ .add(`WHERE (a.${F_TRASH_ID} is missing)`);
302
302
  yield this.cb.one(this, lines.end(), opt);
303
303
  return opt.trashId;
304
304
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samet-it/be-couchbase-common",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Couchbase common component",
5
5
  "keywords": [
6
6
  "Couchbase"