s3db.js 7.2.1 → 7.3.1

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.
@@ -1,5 +1,5 @@
1
1
  import tryFn from "../../concerns/try-fn.js";
2
- // Remover o import estático do SDK
2
+ // Remove static SDK import
3
3
  // import { SQSClient, ReceiveMessageCommand, DeleteMessageCommand } from '@aws-sdk/client-sqs';
4
4
 
5
5
  export class SqsConsumer {
@@ -13,7 +13,7 @@ export class SqsConsumer {
13
13
  this.region = region;
14
14
  this.credentials = credentials;
15
15
  this.endpoint = endpoint;
16
- this.sqs = null; // será inicializado dinamicamente
16
+ this.sqs = null; // will be initialized dynamically
17
17
  this._stopped = false;
18
18
  this._timer = null;
19
19
  this._pollPromise = null;
@@ -132,23 +132,23 @@ export class FullTextPlugin extends Plugin {
132
132
  this.wrapResourceMethod(resource, 'insert', async (result, args, methodName) => {
133
133
  const [data] = args;
134
134
  // Index the new record
135
- this.indexRecord(resource.name, result.id, data).catch(console.error);
135
+ this.indexRecord(resource.name, result.id, data).catch(() => {});
136
136
  return result;
137
137
  });
138
138
 
139
139
  this.wrapResourceMethod(resource, 'update', async (result, args, methodName) => {
140
140
  const [id, data] = args;
141
141
  // Remove old index entries
142
- this.removeRecordFromIndex(resource.name, id).catch(console.error);
142
+ this.removeRecordFromIndex(resource.name, id).catch(() => {});
143
143
  // Index the updated record
144
- this.indexRecord(resource.name, id, result).catch(console.error);
144
+ this.indexRecord(resource.name, id, result).catch(() => {});
145
145
  return result;
146
146
  });
147
147
 
148
148
  this.wrapResourceMethod(resource, 'delete', async (result, args, methodName) => {
149
149
  const [id] = args;
150
150
  // Remove from index
151
- this.removeRecordFromIndex(resource.name, id).catch(console.error);
151
+ this.removeRecordFromIndex(resource.name, id).catch(() => {});
152
152
  return result;
153
153
  });
154
154
 
@@ -156,7 +156,7 @@ export class FullTextPlugin extends Plugin {
156
156
  const [ids] = args;
157
157
  // Remove from index
158
158
  for (const id of ids) {
159
- this.removeRecordFromIndex(resource.name, id).catch(console.error);
159
+ this.removeRecordFromIndex(resource.name, id).catch(() => {});
160
160
  }
161
161
  return result;
162
162
  });
@@ -319,7 +319,7 @@ export class MetricsPlugin extends Plugin {
319
319
  // Only start timer if flushInterval is greater than 0
320
320
  if (this.config.flushInterval > 0) {
321
321
  this.flushTimer = setInterval(() => {
322
- this.flushMetrics().catch(console.error);
322
+ this.flushMetrics().catch(() => {});
323
323
  }, this.config.flushInterval);
324
324
  }
325
325
  }
@@ -405,7 +405,7 @@ export class MetricsPlugin extends Plugin {
405
405
  this.resetMetrics();
406
406
  });
407
407
  if (!ok) {
408
- console.error('Failed to flush metrics:', err);
408
+ // Silent error handling
409
409
  }
410
410
  }
411
411
 
@@ -1,7 +1,7 @@
1
1
  import { createConsumer } from './consumers/index.js';
2
2
  import tryFn from "../concerns/try-fn.js";
3
3
 
4
- // Exemplo de configuração para SQS:
4
+ // Example configuration for SQS:
5
5
  // const plugin = new QueueConsumerPlugin({
6
6
  // driver: 'sqs',
7
7
  // queues: { users: 'https://sqs.us-east-1.amazonaws.com/123456789012/my-queue' },
@@ -11,7 +11,7 @@ import tryFn from "../concerns/try-fn.js";
11
11
  // maxMessages: 10,
12
12
  // });
13
13
  //
14
- // Exemplo de configuração para RabbitMQ:
14
+ // Example configuration for RabbitMQ:
15
15
  // const plugin = new QueueConsumerPlugin({
16
16
  // driver: 'rabbitmq',
17
17
  // queues: { users: 'users-queue' },
@@ -23,7 +23,7 @@ import tryFn from "../concerns/try-fn.js";
23
23
  export default class QueueConsumerPlugin {
24
24
  constructor(options = {}) {
25
25
  this.options = options;
26
- // Novo padrão: consumers = [{ driver, config, consumers: [{ queueUrl, resources, ... }] }]
26
+ // New pattern: consumers = [{ driver, config, consumers: [{ queueUrl, resources, ... }] }]
27
27
  this.driversConfig = Array.isArray(options.consumers) ? options.consumers : [];
28
28
  this.consumers = [];
29
29
  }