@ccci/micro-server 1.0.191 → 1.0.193
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/index.js +853 -73
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -20261,7 +20261,7 @@ Please see the 3.x to 4.x migration guide for details on how to update your app.
|
|
|
20261
20261
|
}
|
|
20262
20262
|
});
|
|
20263
20263
|
|
|
20264
|
-
// node_modules/negotiator/lib/charset.js
|
|
20264
|
+
// node_modules/accepts/node_modules/negotiator/lib/charset.js
|
|
20265
20265
|
var require_charset = __commonJS((exports, module) => {
|
|
20266
20266
|
module.exports = preferredCharsets;
|
|
20267
20267
|
module.exports.preferredCharsets = preferredCharsets;
|
|
@@ -20346,7 +20346,7 @@ var require_charset = __commonJS((exports, module) => {
|
|
|
20346
20346
|
}
|
|
20347
20347
|
});
|
|
20348
20348
|
|
|
20349
|
-
// node_modules/negotiator/lib/encoding.js
|
|
20349
|
+
// node_modules/accepts/node_modules/negotiator/lib/encoding.js
|
|
20350
20350
|
var require_encoding = __commonJS((exports, module) => {
|
|
20351
20351
|
module.exports = preferredEncodings;
|
|
20352
20352
|
module.exports.preferredEncodings = preferredEncodings;
|
|
@@ -20442,7 +20442,7 @@ var require_encoding = __commonJS((exports, module) => {
|
|
|
20442
20442
|
}
|
|
20443
20443
|
});
|
|
20444
20444
|
|
|
20445
|
-
// node_modules/negotiator/lib/language.js
|
|
20445
|
+
// node_modules/accepts/node_modules/negotiator/lib/language.js
|
|
20446
20446
|
var require_language = __commonJS((exports, module) => {
|
|
20447
20447
|
module.exports = preferredLanguages;
|
|
20448
20448
|
module.exports.preferredLanguages = preferredLanguages;
|
|
@@ -20538,7 +20538,7 @@ var require_language = __commonJS((exports, module) => {
|
|
|
20538
20538
|
}
|
|
20539
20539
|
});
|
|
20540
20540
|
|
|
20541
|
-
// node_modules/negotiator/lib/mediaType.js
|
|
20541
|
+
// node_modules/accepts/node_modules/negotiator/lib/mediaType.js
|
|
20542
20542
|
var require_mediaType = __commonJS((exports, module) => {
|
|
20543
20543
|
module.exports = preferredMediaTypes;
|
|
20544
20544
|
module.exports.preferredMediaTypes = preferredMediaTypes;
|
|
@@ -20698,7 +20698,7 @@ var require_mediaType = __commonJS((exports, module) => {
|
|
|
20698
20698
|
}
|
|
20699
20699
|
});
|
|
20700
20700
|
|
|
20701
|
-
// node_modules/negotiator/index.js
|
|
20701
|
+
// node_modules/accepts/node_modules/negotiator/index.js
|
|
20702
20702
|
var require_negotiator = __commonJS((exports, module) => {
|
|
20703
20703
|
/*!
|
|
20704
20704
|
* negotiator
|
|
@@ -279182,6 +279182,783 @@ var require_dist_cjs73 = __commonJS((exports, module) => {
|
|
|
279182
279182
|
}, "waitUntilObjectNotExists");
|
|
279183
279183
|
});
|
|
279184
279184
|
|
|
279185
|
+
// node_modules/negotiator/lib/charset.js
|
|
279186
|
+
var require_charset2 = __commonJS((exports, module) => {
|
|
279187
|
+
module.exports = preferredCharsets;
|
|
279188
|
+
module.exports.preferredCharsets = preferredCharsets;
|
|
279189
|
+
var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
|
|
279190
|
+
function parseAcceptCharset(accept) {
|
|
279191
|
+
var accepts = accept.split(",");
|
|
279192
|
+
for (var i = 0, j = 0;i < accepts.length; i++) {
|
|
279193
|
+
var charset = parseCharset(accepts[i].trim(), i);
|
|
279194
|
+
if (charset) {
|
|
279195
|
+
accepts[j++] = charset;
|
|
279196
|
+
}
|
|
279197
|
+
}
|
|
279198
|
+
accepts.length = j;
|
|
279199
|
+
return accepts;
|
|
279200
|
+
}
|
|
279201
|
+
function parseCharset(str, i) {
|
|
279202
|
+
var match = simpleCharsetRegExp.exec(str);
|
|
279203
|
+
if (!match)
|
|
279204
|
+
return null;
|
|
279205
|
+
var charset = match[1];
|
|
279206
|
+
var q = 1;
|
|
279207
|
+
if (match[2]) {
|
|
279208
|
+
var params = match[2].split(";");
|
|
279209
|
+
for (var j = 0;j < params.length; j++) {
|
|
279210
|
+
var p = params[j].trim().split("=");
|
|
279211
|
+
if (p[0] === "q") {
|
|
279212
|
+
q = parseFloat(p[1]);
|
|
279213
|
+
break;
|
|
279214
|
+
}
|
|
279215
|
+
}
|
|
279216
|
+
}
|
|
279217
|
+
return {
|
|
279218
|
+
charset,
|
|
279219
|
+
q,
|
|
279220
|
+
i
|
|
279221
|
+
};
|
|
279222
|
+
}
|
|
279223
|
+
function getCharsetPriority(charset, accepted, index2) {
|
|
279224
|
+
var priority = { o: -1, q: 0, s: 0 };
|
|
279225
|
+
for (var i = 0;i < accepted.length; i++) {
|
|
279226
|
+
var spec = specify(charset, accepted[i], index2);
|
|
279227
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
279228
|
+
priority = spec;
|
|
279229
|
+
}
|
|
279230
|
+
}
|
|
279231
|
+
return priority;
|
|
279232
|
+
}
|
|
279233
|
+
function specify(charset, spec, index2) {
|
|
279234
|
+
var s = 0;
|
|
279235
|
+
if (spec.charset.toLowerCase() === charset.toLowerCase()) {
|
|
279236
|
+
s |= 1;
|
|
279237
|
+
} else if (spec.charset !== "*") {
|
|
279238
|
+
return null;
|
|
279239
|
+
}
|
|
279240
|
+
return {
|
|
279241
|
+
i: index2,
|
|
279242
|
+
o: spec.i,
|
|
279243
|
+
q: spec.q,
|
|
279244
|
+
s
|
|
279245
|
+
};
|
|
279246
|
+
}
|
|
279247
|
+
function preferredCharsets(accept, provided) {
|
|
279248
|
+
var accepts = parseAcceptCharset(accept === undefined ? "*" : accept || "");
|
|
279249
|
+
if (!provided) {
|
|
279250
|
+
return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset);
|
|
279251
|
+
}
|
|
279252
|
+
var priorities = provided.map(function getPriority(type, index2) {
|
|
279253
|
+
return getCharsetPriority(type, accepts, index2);
|
|
279254
|
+
});
|
|
279255
|
+
return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {
|
|
279256
|
+
return provided[priorities.indexOf(priority)];
|
|
279257
|
+
});
|
|
279258
|
+
}
|
|
279259
|
+
function compareSpecs(a, b) {
|
|
279260
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
279261
|
+
}
|
|
279262
|
+
function getFullCharset(spec) {
|
|
279263
|
+
return spec.charset;
|
|
279264
|
+
}
|
|
279265
|
+
function isQuality(spec) {
|
|
279266
|
+
return spec.q > 0;
|
|
279267
|
+
}
|
|
279268
|
+
});
|
|
279269
|
+
|
|
279270
|
+
// node_modules/negotiator/lib/encoding.js
|
|
279271
|
+
var require_encoding2 = __commonJS((exports, module) => {
|
|
279272
|
+
module.exports = preferredEncodings;
|
|
279273
|
+
module.exports.preferredEncodings = preferredEncodings;
|
|
279274
|
+
var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
|
|
279275
|
+
function parseAcceptEncoding(accept) {
|
|
279276
|
+
var accepts = accept.split(",");
|
|
279277
|
+
var hasIdentity = false;
|
|
279278
|
+
var minQuality = 1;
|
|
279279
|
+
for (var i = 0, j = 0;i < accepts.length; i++) {
|
|
279280
|
+
var encoding = parseEncoding(accepts[i].trim(), i);
|
|
279281
|
+
if (encoding) {
|
|
279282
|
+
accepts[j++] = encoding;
|
|
279283
|
+
hasIdentity = hasIdentity || specify("identity", encoding);
|
|
279284
|
+
minQuality = Math.min(minQuality, encoding.q || 1);
|
|
279285
|
+
}
|
|
279286
|
+
}
|
|
279287
|
+
if (!hasIdentity) {
|
|
279288
|
+
accepts[j++] = {
|
|
279289
|
+
encoding: "identity",
|
|
279290
|
+
q: minQuality,
|
|
279291
|
+
i
|
|
279292
|
+
};
|
|
279293
|
+
}
|
|
279294
|
+
accepts.length = j;
|
|
279295
|
+
return accepts;
|
|
279296
|
+
}
|
|
279297
|
+
function parseEncoding(str, i) {
|
|
279298
|
+
var match = simpleEncodingRegExp.exec(str);
|
|
279299
|
+
if (!match)
|
|
279300
|
+
return null;
|
|
279301
|
+
var encoding = match[1];
|
|
279302
|
+
var q = 1;
|
|
279303
|
+
if (match[2]) {
|
|
279304
|
+
var params = match[2].split(";");
|
|
279305
|
+
for (var j = 0;j < params.length; j++) {
|
|
279306
|
+
var p = params[j].trim().split("=");
|
|
279307
|
+
if (p[0] === "q") {
|
|
279308
|
+
q = parseFloat(p[1]);
|
|
279309
|
+
break;
|
|
279310
|
+
}
|
|
279311
|
+
}
|
|
279312
|
+
}
|
|
279313
|
+
return {
|
|
279314
|
+
encoding,
|
|
279315
|
+
q,
|
|
279316
|
+
i
|
|
279317
|
+
};
|
|
279318
|
+
}
|
|
279319
|
+
function getEncodingPriority(encoding, accepted, index2) {
|
|
279320
|
+
var priority = { encoding, o: -1, q: 0, s: 0 };
|
|
279321
|
+
for (var i = 0;i < accepted.length; i++) {
|
|
279322
|
+
var spec = specify(encoding, accepted[i], index2);
|
|
279323
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
279324
|
+
priority = spec;
|
|
279325
|
+
}
|
|
279326
|
+
}
|
|
279327
|
+
return priority;
|
|
279328
|
+
}
|
|
279329
|
+
function specify(encoding, spec, index2) {
|
|
279330
|
+
var s = 0;
|
|
279331
|
+
if (spec.encoding.toLowerCase() === encoding.toLowerCase()) {
|
|
279332
|
+
s |= 1;
|
|
279333
|
+
} else if (spec.encoding !== "*") {
|
|
279334
|
+
return null;
|
|
279335
|
+
}
|
|
279336
|
+
return {
|
|
279337
|
+
encoding,
|
|
279338
|
+
i: index2,
|
|
279339
|
+
o: spec.i,
|
|
279340
|
+
q: spec.q,
|
|
279341
|
+
s
|
|
279342
|
+
};
|
|
279343
|
+
}
|
|
279344
|
+
function preferredEncodings(accept, provided, preferred) {
|
|
279345
|
+
var accepts = parseAcceptEncoding(accept || "");
|
|
279346
|
+
var comparator = preferred ? function comparator(a, b) {
|
|
279347
|
+
if (a.q !== b.q) {
|
|
279348
|
+
return b.q - a.q;
|
|
279349
|
+
}
|
|
279350
|
+
var aPreferred = preferred.indexOf(a.encoding);
|
|
279351
|
+
var bPreferred = preferred.indexOf(b.encoding);
|
|
279352
|
+
if (aPreferred === -1 && bPreferred === -1) {
|
|
279353
|
+
return b.s - a.s || a.o - b.o || a.i - b.i;
|
|
279354
|
+
}
|
|
279355
|
+
if (aPreferred !== -1 && bPreferred !== -1) {
|
|
279356
|
+
return aPreferred - bPreferred;
|
|
279357
|
+
}
|
|
279358
|
+
return aPreferred === -1 ? 1 : -1;
|
|
279359
|
+
} : compareSpecs;
|
|
279360
|
+
if (!provided) {
|
|
279361
|
+
return accepts.filter(isQuality).sort(comparator).map(getFullEncoding);
|
|
279362
|
+
}
|
|
279363
|
+
var priorities = provided.map(function getPriority(type, index2) {
|
|
279364
|
+
return getEncodingPriority(type, accepts, index2);
|
|
279365
|
+
});
|
|
279366
|
+
return priorities.filter(isQuality).sort(comparator).map(function getEncoding(priority) {
|
|
279367
|
+
return provided[priorities.indexOf(priority)];
|
|
279368
|
+
});
|
|
279369
|
+
}
|
|
279370
|
+
function compareSpecs(a, b) {
|
|
279371
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i;
|
|
279372
|
+
}
|
|
279373
|
+
function getFullEncoding(spec) {
|
|
279374
|
+
return spec.encoding;
|
|
279375
|
+
}
|
|
279376
|
+
function isQuality(spec) {
|
|
279377
|
+
return spec.q > 0;
|
|
279378
|
+
}
|
|
279379
|
+
});
|
|
279380
|
+
|
|
279381
|
+
// node_modules/negotiator/lib/language.js
|
|
279382
|
+
var require_language2 = __commonJS((exports, module) => {
|
|
279383
|
+
module.exports = preferredLanguages;
|
|
279384
|
+
module.exports.preferredLanguages = preferredLanguages;
|
|
279385
|
+
var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
|
|
279386
|
+
function parseAcceptLanguage(accept) {
|
|
279387
|
+
var accepts = accept.split(",");
|
|
279388
|
+
for (var i = 0, j = 0;i < accepts.length; i++) {
|
|
279389
|
+
var language = parseLanguage(accepts[i].trim(), i);
|
|
279390
|
+
if (language) {
|
|
279391
|
+
accepts[j++] = language;
|
|
279392
|
+
}
|
|
279393
|
+
}
|
|
279394
|
+
accepts.length = j;
|
|
279395
|
+
return accepts;
|
|
279396
|
+
}
|
|
279397
|
+
function parseLanguage(str, i) {
|
|
279398
|
+
var match = simpleLanguageRegExp.exec(str);
|
|
279399
|
+
if (!match)
|
|
279400
|
+
return null;
|
|
279401
|
+
var prefix = match[1];
|
|
279402
|
+
var suffix = match[2];
|
|
279403
|
+
var full = prefix;
|
|
279404
|
+
if (suffix)
|
|
279405
|
+
full += "-" + suffix;
|
|
279406
|
+
var q = 1;
|
|
279407
|
+
if (match[3]) {
|
|
279408
|
+
var params = match[3].split(";");
|
|
279409
|
+
for (var j = 0;j < params.length; j++) {
|
|
279410
|
+
var p = params[j].split("=");
|
|
279411
|
+
if (p[0] === "q")
|
|
279412
|
+
q = parseFloat(p[1]);
|
|
279413
|
+
}
|
|
279414
|
+
}
|
|
279415
|
+
return {
|
|
279416
|
+
prefix,
|
|
279417
|
+
suffix,
|
|
279418
|
+
q,
|
|
279419
|
+
i,
|
|
279420
|
+
full
|
|
279421
|
+
};
|
|
279422
|
+
}
|
|
279423
|
+
function getLanguagePriority(language, accepted, index2) {
|
|
279424
|
+
var priority = { o: -1, q: 0, s: 0 };
|
|
279425
|
+
for (var i = 0;i < accepted.length; i++) {
|
|
279426
|
+
var spec = specify(language, accepted[i], index2);
|
|
279427
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
279428
|
+
priority = spec;
|
|
279429
|
+
}
|
|
279430
|
+
}
|
|
279431
|
+
return priority;
|
|
279432
|
+
}
|
|
279433
|
+
function specify(language, spec, index2) {
|
|
279434
|
+
var p = parseLanguage(language);
|
|
279435
|
+
if (!p)
|
|
279436
|
+
return null;
|
|
279437
|
+
var s = 0;
|
|
279438
|
+
if (spec.full.toLowerCase() === p.full.toLowerCase()) {
|
|
279439
|
+
s |= 4;
|
|
279440
|
+
} else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) {
|
|
279441
|
+
s |= 2;
|
|
279442
|
+
} else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) {
|
|
279443
|
+
s |= 1;
|
|
279444
|
+
} else if (spec.full !== "*") {
|
|
279445
|
+
return null;
|
|
279446
|
+
}
|
|
279447
|
+
return {
|
|
279448
|
+
i: index2,
|
|
279449
|
+
o: spec.i,
|
|
279450
|
+
q: spec.q,
|
|
279451
|
+
s
|
|
279452
|
+
};
|
|
279453
|
+
}
|
|
279454
|
+
function preferredLanguages(accept, provided) {
|
|
279455
|
+
var accepts = parseAcceptLanguage(accept === undefined ? "*" : accept || "");
|
|
279456
|
+
if (!provided) {
|
|
279457
|
+
return accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage);
|
|
279458
|
+
}
|
|
279459
|
+
var priorities = provided.map(function getPriority(type, index2) {
|
|
279460
|
+
return getLanguagePriority(type, accepts, index2);
|
|
279461
|
+
});
|
|
279462
|
+
return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) {
|
|
279463
|
+
return provided[priorities.indexOf(priority)];
|
|
279464
|
+
});
|
|
279465
|
+
}
|
|
279466
|
+
function compareSpecs(a, b) {
|
|
279467
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
279468
|
+
}
|
|
279469
|
+
function getFullLanguage(spec) {
|
|
279470
|
+
return spec.full;
|
|
279471
|
+
}
|
|
279472
|
+
function isQuality(spec) {
|
|
279473
|
+
return spec.q > 0;
|
|
279474
|
+
}
|
|
279475
|
+
});
|
|
279476
|
+
|
|
279477
|
+
// node_modules/negotiator/lib/mediaType.js
|
|
279478
|
+
var require_mediaType2 = __commonJS((exports, module) => {
|
|
279479
|
+
module.exports = preferredMediaTypes;
|
|
279480
|
+
module.exports.preferredMediaTypes = preferredMediaTypes;
|
|
279481
|
+
var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
|
|
279482
|
+
function parseAccept(accept) {
|
|
279483
|
+
var accepts = splitMediaTypes(accept);
|
|
279484
|
+
for (var i = 0, j = 0;i < accepts.length; i++) {
|
|
279485
|
+
var mediaType = parseMediaType(accepts[i].trim(), i);
|
|
279486
|
+
if (mediaType) {
|
|
279487
|
+
accepts[j++] = mediaType;
|
|
279488
|
+
}
|
|
279489
|
+
}
|
|
279490
|
+
accepts.length = j;
|
|
279491
|
+
return accepts;
|
|
279492
|
+
}
|
|
279493
|
+
function parseMediaType(str, i) {
|
|
279494
|
+
var match = simpleMediaTypeRegExp.exec(str);
|
|
279495
|
+
if (!match)
|
|
279496
|
+
return null;
|
|
279497
|
+
var params = Object.create(null);
|
|
279498
|
+
var q = 1;
|
|
279499
|
+
var subtype = match[2];
|
|
279500
|
+
var type = match[1];
|
|
279501
|
+
if (match[3]) {
|
|
279502
|
+
var kvps = splitParameters(match[3]).map(splitKeyValuePair);
|
|
279503
|
+
for (var j = 0;j < kvps.length; j++) {
|
|
279504
|
+
var pair = kvps[j];
|
|
279505
|
+
var key = pair[0].toLowerCase();
|
|
279506
|
+
var val2 = pair[1];
|
|
279507
|
+
var value = val2 && val2[0] === '"' && val2[val2.length - 1] === '"' ? val2.slice(1, -1) : val2;
|
|
279508
|
+
if (key === "q") {
|
|
279509
|
+
q = parseFloat(value);
|
|
279510
|
+
break;
|
|
279511
|
+
}
|
|
279512
|
+
params[key] = value;
|
|
279513
|
+
}
|
|
279514
|
+
}
|
|
279515
|
+
return {
|
|
279516
|
+
type,
|
|
279517
|
+
subtype,
|
|
279518
|
+
params,
|
|
279519
|
+
q,
|
|
279520
|
+
i
|
|
279521
|
+
};
|
|
279522
|
+
}
|
|
279523
|
+
function getMediaTypePriority(type, accepted, index2) {
|
|
279524
|
+
var priority = { o: -1, q: 0, s: 0 };
|
|
279525
|
+
for (var i = 0;i < accepted.length; i++) {
|
|
279526
|
+
var spec = specify(type, accepted[i], index2);
|
|
279527
|
+
if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
|
|
279528
|
+
priority = spec;
|
|
279529
|
+
}
|
|
279530
|
+
}
|
|
279531
|
+
return priority;
|
|
279532
|
+
}
|
|
279533
|
+
function specify(type, spec, index2) {
|
|
279534
|
+
var p = parseMediaType(type);
|
|
279535
|
+
var s = 0;
|
|
279536
|
+
if (!p) {
|
|
279537
|
+
return null;
|
|
279538
|
+
}
|
|
279539
|
+
if (spec.type.toLowerCase() == p.type.toLowerCase()) {
|
|
279540
|
+
s |= 4;
|
|
279541
|
+
} else if (spec.type != "*") {
|
|
279542
|
+
return null;
|
|
279543
|
+
}
|
|
279544
|
+
if (spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {
|
|
279545
|
+
s |= 2;
|
|
279546
|
+
} else if (spec.subtype != "*") {
|
|
279547
|
+
return null;
|
|
279548
|
+
}
|
|
279549
|
+
var keys = Object.keys(spec.params);
|
|
279550
|
+
if (keys.length > 0) {
|
|
279551
|
+
if (keys.every(function(k) {
|
|
279552
|
+
return spec.params[k] == "*" || (spec.params[k] || "").toLowerCase() == (p.params[k] || "").toLowerCase();
|
|
279553
|
+
})) {
|
|
279554
|
+
s |= 1;
|
|
279555
|
+
} else {
|
|
279556
|
+
return null;
|
|
279557
|
+
}
|
|
279558
|
+
}
|
|
279559
|
+
return {
|
|
279560
|
+
i: index2,
|
|
279561
|
+
o: spec.i,
|
|
279562
|
+
q: spec.q,
|
|
279563
|
+
s
|
|
279564
|
+
};
|
|
279565
|
+
}
|
|
279566
|
+
function preferredMediaTypes(accept, provided) {
|
|
279567
|
+
var accepts = parseAccept(accept === undefined ? "*/*" : accept || "");
|
|
279568
|
+
if (!provided) {
|
|
279569
|
+
return accepts.filter(isQuality).sort(compareSpecs).map(getFullType);
|
|
279570
|
+
}
|
|
279571
|
+
var priorities = provided.map(function getPriority(type, index2) {
|
|
279572
|
+
return getMediaTypePriority(type, accepts, index2);
|
|
279573
|
+
});
|
|
279574
|
+
return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
|
|
279575
|
+
return provided[priorities.indexOf(priority)];
|
|
279576
|
+
});
|
|
279577
|
+
}
|
|
279578
|
+
function compareSpecs(a, b) {
|
|
279579
|
+
return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i || 0;
|
|
279580
|
+
}
|
|
279581
|
+
function getFullType(spec) {
|
|
279582
|
+
return spec.type + "/" + spec.subtype;
|
|
279583
|
+
}
|
|
279584
|
+
function isQuality(spec) {
|
|
279585
|
+
return spec.q > 0;
|
|
279586
|
+
}
|
|
279587
|
+
function quoteCount(string) {
|
|
279588
|
+
var count = 0;
|
|
279589
|
+
var index2 = 0;
|
|
279590
|
+
while ((index2 = string.indexOf('"', index2)) !== -1) {
|
|
279591
|
+
count++;
|
|
279592
|
+
index2++;
|
|
279593
|
+
}
|
|
279594
|
+
return count;
|
|
279595
|
+
}
|
|
279596
|
+
function splitKeyValuePair(str) {
|
|
279597
|
+
var index2 = str.indexOf("=");
|
|
279598
|
+
var key;
|
|
279599
|
+
var val2;
|
|
279600
|
+
if (index2 === -1) {
|
|
279601
|
+
key = str;
|
|
279602
|
+
} else {
|
|
279603
|
+
key = str.slice(0, index2);
|
|
279604
|
+
val2 = str.slice(index2 + 1);
|
|
279605
|
+
}
|
|
279606
|
+
return [key, val2];
|
|
279607
|
+
}
|
|
279608
|
+
function splitMediaTypes(accept) {
|
|
279609
|
+
var accepts = accept.split(",");
|
|
279610
|
+
for (var i = 1, j = 0;i < accepts.length; i++) {
|
|
279611
|
+
if (quoteCount(accepts[j]) % 2 == 0) {
|
|
279612
|
+
accepts[++j] = accepts[i];
|
|
279613
|
+
} else {
|
|
279614
|
+
accepts[j] += "," + accepts[i];
|
|
279615
|
+
}
|
|
279616
|
+
}
|
|
279617
|
+
accepts.length = j + 1;
|
|
279618
|
+
return accepts;
|
|
279619
|
+
}
|
|
279620
|
+
function splitParameters(str) {
|
|
279621
|
+
var parameters = str.split(";");
|
|
279622
|
+
for (var i = 1, j = 0;i < parameters.length; i++) {
|
|
279623
|
+
if (quoteCount(parameters[j]) % 2 == 0) {
|
|
279624
|
+
parameters[++j] = parameters[i];
|
|
279625
|
+
} else {
|
|
279626
|
+
parameters[j] += ";" + parameters[i];
|
|
279627
|
+
}
|
|
279628
|
+
}
|
|
279629
|
+
parameters.length = j + 1;
|
|
279630
|
+
for (var i = 0;i < parameters.length; i++) {
|
|
279631
|
+
parameters[i] = parameters[i].trim();
|
|
279632
|
+
}
|
|
279633
|
+
return parameters;
|
|
279634
|
+
}
|
|
279635
|
+
});
|
|
279636
|
+
|
|
279637
|
+
// node_modules/negotiator/index.js
|
|
279638
|
+
var require_negotiator2 = __commonJS((exports, module) => {
|
|
279639
|
+
/*!
|
|
279640
|
+
* negotiator
|
|
279641
|
+
* Copyright(c) 2012 Federico Romero
|
|
279642
|
+
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|
279643
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
279644
|
+
* MIT Licensed
|
|
279645
|
+
*/
|
|
279646
|
+
var preferredCharsets = require_charset2();
|
|
279647
|
+
var preferredEncodings = require_encoding2();
|
|
279648
|
+
var preferredLanguages = require_language2();
|
|
279649
|
+
var preferredMediaTypes = require_mediaType2();
|
|
279650
|
+
module.exports = Negotiator;
|
|
279651
|
+
module.exports.Negotiator = Negotiator;
|
|
279652
|
+
function Negotiator(request2) {
|
|
279653
|
+
if (!(this instanceof Negotiator)) {
|
|
279654
|
+
return new Negotiator(request2);
|
|
279655
|
+
}
|
|
279656
|
+
this.request = request2;
|
|
279657
|
+
}
|
|
279658
|
+
Negotiator.prototype.charset = function charset(available) {
|
|
279659
|
+
var set = this.charsets(available);
|
|
279660
|
+
return set && set[0];
|
|
279661
|
+
};
|
|
279662
|
+
Negotiator.prototype.charsets = function charsets(available) {
|
|
279663
|
+
return preferredCharsets(this.request.headers["accept-charset"], available);
|
|
279664
|
+
};
|
|
279665
|
+
Negotiator.prototype.encoding = function encoding(available, preferred) {
|
|
279666
|
+
var set = this.encodings(available, preferred);
|
|
279667
|
+
return set && set[0];
|
|
279668
|
+
};
|
|
279669
|
+
Negotiator.prototype.encodings = function encodings(available, preferred) {
|
|
279670
|
+
return preferredEncodings(this.request.headers["accept-encoding"], available, preferred);
|
|
279671
|
+
};
|
|
279672
|
+
Negotiator.prototype.language = function language(available) {
|
|
279673
|
+
var set = this.languages(available);
|
|
279674
|
+
return set && set[0];
|
|
279675
|
+
};
|
|
279676
|
+
Negotiator.prototype.languages = function languages(available) {
|
|
279677
|
+
return preferredLanguages(this.request.headers["accept-language"], available);
|
|
279678
|
+
};
|
|
279679
|
+
Negotiator.prototype.mediaType = function mediaType(available) {
|
|
279680
|
+
var set = this.mediaTypes(available);
|
|
279681
|
+
return set && set[0];
|
|
279682
|
+
};
|
|
279683
|
+
Negotiator.prototype.mediaTypes = function mediaTypes(available) {
|
|
279684
|
+
return preferredMediaTypes(this.request.headers.accept, available);
|
|
279685
|
+
};
|
|
279686
|
+
Negotiator.prototype.preferredCharset = Negotiator.prototype.charset;
|
|
279687
|
+
Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;
|
|
279688
|
+
Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;
|
|
279689
|
+
Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;
|
|
279690
|
+
Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
|
|
279691
|
+
Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
|
|
279692
|
+
Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
|
|
279693
|
+
Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
|
|
279694
|
+
});
|
|
279695
|
+
|
|
279696
|
+
// node_modules/compressible/index.js
|
|
279697
|
+
var require_compressible = __commonJS((exports, module) => {
|
|
279698
|
+
/*!
|
|
279699
|
+
* compressible
|
|
279700
|
+
* Copyright(c) 2013 Jonathan Ong
|
|
279701
|
+
* Copyright(c) 2014 Jeremiah Senkpiel
|
|
279702
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
279703
|
+
* MIT Licensed
|
|
279704
|
+
*/
|
|
279705
|
+
var db = require_mime_db();
|
|
279706
|
+
var COMPRESSIBLE_TYPE_REGEXP = /^text\/|\+(?:json|text|xml)$/i;
|
|
279707
|
+
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
279708
|
+
module.exports = compressible;
|
|
279709
|
+
function compressible(type) {
|
|
279710
|
+
if (!type || typeof type !== "string") {
|
|
279711
|
+
return false;
|
|
279712
|
+
}
|
|
279713
|
+
var match = EXTRACT_TYPE_REGEXP.exec(type);
|
|
279714
|
+
var mime2 = match && match[1].toLowerCase();
|
|
279715
|
+
var data = db[mime2];
|
|
279716
|
+
if (data && data.compressible !== undefined) {
|
|
279717
|
+
return data.compressible;
|
|
279718
|
+
}
|
|
279719
|
+
return COMPRESSIBLE_TYPE_REGEXP.test(mime2) || undefined;
|
|
279720
|
+
}
|
|
279721
|
+
});
|
|
279722
|
+
|
|
279723
|
+
// node_modules/on-headers/index.js
|
|
279724
|
+
var require_on_headers = __commonJS((exports, module) => {
|
|
279725
|
+
/*!
|
|
279726
|
+
* on-headers
|
|
279727
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
279728
|
+
* MIT Licensed
|
|
279729
|
+
*/
|
|
279730
|
+
module.exports = onHeaders;
|
|
279731
|
+
function createWriteHead(prevWriteHead, listener) {
|
|
279732
|
+
var fired = false;
|
|
279733
|
+
return function writeHead(statusCode) {
|
|
279734
|
+
var args = setWriteHeadHeaders.apply(this, arguments);
|
|
279735
|
+
if (!fired) {
|
|
279736
|
+
fired = true;
|
|
279737
|
+
listener.call(this);
|
|
279738
|
+
if (typeof args[0] === "number" && this.statusCode !== args[0]) {
|
|
279739
|
+
args[0] = this.statusCode;
|
|
279740
|
+
args.length = 1;
|
|
279741
|
+
}
|
|
279742
|
+
}
|
|
279743
|
+
return prevWriteHead.apply(this, args);
|
|
279744
|
+
};
|
|
279745
|
+
}
|
|
279746
|
+
function onHeaders(res, listener) {
|
|
279747
|
+
if (!res) {
|
|
279748
|
+
throw new TypeError("argument res is required");
|
|
279749
|
+
}
|
|
279750
|
+
if (typeof listener !== "function") {
|
|
279751
|
+
throw new TypeError("argument listener must be a function");
|
|
279752
|
+
}
|
|
279753
|
+
res.writeHead = createWriteHead(res.writeHead, listener);
|
|
279754
|
+
}
|
|
279755
|
+
function setHeadersFromArray(res, headers) {
|
|
279756
|
+
for (var i = 0;i < headers.length; i++) {
|
|
279757
|
+
res.setHeader(headers[i][0], headers[i][1]);
|
|
279758
|
+
}
|
|
279759
|
+
}
|
|
279760
|
+
function setHeadersFromObject(res, headers) {
|
|
279761
|
+
var keys = Object.keys(headers);
|
|
279762
|
+
for (var i = 0;i < keys.length; i++) {
|
|
279763
|
+
var k = keys[i];
|
|
279764
|
+
if (k)
|
|
279765
|
+
res.setHeader(k, headers[k]);
|
|
279766
|
+
}
|
|
279767
|
+
}
|
|
279768
|
+
function setWriteHeadHeaders(statusCode) {
|
|
279769
|
+
var length = arguments.length;
|
|
279770
|
+
var headerIndex = length > 1 && typeof arguments[1] === "string" ? 2 : 1;
|
|
279771
|
+
var headers = length >= headerIndex + 1 ? arguments[headerIndex] : undefined;
|
|
279772
|
+
this.statusCode = statusCode;
|
|
279773
|
+
if (Array.isArray(headers)) {
|
|
279774
|
+
setHeadersFromArray(this, headers);
|
|
279775
|
+
} else if (headers) {
|
|
279776
|
+
setHeadersFromObject(this, headers);
|
|
279777
|
+
}
|
|
279778
|
+
var args = new Array(Math.min(length, headerIndex));
|
|
279779
|
+
for (var i = 0;i < args.length; i++) {
|
|
279780
|
+
args[i] = arguments[i];
|
|
279781
|
+
}
|
|
279782
|
+
return args;
|
|
279783
|
+
}
|
|
279784
|
+
});
|
|
279785
|
+
|
|
279786
|
+
// node_modules/compression/index.js
|
|
279787
|
+
var require_compression = __commonJS((exports, module) => {
|
|
279788
|
+
/*!
|
|
279789
|
+
* compression
|
|
279790
|
+
* Copyright(c) 2010 Sencha Inc.
|
|
279791
|
+
* Copyright(c) 2011 TJ Holowaychuk
|
|
279792
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
279793
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
279794
|
+
* MIT Licensed
|
|
279795
|
+
*/
|
|
279796
|
+
var Negotiator = require_negotiator2();
|
|
279797
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
279798
|
+
var bytes = require_bytes();
|
|
279799
|
+
var compressible = require_compressible();
|
|
279800
|
+
var debug = require_src()("compression");
|
|
279801
|
+
var onHeaders = require_on_headers();
|
|
279802
|
+
var vary = require_vary();
|
|
279803
|
+
var zlib = __require("zlib");
|
|
279804
|
+
module.exports = compression;
|
|
279805
|
+
module.exports.filter = shouldCompress;
|
|
279806
|
+
var hasBrotliSupport = "createBrotliCompress" in zlib;
|
|
279807
|
+
var cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/;
|
|
279808
|
+
var SUPPORTED_ENCODING = hasBrotliSupport ? ["br", "gzip", "deflate", "identity"] : ["gzip", "deflate", "identity"];
|
|
279809
|
+
var PREFERRED_ENCODING = hasBrotliSupport ? ["br", "gzip"] : ["gzip"];
|
|
279810
|
+
var encodingSupported = ["gzip", "deflate", "identity", "br"];
|
|
279811
|
+
function compression(options) {
|
|
279812
|
+
var opts = options || {};
|
|
279813
|
+
var optsBrotli = {};
|
|
279814
|
+
if (hasBrotliSupport) {
|
|
279815
|
+
Object.assign(optsBrotli, opts.brotli);
|
|
279816
|
+
var brotliParams = {};
|
|
279817
|
+
brotliParams[zlib.constants.BROTLI_PARAM_QUALITY] = 4;
|
|
279818
|
+
optsBrotli.params = Object.assign(brotliParams, optsBrotli.params);
|
|
279819
|
+
}
|
|
279820
|
+
var filter = opts.filter || shouldCompress;
|
|
279821
|
+
var threshold = bytes.parse(opts.threshold);
|
|
279822
|
+
var enforceEncoding = opts.enforceEncoding || "identity";
|
|
279823
|
+
if (threshold == null) {
|
|
279824
|
+
threshold = 1024;
|
|
279825
|
+
}
|
|
279826
|
+
return function compression(req, res, next) {
|
|
279827
|
+
var ended = false;
|
|
279828
|
+
var length;
|
|
279829
|
+
var listeners = [];
|
|
279830
|
+
var stream5;
|
|
279831
|
+
var _end = res.end;
|
|
279832
|
+
var _on = res.on;
|
|
279833
|
+
var _write = res.write;
|
|
279834
|
+
res.flush = function flush() {
|
|
279835
|
+
if (stream5) {
|
|
279836
|
+
stream5.flush();
|
|
279837
|
+
}
|
|
279838
|
+
};
|
|
279839
|
+
res.write = function write(chunk, encoding) {
|
|
279840
|
+
if (ended) {
|
|
279841
|
+
return false;
|
|
279842
|
+
}
|
|
279843
|
+
if (!headersSent(res)) {
|
|
279844
|
+
this.writeHead(this.statusCode);
|
|
279845
|
+
}
|
|
279846
|
+
return stream5 ? stream5.write(toBuffer(chunk, encoding)) : _write.call(this, chunk, encoding);
|
|
279847
|
+
};
|
|
279848
|
+
res.end = function end(chunk, encoding) {
|
|
279849
|
+
if (ended) {
|
|
279850
|
+
return false;
|
|
279851
|
+
}
|
|
279852
|
+
if (!headersSent(res)) {
|
|
279853
|
+
if (!this.getHeader("Content-Length")) {
|
|
279854
|
+
length = chunkLength(chunk, encoding);
|
|
279855
|
+
}
|
|
279856
|
+
this.writeHead(this.statusCode);
|
|
279857
|
+
}
|
|
279858
|
+
if (!stream5) {
|
|
279859
|
+
return _end.call(this, chunk, encoding);
|
|
279860
|
+
}
|
|
279861
|
+
ended = true;
|
|
279862
|
+
return chunk ? stream5.end(toBuffer(chunk, encoding)) : stream5.end();
|
|
279863
|
+
};
|
|
279864
|
+
res.on = function on(type, listener) {
|
|
279865
|
+
if (!listeners || type !== "drain") {
|
|
279866
|
+
return _on.call(this, type, listener);
|
|
279867
|
+
}
|
|
279868
|
+
if (stream5) {
|
|
279869
|
+
return stream5.on(type, listener);
|
|
279870
|
+
}
|
|
279871
|
+
listeners.push([type, listener]);
|
|
279872
|
+
return this;
|
|
279873
|
+
};
|
|
279874
|
+
function nocompress(msg) {
|
|
279875
|
+
debug("no compression: %s", msg);
|
|
279876
|
+
addListeners(res, _on, listeners);
|
|
279877
|
+
listeners = null;
|
|
279878
|
+
}
|
|
279879
|
+
onHeaders(res, function onResponseHeaders() {
|
|
279880
|
+
if (!filter(req, res)) {
|
|
279881
|
+
nocompress("filtered");
|
|
279882
|
+
return;
|
|
279883
|
+
}
|
|
279884
|
+
if (!shouldTransform(req, res)) {
|
|
279885
|
+
nocompress("no transform");
|
|
279886
|
+
return;
|
|
279887
|
+
}
|
|
279888
|
+
vary(res, "Accept-Encoding");
|
|
279889
|
+
if (Number(res.getHeader("Content-Length")) < threshold || length < threshold) {
|
|
279890
|
+
nocompress("size below threshold");
|
|
279891
|
+
return;
|
|
279892
|
+
}
|
|
279893
|
+
var encoding = res.getHeader("Content-Encoding") || "identity";
|
|
279894
|
+
if (encoding !== "identity") {
|
|
279895
|
+
nocompress("already encoded");
|
|
279896
|
+
return;
|
|
279897
|
+
}
|
|
279898
|
+
if (req.method === "HEAD") {
|
|
279899
|
+
nocompress("HEAD request");
|
|
279900
|
+
return;
|
|
279901
|
+
}
|
|
279902
|
+
var negotiator = new Negotiator(req);
|
|
279903
|
+
var method = negotiator.encoding(SUPPORTED_ENCODING, PREFERRED_ENCODING);
|
|
279904
|
+
if (!req.headers["accept-encoding"] && encodingSupported.indexOf(enforceEncoding) !== -1) {
|
|
279905
|
+
method = enforceEncoding;
|
|
279906
|
+
}
|
|
279907
|
+
if (!method || method === "identity") {
|
|
279908
|
+
nocompress("not acceptable");
|
|
279909
|
+
return;
|
|
279910
|
+
}
|
|
279911
|
+
debug("%s compression", method);
|
|
279912
|
+
stream5 = method === "gzip" ? zlib.createGzip(opts) : method === "br" ? zlib.createBrotliCompress(optsBrotli) : zlib.createDeflate(opts);
|
|
279913
|
+
addListeners(stream5, stream5.on, listeners);
|
|
279914
|
+
res.setHeader("Content-Encoding", method);
|
|
279915
|
+
res.removeHeader("Content-Length");
|
|
279916
|
+
stream5.on("data", function onStreamData(chunk) {
|
|
279917
|
+
if (_write.call(res, chunk) === false) {
|
|
279918
|
+
stream5.pause();
|
|
279919
|
+
}
|
|
279920
|
+
});
|
|
279921
|
+
stream5.on("end", function onStreamEnd() {
|
|
279922
|
+
_end.call(res);
|
|
279923
|
+
});
|
|
279924
|
+
_on.call(res, "drain", function onResponseDrain() {
|
|
279925
|
+
stream5.resume();
|
|
279926
|
+
});
|
|
279927
|
+
});
|
|
279928
|
+
next();
|
|
279929
|
+
};
|
|
279930
|
+
}
|
|
279931
|
+
function addListeners(stream5, on, listeners) {
|
|
279932
|
+
for (var i = 0;i < listeners.length; i++) {
|
|
279933
|
+
on.apply(stream5, listeners[i]);
|
|
279934
|
+
}
|
|
279935
|
+
}
|
|
279936
|
+
function chunkLength(chunk, encoding) {
|
|
279937
|
+
if (!chunk) {
|
|
279938
|
+
return 0;
|
|
279939
|
+
}
|
|
279940
|
+
return Buffer2.isBuffer(chunk) ? chunk.length : Buffer2.byteLength(chunk, encoding);
|
|
279941
|
+
}
|
|
279942
|
+
function shouldCompress(req, res) {
|
|
279943
|
+
var type = res.getHeader("Content-Type");
|
|
279944
|
+
if (type === undefined || !compressible(type)) {
|
|
279945
|
+
debug("%s not compressible", type);
|
|
279946
|
+
return false;
|
|
279947
|
+
}
|
|
279948
|
+
return true;
|
|
279949
|
+
}
|
|
279950
|
+
function shouldTransform(req, res) {
|
|
279951
|
+
var cacheControl = res.getHeader("Cache-Control");
|
|
279952
|
+
return !cacheControl || !cacheControlNoTransformRegExp.test(cacheControl);
|
|
279953
|
+
}
|
|
279954
|
+
function toBuffer(chunk, encoding) {
|
|
279955
|
+
return Buffer2.isBuffer(chunk) ? chunk : Buffer2.from(chunk, encoding);
|
|
279956
|
+
}
|
|
279957
|
+
function headersSent(res) {
|
|
279958
|
+
return typeof res.headersSent !== "boolean" ? Boolean(res._header) : res.headersSent;
|
|
279959
|
+
}
|
|
279960
|
+
});
|
|
279961
|
+
|
|
279185
279962
|
// node_modules/kafkajs/src/loggers/index.js
|
|
279186
279963
|
var require_loggers = __commonJS((exports, module) => {
|
|
279187
279964
|
var { assign } = Object;
|
|
@@ -279766,7 +280543,7 @@ var require_gzip = __commonJS((exports, module) => {
|
|
|
279766
280543
|
});
|
|
279767
280544
|
|
|
279768
280545
|
// node_modules/kafkajs/src/protocol/message/compression/index.js
|
|
279769
|
-
var
|
|
280546
|
+
var require_compression2 = __commonJS((exports, module) => {
|
|
279770
280547
|
var { KafkaJSNotImplemented } = require_errors6();
|
|
279771
280548
|
var COMPRESSION_CODEC_MASK = 7;
|
|
279772
280549
|
var Types = {
|
|
@@ -280612,9 +281389,9 @@ var require_crc32 = __commonJS((exports, module) => {
|
|
|
280612
281389
|
var require_v0 = __commonJS((exports, module) => {
|
|
280613
281390
|
var Encoder2 = require_encoder2();
|
|
280614
281391
|
var crc322 = require_crc32();
|
|
280615
|
-
var { Types: Compression, COMPRESSION_CODEC_MASK } =
|
|
280616
|
-
module.exports = ({ compression = Compression.None, key, value }) => {
|
|
280617
|
-
const content = new Encoder2().writeInt8(0).writeInt8(
|
|
281392
|
+
var { Types: Compression, COMPRESSION_CODEC_MASK } = require_compression2();
|
|
281393
|
+
module.exports = ({ compression: compression2 = Compression.None, key, value }) => {
|
|
281394
|
+
const content = new Encoder2().writeInt8(0).writeInt8(compression2 & COMPRESSION_CODEC_MASK).writeBytes(key).writeBytes(value);
|
|
280618
281395
|
const crc = crc322(content);
|
|
280619
281396
|
return new Encoder2().writeInt32(crc).writeEncoder(content);
|
|
280620
281397
|
};
|
|
@@ -280624,9 +281401,9 @@ var require_v0 = __commonJS((exports, module) => {
|
|
|
280624
281401
|
var require_v19 = __commonJS((exports, module) => {
|
|
280625
281402
|
var Encoder2 = require_encoder2();
|
|
280626
281403
|
var crc322 = require_crc32();
|
|
280627
|
-
var { Types: Compression, COMPRESSION_CODEC_MASK } =
|
|
280628
|
-
module.exports = ({ compression = Compression.None, timestamp: timestamp2 = Date.now(), key, value }) => {
|
|
280629
|
-
const content = new Encoder2().writeInt8(1).writeInt8(
|
|
281404
|
+
var { Types: Compression, COMPRESSION_CODEC_MASK } = require_compression2();
|
|
281405
|
+
module.exports = ({ compression: compression2 = Compression.None, timestamp: timestamp2 = Date.now(), key, value }) => {
|
|
281406
|
+
const content = new Encoder2().writeInt8(1).writeInt8(compression2 & COMPRESSION_CODEC_MASK).writeInt64(timestamp2).writeBytes(key).writeBytes(value);
|
|
280630
281407
|
const crc = crc322(content);
|
|
280631
281408
|
return new Encoder2().writeInt32(crc).writeEncoder(content);
|
|
280632
281409
|
};
|
|
@@ -280645,9 +281422,9 @@ var require_message2 = __commonJS((exports, module) => {
|
|
|
280645
281422
|
var require_messageSet = __commonJS((exports, module) => {
|
|
280646
281423
|
var Encoder2 = require_encoder2();
|
|
280647
281424
|
var MessageProtocol = require_message2();
|
|
280648
|
-
var { Types } =
|
|
280649
|
-
module.exports = ({ messageVersion = 0, compression, entries }) => {
|
|
280650
|
-
const isCompressed =
|
|
281425
|
+
var { Types } = require_compression2();
|
|
281426
|
+
module.exports = ({ messageVersion = 0, compression: compression2, entries }) => {
|
|
281427
|
+
const isCompressed = compression2 !== Types.None;
|
|
280651
281428
|
const Message = MessageProtocol({ version: messageVersion });
|
|
280652
281429
|
const encoder = new Encoder2;
|
|
280653
281430
|
entries.forEach((entry, i) => {
|
|
@@ -281569,14 +282346,14 @@ var require_request5 = __commonJS((exports, module) => {
|
|
|
281569
282346
|
var Encoder2 = require_encoder2();
|
|
281570
282347
|
var { Produce: apiKey } = require_apiKeys();
|
|
281571
282348
|
var MessageSet = require_messageSet();
|
|
281572
|
-
var { Types, lookupCodec } =
|
|
281573
|
-
module.exports = ({ acks, timeout, compression = Types.None, topicData }) => ({
|
|
282349
|
+
var { Types, lookupCodec } = require_compression2();
|
|
282350
|
+
module.exports = ({ acks, timeout, compression: compression2 = Types.None, topicData }) => ({
|
|
281574
282351
|
apiKey,
|
|
281575
282352
|
apiVersion: 2,
|
|
281576
282353
|
apiName: "Produce",
|
|
281577
282354
|
expectResponse: () => acks !== 0,
|
|
281578
282355
|
encode: async () => {
|
|
281579
|
-
const encodeTopic = topicEncoder(
|
|
282356
|
+
const encodeTopic = topicEncoder(compression2);
|
|
281580
282357
|
const encodedTopicData = [];
|
|
281581
282358
|
for (const data of topicData) {
|
|
281582
282359
|
encodedTopicData.push(await encodeTopic(data));
|
|
@@ -281584,8 +282361,8 @@ var require_request5 = __commonJS((exports, module) => {
|
|
|
281584
282361
|
return new Encoder2().writeInt16(acks).writeInt32(timeout).writeArray(encodedTopicData);
|
|
281585
282362
|
}
|
|
281586
282363
|
});
|
|
281587
|
-
var topicEncoder = (
|
|
281588
|
-
const encodePartitions = partitionsEncoder(
|
|
282364
|
+
var topicEncoder = (compression2) => {
|
|
282365
|
+
const encodePartitions = partitionsEncoder(compression2);
|
|
281589
282366
|
return async ({ topic, partitions }) => {
|
|
281590
282367
|
const encodedPartitions = [];
|
|
281591
282368
|
for (const data of partitions) {
|
|
@@ -281594,17 +282371,17 @@ var require_request5 = __commonJS((exports, module) => {
|
|
|
281594
282371
|
return new Encoder2().writeString(topic).writeArray(encodedPartitions);
|
|
281595
282372
|
};
|
|
281596
282373
|
};
|
|
281597
|
-
var partitionsEncoder = (
|
|
281598
|
-
const messageSet = MessageSet({ messageVersion: 1, compression, entries: messages });
|
|
281599
|
-
if (
|
|
282374
|
+
var partitionsEncoder = (compression2) => async ({ partition, messages }) => {
|
|
282375
|
+
const messageSet = MessageSet({ messageVersion: 1, compression: compression2, entries: messages });
|
|
282376
|
+
if (compression2 === Types.None) {
|
|
281600
282377
|
return new Encoder2().writeInt32(partition).writeInt32(messageSet.size()).writeEncoder(messageSet);
|
|
281601
282378
|
}
|
|
281602
282379
|
const timestamp2 = messages[0].timestamp || Date.now();
|
|
281603
|
-
const codec = lookupCodec(
|
|
282380
|
+
const codec = lookupCodec(compression2);
|
|
281604
282381
|
const compressedValue = await codec.compress(messageSet);
|
|
281605
282382
|
const compressedMessageSet = MessageSet({
|
|
281606
282383
|
messageVersion: 1,
|
|
281607
|
-
entries: [{ compression, timestamp: timestamp2, value: compressedValue }]
|
|
282384
|
+
entries: [{ compression: compression2, timestamp: timestamp2, value: compressedValue }]
|
|
281608
282385
|
});
|
|
281609
282386
|
return new Encoder2().writeInt32(partition).writeInt32(compressedMessageSet.size()).writeEncoder(compressedMessageSet);
|
|
281610
282387
|
};
|
|
@@ -281957,12 +282734,12 @@ var require_v04 = __commonJS((exports, module) => {
|
|
|
281957
282734
|
Types: Compression,
|
|
281958
282735
|
lookupCodec,
|
|
281959
282736
|
COMPRESSION_CODEC_MASK
|
|
281960
|
-
} =
|
|
282737
|
+
} = require_compression2();
|
|
281961
282738
|
var MAGIC_BYTE = 2;
|
|
281962
282739
|
var TIMESTAMP_MASK = 0;
|
|
281963
282740
|
var TRANSACTIONAL_MASK = 16;
|
|
281964
282741
|
var RecordBatch = async ({
|
|
281965
|
-
compression = Compression.None,
|
|
282742
|
+
compression: compression2 = Compression.None,
|
|
281966
282743
|
firstOffset = Long.fromInt(0),
|
|
281967
282744
|
firstTimestamp = Date.now(),
|
|
281968
282745
|
maxTimestamp = Date.now(),
|
|
@@ -281974,25 +282751,25 @@ var require_v04 = __commonJS((exports, module) => {
|
|
|
281974
282751
|
firstSequence = 0,
|
|
281975
282752
|
records = []
|
|
281976
282753
|
}) => {
|
|
281977
|
-
const COMPRESSION_CODEC =
|
|
282754
|
+
const COMPRESSION_CODEC = compression2 & COMPRESSION_CODEC_MASK;
|
|
281978
282755
|
const IN_TRANSACTION = transactional ? TRANSACTIONAL_MASK : 0;
|
|
281979
282756
|
const attributes = COMPRESSION_CODEC | TIMESTAMP_MASK | IN_TRANSACTION;
|
|
281980
282757
|
const batchBody = new Encoder2().writeInt16(attributes).writeInt32(lastOffsetDelta).writeInt64(firstTimestamp).writeInt64(maxTimestamp).writeInt64(producerId).writeInt16(producerEpoch).writeInt32(firstSequence);
|
|
281981
|
-
if (
|
|
282758
|
+
if (compression2 === Compression.None) {
|
|
281982
282759
|
if (records.every((v) => typeof v === typeof records[0])) {
|
|
281983
282760
|
batchBody.writeArray(records, typeof records[0]);
|
|
281984
282761
|
} else {
|
|
281985
282762
|
batchBody.writeArray(records);
|
|
281986
282763
|
}
|
|
281987
282764
|
} else {
|
|
281988
|
-
const compressedRecords = await compressRecords(
|
|
282765
|
+
const compressedRecords = await compressRecords(compression2, records);
|
|
281989
282766
|
batchBody.writeInt32(records.length).writeBuffer(compressedRecords);
|
|
281990
282767
|
}
|
|
281991
282768
|
const batch = new Encoder2().writeInt32(partitionLeaderEpoch).writeInt8(MAGIC_BYTE).writeUInt32(crc32C(batchBody.buffer)).writeEncoder(batchBody);
|
|
281992
282769
|
return new Encoder2().writeInt64(firstOffset).writeBytes(batch.buffer);
|
|
281993
282770
|
};
|
|
281994
|
-
var compressRecords = async (
|
|
281995
|
-
const codec = lookupCodec(
|
|
282771
|
+
var compressRecords = async (compression2, records) => {
|
|
282772
|
+
const codec = lookupCodec(compression2);
|
|
281996
282773
|
const recordsEncoder = new Encoder2;
|
|
281997
282774
|
recordsEncoder.writeEncoderArray(records);
|
|
281998
282775
|
return codec.compress(recordsEncoder);
|
|
@@ -282008,7 +282785,7 @@ var require_request6 = __commonJS((exports, module) => {
|
|
|
282008
282785
|
var Long = require_long();
|
|
282009
282786
|
var Encoder2 = require_encoder2();
|
|
282010
282787
|
var { Produce: apiKey } = require_apiKeys();
|
|
282011
|
-
var { Types } =
|
|
282788
|
+
var { Types } = require_compression2();
|
|
282012
282789
|
var Record = require_v03();
|
|
282013
282790
|
var { RecordBatch } = require_v04();
|
|
282014
282791
|
module.exports = ({
|
|
@@ -282017,7 +282794,7 @@ var require_request6 = __commonJS((exports, module) => {
|
|
|
282017
282794
|
transactionalId = null,
|
|
282018
282795
|
producerId = Long.fromInt(-1),
|
|
282019
282796
|
producerEpoch = 0,
|
|
282020
|
-
compression = Types.None,
|
|
282797
|
+
compression: compression2 = Types.None,
|
|
282021
282798
|
topicData
|
|
282022
282799
|
}) => ({
|
|
282023
282800
|
apiKey,
|
|
@@ -282025,7 +282802,7 @@ var require_request6 = __commonJS((exports, module) => {
|
|
|
282025
282802
|
apiName: "Produce",
|
|
282026
282803
|
expectResponse: () => acks !== 0,
|
|
282027
282804
|
encode: async () => {
|
|
282028
|
-
const encodeTopic = topicEncoder(
|
|
282805
|
+
const encodeTopic = topicEncoder(compression2);
|
|
282029
282806
|
const encodedTopicData = [];
|
|
282030
282807
|
for (const data of topicData) {
|
|
282031
282808
|
encodedTopicData.push(await encodeTopic({ ...data, transactionalId, producerId, producerEpoch }));
|
|
@@ -282033,21 +282810,21 @@ var require_request6 = __commonJS((exports, module) => {
|
|
|
282033
282810
|
return new Encoder2().writeString(transactionalId).writeInt16(acks).writeInt32(timeout).writeArray(encodedTopicData);
|
|
282034
282811
|
}
|
|
282035
282812
|
});
|
|
282036
|
-
var topicEncoder = (
|
|
282813
|
+
var topicEncoder = (compression2) => async ({
|
|
282037
282814
|
topic,
|
|
282038
282815
|
partitions,
|
|
282039
282816
|
transactionalId,
|
|
282040
282817
|
producerId,
|
|
282041
282818
|
producerEpoch
|
|
282042
282819
|
}) => {
|
|
282043
|
-
const encodePartitions = partitionsEncoder(
|
|
282820
|
+
const encodePartitions = partitionsEncoder(compression2);
|
|
282044
282821
|
const encodedPartitions = [];
|
|
282045
282822
|
for (const data of partitions) {
|
|
282046
282823
|
encodedPartitions.push(await encodePartitions({ ...data, transactionalId, producerId, producerEpoch }));
|
|
282047
282824
|
}
|
|
282048
282825
|
return new Encoder2().writeString(topic).writeArray(encodedPartitions);
|
|
282049
282826
|
};
|
|
282050
|
-
var partitionsEncoder = (
|
|
282827
|
+
var partitionsEncoder = (compression2) => async ({
|
|
282051
282828
|
partition,
|
|
282052
282829
|
messages,
|
|
282053
282830
|
transactionalId,
|
|
@@ -282066,7 +282843,7 @@ var require_request6 = __commonJS((exports, module) => {
|
|
|
282066
282843
|
timestampDelta: (message.timestamp || dateNow) - firstTimestamp
|
|
282067
282844
|
}));
|
|
282068
282845
|
const recordBatch = await RecordBatch({
|
|
282069
|
-
compression,
|
|
282846
|
+
compression: compression2,
|
|
282070
282847
|
records,
|
|
282071
282848
|
firstTimestamp,
|
|
282072
282849
|
maxTimestamp,
|
|
@@ -282127,7 +282904,7 @@ var require_request7 = __commonJS((exports, module) => {
|
|
|
282127
282904
|
transactionalId,
|
|
282128
282905
|
producerId,
|
|
282129
282906
|
producerEpoch,
|
|
282130
|
-
compression,
|
|
282907
|
+
compression: compression2,
|
|
282131
282908
|
topicData
|
|
282132
282909
|
}) => Object.assign(requestV3({
|
|
282133
282910
|
acks,
|
|
@@ -282135,7 +282912,7 @@ var require_request7 = __commonJS((exports, module) => {
|
|
|
282135
282912
|
transactionalId,
|
|
282136
282913
|
producerId,
|
|
282137
282914
|
producerEpoch,
|
|
282138
|
-
compression,
|
|
282915
|
+
compression: compression2,
|
|
282139
282916
|
topicData
|
|
282140
282917
|
}), { apiVersion: 4 });
|
|
282141
282918
|
});
|
|
@@ -282158,7 +282935,7 @@ var require_request8 = __commonJS((exports, module) => {
|
|
|
282158
282935
|
transactionalId,
|
|
282159
282936
|
producerId,
|
|
282160
282937
|
producerEpoch,
|
|
282161
|
-
compression,
|
|
282938
|
+
compression: compression2,
|
|
282162
282939
|
topicData
|
|
282163
282940
|
}) => Object.assign(requestV3({
|
|
282164
282941
|
acks,
|
|
@@ -282166,7 +282943,7 @@ var require_request8 = __commonJS((exports, module) => {
|
|
|
282166
282943
|
transactionalId,
|
|
282167
282944
|
producerId,
|
|
282168
282945
|
producerEpoch,
|
|
282169
|
-
compression,
|
|
282946
|
+
compression: compression2,
|
|
282170
282947
|
topicData
|
|
282171
282948
|
}), { apiVersion: 5 });
|
|
282172
282949
|
});
|
|
@@ -282209,7 +282986,7 @@ var require_request9 = __commonJS((exports, module) => {
|
|
|
282209
282986
|
transactionalId,
|
|
282210
282987
|
producerId,
|
|
282211
282988
|
producerEpoch,
|
|
282212
|
-
compression,
|
|
282989
|
+
compression: compression2,
|
|
282213
282990
|
topicData
|
|
282214
282991
|
}) => Object.assign(requestV5({
|
|
282215
282992
|
acks,
|
|
@@ -282217,7 +282994,7 @@ var require_request9 = __commonJS((exports, module) => {
|
|
|
282217
282994
|
transactionalId,
|
|
282218
282995
|
producerId,
|
|
282219
282996
|
producerEpoch,
|
|
282220
|
-
compression,
|
|
282997
|
+
compression: compression2,
|
|
282221
282998
|
topicData
|
|
282222
282999
|
}), { apiVersion: 6 });
|
|
282223
283000
|
});
|
|
@@ -282248,7 +283025,7 @@ var require_request10 = __commonJS((exports, module) => {
|
|
|
282248
283025
|
transactionalId,
|
|
282249
283026
|
producerId,
|
|
282250
283027
|
producerEpoch,
|
|
282251
|
-
compression,
|
|
283028
|
+
compression: compression2,
|
|
282252
283029
|
topicData
|
|
282253
283030
|
}) => Object.assign(requestV6({
|
|
282254
283031
|
acks,
|
|
@@ -282256,7 +283033,7 @@ var require_request10 = __commonJS((exports, module) => {
|
|
|
282256
283033
|
transactionalId,
|
|
282257
283034
|
producerId,
|
|
282258
283035
|
producerEpoch,
|
|
282259
|
-
compression,
|
|
283036
|
+
compression: compression2,
|
|
282260
283037
|
topicData
|
|
282261
283038
|
}), { apiVersion: 7 });
|
|
282262
283039
|
});
|
|
@@ -282283,19 +283060,19 @@ var require_produce2 = __commonJS((exports, module) => {
|
|
|
282283
283060
|
const response = require_response3();
|
|
282284
283061
|
return { request: request2({ acks, timeout, topicData }), response };
|
|
282285
283062
|
},
|
|
282286
|
-
2: ({ acks, timeout, topicData, compression }) => {
|
|
283063
|
+
2: ({ acks, timeout, topicData, compression: compression2 }) => {
|
|
282287
283064
|
const request2 = require_request5();
|
|
282288
283065
|
const response = require_response4();
|
|
282289
|
-
return { request: request2({ acks, timeout, compression, topicData }), response };
|
|
283066
|
+
return { request: request2({ acks, timeout, compression: compression2, topicData }), response };
|
|
282290
283067
|
},
|
|
282291
|
-
3: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
283068
|
+
3: ({ acks, timeout, compression: compression2, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
282292
283069
|
const request2 = require_request6();
|
|
282293
283070
|
const response = require_response5();
|
|
282294
283071
|
return {
|
|
282295
283072
|
request: request2({
|
|
282296
283073
|
acks,
|
|
282297
283074
|
timeout,
|
|
282298
|
-
compression,
|
|
283075
|
+
compression: compression2,
|
|
282299
283076
|
topicData,
|
|
282300
283077
|
transactionalId,
|
|
282301
283078
|
producerId,
|
|
@@ -282304,14 +283081,14 @@ var require_produce2 = __commonJS((exports, module) => {
|
|
|
282304
283081
|
response
|
|
282305
283082
|
};
|
|
282306
283083
|
},
|
|
282307
|
-
4: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
283084
|
+
4: ({ acks, timeout, compression: compression2, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
282308
283085
|
const request2 = require_request7();
|
|
282309
283086
|
const response = require_response6();
|
|
282310
283087
|
return {
|
|
282311
283088
|
request: request2({
|
|
282312
283089
|
acks,
|
|
282313
283090
|
timeout,
|
|
282314
|
-
compression,
|
|
283091
|
+
compression: compression2,
|
|
282315
283092
|
topicData,
|
|
282316
283093
|
transactionalId,
|
|
282317
283094
|
producerId,
|
|
@@ -282320,14 +283097,14 @@ var require_produce2 = __commonJS((exports, module) => {
|
|
|
282320
283097
|
response
|
|
282321
283098
|
};
|
|
282322
283099
|
},
|
|
282323
|
-
5: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
283100
|
+
5: ({ acks, timeout, compression: compression2, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
282324
283101
|
const request2 = require_request8();
|
|
282325
283102
|
const response = require_response7();
|
|
282326
283103
|
return {
|
|
282327
283104
|
request: request2({
|
|
282328
283105
|
acks,
|
|
282329
283106
|
timeout,
|
|
282330
|
-
compression,
|
|
283107
|
+
compression: compression2,
|
|
282331
283108
|
topicData,
|
|
282332
283109
|
transactionalId,
|
|
282333
283110
|
producerId,
|
|
@@ -282336,14 +283113,14 @@ var require_produce2 = __commonJS((exports, module) => {
|
|
|
282336
283113
|
response
|
|
282337
283114
|
};
|
|
282338
283115
|
},
|
|
282339
|
-
6: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
283116
|
+
6: ({ acks, timeout, compression: compression2, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
282340
283117
|
const request2 = require_request9();
|
|
282341
283118
|
const response = require_response8();
|
|
282342
283119
|
return {
|
|
282343
283120
|
request: request2({
|
|
282344
283121
|
acks,
|
|
282345
283122
|
timeout,
|
|
282346
|
-
compression,
|
|
283123
|
+
compression: compression2,
|
|
282347
283124
|
topicData,
|
|
282348
283125
|
transactionalId,
|
|
282349
283126
|
producerId,
|
|
@@ -282352,14 +283129,14 @@ var require_produce2 = __commonJS((exports, module) => {
|
|
|
282352
283129
|
response
|
|
282353
283130
|
};
|
|
282354
283131
|
},
|
|
282355
|
-
7: ({ acks, timeout, compression, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
283132
|
+
7: ({ acks, timeout, compression: compression2, topicData, transactionalId, producerId, producerEpoch }) => {
|
|
282356
283133
|
const request2 = require_request10();
|
|
282357
283134
|
const response = require_response9();
|
|
282358
283135
|
return {
|
|
282359
283136
|
request: request2({
|
|
282360
283137
|
acks,
|
|
282361
283138
|
timeout,
|
|
282362
|
-
compression,
|
|
283139
|
+
compression: compression2,
|
|
282363
283140
|
topicData,
|
|
282364
283141
|
transactionalId,
|
|
282365
283142
|
producerId,
|
|
@@ -282457,7 +283234,7 @@ var require_decoder6 = __commonJS((exports, module) => {
|
|
|
282457
283234
|
var Long = require_long();
|
|
282458
283235
|
var Decoder = require_decoder2();
|
|
282459
283236
|
var MessageDecoder = require_decoder5();
|
|
282460
|
-
var { lookupCodecByAttributes } =
|
|
283237
|
+
var { lookupCodecByAttributes } = require_compression2();
|
|
282461
283238
|
var { KafkaJSPartialMessageError } = require_errors6();
|
|
282462
283239
|
module.exports = async (primaryDecoder, size = null) => {
|
|
282463
283240
|
const messages = [];
|
|
@@ -282729,7 +283506,7 @@ var require_decoder8 = __commonJS((exports, module) => {
|
|
|
282729
283506
|
var require_decoder9 = __commonJS((exports, module) => {
|
|
282730
283507
|
var Decoder = require_decoder2();
|
|
282731
283508
|
var { KafkaJSPartialMessageError } = require_errors6();
|
|
282732
|
-
var { lookupCodecByAttributes } =
|
|
283509
|
+
var { lookupCodecByAttributes } = require_compression2();
|
|
282733
283510
|
var RecordDecoder = require_decoder8();
|
|
282734
283511
|
var TimestampTypes = require_timestampTypes();
|
|
282735
283512
|
var TIMESTAMP_TYPE_FLAG_MASK = 8;
|
|
@@ -288247,7 +289024,7 @@ var require_shuffle = __commonJS((exports, module) => {
|
|
|
288247
289024
|
// node_modules/kafkajs/src/broker/index.js
|
|
288248
289025
|
var require_broker = __commonJS((exports, module) => {
|
|
288249
289026
|
var Lock = require_lock();
|
|
288250
|
-
var { Types: Compression } =
|
|
289027
|
+
var { Types: Compression } = require_compression2();
|
|
288251
289028
|
var { requests, lookup: lookup2 } = require_requests();
|
|
288252
289029
|
var { KafkaJSNonRetriableError } = require_errors6();
|
|
288253
289030
|
var apiKeys = require_apiKeys();
|
|
@@ -288358,13 +289135,13 @@ var require_broker = __commonJS((exports, module) => {
|
|
|
288358
289135
|
producerEpoch,
|
|
288359
289136
|
acks = -1,
|
|
288360
289137
|
timeout = 30000,
|
|
288361
|
-
compression = Compression.None
|
|
289138
|
+
compression: compression2 = Compression.None
|
|
288362
289139
|
}) {
|
|
288363
289140
|
const produce = this.lookupRequest(apiKeys.Produce, requests.Produce);
|
|
288364
289141
|
return await this[PRIVATE.SEND_REQUEST](produce({
|
|
288365
289142
|
acks,
|
|
288366
289143
|
timeout,
|
|
288367
|
-
compression,
|
|
289144
|
+
compression: compression2,
|
|
288368
289145
|
topicData,
|
|
288369
289146
|
transactionalId,
|
|
288370
289147
|
producerId,
|
|
@@ -291144,7 +291921,7 @@ var require_sendMessages = __commonJS((exports, module) => {
|
|
|
291144
291921
|
var responseSerializer = require_responseSerializer();
|
|
291145
291922
|
var { keys } = Object;
|
|
291146
291923
|
module.exports = ({ logger: logger2, cluster, partitioner, eosManager, retrier }) => {
|
|
291147
|
-
return async ({ acks, timeout, compression, topicMessages }) => {
|
|
291924
|
+
return async ({ acks, timeout, compression: compression2, topicMessages }) => {
|
|
291148
291925
|
const responsePerBroker = new Map;
|
|
291149
291926
|
const createProducerRequests = async (responsePerBroker2) => {
|
|
291150
291927
|
const topicMetadata = new Map;
|
|
@@ -291207,7 +291984,7 @@ var require_sendMessages = __commonJS((exports, module) => {
|
|
|
291207
291984
|
producerEpoch: eosManager.getProducerEpoch(),
|
|
291208
291985
|
acks,
|
|
291209
291986
|
timeout,
|
|
291210
|
-
compression,
|
|
291987
|
+
compression: compression2,
|
|
291211
291988
|
topicData
|
|
291212
291989
|
});
|
|
291213
291990
|
} catch (e) {
|
|
@@ -291294,7 +292071,7 @@ var require_messageProducer = __commonJS((exports, module) => {
|
|
|
291294
292071
|
throw new KafkaJSError("The producer is disconnected");
|
|
291295
292072
|
}
|
|
291296
292073
|
};
|
|
291297
|
-
const sendBatch = async ({ acks = -1, timeout, compression, topicMessages = [] }) => {
|
|
292074
|
+
const sendBatch = async ({ acks = -1, timeout, compression: compression2, topicMessages = [] }) => {
|
|
291298
292075
|
if (topicMessages.some(({ topic }) => !topic)) {
|
|
291299
292076
|
throw new KafkaJSNonRetriableError(`Invalid topic`);
|
|
291300
292077
|
}
|
|
@@ -291323,16 +292100,16 @@ var require_messageProducer = __commonJS((exports, module) => {
|
|
|
291323
292100
|
return await sendMessages({
|
|
291324
292101
|
acks,
|
|
291325
292102
|
timeout,
|
|
291326
|
-
compression,
|
|
292103
|
+
compression: compression2,
|
|
291327
292104
|
topicMessages: mergedTopicMessages
|
|
291328
292105
|
});
|
|
291329
292106
|
};
|
|
291330
|
-
const send = async ({ acks, timeout, compression, topic, messages }) => {
|
|
292107
|
+
const send = async ({ acks, timeout, compression: compression2, topic, messages }) => {
|
|
291331
292108
|
const topicMessage = { topic, messages };
|
|
291332
292109
|
return sendBatch({
|
|
291333
292110
|
acks,
|
|
291334
292111
|
timeout,
|
|
291335
|
-
compression,
|
|
292112
|
+
compression: compression2,
|
|
291336
292113
|
topicMessages: [topicMessage]
|
|
291337
292114
|
});
|
|
291338
292115
|
};
|
|
@@ -294899,7 +295676,7 @@ var require_kafkajs = __commonJS((exports, module) => {
|
|
|
294899
295676
|
var PartitionAssigners = require_assigners();
|
|
294900
295677
|
var AssignerProtocol = require_assignerProtocol();
|
|
294901
295678
|
var Partitioners = require_partitioners();
|
|
294902
|
-
var Compression =
|
|
295679
|
+
var Compression = require_compression2();
|
|
294903
295680
|
var ConfigResourceTypes = require_configResourceTypes();
|
|
294904
295681
|
var ConfigSource = require_configSource();
|
|
294905
295682
|
var AclResourceTypes = require_aclResourceTypes();
|
|
@@ -303311,6 +304088,8 @@ class ServeKafka {
|
|
|
303311
304088
|
}
|
|
303312
304089
|
|
|
303313
304090
|
// src/utils/ApplicationServer.ts
|
|
304091
|
+
var import_compression = __toESM(require_compression(), 1);
|
|
304092
|
+
|
|
303314
304093
|
class ApplicationServer {
|
|
303315
304094
|
static app;
|
|
303316
304095
|
static socketHandlers;
|
|
@@ -303321,6 +304100,7 @@ class ApplicationServer {
|
|
|
303321
304100
|
ApplicationServer.app.use(import_express.default.json({ limit: "500mb" }));
|
|
303322
304101
|
ApplicationServer.app.use(import_express.default.urlencoded({ limit: "500mb", extended: true, parameterLimit: 5000000 }));
|
|
303323
304102
|
ApplicationServer.app.use(import_express_fileupload.default());
|
|
304103
|
+
ApplicationServer.app.use(import_compression.default());
|
|
303324
304104
|
const db = new DatabaseConnector(process.cwd());
|
|
303325
304105
|
const conn = await DatabaseConnector.init();
|
|
303326
304106
|
await db.initializeModels();
|
|
@@ -303825,7 +304605,7 @@ class BaseController {
|
|
|
303825
304605
|
data.updatedById = (req.user || {}).id || null;
|
|
303826
304606
|
}
|
|
303827
304607
|
let originalData = await this._model?.findByPk(data.id);
|
|
303828
|
-
let response = await this._model?.update(data, { where: req.params, returning: true, individualHooks: true });
|
|
304608
|
+
let response = await this._model?.update(data, { where: req.params, returning: true, individualHooks: true, hooks: true });
|
|
303829
304609
|
let result = response && response[1] ? response[1] : undefined;
|
|
303830
304610
|
await this.afterUpdate(req, result, originalData);
|
|
303831
304611
|
return ResponseHelper(response);
|
|
@@ -303837,7 +304617,7 @@ class BaseController {
|
|
|
303837
304617
|
async delete(req, res, next) {
|
|
303838
304618
|
try {
|
|
303839
304619
|
await this.beforeDelete(req);
|
|
303840
|
-
let response = await this._model?.destroy({ where: req.params });
|
|
304620
|
+
let response = await this._model?.destroy({ where: req.params, individualHooks: true, hooks: true });
|
|
303841
304621
|
await this.afterDelete(req, req.params);
|
|
303842
304622
|
return ResponseHelper(response);
|
|
303843
304623
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccci/micro-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.193",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/bcryptjs": "^2.4.6",
|
|
17
17
|
"@types/bun": "latest",
|
|
18
|
+
"@types/compression": "^1.7.5",
|
|
18
19
|
"@types/cors": "^2.8.17",
|
|
19
20
|
"@types/express": "^4.17.21",
|
|
20
21
|
"@types/express-fileupload": "^1.5.0",
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@aws-sdk/client-s3": "^3.699.0",
|
|
40
41
|
"bcryptjs": "^2.4.3",
|
|
42
|
+
"compression": "^1.8.0",
|
|
41
43
|
"cors": "^2.8.5",
|
|
42
44
|
"express": "^4.19.2",
|
|
43
45
|
"express-fileupload": "^1.5.0",
|