s3db.js 19.3.18 → 19.3.19
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/dist/clients/recker-http-handler.js +14 -5
- package/dist/clients/s3-client.class.js +20 -12
- package/dist/s3db-lite.cjs +37 -20
- package/dist/s3db-lite.es.js +37 -20
- package/dist/s3db.cjs +36 -19
- package/dist/s3db.es.js +36 -19
- package/dist/types/clients/recker-http-handler.d.ts +2 -1
- package/dist/types/clients/s3-client.class.d.ts +1 -0
- package/dist/types/clients/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/clients/recker-http-handler.ts +14 -5
- package/src/clients/s3-client.class.ts +23 -13
- package/src/clients/types.ts +1 -1
|
@@ -359,13 +359,22 @@ export class ReckerHttpHandler {
|
|
|
359
359
|
circuitBreakerTrips: 0,
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
362
|
+
destroy() {
|
|
363
|
+
void this.destroyAsync();
|
|
364
|
+
}
|
|
365
|
+
async destroyAsync() {
|
|
366
|
+
const client = this.client;
|
|
367
|
+
this.client = null;
|
|
367
368
|
this.deduplicator = null;
|
|
368
369
|
this.circuitBreaker = null;
|
|
370
|
+
if (client) {
|
|
371
|
+
try {
|
|
372
|
+
await client.destroy();
|
|
373
|
+
}
|
|
374
|
+
catch {
|
|
375
|
+
// Ignore cleanup errors
|
|
376
|
+
}
|
|
377
|
+
}
|
|
369
378
|
}
|
|
370
379
|
}
|
|
371
380
|
export default ReckerHttpHandler;
|
|
@@ -20,6 +20,7 @@ export class S3Client extends EventEmitter {
|
|
|
20
20
|
httpClientOptions;
|
|
21
21
|
client;
|
|
22
22
|
httpHandler = null;
|
|
23
|
+
_rawHttpClientOptions;
|
|
23
24
|
_inflightCoalescing;
|
|
24
25
|
taskExecutorConfig;
|
|
25
26
|
taskExecutor;
|
|
@@ -37,6 +38,7 @@ export class S3Client extends EventEmitter {
|
|
|
37
38
|
this.id = id ?? idGenerator(77);
|
|
38
39
|
this.config = new ConnectionString(connectionString);
|
|
39
40
|
this.connectionString = connectionString;
|
|
41
|
+
this._rawHttpClientOptions = httpClientOptions || {};
|
|
40
42
|
this.httpClientOptions = {
|
|
41
43
|
keepAlive: true,
|
|
42
44
|
keepAliveMsecs: 1000,
|
|
@@ -102,17 +104,23 @@ export class S3Client extends EventEmitter {
|
|
|
102
104
|
}
|
|
103
105
|
_normalizeHttpHandlerOptions() {
|
|
104
106
|
const options = this.httpClientOptions;
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
const raw = this._rawHttpClientOptions;
|
|
108
|
+
const connections = typeof raw.connections === 'number'
|
|
109
|
+
? raw.connections
|
|
110
|
+
: raw.maxSockets;
|
|
111
|
+
const keepAliveTimeout = raw.keepAliveTimeout ?? raw.keepAliveMsecs;
|
|
112
|
+
const bodyTimeout = raw.bodyTimeout ?? raw.timeout;
|
|
113
|
+
const normalized = { ...options };
|
|
114
|
+
if (connections !== undefined) {
|
|
115
|
+
normalized.connections = connections;
|
|
116
|
+
}
|
|
117
|
+
if (keepAliveTimeout !== undefined) {
|
|
118
|
+
normalized.keepAliveTimeout = keepAliveTimeout;
|
|
119
|
+
}
|
|
120
|
+
if (bodyTimeout !== undefined) {
|
|
121
|
+
normalized.bodyTimeout = bodyTimeout;
|
|
122
|
+
}
|
|
123
|
+
return normalized;
|
|
116
124
|
}
|
|
117
125
|
_createTasksPool() {
|
|
118
126
|
const poolConfig = {
|
|
@@ -217,7 +225,7 @@ export class S3Client extends EventEmitter {
|
|
|
217
225
|
}
|
|
218
226
|
async destroy() {
|
|
219
227
|
if (this.httpHandler) {
|
|
220
|
-
await this.httpHandler.
|
|
228
|
+
await this.httpHandler.destroyAsync();
|
|
221
229
|
this.httpHandler = null;
|
|
222
230
|
}
|
|
223
231
|
if (this.client && typeof this.client.destroy === 'function') {
|
package/dist/s3db-lite.cjs
CHANGED
|
@@ -40162,7 +40162,7 @@ function getDefaultUserAgent() {
|
|
|
40162
40162
|
return `recker/${VERSION$1}`;
|
|
40163
40163
|
}
|
|
40164
40164
|
|
|
40165
|
-
const VERSION = '1.0.
|
|
40165
|
+
const VERSION = '1.0.68';
|
|
40166
40166
|
let _version = null;
|
|
40167
40167
|
async function getVersion() {
|
|
40168
40168
|
if (_version)
|
|
@@ -51397,13 +51397,22 @@ class ReckerHttpHandler {
|
|
|
51397
51397
|
circuitBreakerTrips: 0,
|
|
51398
51398
|
};
|
|
51399
51399
|
}
|
|
51400
|
-
|
|
51401
|
-
|
|
51402
|
-
|
|
51403
|
-
|
|
51404
|
-
|
|
51400
|
+
destroy() {
|
|
51401
|
+
void this.destroyAsync();
|
|
51402
|
+
}
|
|
51403
|
+
async destroyAsync() {
|
|
51404
|
+
const client = this.client;
|
|
51405
|
+
this.client = null;
|
|
51405
51406
|
this.deduplicator = null;
|
|
51406
51407
|
this.circuitBreaker = null;
|
|
51408
|
+
if (client) {
|
|
51409
|
+
try {
|
|
51410
|
+
await client.destroy();
|
|
51411
|
+
}
|
|
51412
|
+
catch {
|
|
51413
|
+
// Ignore cleanup errors
|
|
51414
|
+
}
|
|
51415
|
+
}
|
|
51407
51416
|
}
|
|
51408
51417
|
}
|
|
51409
51418
|
|
|
@@ -55061,6 +55070,7 @@ class S3Client extends EventEmitter {
|
|
|
55061
55070
|
httpClientOptions;
|
|
55062
55071
|
client;
|
|
55063
55072
|
httpHandler = null;
|
|
55073
|
+
_rawHttpClientOptions;
|
|
55064
55074
|
_inflightCoalescing;
|
|
55065
55075
|
taskExecutorConfig;
|
|
55066
55076
|
taskExecutor;
|
|
@@ -55078,6 +55088,7 @@ class S3Client extends EventEmitter {
|
|
|
55078
55088
|
this.id = id ?? idGenerator(77);
|
|
55079
55089
|
this.config = new ConnectionString(connectionString);
|
|
55080
55090
|
this.connectionString = connectionString;
|
|
55091
|
+
this._rawHttpClientOptions = httpClientOptions || {};
|
|
55081
55092
|
this.httpClientOptions = {
|
|
55082
55093
|
keepAlive: true,
|
|
55083
55094
|
keepAliveMsecs: 1000,
|
|
@@ -55143,17 +55154,23 @@ class S3Client extends EventEmitter {
|
|
|
55143
55154
|
}
|
|
55144
55155
|
_normalizeHttpHandlerOptions() {
|
|
55145
55156
|
const options = this.httpClientOptions;
|
|
55146
|
-
const
|
|
55147
|
-
|
|
55148
|
-
|
|
55149
|
-
|
|
55150
|
-
const
|
|
55151
|
-
|
|
55152
|
-
|
|
55153
|
-
|
|
55154
|
-
|
|
55155
|
-
|
|
55156
|
-
|
|
55157
|
+
const raw = this._rawHttpClientOptions;
|
|
55158
|
+
const connections = typeof raw.connections === 'number'
|
|
55159
|
+
? raw.connections
|
|
55160
|
+
: raw.maxSockets;
|
|
55161
|
+
const keepAliveTimeout = raw.keepAliveTimeout ?? raw.keepAliveMsecs;
|
|
55162
|
+
const bodyTimeout = raw.bodyTimeout ?? raw.timeout;
|
|
55163
|
+
const normalized = { ...options };
|
|
55164
|
+
if (connections !== undefined) {
|
|
55165
|
+
normalized.connections = connections;
|
|
55166
|
+
}
|
|
55167
|
+
if (keepAliveTimeout !== undefined) {
|
|
55168
|
+
normalized.keepAliveTimeout = keepAliveTimeout;
|
|
55169
|
+
}
|
|
55170
|
+
if (bodyTimeout !== undefined) {
|
|
55171
|
+
normalized.bodyTimeout = bodyTimeout;
|
|
55172
|
+
}
|
|
55173
|
+
return normalized;
|
|
55157
55174
|
}
|
|
55158
55175
|
_createTasksPool() {
|
|
55159
55176
|
const poolConfig = {
|
|
@@ -55258,7 +55275,7 @@ class S3Client extends EventEmitter {
|
|
|
55258
55275
|
}
|
|
55259
55276
|
async destroy() {
|
|
55260
55277
|
if (this.httpHandler) {
|
|
55261
|
-
await this.httpHandler.
|
|
55278
|
+
await this.httpHandler.destroyAsync();
|
|
55262
55279
|
this.httpHandler = null;
|
|
55263
55280
|
}
|
|
55264
55281
|
if (this.client && typeof this.client.destroy === 'function') {
|
|
@@ -70418,8 +70435,8 @@ class Database extends SafeEventEmitter {
|
|
|
70418
70435
|
})();
|
|
70419
70436
|
this.version = '1';
|
|
70420
70437
|
this.s3dbVersion = (() => {
|
|
70421
|
-
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.
|
|
70422
|
-
? globalThis['19.3.
|
|
70438
|
+
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.19'] !== 'undefined' && globalThis['19.3.19'] !== '19.3.19'
|
|
70439
|
+
? globalThis['19.3.19']
|
|
70423
70440
|
: 'latest'));
|
|
70424
70441
|
return ok ? version : 'latest';
|
|
70425
70442
|
})();
|
package/dist/s3db-lite.es.js
CHANGED
|
@@ -40139,7 +40139,7 @@ function getDefaultUserAgent() {
|
|
|
40139
40139
|
return `recker/${VERSION$1}`;
|
|
40140
40140
|
}
|
|
40141
40141
|
|
|
40142
|
-
const VERSION = '1.0.
|
|
40142
|
+
const VERSION = '1.0.68';
|
|
40143
40143
|
let _version = null;
|
|
40144
40144
|
async function getVersion() {
|
|
40145
40145
|
if (_version)
|
|
@@ -51374,13 +51374,22 @@ class ReckerHttpHandler {
|
|
|
51374
51374
|
circuitBreakerTrips: 0,
|
|
51375
51375
|
};
|
|
51376
51376
|
}
|
|
51377
|
-
|
|
51378
|
-
|
|
51379
|
-
|
|
51380
|
-
|
|
51381
|
-
|
|
51377
|
+
destroy() {
|
|
51378
|
+
void this.destroyAsync();
|
|
51379
|
+
}
|
|
51380
|
+
async destroyAsync() {
|
|
51381
|
+
const client = this.client;
|
|
51382
|
+
this.client = null;
|
|
51382
51383
|
this.deduplicator = null;
|
|
51383
51384
|
this.circuitBreaker = null;
|
|
51385
|
+
if (client) {
|
|
51386
|
+
try {
|
|
51387
|
+
await client.destroy();
|
|
51388
|
+
}
|
|
51389
|
+
catch {
|
|
51390
|
+
// Ignore cleanup errors
|
|
51391
|
+
}
|
|
51392
|
+
}
|
|
51384
51393
|
}
|
|
51385
51394
|
}
|
|
51386
51395
|
|
|
@@ -55038,6 +55047,7 @@ class S3Client extends EventEmitter$1 {
|
|
|
55038
55047
|
httpClientOptions;
|
|
55039
55048
|
client;
|
|
55040
55049
|
httpHandler = null;
|
|
55050
|
+
_rawHttpClientOptions;
|
|
55041
55051
|
_inflightCoalescing;
|
|
55042
55052
|
taskExecutorConfig;
|
|
55043
55053
|
taskExecutor;
|
|
@@ -55055,6 +55065,7 @@ class S3Client extends EventEmitter$1 {
|
|
|
55055
55065
|
this.id = id ?? idGenerator(77);
|
|
55056
55066
|
this.config = new ConnectionString(connectionString);
|
|
55057
55067
|
this.connectionString = connectionString;
|
|
55068
|
+
this._rawHttpClientOptions = httpClientOptions || {};
|
|
55058
55069
|
this.httpClientOptions = {
|
|
55059
55070
|
keepAlive: true,
|
|
55060
55071
|
keepAliveMsecs: 1000,
|
|
@@ -55120,17 +55131,23 @@ class S3Client extends EventEmitter$1 {
|
|
|
55120
55131
|
}
|
|
55121
55132
|
_normalizeHttpHandlerOptions() {
|
|
55122
55133
|
const options = this.httpClientOptions;
|
|
55123
|
-
const
|
|
55124
|
-
|
|
55125
|
-
|
|
55126
|
-
|
|
55127
|
-
const
|
|
55128
|
-
|
|
55129
|
-
|
|
55130
|
-
|
|
55131
|
-
|
|
55132
|
-
|
|
55133
|
-
|
|
55134
|
+
const raw = this._rawHttpClientOptions;
|
|
55135
|
+
const connections = typeof raw.connections === 'number'
|
|
55136
|
+
? raw.connections
|
|
55137
|
+
: raw.maxSockets;
|
|
55138
|
+
const keepAliveTimeout = raw.keepAliveTimeout ?? raw.keepAliveMsecs;
|
|
55139
|
+
const bodyTimeout = raw.bodyTimeout ?? raw.timeout;
|
|
55140
|
+
const normalized = { ...options };
|
|
55141
|
+
if (connections !== undefined) {
|
|
55142
|
+
normalized.connections = connections;
|
|
55143
|
+
}
|
|
55144
|
+
if (keepAliveTimeout !== undefined) {
|
|
55145
|
+
normalized.keepAliveTimeout = keepAliveTimeout;
|
|
55146
|
+
}
|
|
55147
|
+
if (bodyTimeout !== undefined) {
|
|
55148
|
+
normalized.bodyTimeout = bodyTimeout;
|
|
55149
|
+
}
|
|
55150
|
+
return normalized;
|
|
55134
55151
|
}
|
|
55135
55152
|
_createTasksPool() {
|
|
55136
55153
|
const poolConfig = {
|
|
@@ -55235,7 +55252,7 @@ class S3Client extends EventEmitter$1 {
|
|
|
55235
55252
|
}
|
|
55236
55253
|
async destroy() {
|
|
55237
55254
|
if (this.httpHandler) {
|
|
55238
|
-
await this.httpHandler.
|
|
55255
|
+
await this.httpHandler.destroyAsync();
|
|
55239
55256
|
this.httpHandler = null;
|
|
55240
55257
|
}
|
|
55241
55258
|
if (this.client && typeof this.client.destroy === 'function') {
|
|
@@ -70395,8 +70412,8 @@ class Database extends SafeEventEmitter {
|
|
|
70395
70412
|
})();
|
|
70396
70413
|
this.version = '1';
|
|
70397
70414
|
this.s3dbVersion = (() => {
|
|
70398
|
-
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.
|
|
70399
|
-
? globalThis['19.3.
|
|
70415
|
+
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.19'] !== 'undefined' && globalThis['19.3.19'] !== '19.3.19'
|
|
70416
|
+
? globalThis['19.3.19']
|
|
70400
70417
|
: 'latest'));
|
|
70401
70418
|
return ok ? version : 'latest';
|
|
70402
70419
|
})();
|
package/dist/s3db.cjs
CHANGED
|
@@ -519,13 +519,22 @@ class ReckerHttpHandler {
|
|
|
519
519
|
circuitBreakerTrips: 0,
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
522
|
+
destroy() {
|
|
523
|
+
void this.destroyAsync();
|
|
524
|
+
}
|
|
525
|
+
async destroyAsync() {
|
|
526
|
+
const client = this.client;
|
|
527
|
+
this.client = null;
|
|
527
528
|
this.deduplicator = null;
|
|
528
529
|
this.circuitBreaker = null;
|
|
530
|
+
if (client) {
|
|
531
|
+
try {
|
|
532
|
+
await client.destroy();
|
|
533
|
+
}
|
|
534
|
+
catch {
|
|
535
|
+
// Ignore cleanup errors
|
|
536
|
+
}
|
|
537
|
+
}
|
|
529
538
|
}
|
|
530
539
|
}
|
|
531
540
|
|
|
@@ -4334,6 +4343,7 @@ class S3Client extends EventEmitter {
|
|
|
4334
4343
|
httpClientOptions;
|
|
4335
4344
|
client;
|
|
4336
4345
|
httpHandler = null;
|
|
4346
|
+
_rawHttpClientOptions;
|
|
4337
4347
|
_inflightCoalescing;
|
|
4338
4348
|
taskExecutorConfig;
|
|
4339
4349
|
taskExecutor;
|
|
@@ -4351,6 +4361,7 @@ class S3Client extends EventEmitter {
|
|
|
4351
4361
|
this.id = id ?? idGenerator(77);
|
|
4352
4362
|
this.config = new ConnectionString(connectionString);
|
|
4353
4363
|
this.connectionString = connectionString;
|
|
4364
|
+
this._rawHttpClientOptions = httpClientOptions || {};
|
|
4354
4365
|
this.httpClientOptions = {
|
|
4355
4366
|
keepAlive: true,
|
|
4356
4367
|
keepAliveMsecs: 1000,
|
|
@@ -4416,17 +4427,23 @@ class S3Client extends EventEmitter {
|
|
|
4416
4427
|
}
|
|
4417
4428
|
_normalizeHttpHandlerOptions() {
|
|
4418
4429
|
const options = this.httpClientOptions;
|
|
4419
|
-
const
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
const
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
+
const raw = this._rawHttpClientOptions;
|
|
4431
|
+
const connections = typeof raw.connections === 'number'
|
|
4432
|
+
? raw.connections
|
|
4433
|
+
: raw.maxSockets;
|
|
4434
|
+
const keepAliveTimeout = raw.keepAliveTimeout ?? raw.keepAliveMsecs;
|
|
4435
|
+
const bodyTimeout = raw.bodyTimeout ?? raw.timeout;
|
|
4436
|
+
const normalized = { ...options };
|
|
4437
|
+
if (connections !== undefined) {
|
|
4438
|
+
normalized.connections = connections;
|
|
4439
|
+
}
|
|
4440
|
+
if (keepAliveTimeout !== undefined) {
|
|
4441
|
+
normalized.keepAliveTimeout = keepAliveTimeout;
|
|
4442
|
+
}
|
|
4443
|
+
if (bodyTimeout !== undefined) {
|
|
4444
|
+
normalized.bodyTimeout = bodyTimeout;
|
|
4445
|
+
}
|
|
4446
|
+
return normalized;
|
|
4430
4447
|
}
|
|
4431
4448
|
_createTasksPool() {
|
|
4432
4449
|
const poolConfig = {
|
|
@@ -4531,7 +4548,7 @@ class S3Client extends EventEmitter {
|
|
|
4531
4548
|
}
|
|
4532
4549
|
async destroy() {
|
|
4533
4550
|
if (this.httpHandler) {
|
|
4534
|
-
await this.httpHandler.
|
|
4551
|
+
await this.httpHandler.destroyAsync();
|
|
4535
4552
|
this.httpHandler = null;
|
|
4536
4553
|
}
|
|
4537
4554
|
if (this.client && typeof this.client.destroy === 'function') {
|
|
@@ -20115,8 +20132,8 @@ class Database extends SafeEventEmitter {
|
|
|
20115
20132
|
})();
|
|
20116
20133
|
this.version = '1';
|
|
20117
20134
|
this.s3dbVersion = (() => {
|
|
20118
|
-
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.
|
|
20119
|
-
? globalThis['19.3.
|
|
20135
|
+
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.19'] !== 'undefined' && globalThis['19.3.19'] !== '19.3.19'
|
|
20136
|
+
? globalThis['19.3.19']
|
|
20120
20137
|
: 'latest'));
|
|
20121
20138
|
return ok ? version : 'latest';
|
|
20122
20139
|
})();
|
package/dist/s3db.es.js
CHANGED
|
@@ -495,13 +495,22 @@ class ReckerHttpHandler {
|
|
|
495
495
|
circuitBreakerTrips: 0,
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
498
|
+
destroy() {
|
|
499
|
+
void this.destroyAsync();
|
|
500
|
+
}
|
|
501
|
+
async destroyAsync() {
|
|
502
|
+
const client = this.client;
|
|
503
|
+
this.client = null;
|
|
503
504
|
this.deduplicator = null;
|
|
504
505
|
this.circuitBreaker = null;
|
|
506
|
+
if (client) {
|
|
507
|
+
try {
|
|
508
|
+
await client.destroy();
|
|
509
|
+
}
|
|
510
|
+
catch {
|
|
511
|
+
// Ignore cleanup errors
|
|
512
|
+
}
|
|
513
|
+
}
|
|
505
514
|
}
|
|
506
515
|
}
|
|
507
516
|
|
|
@@ -4310,6 +4319,7 @@ class S3Client extends EventEmitter$1 {
|
|
|
4310
4319
|
httpClientOptions;
|
|
4311
4320
|
client;
|
|
4312
4321
|
httpHandler = null;
|
|
4322
|
+
_rawHttpClientOptions;
|
|
4313
4323
|
_inflightCoalescing;
|
|
4314
4324
|
taskExecutorConfig;
|
|
4315
4325
|
taskExecutor;
|
|
@@ -4327,6 +4337,7 @@ class S3Client extends EventEmitter$1 {
|
|
|
4327
4337
|
this.id = id ?? idGenerator(77);
|
|
4328
4338
|
this.config = new ConnectionString(connectionString);
|
|
4329
4339
|
this.connectionString = connectionString;
|
|
4340
|
+
this._rawHttpClientOptions = httpClientOptions || {};
|
|
4330
4341
|
this.httpClientOptions = {
|
|
4331
4342
|
keepAlive: true,
|
|
4332
4343
|
keepAliveMsecs: 1000,
|
|
@@ -4392,17 +4403,23 @@ class S3Client extends EventEmitter$1 {
|
|
|
4392
4403
|
}
|
|
4393
4404
|
_normalizeHttpHandlerOptions() {
|
|
4394
4405
|
const options = this.httpClientOptions;
|
|
4395
|
-
const
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
const
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
+
const raw = this._rawHttpClientOptions;
|
|
4407
|
+
const connections = typeof raw.connections === 'number'
|
|
4408
|
+
? raw.connections
|
|
4409
|
+
: raw.maxSockets;
|
|
4410
|
+
const keepAliveTimeout = raw.keepAliveTimeout ?? raw.keepAliveMsecs;
|
|
4411
|
+
const bodyTimeout = raw.bodyTimeout ?? raw.timeout;
|
|
4412
|
+
const normalized = { ...options };
|
|
4413
|
+
if (connections !== undefined) {
|
|
4414
|
+
normalized.connections = connections;
|
|
4415
|
+
}
|
|
4416
|
+
if (keepAliveTimeout !== undefined) {
|
|
4417
|
+
normalized.keepAliveTimeout = keepAliveTimeout;
|
|
4418
|
+
}
|
|
4419
|
+
if (bodyTimeout !== undefined) {
|
|
4420
|
+
normalized.bodyTimeout = bodyTimeout;
|
|
4421
|
+
}
|
|
4422
|
+
return normalized;
|
|
4406
4423
|
}
|
|
4407
4424
|
_createTasksPool() {
|
|
4408
4425
|
const poolConfig = {
|
|
@@ -4507,7 +4524,7 @@ class S3Client extends EventEmitter$1 {
|
|
|
4507
4524
|
}
|
|
4508
4525
|
async destroy() {
|
|
4509
4526
|
if (this.httpHandler) {
|
|
4510
|
-
await this.httpHandler.
|
|
4527
|
+
await this.httpHandler.destroyAsync();
|
|
4511
4528
|
this.httpHandler = null;
|
|
4512
4529
|
}
|
|
4513
4530
|
if (this.client && typeof this.client.destroy === 'function') {
|
|
@@ -20091,8 +20108,8 @@ class Database extends SafeEventEmitter {
|
|
|
20091
20108
|
})();
|
|
20092
20109
|
this.version = '1';
|
|
20093
20110
|
this.s3dbVersion = (() => {
|
|
20094
|
-
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.
|
|
20095
|
-
? globalThis['19.3.
|
|
20111
|
+
const [ok, , version] = tryFnSync(() => (typeof globalThis['19.3.19'] !== 'undefined' && globalThis['19.3.19'] !== '19.3.19'
|
|
20112
|
+
? globalThis['19.3.19']
|
|
20096
20113
|
: 'latest'));
|
|
20097
20114
|
return ok ? version : 'latest';
|
|
20098
20115
|
})();
|
|
@@ -17,7 +17,8 @@ export declare class ReckerHttpHandler {
|
|
|
17
17
|
httpHandlerConfigs(): ReckerHttpHandlerOptions;
|
|
18
18
|
getMetrics(): HandlerMetrics;
|
|
19
19
|
resetMetrics(): void;
|
|
20
|
-
destroy():
|
|
20
|
+
destroy(): void;
|
|
21
|
+
destroyAsync(): Promise<void>;
|
|
21
22
|
}
|
|
22
23
|
export default ReckerHttpHandler;
|
|
23
24
|
//# sourceMappingURL=recker-http-handler.d.ts.map
|
|
@@ -17,6 +17,7 @@ export declare class S3Client extends EventEmitter {
|
|
|
17
17
|
httpClientOptions: HttpClientOptions;
|
|
18
18
|
client: AwsS3Client;
|
|
19
19
|
private httpHandler;
|
|
20
|
+
private _rawHttpClientOptions;
|
|
20
21
|
private _inflightCoalescing;
|
|
21
22
|
private taskExecutorConfig;
|
|
22
23
|
private taskExecutor;
|
|
@@ -486,6 +486,6 @@ export interface Client extends EventEmitter {
|
|
|
486
486
|
}>>;
|
|
487
487
|
getQueueStats(): QueueStats | null;
|
|
488
488
|
getAggregateMetrics(since?: number): unknown | null;
|
|
489
|
-
destroy(): void
|
|
489
|
+
destroy(): void | Promise<void>;
|
|
490
490
|
}
|
|
491
491
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "s3db.js",
|
|
3
|
-
"version": "19.3.
|
|
3
|
+
"version": "19.3.19",
|
|
4
4
|
"description": "Use AWS S3, the world's most reliable document storage, as a database with this ORM.",
|
|
5
5
|
"main": "dist/s3db.cjs",
|
|
6
6
|
"module": "dist/s3db.es.js",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"nanoid": "5.1.6",
|
|
96
96
|
"pino": "^10.2.0",
|
|
97
97
|
"pino-pretty": "^13.1.3",
|
|
98
|
-
"recker": "1.0.
|
|
98
|
+
"recker": "1.0.68"
|
|
99
99
|
},
|
|
100
100
|
"optionalDependencies": {
|
|
101
101
|
"@modelcontextprotocol/sdk": "^1.25.2",
|
|
@@ -462,13 +462,22 @@ export class ReckerHttpHandler {
|
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
465
|
+
destroy(): void {
|
|
466
|
+
void this.destroyAsync();
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
async destroyAsync(): Promise<void> {
|
|
470
|
+
const client = this.client;
|
|
471
|
+
this.client = null;
|
|
470
472
|
this.deduplicator = null;
|
|
471
473
|
this.circuitBreaker = null;
|
|
474
|
+
if (client) {
|
|
475
|
+
try {
|
|
476
|
+
await client.destroy();
|
|
477
|
+
} catch {
|
|
478
|
+
// Ignore cleanup errors
|
|
479
|
+
}
|
|
480
|
+
}
|
|
472
481
|
}
|
|
473
482
|
}
|
|
474
483
|
|
|
@@ -88,6 +88,7 @@ export class S3Client extends EventEmitter {
|
|
|
88
88
|
httpClientOptions: HttpClientOptions;
|
|
89
89
|
client: AwsS3Client;
|
|
90
90
|
private httpHandler: ReckerHttpHandler | null = null;
|
|
91
|
+
private _rawHttpClientOptions: HttpClientOptions;
|
|
91
92
|
private _inflightCoalescing: Map<string, Promise<unknown>>;
|
|
92
93
|
private taskExecutorConfig: NormalizedTaskExecutorConfig;
|
|
93
94
|
private taskExecutor: TasksPoolType | null;
|
|
@@ -117,6 +118,7 @@ export class S3Client extends EventEmitter {
|
|
|
117
118
|
this.id = id ?? idGenerator(77);
|
|
118
119
|
this.config = new ConnectionString(connectionString);
|
|
119
120
|
this.connectionString = connectionString;
|
|
121
|
+
this._rawHttpClientOptions = httpClientOptions || {};
|
|
120
122
|
this.httpClientOptions = {
|
|
121
123
|
keepAlive: true,
|
|
122
124
|
keepAliveMsecs: 1000,
|
|
@@ -194,18 +196,26 @@ export class S3Client extends EventEmitter {
|
|
|
194
196
|
|
|
195
197
|
private _normalizeHttpHandlerOptions(): ReckerHttpHandlerOptions {
|
|
196
198
|
const options = this.httpClientOptions;
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
199
|
+
const raw = this._rawHttpClientOptions;
|
|
200
|
+
const connections = typeof raw.connections === 'number'
|
|
201
|
+
? raw.connections
|
|
202
|
+
: raw.maxSockets;
|
|
203
|
+
const keepAliveTimeout = raw.keepAliveTimeout ?? raw.keepAliveMsecs;
|
|
204
|
+
const bodyTimeout = raw.bodyTimeout ?? raw.timeout;
|
|
205
|
+
|
|
206
|
+
const normalized: ReckerHttpHandlerOptions = { ...options };
|
|
207
|
+
|
|
208
|
+
if (connections !== undefined) {
|
|
209
|
+
normalized.connections = connections;
|
|
210
|
+
}
|
|
211
|
+
if (keepAliveTimeout !== undefined) {
|
|
212
|
+
normalized.keepAliveTimeout = keepAliveTimeout;
|
|
213
|
+
}
|
|
214
|
+
if (bodyTimeout !== undefined) {
|
|
215
|
+
normalized.bodyTimeout = bodyTimeout;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return normalized;
|
|
209
219
|
}
|
|
210
220
|
|
|
211
221
|
private _createTasksPool(): TasksPoolType {
|
|
@@ -334,7 +344,7 @@ export class S3Client extends EventEmitter {
|
|
|
334
344
|
|
|
335
345
|
async destroy(): Promise<void> {
|
|
336
346
|
if (this.httpHandler) {
|
|
337
|
-
await this.httpHandler.
|
|
347
|
+
await this.httpHandler.destroyAsync();
|
|
338
348
|
this.httpHandler = null;
|
|
339
349
|
}
|
|
340
350
|
if (this.client && typeof this.client.destroy === 'function') {
|
package/src/clients/types.ts
CHANGED
|
@@ -502,5 +502,5 @@ export interface Client extends EventEmitter {
|
|
|
502
502
|
moveAllObjects(params: { prefixFrom: string; prefixTo: string }): Promise<Array<{ from: string; to: string }>>;
|
|
503
503
|
getQueueStats(): QueueStats | null;
|
|
504
504
|
getAggregateMetrics(since?: number): unknown | null;
|
|
505
|
-
destroy(): void
|
|
505
|
+
destroy(): void | Promise<void>;
|
|
506
506
|
}
|