@adobe/spacecat-shared-data-access 1.61.7 → 1.61.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-data-access-v1.61.8](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.7...@adobe/spacecat-shared-data-access-v1.61.8) (2024-12-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * logging ([#515](https://github.com/adobe/spacecat-shared/issues/515)) ([a0010ea](https://github.com/adobe/spacecat-shared/commit/a0010eae6ff87b04c065568c1af135736cfdbcfd))
7
+
1
8
  # [@adobe/spacecat-shared-data-access-v1.61.7](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.61.6...@adobe/spacecat-shared-data-access-v1.61.7) (2024-12-31)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "1.61.7",
3
+ "version": "1.61.8",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -377,6 +377,9 @@ class BaseCollection {
377
377
  const instance = this.#createInstance(record.data);
378
378
 
379
379
  this.#invalidateCache();
380
+
381
+ this.log.info(`Created item for [${this.entityName}]`);
382
+
380
383
  await this.#onCreate(instance);
381
384
 
382
385
  return instance;
@@ -491,6 +494,8 @@ class BaseCollection {
491
494
  this.log.error(`Failed to process all items in batch write for [${this.entityName}]: ${JSON.stringify(response.unprocessed)}`);
492
495
  }
493
496
 
497
+ this.log.info(`Updated ${items.length} items for [${this.entityName}]`);
498
+
494
499
  return this.#invalidateCache();
495
500
  } catch (error) {
496
501
  return this.#logAndThrowError('Failed to save many', error);
@@ -513,11 +518,12 @@ class BaseCollection {
513
518
  }
514
519
 
515
520
  try {
516
- this.log.info(`Removing ${ids.length} items for [${this.entityName}]`);
517
521
  // todo: consider removing dependent records
518
522
 
519
523
  await this.entity.delete(ids.map((id) => ({ [this.idName]: id }))).go();
520
524
 
525
+ this.log.info(`Removed ${ids.length} items for [${this.entityName}]`);
526
+
521
527
  return this.#invalidateCache();
522
528
  } catch (error) {
523
529
  return this.#logAndThrowError('Failed to remove by IDs', error);
@@ -346,7 +346,7 @@ class Schema {
346
346
  requiredKeys: subset,
347
347
  });
348
348
 
349
- log.info(`Created accessors for index [${indexName}] with keys [${subset.join(', ')}]`);
349
+ log.debug(`Created accessors for index [${indexName}] with keys [${subset.join(', ')}]`);
350
350
  });
351
351
  });
352
352
 
@@ -48,6 +48,8 @@ class SuggestionCollection extends BaseCollection {
48
48
 
49
49
  await this._saveMany(suggestions);
50
50
 
51
+ this.log.info(`Bulk updated ${suggestions.length} suggestions to status: ${status}`);
52
+
51
53
  return suggestions;
52
54
  }
53
55
  }
@@ -153,6 +153,6 @@ export function createAccessor(config) { /* eslint-disable no-underscore-dangle
153
153
  export function createAccessors(configs, log) {
154
154
  configs.forEach((config) => {
155
155
  createAccessor(config);
156
- log.info(`Created accessor ${config.name} for ${config.context.schema.getModelName()} to ${config.collection.schema.getModelName()}`);
156
+ log.debug(`Created accessor ${config.name} for ${config.context.schema.getModelName()} to ${config.collection.schema.getModelName()}`);
157
157
  });
158
158
  }