@adobe/spacecat-shared-data-access 2.65.0 → 2.65.2

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,17 @@
1
+ # [@adobe/spacecat-shared-data-access-v2.65.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.65.1...@adobe/spacecat-shared-data-access-v2.65.2) (2025-10-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove all debug logs from data access ([#994](https://github.com/adobe/spacecat-shared/issues/994)) ([453d55b](https://github.com/adobe/spacecat-shared/commit/453d55bde5373519b9102ffdc8ca1ea523338078))
7
+
8
+ # [@adobe/spacecat-shared-data-access-v2.65.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.65.0...@adobe/spacecat-shared-data-access-v2.65.1) (2025-10-01)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * remove accessor logging ([#992](https://github.com/adobe/spacecat-shared/issues/992)) ([22a8be3](https://github.com/adobe/spacecat-shared/commit/22a8be32b910bb03521400bc572d1ba084ccc381))
14
+
1
15
  # [@adobe/spacecat-shared-data-access-v2.65.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.64.6...@adobe/spacecat-shared-data-access-v2.65.0) (2025-09-29)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "2.65.0",
3
+ "version": "2.65.2",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -260,26 +260,12 @@ class BaseCollection {
260
260
  || (options.fetchAllPages !== false && !options.limit);
261
261
 
262
262
  if (shouldFetchAllPages) {
263
- let pageCount = 1;
264
- const startTime = Date.now();
265
-
266
263
  while (result.cursor) {
267
- pageCount += 1;
268
264
  queryOptions.cursor = result.cursor;
269
265
  // eslint-disable-next-line no-await-in-loop
270
266
  result = await query.go(queryOptions);
271
267
  allData = allData.concat(result.data);
272
268
  }
273
-
274
- // Debug logging to track pagination behavior
275
- if (pageCount > 1) {
276
- this.log.debug(`Pagination completed for ${this.entityName}`, {
277
- entityName: this.entityName,
278
- totalPages: pageCount,
279
- totalRecords: allData.length,
280
- queryDuration: Date.now() - startTime,
281
- });
282
- }
283
269
  }
284
270
 
285
271
  if (options.limit === 1) {
@@ -415,8 +401,6 @@ class BaseCollection {
415
401
 
416
402
  this.#invalidateCache();
417
403
 
418
- this.log.debug(`Created item for [${this.entityName}]`); // ~100k logs
419
-
420
404
  await this.#onCreate(instance);
421
405
 
422
406
  return instance;
@@ -495,8 +479,6 @@ class BaseCollection {
495
479
 
496
480
  this.#invalidateCache();
497
481
 
498
- this.log.debug(`Created ${createdItems.length} items for [${this.entityName}]`);
499
-
500
482
  await this.#onCreateMany({ createdItems, errorItems });
501
483
 
502
484
  return { createdItems, errorItems };
@@ -537,8 +519,6 @@ class BaseCollection {
537
519
  this.log.error(`Failed to process all items in batch write for [${this.entityName}]: ${JSON.stringify(response.unprocessed)}`);
538
520
  }
539
521
 
540
- this.log.debug(`Updated ${items.length} items for [${this.entityName}]`);
541
-
542
522
  return this.#invalidateCache();
543
523
  } catch (error) {
544
524
  return this.#logAndThrowError('Failed to save many', error);
@@ -565,8 +545,6 @@ class BaseCollection {
565
545
 
566
546
  await this.entity.delete(ids.map((id) => ({ [this.idName]: id }))).go();
567
547
 
568
- this.log.debug(`Removed ${ids.length} items for [${this.entityName}]`);
569
-
570
548
  return this.#invalidateCache();
571
549
  } catch (error) {
572
550
  return this.#logAndThrowError('Failed to remove by IDs', error);
@@ -267,8 +267,6 @@ class BaseModel {
267
267
  }
268
268
  });
269
269
 
270
- this.log.debug(`Removing entity ${this.entityName} with ID ${this.getId()} and ${dependents.length} dependents`);
271
-
272
270
  await Promise.all(removePromises);
273
271
 
274
272
  await this.entity.remove({ [this.idName]: this.getId() }).go();
@@ -297,8 +295,6 @@ class BaseModel {
297
295
  async save() {
298
296
  // todo: validate associations
299
297
  try {
300
- this.log.debug(`Saving entity ${this.entityName} with ID ${this.getId()}`);
301
-
302
298
  await this.patcher.save();
303
299
  this.#invalidateCache();
304
300
 
@@ -97,18 +97,6 @@ class EntityRegistry {
97
97
  const collection = new Collection(this.service, this, schema, this.log);
98
98
  this.collections.set(Collection.name, collection);
99
99
  });
100
-
101
- this.#logIndexes();
102
- }
103
-
104
- #logIndexes() {
105
- // reduce collection schema indexes into object
106
- const indexes = Object.values(EntityRegistry.entities).reduce((acc, { schema }) => {
107
- acc[schema.getEntityName()] = schema.indexes;
108
- return acc;
109
- }, {});
110
-
111
- this.log.debug('Indexes:', JSON.stringify(indexes, null, 2));
112
100
  }
113
101
 
114
102
  /**
@@ -45,7 +45,6 @@ const createSortKeyAccessorConfigs = (
45
45
 
46
46
  const sortKeys = belongsToRef.getSortKeys();
47
47
  if (!isNonEmptyArray(sortKeys)) {
48
- log.debug(`No sort keys defined for ${entity.schema.getModelName()} to ${target}`);
49
48
  return configs;
50
49
  }
51
50
 
@@ -315,7 +315,7 @@ class Schema {
315
315
  * @throws {SchemaError} - Throws an error if the entity is not a BaseModel or BaseCollection.
316
316
  * @return {Object[]}
317
317
  */
318
- toAccessorConfigs(entity, log = console) {
318
+ toAccessorConfigs(entity) {
319
319
  if (!(entity instanceof BaseModel) && !(entity instanceof BaseCollection)) {
320
320
  throw new SchemaError(this, 'Entity must extend BaseModel or BaseCollection');
321
321
  }
@@ -323,7 +323,7 @@ class Schema {
323
323
  const indexAccessors = this.getIndexAccessors();
324
324
  const accessorConfigs = [];
325
325
 
326
- indexAccessors.forEach(({ indexName, keySets }) => {
326
+ indexAccessors.forEach(({ keySets }) => {
327
327
  // generate a method for each prefix of the keySets array
328
328
  // for example, if keySets = ['opportunityId', 'status'], we create:
329
329
  // allByOpportunityId(...)
@@ -345,8 +345,6 @@ class Schema {
345
345
  name: keyNamesToMethodName(subset, 'findBy'),
346
346
  requiredKeys: subset,
347
347
  });
348
-
349
- log.debug(`Created accessors for index [${indexName}] with keys [${subset.join(', ')}]`);
350
348
  });
351
349
  });
352
350
 
@@ -150,7 +150,7 @@ class SiteTopFormCollection extends BaseCollection {
150
150
  });
151
151
  } catch (legacyError) {
152
152
  // If the null search also fails, ignore and return the original null result
153
- this.log.debug(`Legacy null formSource search failed: ${legacyError.message}`);
153
+ this.log.error(`Legacy null formSource search failed: ${legacyError.message}`);
154
154
  }
155
155
  }
156
156
 
@@ -48,8 +48,6 @@ class SuggestionCollection extends BaseCollection {
48
48
 
49
49
  await this._saveMany(suggestions);
50
50
 
51
- this.log.debug(`Bulk updated ${suggestions.length} suggestions to status: ${status}`);
52
-
53
51
  return suggestions;
54
52
  }
55
53
  }